commit 8ac1a54
zzo38
·
2022-11-16 22:45:29 +0000 UTC
parent e5299bb
Now = has the same meaning as : (since the official implementation does this, even though it seems unnecessary to me)
M
asm.doc
+2,
-0
1@@ -72,6 +72,8 @@ The following standard tokens are available:
2 : and a name will write the 16-bit address of the specified name directly,
3 without any opcode. (It is like ; but excluding the LIT2 instruction.)
4
5+ = and a name is the same as : and a name.
6+
7 - and a name is like . but without the LIT opcode.
8
9 _ and a name is like , but without the LIT opcode.
M
uxnasm.c
+7,
-2
1@@ -1,3 +1,8 @@
2+#if 0
3+gcc -s -O2 -o ./uxnasm uxnasm.c
4+exit
5+#endif
6+
7 #include <stdio.h>
8
9 /*
10@@ -395,7 +400,7 @@ parse(char *w, FILE *f)
11 makereference(p.scope, w, p.ptr);
12 if(!writeshort(0xffff, 1)) return 0;
13 break;
14- case ':': /* raw short absolute */
15+ case ':': case '=': /* raw short absolute */
16 makereference(p.scope, w, p.ptr);
17 if(!writeshort(0xffff, 0)) return 0;
18 break;
19@@ -527,7 +532,7 @@ resolve(void)
20 p.data[r->addr + 2] = l->addr & 0xff;
21 l->refs++;
22 break;
23- case ':':
24+ case ':': case '=':
25 if(!(l = findlabel(r->name)))
26 return error("Unknown absolute reference", r->name);
27 p.data[r->addr + 0] = l->addr >> 0x8;