commit 95a28d6

Devine Lu Linvega  ·  2022-06-13 17:32:59 +0000 UTC
parent 4d252e3
Removed err4, display only stack when not empty on debug
2 files changed,  +7, -5
+6, -4
 1@@ -17,14 +17,14 @@ WITH REGARD TO THIS SOFTWARE.
 2 static const char *errors[] = {
 3 	"underflow",
 4 	"overflow",
 5-	"division by zero",
 6-	"Busy"
 7+	"division by zero"
 8 };
 9 
10 static void
11 system_print(Stack *s, char *name)
12 {
13 	Uint8 i;
14+
15 	fprintf(stderr, "<%s>", name);
16 	for(i = 0; i < s->ptr; i++)
17 		fprintf(stderr, " %02x", s->dat[i]);
18@@ -36,8 +36,10 @@ system_print(Stack *s, char *name)
19 void
20 system_inspect(Uxn *u)
21 {
22-	system_print(u->wst, "wst");
23-	system_print(u->rst, "rst");
24+	if(u->wst->ptr)
25+		system_print(u->wst, "wst");
26+	if(u->rst->ptr)
27+		system_print(u->rst, "rst");
28 }
29 
30 int
+1, -1
1@@ -88,7 +88,7 @@ uxn_eval(Uxn *u, Uint16 pc)
2 		case 0x1f: /* SFT */ POP8(a) POP(b) PUSH(src, b >> (a & 0x0f) << ((a & 0xf0) >> 4)) break;
3 		}
4 	}
5-	return (u->wst->ptr || u->rst->ptr) ? uxn_halt(u, instr, 4, pc - 1) : 1;
6+	return 1;
7 err:
8 	return uxn_halt(u, instr, errcode, pc - 1);
9 }