CALLing a local label?
Nick Mueller
Posts: 815
Hi!
when I do have some code that looks like this:
... and change it to locals (eg: :someReg, etc), a call #:notSoMuch doesn't compile.
How does that make sense that calls only work with global labels?
Only workaround is using jmpret. Then I can use local labels.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
when I do have some code that looks like this:
org 0 SomeCode mov someReg, #0 call #notSoMuch jmp SomeCode notSoMuch nop notSoMuch_ret ret someReg res 1
... and change it to locals (eg: :someReg, etc), a call #:notSoMuch doesn't compile.
How does that make sense that calls only work with global labels?
Only workaround is using jmpret. Then I can use local labels.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Comments
The idea behind "local labels" is a little bit obscure, I think they have been invented to simplify the patching for indexed addressing...
Well, it is a macro that does generate a jmpret. But jmpret *does* handle locals.
> The idea behind "local labels" is a little bit obscure, ...
What!? locals support the concept of scope. But ... OK, I shut up.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Sure. But scope within a subroutine. The idea is so that you can use the same labels in different subroutines, not to have multiple subroutines with the same name.
I'd say the idea is to use global labels for the entry point, subroutine labels, and data, and locals for labels on jmps within subroutines.
Of course when trying to squeeze something into 496 longs, things can sometimes get messier than that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Help to build the Propeller wiki - propeller.wikispaces.com
Play Defender - Propeller version of the classic game
Prop Room Robotics - my web store for Roomba spare parts in the UK