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:23:55 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-10-13 01:24:13 -0700
commit5a25c6e66f78b0c5588af9de8d42e30e0d2232f3 (patch)
tree92f58c153f5fd5417919f8b890098f5d6d252fbe /subx/011direct_addressing.cc
parent8745e7456a4a14e0c0220fe8c6a5f988fdd39a29 (diff)
downloadmu-5a25c6e66f78b0c5588af9de8d42e30e0d2232f3.tar.gz
4058
Diffstat (limited to 'subx/011direct_addressing.cc')
-rw-r--r--subx/011direct_addressing.cc23
1 files changed, 23 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;
+}