about summary refs log tree commit diff stats
path: root/subx/010vm.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-16 22:18:18 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-16 22:18:18 -0700
commit6602c82f9f35235b998132f0adc54c852aa4e025 (patch)
tree8fbb5a3532c7cd279838b15f9149f3d39afda487 /subx/010vm.cc
parenta50a95d21505148035ec8f08af414d663e9dad7e (diff)
downloadmu-6602c82f9f35235b998132f0adc54c852aa4e025.tar.gz
4363 - subx: first program using the stack segment
We allocate space for a local variable, read() a character from stdin to
it, and write() it out to stdout.
Diffstat (limited to 'subx/010vm.cc')
-rw-r--r--subx/010vm.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/subx/010vm.cc b/subx/010vm.cc
index 17c4e064..50074114 100644
--- a/subx/010vm.cc
+++ b/subx/010vm.cc
@@ -133,6 +133,7 @@ void run_one_instruction() {
     // End Two-Byte Opcodes Starting With 0f
     default:
       cerr << "unrecognized second opcode after 0f: " << HEXBYTE << NUM(op2) << '\n';
+      DUMP("");
       exit(1);
     }
     break;
@@ -144,16 +145,19 @@ void run_one_instruction() {
       // End Three-Byte Opcodes Starting With f3 0f
       default:
         cerr << "unrecognized third opcode after f3 0f: " << HEXBYTE << NUM(op3) << '\n';
+        DUMP("");
         exit(1);
       }
       break;
     default:
       cerr << "unrecognized second opcode after f3: " << HEXBYTE << NUM(op2) << '\n';
+      DUMP("");
       exit(1);
     }
     break;
   default:
     cerr << "unrecognized opcode: " << HEXBYTE << NUM(op) << '\n';
+    DUMP("");
     exit(1);
   }
 }