about summary refs log tree commit diff stats
path: root/subx/014immediate_addressing.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-30 11:23:23 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-30 11:23:23 -0700
commit62c6d1638a2682bbc291987e2d6cb87b5c5d8da1 (patch)
tree2e23d80fac375253199082854d69270e07c0d008 /subx/014immediate_addressing.cc
parentb4c78a5939443d4fe08510b75ea51fbad94c2211 (diff)
downloadmu-62c6d1638a2682bbc291987e2d6cb87b5c5d8da1.tar.gz
4456 - example with function calls: factorial
I found a bug with multiply in the process; another case (after the swap
of call/jump opcodes in 4453) where there's no point improving testing.

Unit tests can only tell us if our instructions are internally
consistent. Validating against a real machine has to be manual.

I'm definitely feeling the pain of debugging machine code now, that's
for sure. Going over an instruction trace, comparing the state of
registers line by line.
Diffstat (limited to 'subx/014immediate_addressing.cc')
-rw-r--r--subx/014immediate_addressing.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/subx/014immediate_addressing.cc b/subx/014immediate_addressing.cc
index 8ef36f95..c75c419e 100644
--- a/subx/014immediate_addressing.cc
+++ b/subx/014immediate_addressing.cc
@@ -469,6 +469,7 @@ put(name, "68", "push imm32 to stack");
 case 0x68: {
   uint32_t val = static_cast<uint32_t>(imm32());
   trace(90, "run") << "push imm32 0x" << HEXWORD << val << end();
+//?   cerr << "push: " << val << " => " << Reg[ESP].u << '\n';
   push(val);
   trace(90, "run") << "ESP is now 0x" << HEXWORD << Reg[ESP].u << end();
   trace(90, "run") << "contents at ESP: 0x" << HEXWORD << read_mem_u32(Reg[ESP].u) << end();