Skip to content

Commit

Permalink
allow using macro argument syntax outside macros
Browse files Browse the repository at this point in the history
  • Loading branch information
randomdude999 committed Jul 16, 2023
1 parent 2b29a7d commit d39723a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/asar/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,9 @@ void assembleline(const char * fname, int linenum, const char * line)
single_line_for_tracker = 1;
try
{
string tmp=replace_macro_args(line);
string tmp;
if(inmacro) tmp = replace_macro_args(line);
else tmp = line;
clean(tmp);
string out;
if (numif==numtrue) resolvedefines(out, tmp);
Expand Down
6 changes: 5 additions & 1 deletion tests/macrolabels.asm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
;`1D 80 00
;`04 80 00
;`04 80 00
;`3C 61 3E

org $008000
Main:
Expand Down Expand Up @@ -49,4 +50,7 @@ org $008000
dl Main_Sub
dl InMacro
dl Main_InMacroSub ; Note that this is not InMacro_InMacroSub

; not exactly a test for macro labels, but close enough
db "<a>" ; macro argument outside macro - should be left unexpanded

0 comments on commit d39723a

Please sign in to comment.