Perhaps someone can shed some light on this ...
The following shift code does not work as intended when run in the simulator, as b0 returns 128 instead of 127.
This behaviour seems to appear only when 255 is loaded into b0. Am i missing something ?
I have not tried this code in a PICAXE 40X1 yet though.
The following shift code does not work as intended when run in the simulator, as b0 returns 128 instead of 127.
Code:
#picaxe 40X1
setfreq 16em
let b0 = 255
b0 = b0 >> 1 'This returns 128
'Sanity check
let b0 = 255
b0 = b0 / 2 'This returns 127 as expected
I have not tried this code in a PICAXE 40X1 yet though.
Last edited: