From 438670cf690858d1b4f884582330eaaa3acd29b3 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Wed, 1 Jan 2020 13:51:31 -0500 Subject: Fix updating of PC --- main.myr | 8 ++++++-- 1 file 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 -- cgit v1.3