all repos — xyw @ d7a215a6ec18fefd1f668e46a96a015d70b6fe99

A minimal virtual machine and assembler for terminals.

Fixes.
h3rald h3rald@h3rald.com
Sat, 29 Nov 2025 17:23:12 +0100
commit

d7a215a6ec18fefd1f668e46a96a015d70b6fe99

parent

9b133410ee47c39b928890d0bc3bdaf9cc033049

2 files changed, 4 insertions(+), 4 deletions(-)

jump to
M xywxyw

          
M xywvm.cxywvm.c

@@ -174,7 +174,7 @@ //// Instructions

static void PSH() { - if (usp > STACK_SIZE - 1) + if (*usp > STACK_SIZE - 1) { xyw_memory[SYSTEM_ERROR] = XYW_ERROR_STACK_OVERFLOW; return;

@@ -184,7 +184,7 @@ }

static void PSHw() { - if (usp > STACK_SIZE - 2) + if (*usp > STACK_SIZE - 2) { xyw_memory[SYSTEM_ERROR] = XYW_ERROR_STACK_OVERFLOW; return;

@@ -211,7 +211,7 @@ {

return *y; } // If no mode is set, pop from stack - if (usp < 1) + if (*usp < 1) { xyw_memory[SYSTEM_ERROR] = XYW_ERROR_STACK_UNDERFLOW; return -1;

@@ -240,7 +240,7 @@ {

return yw(); } // If no mode is set, pop from stack - if (usp < 2) + if (*usp < 2) { xyw_memory[SYSTEM_ERROR] = XYW_ERROR_STACK_UNDERFLOW; return -1;