From 7a5578277f6b31a6ce7da9215c3016f53fb55ce4 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Mon, 1 Oct 2018 16:24:01 -0700 Subject: [PATCH] Fix over optimization of immediate opcodes --- src/vmsrc/plvm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vmsrc/plvm.c b/src/vmsrc/plvm.c index c636fab..7cc2848 100755 --- a/src/vmsrc/plvm.c +++ b/src/vmsrc/plvm.c @@ -640,19 +640,23 @@ void interp(code *ip) case 0x36: // DIVMOD break; case 0x38: // ADDI - PUSH(POP + BYTE_PTR(ip)); + val = POP + BYTE_PTR(ip); + PUSH(val); ip++; break; case 0x3A: // SUBI - PUSH(POP - BYTE_PTR(ip)); + val = POP - BYTE_PTR(ip); + PUSH(val); ip++; break; case 0x3C: // ANDI - PUSH(POP & BYTE_PTR(ip)); + val = POP & BYTE_PTR(ip); + PUSH(val); ip++; break; case 0x3E: // ORI - PUSH(POP | BYTE_PTR(ip)); + val = POP | BYTE_PTR(ip); + PUSH(val); ip++; break; /*