about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-30 09:57:32 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-30 09:57:32 -0700
commitd98cc38e445ab076c57fdcd5de0d20589dbaa293 (patch)
tree93aaed787c08a39039312c476efce077dc9783f5
parent126b4144013114705604fb7c9dc323bc9b4e6ea2 (diff)
downloadmu-d98cc38e445ab076c57fdcd5de0d20589dbaa293.tar.gz
4451
-rw-r--r--subx/014immediate_addressing.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/subx/014immediate_addressing.cc b/subx/014immediate_addressing.cc
index 165cc446..8ef36f95 100644
--- a/subx/014immediate_addressing.cc
+++ b/subx/014immediate_addressing.cc
@@ -467,10 +467,9 @@ put(name, "68", "push imm32 to stack");
 
 :(before "End Single-Byte Opcodes")
 case 0x68: {
-  int32_t val = imm32();
+  uint32_t val = static_cast<uint32_t>(imm32());
   trace(90, "run") << "push imm32 0x" << HEXWORD << val << end();
-  Reg[ESP].u -= 4;
-  write_mem_i32(Reg[ESP].u, val);
+  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();
   break;