(uxnasm) Added support for partial label jsi
This commit is contained in:
parent
b9a79eca19
commit
a55b07e1db
|
@ -25,18 +25,20 @@ BRK
|
||||||
(
|
(
|
||||||
@| test label inheritance )
|
@| test label inheritance )
|
||||||
|
|
||||||
@object
|
@Object &x $1 &y $1
|
||||||
|
|
||||||
&x $1 &y $1
|
|
||||||
|
|
||||||
&get-x ( -- x )
|
&get-x ( -- x )
|
||||||
,&x LDR
|
,&x LDR
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
@object/get-y ( -- y )
|
@Object/get-y ( -- y )
|
||||||
,&y LDR
|
,&y LDR
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
|
@Object/get-both ( -- x y )
|
||||||
|
/get-x /get-y
|
||||||
|
JMP2r
|
||||||
|
|
||||||
( raw lambda length )
|
( raw lambda length )
|
||||||
_{ 01 02 03 }
|
_{ 01 02 03 }
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ makereference(char *scope, char *label, char rune, Uint16 addr)
|
||||||
if(label[0] == '{') {
|
if(label[0] == '{') {
|
||||||
p.lambda_stack[p.lambda_ptr++] = p.lambda_count;
|
p.lambda_stack[p.lambda_ptr++] = p.lambda_count;
|
||||||
scpy(makelambda(p.lambda_count++), r->name, 0x40);
|
scpy(makelambda(p.lambda_count++), r->name, 0x40);
|
||||||
} else if(label[0] == '&') {
|
} else if(label[0] == '&' || label[0] == '/') {
|
||||||
if(!sublabel(subw, scope, label + 1))
|
if(!sublabel(subw, scope, label + 1))
|
||||||
return error("Invalid sublabel", label);
|
return error("Invalid sublabel", label);
|
||||||
scpy(subw, r->name, 0x40);
|
scpy(subw, r->name, 0x40);
|
||||||
|
@ -502,7 +502,7 @@ main(int argc, char *argv[])
|
||||||
if(argc == 1)
|
if(argc == 1)
|
||||||
return error("usage", "uxnasm [-v] input.tal output.rom");
|
return error("usage", "uxnasm [-v] input.tal output.rom");
|
||||||
if(argv[1][0] == '-' && argv[1][1] == 'v')
|
if(argv[1][0] == '-' && argv[1][1] == 'v')
|
||||||
return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 24 Feb 2024.\n");
|
return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 25 Feb 2024.\n");
|
||||||
if(!(src = fopen(argv[1], "r")))
|
if(!(src = fopen(argv[1], "r")))
|
||||||
return !error("Invalid input", argv[1]);
|
return !error("Invalid input", argv[1]);
|
||||||
if(!assemble(src))
|
if(!assemble(src))
|
||||||
|
|
Loading…
Reference in New Issue