Пример #1
0
 internal void HandleResult(BarcodeDecodeResult result)
 {
     if (Decoded != null)
     {
         Decoded.Invoke(this, result);
     }
 }
Пример #2
0
        public void decode()
        {
            //Read the instruction from IR
            string inst = IR;

            //Decode it's opcode to see if it's I, or R or J:
            string opcode = IR.Substring(0, 6);

            switch (opcode)
            {
            case "000000":
                //RFormat
                string funct = inst.Substring(26);
                instruction = Rformat[funct];

                break;

            case "000010":
                //J
                instruction = Jformat[opcode];
                break;

            case "000011":
                //J
                instruction = Jformat[opcode];
                //Jformat.TryGetValue(opcode, out instruction);
                break;

            case "010000":
                //Coproc1
                Terminate_Error.Invoke("COPROC Instructions aren't supported by simulator");
                break;

            case "010001":
                //Coproc2
                Terminate_Error.Invoke("COPROC Instructions aren't supported by simulator");
                break;

            case "010010":
                //Coproc3
                Terminate_Error.Invoke("COPROC Instructions aren't supported by simulator");
                break;

            //Coproc4
            case "010011":
                Terminate_Error.Invoke("COPROC Instructions aren't supported by simulator");
                break;

            default:
                //I instruction
                instruction = Iformat[opcode];
                //Iformat.TryGetValue(opcode, out instruction);
                break;
            }
            //Increment Clock;

            Decoded.Invoke();
        }
Пример #3
0
        public async void DecodeAsync()
        {
            var(code, bytes) = await Task.Run(() => Decode());

            Decoded?.Invoke(this, new RSExtEventArgs(code, bytes, isNoised));
        }