I have spent some time digging around the compiler manual and online, but I can seem to find a clear answer for the behavior of the following code:
myBit1 var bit
myBit2 var bit
myByte var byte
myBit1 = 1
myBit2 = 1
myByte = 0
if myBit1 + myBit2 = 2 then
//Will this evaluate to true?
//How about this?
myByte = myBit1 + myBit2
//Would either of this change if they were aliases for pins instead of bit vars?
I can't seem to find any explanation in the compiler manual or otherwise how PBP 3 handles these sorts of operations. If I can add multiple bits together and get a byte, it would allow me to write much more simple code in cases where I need to compare the state of multiple pins or flags or combinations of the two. I'm aware I could use bitwise operations or other comparisons to do the same, but being able to leverage math would be useful at some points.
The trouble is, in my testing it seems to work okay in some cases, and not in others. Leading me to think it's not really handled in a consistent way by the compiler (or simply that I made some other mistake).
If anyone could clear this up for me, it would be extremely appreciated!