Nice to have a confirmation on this.
Though I would like to have on PBP local variables and passing values to subs as C does. This would produce even more efficient code.
But anyway, I guess this won't come in the near (or far) future.
Ioannis
Nice to have a confirmation on this.
Though I would like to have on PBP local variables and passing values to subs as C does. This would produce even more efficient code.
But anyway, I guess this won't come in the near (or far) future.
Ioannis
I declare "b0 VAR BYTE" and use it as a generic local variable in subroutines. I can have b1, b2, or even w0, w1... etc. I learned that back in my PICAXE days. It's common to declare "int i;" in C to use in for() loops, where "i" is local.
I use TmpB1... TmpW1... TmpL1 etc...
Passing values to sub cant make nothing for better code efficiently.
It can make it just look better. Behind curtain, ASM code is same, or worse if compiler move vars for you.
That's not necessarily true... it all depends on how the compiler allocates variables, how much your program uses, and the device.Passing values to sub cant make nothing for better code efficiently
If "passed" variables are allocated in access memory vs banked memory the resulting code can be much smaller.
You just need a good compiler.
Then declare variable in BANKA. And use it.
I have one of best compilers for pic. It iscalled PicBasic Pro![]()
And pbp have very good optimization. And wouln't benefit in program size from adding passable variables. It would just be visualy neater code.
It have usercommand that do exactly that. And I see verry little use of it.
LOL, why this thread turned into another wishlist?I've asked what is perfectly doable and needs only one executable to be updated....
Bookmarks