I want a byte variable to follow the sequence 1,2,4,8,16,32,64,128,1,2 ... so I wrote the code
but that took temp from 128 to 0 not 1.
Replacing
temp = temp*2 min 1
by
temp = temp*2
temp = temp min 1
gets it working OK.
Does the first version fail me because it's working with a word when it applies the MIN operation?
Derek
Code:
symbol temp = b2
temp = 1
DO
'Operations
temp = temp*2 min 1
LOOP
Replacing
temp = temp*2 min 1
by
temp = temp*2
temp = temp min 1
gets it working OK.
Does the first version fail me because it's working with a word when it applies the MIN operation?
Derek