Ejemplo n.º 1
0
        public static Propeller.Assembly.SubInstruction GetSubInstruction(Propeller.Assembly.Instruction SourceInstruction, ParsedInstruction ParsedInstruction)
        {
            switch (SourceInstruction.Type)
            {
            case Propeller.Assembly.InstructionType.Normal:
                return(SourceInstruction.SubInstructions[0]);

            case Propeller.Assembly.InstructionType.WR:
                return(SourceInstruction.SubInstructions[(ParsedInstruction.ZCRI & ParsedInstruction.WriteResultFlag) == ParsedInstruction.WriteResultFlag ? 0 : 1]);

            case Propeller.Assembly.InstructionType.Hub:
                return(SourceInstruction.SubInstructions[ParsedInstruction.SRC & 0x7]);

            case Propeller.Assembly.InstructionType.Jump:
                int num = ParsedInstruction.ZCRI & 0x3;
                if (num <= 1)
                {
                    num = 0;
                    if (ParsedInstruction.SRC == 0)
                    {
                        num = 1;
                    }
                }
                return(SourceInstruction.SubInstructions[num]);
            }
            throw new Exception("Uknown Instruction Type: " + SourceInstruction.Type.ToString());
        }
Ejemplo n.º 2
0
            public ParsedInstruction(uint Opcode)
            {
                this.Opcode = Opcode;
                this.INSTR  = (byte  )((Opcode >> 26) & 0x03F);  // (bits 31:26)
                this.ZCRI   = (byte  )((Opcode >> 22) & 0x00F);  // (bits 25:22)
                this.CON    = (byte  )((Opcode >> 18) & 0x00F);  // (bits 21:18)
                this.DEST   = (ushort)((Opcode >> 9) & 0x1FF);   // (bits 17:09)
                this.SRC    = (ushort)(Opcode & 0x1FF);          // (bits 08:00)

                this.SourceInstruction    = Propeller.Assembly.Instructions[this.INSTR];
                this.SourceSubInstruction = null;
            }