asar icon indicating copy to clipboard operation
asar copied to clipboard

Allow branches to take full addresses

Open MarioFanGamer opened this issue 2 years ago • 4 comments

That one is a more situational suggestion, being only useful for hijacks, but still proves to be useful in my eyes.

The idea is that for hijacks, you sometimes want to skip certain code. The most sane method would be this in my eyes:

org $00802A
BRA $008041

However, Asar will only take the last byte and treat it as a BRA $41 instead of BRA $17 as one would like. You can work around this limit with either

BraDestination = $008041

org $00802A
BRA BraDestination

or

org $00802A
BRA BraDestination 

org $008041
BraDestination:

but both of them clutter the code a little bit.

Obviously, this works the best if this syntactic sugar only supports the whole address with the bank and not just a 16-bit value to avoid confusion with BRL which does take a 16-bit parameter and instead throw an error if someone attempts to put a 16-bit value for any other branch.

MarioFanGamer avatar Dec 13 '22 08:12 MarioFanGamer