(uxnasm) Added support for partial label jsi

This commit is contained in:
Devine Lu Linvega 2024-02-25 16:06:14 -08:00
parent b9a79eca19
commit a55b07e1db
2 changed files with 10 additions and 8 deletions

View File

@ -25,18 +25,20 @@ BRK
(
@| test label inheritance )
@object
&x $1 &y $1
@Object &x $1 &y $1
&get-x ( -- x )
,&x LDR
JMP2r
@object/get-y ( -- y )
@Object/get-y ( -- y )
,&y LDR
JMP2r
@Object/get-both ( -- x y )
/get-x /get-y
JMP2r
( raw lambda length )
_{ 01 02 03 }

View File

@ -195,7 +195,7 @@ makereference(char *scope, char *label, char rune, Uint16 addr)
if(label[0] == '{') {
p.lambda_stack[p.lambda_ptr++] = p.lambda_count;
scpy(makelambda(p.lambda_count++), r->name, 0x40);
} else if(label[0] == '&') {
} else if(label[0] == '&' || label[0] == '/') {
if(!sublabel(subw, scope, label + 1))
return error("Invalid sublabel", label);
scpy(subw, r->name, 0x40);
@ -502,7 +502,7 @@ main(int argc, char *argv[])
if(argc == 1)
return error("usage", "uxnasm [-v] input.tal output.rom");
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")))
return !error("Invalid input", argv[1]);
if(!assemble(src))