I think you are confusing "and" with "or"
Zero is correct for "and"
You would only get %11111111 if you "or" the two
To see the result in simulation you may need at least one more instruction after the calculation.
Maybe something like:
Code: Select all
' found on forum...
' simple logic test program
' processor unknown, clock speed unknown
' mikroBASIC compiler 7.2.0
program forum
' Declarations section
dim tempi as integer
dim temp2 as byte
dim temp3 as byte
dim temp4 as byte
main:
temp2 = %10101010 ' test value 1
temp3 = %01010101 ' test value 2
temp4 = temp2 or temp3 ' expect 0 for "and" or %11111111 for "or"
temp2 = 0 ' pointless instruction just to allow result to be seen in simulator
while 1 ' infinite loop at end
wend
end.