diff options
Diffstat (limited to 'subx')
-rw-r--r-- | subx/011direct_addressing.cc | 23 | ||||
-rw-r--r-- | subx/012indirect_addressing.cc | 15 |
2 files changed, 38 insertions, 0 deletions
diff --git a/subx/011direct_addressing.cc b/subx/011direct_addressing.cc index 3286cbea..a1d83b8c 100644 --- a/subx/011direct_addressing.cc +++ b/subx/011direct_addressing.cc @@ -125,3 +125,26 @@ case 0x31: { // xor r32 with r/m32 BINARY_BITWISE_OP(^, *arg1, Reg[arg2].u); break; } + +//:: not + +:(scenario not_r32) +% Reg[3].i = 0x0f0f00ff; +# op ModR/M SIB displacement immediate + f7 c3 # not EBX (reg 3) ++run: 'not' of effective address ++run: effective address is reg 3 ++run: storing 0xf0f0ff00 + +:(before "End Single-Byte Opcodes") +case 0xf7: { // xor r32 with r/m32 + uint8_t modrm = next(); + trace(2, "run") << "'not' of effective address" << end(); + int32_t* arg1 = effective_address(modrm); + *arg1 = ~(*arg1); + trace(2, "run") << "storing 0x" << HEXWORD << *arg1 << end(); + SF = (*arg1 >> 31); + ZF = (*arg1 == 0); + OF = false; + break; +} diff --git a/subx/012indirect_addressing.cc b/subx/012indirect_addressing.cc index 3c3fae3c..4095fb1b 100644 --- a/subx/012indirect_addressing.cc +++ b/subx/012indirect_addressing.cc @@ -196,3 +196,18 @@ case 0x33: { // xor r/m32 with r32 BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); break; } + +//:: not + +:(scenario not_r32_with_mem_at_r32) +% Reg[3].i = 0x60; +# word at 0x60 is 0x0f0f00ff +% Mem.at(0x60) = 0xff; +% Mem.at(0x61) = 0x00; +% Mem.at(0x62) = 0x0f; +% Mem.at(0x63) = 0x0f; +# op ModRM SIB displacement immediate + f7 03 # negate *EBX (reg 3) ++run: 'not' of effective address ++run: effective address is mem at address 0x60 (reg 3) ++run: storing 0xf0f0ff00 |