fastbasic
fastbasic copied to clipboard
inc 256
I was wondering if you could add a way of incrementing an integer by 256.
I suspect this would be just like inc only you'd increment the hi byte instead of the lo byte of the integer.
Hi!
I was wondering if you could add a way of incrementing an integer by 256.
I suspect this would be just like inc only you'd increment the hi byte instead of the lo byte of the integer.
Yes, would be easy to implement, but it would take some extra bytes in the IDE and not be substantially faster.
What is your use case? Do you need something faster than A = A + 256, or do you need smaller code?
Have Fun!
Yeah, it's just for working with memory, moving things up and down screen when each line is a page.
inc a is 3x faster than a=a+1 so I figured inc256 would be similar speed and not too much work or memory wastage for you.
It's no big requirement, just thought it might be useful if it's simple to code and doesn't use too much space.
Hi!
Yeah, it's just for working with memory, moving things up and down screen when each line is a page.
inc a is 3x faster than a=a+1 so I figured inc256 would be similar speed and not too much work or memory wastage for you.
I could add this as an optimization to the cross compiler, converting A=A+256 to a faster variant, so that the native compiler does not get bigger.
If (when) I finish the cross compiler to native code, it will certainly optimize this.
Have Fun!