RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
204 stars 44 forks source link

label optimizer is too aggressive with +/- labels #300

Open randomdude999 opened 9 months ago

randomdude999 commented 9 months ago

(alternative title: label optimizer barely knows +/- labels exist)

org $8000
lda (+)-1
+

miscompiles to A5 01. +/- labels are only considered in getlen if the entire argument is a label reference, not if you do any math on it.

i really don't know how to fix this without rewriting most of the math parser. i don't even know how it should work: the label optimizer is very fragile and heuristic-based and i don't know what the "right" heuristics would be.