about summary refs log tree commit diff stats
path: root/subx/011add.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-10-12 21:02:11 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-10-12 21:04:42 -0700
commit1091118ae55e6492fb5dea455bae408bebe83fec (patch)
tree6eb7c68fd7ba0074a9a3924de39395034ff9aecf /subx/011add.cc
parent7c0f7d69ae75ac06b5a17ee4d1e84ae05ac3a1c3 (diff)
downloadmu-1091118ae55e6492fb5dea455bae408bebe83fec.tar.gz
4037
Fix non-standard switch statement.
Diffstat (limited to 'subx/011add.cc')
-rw-r--r--subx/011add.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/subx/011add.cc b/subx/011add.cc
index 4f504be6..5ba1e080 100644
--- a/subx/011add.cc
+++ b/subx/011add.cc
@@ -29,18 +29,21 @@ int32_t* effective_address(uint8_t modrm) {
   uint8_t rm = modrm & 0x7;
   int32_t* result = 0;
   switch (mod) {
-    case 0:
-      // mod 0 is usually indirect addressing
-      switch (rm) {
-      default:
-        trace(99, "run") << "effective address is mem at address 0x" << std::hex << Reg[rm].u << " (reg " << static_cast<int>(rm) << ")" << end();
-        assert(Reg[rm].u + sizeof(int32_t) <= Mem.size());
-        result = reinterpret_cast<int32_t*>(&Mem.at(Reg[rm].u));  // rely on the host itself being in little-endian order
-        break;
-      // End Mod 0 Special-Cases
-      }
+  case 0:
+    // mod 0 is usually indirect addressing
+    switch (rm) {
+    default:
+      trace(99, "run") << "effective address is mem at address 0x" << std::hex << Reg[rm].u << " (reg " << static_cast<int>(rm) << ")" << end();
+      assert(Reg[rm].u + sizeof(int32_t) <= Mem.size());
+      result = reinterpret_cast<int32_t*>(&Mem.at(Reg[rm].u));  // rely on the host itself being in little-endian order
       break;
-    // End Mod Special-Cases
+    // End Mod 0 Special-Cases
+    }
+    break;
+  // End Mod Special-Cases
+  default:
+    cerr << "unrecognized mod bits: " << static_cast<int>(mod) << '\n';
+    exit(1);
   }
   return result;
 }