I will try your suggestions though I think typing OR seems the easiest.
Though it looks cool to use those symbols I think it's easier just to type OR and know what it means
.
NOT sure about that , this is what the book says
3.4.2 Logical vs. Bitwise
Logical operators are very different than bitwise operators! There are
circumstances under which PBP will allow the use of logical operators in
expressions. This means that no error message will be generated when you
mistakenly use a logical operator in a bitwise calculation. Consider the following:
result = PORTB AND %00001111
' Returns logical result (1 or 0)
The above example will compile and give a result. The value of the result can only
be one or zero (true or false). If the intent is to use a bitwise operation to obtain a
binary result, you MUST USE BITWISE OPERATORS:
Code:
i_term=0
d_err=4
i_err= 3
i_term= i_err | d_err
serout2 PORTA.0,84,[ "3 | 4 ",9,#i_term, 13,10]
i_term= i_err OR d_err
serout2 PORTA.0,84,[ "3 OR 4 ",9,#i_term, 13,10]
PRINTOUT:
3 | 4 7
3 OR 4 65535
Bookmarks