Is it possible to make inline ‘method’ jump in nesasm (or any asm it may work in nesasm)?
What I mean is:
I got code like this.
Start;
LDA $0000
; here goes more code
JSR SomeMethod ; jump to method (put back pointer on stack)
EndOfMethod: ; just help label to make code more clear
STA $0000
; here goes a lot of more code
SomeMethod:
TAX
;here goes more method code
RTS ; return to position on stack
And now I want to make ‘SomeMethod’ inline (like in C++) so when compiled it will look like this:
Start;
LDA $0000
; here goes more code
SomeMethod:
TAX
;here goes more method code
EndOfMethod: ; just help label to make code more clear
STA $0000
; here goes a lot of more code
If your assembler supports some kind of macro, particularly one w/ parameters, then you could define
SomeMethodas a macro and use a parameter to have each instance have its own set of labels (by incorporating the parameter in the label name).Something like:
And then when you want to stick an instance in your code:
where you’d be responsible for insuring each instance has a different argument.