예제 #1
0
 private void decodeArg(VMPreparedOperand op, bool byteMode)
 {
     int data = GetBits();
     if ((data & 0x8000) != 0)
     {
         op.Type = VMOpType.VM_OPREG;
         op.Data = (data >> 12) & 7;
         op.Offset = op.Data;
         AddBits(4);
     }
     else
     {
         if ((data & 0xc000) == 0)
         {
             op.Type = VMOpType.VM_OPINT;
             if (byteMode)
             {
                 op.Data = (data >> 6) & 0xff;
                 AddBits(10);
             }
             else
             {
                 AddBits(2);
                 op.Data = ReadData(this);
             }
         }
         else
         {
             op.Type = VMOpType.VM_OPREGMEM;
             if ((data & 0x2000) == 0)
             {
                 op.Data = (data >> 10) & 7;
                 op.Offset = op.Data;
                 op.Base = 0;
                 AddBits(6);
             }
             else
             {
                 if ((data & 0x1000) == 0)
                 {
                     op.Data = (data >> 9) & 7;
                     op.Offset = op.Data;
                     AddBits(7);
                 }
                 else
                 {
                     op.Data = 0;
                     AddBits(4);
                 }
                 op.Base = ReadData(this);
             }
         }
     }
 }
예제 #2
0
 private int GetOperand(VMPreparedOperand cmdOp)
 {
     int ret = 0;
     if (cmdOp.Type == VMOpType.VM_OPREGMEM)
     {
         int pos = (cmdOp.Offset + cmdOp.Base) & VM_MEMMASK;
         ret = DataConverter.LittleEndian.GetInt32(Mem, pos);
     }
     else
     {
         int pos = cmdOp.Offset;
         ret = DataConverter.LittleEndian.GetInt32(Mem, pos);
     }
     return ret;
 }
예제 #3
0
 private int GetOperand(VMPreparedOperand cmdOp)
 {
     int ret = 0;
     if (cmdOp.Type == VMOpType.VM_OPREGMEM)
     {
         int pos = (cmdOp.Offset + cmdOp.Base) & VM_MEMMASK;
         ret = Utility.readIntLittleEndian(Mem, pos);
     }
     else
     {
         int pos = cmdOp.Offset;
         ret = Utility.readIntLittleEndian(Mem, pos);
     }
     return ret;
 }
예제 #4
0
 private int GetOperand(VMPreparedOperand cmdOp)
 {
     int offset;
     if (cmdOp.Type == VMOpType.VM_OPREGMEM)
     {
         offset = (cmdOp.Offset + cmdOp.Base) & VM_MEMMASK;
         return Utility.readIntLittleEndian(this.Mem, offset);
     }
     offset = cmdOp.Offset;
     return Utility.readIntLittleEndian(this.Mem, offset);
 }