flamewing / asl-releases

Improved/bugfixed version of Alfred Arnold's The Macro Assembler AS
http://john.ccac.rwth-aachen.de:8000/as/
GNU General Public License v2.0
20 stars 2 forks source link

sometimes labels just don't work #8

Closed Awuwunya closed 3 years ago

Awuwunya commented 3 years ago

I had this issue with porting AMPS to AS. Labels would just kinda... not work? I would have a nested macro (code -> macro -> macro) that created labels that would be referenced by code within another macro. However, these labels apparently didn't exist! I found a workaround by using the label directive, but it was still a weird bug. Here is the working example:

.nowrap label * 
flamewing commented 3 years ago

That is by design: labels defined in macros are not exported by default in AS, but it can be toggled by the GLOBALSYMBOLS/NOGLOBALSYMBOLS macro atributes. The label pseudoinstruction was added to AS to allow selective exporting of labels, so it is also not a workaround.

Awuwunya commented 3 years ago

ok yeah that is not very intuitive especially coming from ASM68K where macro local labels are defined in the label scope. That does bring its own issues to be fair, but its how I handled stuff in AMPS anyway because of the extensive use of macros