summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2020-01-01 13:51:31 -0500
committerJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2020-01-01 13:51:31 -0500
commit438670cf690858d1b4f884582330eaaa3acd29b3 (patch)
tree1436f3988289368dbf1f31bc31a3bd17e7e0fe0e
parent9066890b6bde90ffcfbde7522c4371a29f9ff1a5 (diff)
Fix updating of PC
-rw-r--r--main.myr8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.myr b/main.myr
index 0fd856c..292d2d6 100644
--- a/main.myr
+++ b/main.myr
@@ -86,7 +86,9 @@ const main = {
;;
// JP
| 0x1:
- pc = ((opcode & 0x0f) << 8) | arg
+ pc = (opcode & 0x0f : uint16)
+ pc <<= 8
+ pc |= (arg : uint16)
// CALL
| 0x2:
sp++
@@ -94,7 +96,9 @@ const main = {
std.die("stack overflow")
;;
stk[sp] = pc
- pc = ((opcode & 0x0f) << 8) | arg
+ pc = (opcode & 0x0f : uint16)
+ pc <<= 8
+ pc |= (arg : uint16)
// SE
| 0x3:
if reg[opcode & 0x0f] == arg