commit 4464b1ec564adf7edf74cede0672470870f84015
parent 39fa5851eb50a1aab00f7ea2c721182245abb180
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Mon, 13 Mar 2023 06:03:44 +0000
Correct SET values for NIP.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/uxn.c b/src/uxn.c
@@ -61,7 +61,7 @@ uxn_eval(Uxn *u, Uint16 pc)
/* ALU */
case 0x01: /* INC */ t=T; SET(1, 0) PUT(0, t + 1) break; case 0x21: t=T2; SET(2, 0) PUT2(0, t + 1) break;
case 0x02: /* POP */ SET(1,-1) break; case 0x22: SET(2,-2) break;
- case 0x03: /* NIP */ t=T; SET(1,-1) PUT(0, t) break; case 0x23: t=T2; SET(2,-2) PUT2(0, t) break;
+ case 0x03: /* NIP */ t=T; SET(2,-1) PUT(0, t) break; case 0x23: t=T2; SET(4,-2) PUT2(0, t) break;
case 0x04: /* SWP */ t=T;n=N; SET(2, 0) PUT(0, n) PUT(1, t) break; case 0x24: t=T2;n=N2; SET(4, 0) PUT2(0, n) PUT2(2, t) break;
case 0x05: /* ROT */ t=T;n=N;l=L; SET(3, 0) PUT(0, l) PUT(1, t) PUT(2, n) break; case 0x25: t=T2;n=N2;l=L2; SET(6, 0) PUT2(0, l) PUT2(2, t) PUT2(4, n) break;
case 0x06: /* DUP */ t=T; SET(1, 1) PUT(0, t) PUT(1, t) break; case 0x26: t=T2; SET(2, 2) PUT2(0, t) PUT2(2, t) break;