commit d5253086b54911bf33db635fa5eadf03eee35a6a
parent c2ffe63cc3c07f96a407204d21462aaaea769900
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Mon, 18 Apr 2022 09:45:33 +0100
Move stack opcodes.
Diffstat:
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/projects/library/asma.tal b/projects/library/asma.tal
@@ -949,11 +949,11 @@
&_entry :>H :&ROT &_disasm "LIT 00
&INC $2 $2 "INC 00
&POP $2 $2 "POP 00
- &DUP $2 $2 "DUP 00
&NIP :&MUL :&OVR "NIP 00
&SWP $2 $2 "SWP 00
- &OVR :&ORA :&POP "OVR 00
&ROT :&NIP :&STR "ROT 00
+ &DUP $2 $2 "DUP 00
+ &OVR :&ORA :&POP "OVR 00
&EQU $2 $2 "EQU 00
&NEQ $2 $2 "NEQ 00
>H :&DIV :&JSR "GTH 00
diff --git a/src/uxn.c b/src/uxn.c
@@ -70,11 +70,11 @@ uxn_eval(Uxn *u, Uint16 pc)
else { a = u->ram[pc]; PUSH8(src, a) pc++; } break;
case 0x01: /* INC */ POP(a) PUSH(src, a + 1) break;
case 0x02: /* POP */ POP(a) break;
- case 0x03: /* DUP */ POP(a) PUSH(src, a) PUSH(src, a) break;
- case 0x04: /* NIP */ POP(a) POP(b) PUSH(src, a) break;
- case 0x05: /* SWP */ POP(a) POP(b) PUSH(src, a) PUSH(src, b) break;
- case 0x06: /* OVR */ POP(a) POP(b) PUSH(src, b) PUSH(src, a) PUSH(src, b) break;
- case 0x07: /* ROT */ POP(a) POP(b) POP(c) PUSH(src, b) PUSH(src, a) PUSH(src, c) break;
+ case 0x03: /* NIP */ POP(a) POP(b) PUSH(src, a) break;
+ case 0x04: /* SWP */ POP(a) POP(b) PUSH(src, a) PUSH(src, b) break;
+ case 0x05: /* ROT */ POP(a) POP(b) POP(c) PUSH(src, b) PUSH(src, a) PUSH(src, c) break;
+ case 0x06: /* DUP */ POP(a) PUSH(src, a) PUSH(src, a) break;
+ case 0x07: /* OVR */ POP(a) POP(b) PUSH(src, b) PUSH(src, a) PUSH(src, b) break;
/* Logic */
case 0x08: /* EQU */ POP(a) POP(b) PUSH8(src, b == a) break;
case 0x09: /* NEQ */ POP(a) POP(b) PUSH8(src, b != a) break;
diff --git a/src/uxnasm.c b/src/uxnasm.c
@@ -49,7 +49,7 @@ static int litlast = 0;
/* clang-format off */
static char ops[][4] = {
- "LIT", "INC", "POP", "DUP", "NIP", "SWP", "OVR", "ROT",
+ "LIT", "INC", "POP", "NIP", "SWP", "ROT", "DUP", "OVR",
"EQU", "NEQ", "GTH", "LTH", "JMP", "JCN", "JSR", "STH",
"LDZ", "STZ", "LDR", "STR", "LDA", "STA", "DEI", "DEO",
"ADD", "SUB", "MUL", "DIV", "AND", "ORA", "EOR", "SFT"