From fec233db2ab232a1ef3eaba7d954dcf2171337eb Mon Sep 17 00:00:00 2001 From: neauoire Date: Mon, 18 Apr 2022 12:33:30 -0700 Subject: [PATCH] Use helpers for LIT --- src/uxn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uxn.c b/src/uxn.c index f1f274b..7fcd754 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -66,8 +66,7 @@ uxn_eval(Uxn *u, Uint16 pc) bs = instr & 0x20 ? 1 : 0; switch(instr & 0x1f) { /* Stack */ - case 0x00: /* LIT */ if(bs) { PEEK16(a, pc) PUSH16(src, a) pc += 2; } - else { a = u->ram[pc]; PUSH8(src, a) pc++; } break; + case 0x00: /* LIT */ PEEK(a, pc) PUSH(src, a) pc += 1 + bs; break; case 0x01: /* INC */ POP(a) PUSH(src, a + 1) break; case 0x02: /* POP */ POP(a) break; case 0x03: /* NIP */ POP(a) POP(b) PUSH(src, a) break;