Browse code

LIT is now 0x01

neauoire authored on 19/04/2021 16:51:52
Showing 2 changed files
... ...
@@ -49,7 +49,7 @@ Program p;
49 49
 /* clang-format off */
50 50
 
51 51
 char ops[][4] = {
52
-	"BRK", "NOP", "LIT", "POP", "DUP", "SWP", "OVR", "ROT",
52
+	"BRK", "LIT", "NOP", "POP", "DUP", "SWP", "OVR", "ROT",
53 53
 	"EQU", "NEQ", "GTH", "LTH", "GTS", "LTS", "---", "---",
54 54
 	"PEK", "POK", "LDR", "STR", "JMP", "JNZ", "JSR", "STH",
55 55
 	"ADD", "SUB", "MUL", "DIV", "AND", "ORA", "EOR", "SFT"
... ...
@@ -71,14 +71,14 @@ char *scpy(char *src, char *dst, int len) { int i = 0; while((dst[i] = src[i]) &
71 71
 void
72 72
 pushbyte(Uint8 b, int lit)
73 73
 {
74
-	if(lit) pushbyte(0x02, 0);
74
+	if(lit) pushbyte(0x01, 0);
75 75
 	p.data[p.ptr++] = b;
76 76
 }
77 77
 
78 78
 void
79 79
 pushshort(Uint16 s, int lit)
80 80
 {
81
-	if(lit) pushbyte(0x22, 0);
81
+	if(lit) pushbyte(0x21, 0);
82 82
 	pushbyte((s >> 8) & 0xff, 0);
83 83
 	pushbyte(s & 0xff, 0);
84 84
 }
... ...
@@ -88,7 +88,7 @@ pushtext(char *s, int lit)
88 88
 {
89 89
 	int i = 0;
90 90
 	char c;
91
-	if(lit) pushbyte(0x22, 0);
91
+	if(lit) pushbyte(0x21, 0);
92 92
 	while((c = s[i++])) pushbyte(c, 0);
93 93
 }
94 94
 
... ...
@@ -63,7 +63,6 @@ void op_eor(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b
63 63
 void op_sft(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b >> (a & 0x07) << ((a & 0x70) >> 4)); }
64 64
 /* Stack */
65 65
 void op_lit16(Uxn *u) { push16(u->src, mempeek16(u, u->ram.ptr++)); u->ram.ptr++; }
66
-void op_nop16(Uxn *u) { printf("%04x\n", pop16(u->src)); }
67 66
 void op_pop16(Uxn *u) { pop16(u->src); }
68 67
 void op_dup16(Uxn *u) { push16(u->src, peek16(u->src, 0)); }
69 68
 void op_swp16(Uxn *u) { Uint16 b = pop16(u->src), a = pop16(u->src); push16(u->src, b); push16(u->src, a); }
... ...
@@ -96,12 +95,12 @@ void op_eor16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->s
96 95
 void op_sft16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b >> (a & 0x000f) << ((a & 0x00f0) >> 4)); }
97 96
 
98 97
 void (*ops[])(Uxn *u) = {
99
-	op_brk, op_nop, op_lit, op_pop, op_dup, op_swp, op_ovr, op_rot,
98
+	op_brk, op_lit, op_nop, op_pop, op_dup, op_swp, op_ovr, op_rot,
100 99
 	op_equ, op_neq, op_gth, op_lth, op_gts, op_lts, op_nop, op_nop,
101 100
 	op_pek, op_pok, op_ldr, op_str, op_jmp, op_jnz, op_jsr, op_sth, 
102 101
 	op_add, op_sub, op_mul, op_div, op_and, op_ora, op_eor, op_sft,
103 102
 	/* 16-bit */
104
-	op_brk,   op_nop16, op_lit16, op_pop16, op_dup16, op_swp16, op_ovr16, op_rot16,
103
+	op_brk,   op_lit16, op_nop, op_pop16, op_dup16, op_swp16, op_ovr16, op_rot16,
105 104
 	op_equ16, op_neq16, op_gth16, op_lth16, op_gts16, op_lts16, op_nop,   op_nop, 
106 105
 	op_pek16, op_pok16, op_ldr16, op_str16, op_jmp16, op_jnz16, op_jsr16, op_sth16, 
107 106
 	op_add16, op_sub16, op_mul16, op_div16, op_and16, op_ora16, op_eor16, op_sft16