diff options
Diffstat (limited to 'subx/012indirect_addressing.cc')
-rw-r--r-- | subx/012indirect_addressing.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/subx/012indirect_addressing.cc b/subx/012indirect_addressing.cc index 6e9a5f01..4cc3cb9d 100644 --- a/subx/012indirect_addressing.cc +++ b/subx/012indirect_addressing.cc @@ -116,3 +116,43 @@ case 0x23: { // and r/m32 with r32 BINARY_BITWISE_OP(&, Reg[arg1].u, *arg2); break; } + +//:: or + +:(scenario or_r32_with_mem_at_r32) +% Reg[0].i = 0x60; +% Mem.at(0x60) = 0x0d; +% Mem.at(0x61) = 0x0c; +% Mem.at(0x62) = 0x0b; +% Mem.at(0x63) = 0x0a; +% Reg[3].i = 0xa0b0c0d0; +# op ModRM SIB displacement immediate + 09 18 # or EBX (reg 3) with *EAX (reg 0) ++run: or reg 3 with effective address ++run: effective address is mem at address 0x60 (reg 0) ++run: storing 0xaabbccdd + +//: + +:(scenario or_mem_at_r32_with_r32) +% Reg[0].i = 0x60; +% Mem.at(0x60) = 0x0d; +% Mem.at(0x61) = 0x0c; +% Mem.at(0x62) = 0x0b; +% Mem.at(0x63) = 0x0a; +% Reg[3].i = 0xa0b0c0d0; +# op ModRM SIB displacement immediate + 0b 18 # or *EAX (reg 0) with EBX (reg 3) ++run: or effective address with reg 3 ++run: effective address is mem at address 0x60 (reg 0) ++run: storing 0xaabbccdd + +:(before "End Single-Byte Opcodes") +case 0x0b: { // or r/m32 with r32 + uint8_t modrm = next(); + uint8_t arg1 = (modrm>>3)&0x7; + trace(2, "run") << "or effective address with reg " << NUM(arg1) << end(); + const int32_t* arg2 = effective_address(modrm); + BINARY_BITWISE_OP(|, Reg[arg1].u, *arg2); + break; +} |