diff options
Diffstat (limited to 'subx/015immediate_addressing.cc')
-rw-r--r-- | subx/015immediate_addressing.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/subx/015immediate_addressing.cc b/subx/015immediate_addressing.cc index b1d97f1e..c6cf843b 100644 --- a/subx/015immediate_addressing.cc +++ b/subx/015immediate_addressing.cc @@ -20,7 +20,7 @@ case 0x81: { // combine imm32 with r/m32 trace(90, "run") << "combine imm32 with r/m32" << end(); uint8_t modrm = next(); int32_t* arg1 = effective_address(modrm); - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "imm32 is 0x" << HEXWORD << arg2 << end(); uint8_t subop = (modrm>>3)&0x7; // middle 3 'reg opcode' bits switch (subop) { @@ -67,7 +67,7 @@ put(name, "2d", "subtract imm32 from R0 (EAX)"); :(before "End Single-Byte Opcodes") case 0x2d: { // subtract imm32 from EAX - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "subtract imm32 0x" << HEXWORD << arg2 << " from EAX" << end(); BINARY_ARITHMETIC_OP(-, Reg[EAX].i, arg2); break; @@ -125,7 +125,7 @@ put(name, "25", "R0 = bitwise AND of imm32 with R0 (EAX)"); :(before "End Single-Byte Opcodes") case 0x25: { // and imm32 with EAX - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "and imm32 0x" << HEXWORD << arg2 << " with EAX" << end(); BINARY_BITWISE_OP(&, Reg[EAX].i, arg2); break; @@ -183,7 +183,7 @@ put(name, "0d", "R0 = bitwise OR of imm32 with R0 (EAX)"); :(before "End Single-Byte Opcodes") case 0x0d: { // or imm32 with EAX - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "or imm32 0x" << HEXWORD << arg2 << " with EAX" << end(); BINARY_BITWISE_OP(|, Reg[EAX].i, arg2); break; @@ -239,7 +239,7 @@ put(name, "35", "R0 = bitwise XOR of imm32 with R0 (EAX)"); :(before "End Single-Byte Opcodes") case 0x35: { // xor imm32 with EAX - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "xor imm32 0x" << HEXWORD << arg2 << " with EAX" << end(); BINARY_BITWISE_OP(^, Reg[EAX].i, arg2); break; @@ -296,7 +296,7 @@ put(name, "3d", "subtract imm32 from R0 (EAX)"); :(before "End Single-Byte Opcodes") case 0x3d: { // subtract imm32 from EAX int32_t arg1 = Reg[EAX].i; - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "compare EAX and imm32 0x" << HEXWORD << arg2 << end(); int32_t tmp1 = arg1 - arg2; SF = (tmp1 < 0); @@ -438,7 +438,7 @@ case 0xbd: case 0xbe: case 0xbf: { // copy imm32 to r32 uint8_t reg1 = op & 0x7; - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "copy imm32 0x" << HEXWORD << arg2 << " to " << rname(reg1) << end(); Reg[reg1].i = arg2; break; @@ -464,7 +464,7 @@ case 0xc7: { // copy imm32 to r32 uint8_t modrm = next(); trace(90, "run") << "copy imm32 to r/m32" << end(); int32_t* arg1 = effective_address(modrm); - int32_t arg2 = imm32(); + int32_t arg2 = next32(); trace(90, "run") << "imm32 is 0x" << HEXWORD << arg2 << end(); *arg1 = arg2; break; @@ -486,7 +486,7 @@ put(name, "68", "push imm32 to stack"); :(before "End Single-Byte Opcodes") case 0x68: { - uint32_t val = static_cast<uint32_t>(imm32()); + uint32_t val = static_cast<uint32_t>(next32()); trace(90, "run") << "push imm32 0x" << HEXWORD << val << end(); //? cerr << "push: " << val << " => " << Reg[ESP].u << '\n'; push(val); |