Пример #1
0
 public InstrOpInfo(string mnemonic, ref Instruction instr, InstrOpInfoFlags flags)
 {
     Mnemonic = mnemonic;
     Flags    = flags;
     OpCount  = (byte)instr.OpCount;
     Debug.Assert(instr.OpCount <= 4);
     Op0Kind = (InstrOpKind)instr.Op0Kind;
     Op1Kind = (InstrOpKind)instr.Op1Kind;
     Op2Kind = (InstrOpKind)instr.Op2Kind;
     Op3Kind = (InstrOpKind)instr.Op3Kind;
     Debug.Assert(TEST_RegisterBits == 8);
     Op0Register = (byte)instr.Op0Register;
     Debug.Assert(TEST_RegisterBits == 8);
     Op1Register = (byte)instr.Op1Register;
     Debug.Assert(TEST_RegisterBits == 8);
     Op2Register = (byte)instr.Op2Register;
     Debug.Assert(TEST_RegisterBits == 8);
     Op3Register = (byte)instr.Op3Register;
 }
Пример #2
0
        public SimpleInstrInfo_DeclareData(Code code, string mnemonic)
            : base(code)
        {
            this.mnemonic = mnemonic;
            InstrOpKind opKind;

            switch (code)
            {
            case Code.DeclareByte: opKind = InstrOpKind.DeclareByte; break;

            case Code.DeclareWord: opKind = InstrOpKind.DeclareWord; break;

            case Code.DeclareDword: opKind = InstrOpKind.DeclareDword; break;

            case Code.DeclareQword: opKind = InstrOpKind.DeclareQword; break;

            default: throw new InvalidOperationException();
            }
            this.opKind = opKind;
        }
Пример #3
0
 public InstrOpInfo(string mnemonic, ref Instruction instr, InstrOpInfoFlags flags)
 {
     Debug.Assert(DecoderConstants.MaxOpCount == 5);
     Mnemonic = mnemonic;
     Flags    = flags;
     OpCount  = (byte)instr.OpCount;
     Op0Kind  = (InstrOpKind)instr.Op0Kind;
     Op1Kind  = (InstrOpKind)instr.Op1Kind;
     Op2Kind  = (InstrOpKind)instr.Op2Kind;
     Op3Kind  = (InstrOpKind)instr.Op3Kind;
     Op4Kind  = (InstrOpKind)instr.Op4Kind;
     Debug.Assert(TEST_RegisterBits == 8);
     Op0Register = (byte)instr.Op0Register;
     Debug.Assert(TEST_RegisterBits == 8);
     Op1Register = (byte)instr.Op1Register;
     Debug.Assert(TEST_RegisterBits == 8);
     Op2Register = (byte)instr.Op2Register;
     Debug.Assert(TEST_RegisterBits == 8);
     Op3Register = (byte)instr.Op3Register;
     Debug.Assert(TEST_RegisterBits == 8);
     Op4Register = (byte)instr.Op4Register;
 }
Пример #4
0
        public InstrOpInfo(string mnemonic, ref Instruction instr, InstrOpInfoFlags flags)
        {
            Debug.Assert(DecoderConstants.MaxOpCount == 5);
            Mnemonic = mnemonic;
            Flags    = flags;
            Op0Kind  = (InstrOpKind)instr.Op0Kind;
            Op1Kind  = (InstrOpKind)instr.Op1Kind;
            Op2Kind  = (InstrOpKind)instr.Op2Kind;
            Op3Kind  = (InstrOpKind)instr.Op3Kind;
            Op4Kind  = (InstrOpKind)instr.Op4Kind;
            Debug.Assert(TEST_RegisterBits == 8);
            Op0Register = (byte)instr.Op0Register;
            Debug.Assert(TEST_RegisterBits == 8);
            Op1Register = (byte)instr.Op1Register;
            Debug.Assert(TEST_RegisterBits == 8);
            Op2Register = (byte)instr.Op2Register;
            Debug.Assert(TEST_RegisterBits == 8);
            Op3Register = (byte)instr.Op3Register;
            Debug.Assert(TEST_RegisterBits == 8);
            Op4Register = (byte)instr.Op4Register;
            int opCount = instr.OpCount;

            OpCount = (byte)opCount;
            switch (opCount)
            {
            case 0:
                Op0Index = InstrInfo.OpAccess_INVALID;
                Op1Index = InstrInfo.OpAccess_INVALID;
                Op2Index = InstrInfo.OpAccess_INVALID;
                Op3Index = InstrInfo.OpAccess_INVALID;
                Op4Index = InstrInfo.OpAccess_INVALID;
                break;

            case 1:
                Op0Index = 0;
                Op1Index = InstrInfo.OpAccess_INVALID;
                Op2Index = InstrInfo.OpAccess_INVALID;
                Op3Index = InstrInfo.OpAccess_INVALID;
                Op4Index = InstrInfo.OpAccess_INVALID;
                break;

            case 2:
                Op0Index = 0;
                Op1Index = 1;
                Op2Index = InstrInfo.OpAccess_INVALID;
                Op3Index = InstrInfo.OpAccess_INVALID;
                Op4Index = InstrInfo.OpAccess_INVALID;
                break;

            case 3:
                Op0Index = 0;
                Op1Index = 1;
                Op2Index = 2;
                Op3Index = InstrInfo.OpAccess_INVALID;
                Op4Index = InstrInfo.OpAccess_INVALID;
                break;

            case 4:
                Op0Index = 0;
                Op1Index = 1;
                Op2Index = 2;
                Op3Index = 3;
                Op4Index = InstrInfo.OpAccess_INVALID;
                break;

            case 5:
                Op0Index = 0;
                Op1Index = 1;
                Op2Index = 2;
                Op3Index = 3;
                Op4Index = 4;
                break;

            default:
                throw new InvalidOperationException();
            }
        }