about summary refs log tree commit diff stats
path: root/subx/011direct_addressing.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-10-13 01:05:53 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-10-13 01:05:53 -0700
commitce315187881b625354ab3279f470a3e771e61525 (patch)
tree0b75e3d500770dee817a95e55f8541adf9340e10 /subx/011direct_addressing.cc
parent280f5115465501464b2f7e9f4671f9e8f3b52147 (diff)
downloadmu-ce315187881b625354ab3279f470a3e771e61525.tar.gz
4056
subx: 'or'
Diffstat (limited to 'subx/011direct_addressing.cc')
-rw-r--r--subx/011direct_addressing.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/subx/011direct_addressing.cc b/subx/011direct_addressing.cc
index de5e923a..bbd482d4 100644
--- a/subx/011direct_addressing.cc
+++ b/subx/011direct_addressing.cc
@@ -83,3 +83,24 @@ case 0x21: {  // and r32 with r/m32
   BINARY_BITWISE_OP(&, *arg1, Reg[arg2].u);
   break;
 }
+
+//:: or
+
+:(scenario or_r32_with_r32)
+% Reg[0].i = 0x0a0b0c0d;
+% Reg[3].i = 0xa0b0c0d0;
+# op  ModR/M  SIB   displacement  immediate
+  09  d8                                      # or EBX (reg 3) with destination EAX (reg 0)
++run: or reg 3 with effective address
++run: effective address is reg 0
++run: storing 0xaabbccdd
+
+:(before "End Single-Byte Opcodes")
+case 0x09: {  // or r32 with r/m32
+  uint8_t modrm = next();
+  uint8_t arg2 = (modrm>>3)&0x7;
+  trace(2, "run") << "or reg " << NUM(arg2) << " with effective address" << end();
+  int32_t* arg1 = effective_address(modrm);
+  BINARY_BITWISE_OP(|, *arg1, Reg[arg2].u);
+  break;
+}