local vars: clear-only variable tables should appear before long comments
(Minor enhancement)
Currently, when an empty, clearing variable table occurs on the same line as a long comment, you see something like:
a7ba: 38 @secAndRts sec
a7bb: 60 rts
; clears carry if A is alphanumeric, sets otherwise
• Clear variables
a7bc: c9 30 IsAlNum cmp #$30 ; < '0' (punctuation, or control chars)?
a7be: 90 fa bcc @secAndRts
a7c0: c9 3a cmp #$3a ; digit?
In such instances, I'd prefer the "Clear variables" remark appears above, as it has more to do with "ending" the variable table above it, than beginning something below, and can easily be lost amongst the comment if someone is searching for where the vars stop applying.
It's currently output along with the table. This would usually happen at the start of a function, e.g.:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Main command-handler entry point. The Applesoft ampersand vector points ;
; here. ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.addrs $b300
• Clear variables
]ptr_3c .var $3c {addr/2}
]ptr_3e .var $3e {addr/2}
]cmd_tmp .var $46 {addr/1}
b300: 85 46 AmperEntry sta ]cmd_tmp ;A-reg holds the Applesoft token that follows "&"
b302: a0 fd ldy #$fd ;start at -3
Shifting the "clear variables" line above the comment should be possible.
Note "clear variables" doesn't actually appear in generated assembly code. I think the only exception would be ACME, because everything has explicit nested scope.
Note "clear variables" doesn't actually appear in generated assembly code.
It does, for me, at least in HTML. See for example the link to the HTML for the example given in the first comment. (This is with SourceGen 1.10.0; sorry, I should've specified that at the start)
When I say "Generated assembly code", I mean what you get from File > Generate Assembly, i.e. stuff you can actually feed into an assembler. The on-screen / exported version is an idealized form that doesn't have to work around whatever strange things each assembler wants.