System Debug Reference Manual (32650-90888)

Chapter 2 33
User Interface
Operators
operand type.
BAND, BOR, and BNOT
These operators perform the indicated logical operation bit-by-bit on their operand(s),
which are treated as unsigned integers of the appropriate size. When the sizes of the
operands differ, they are aligned at the rightmost bits, with the smaller operand extended
on the left with zeros. When a long pointer and an extended address are BANDed or BORed
together, the operation is performed separately on the SID and offset parts, with the
offsets aligned at the right.
For example, when a U16 is BANDed with a U32, the U16 is treated as a U32 whose
high-order 16 bits are all zero.
The definitions of the logical operations BAND, BOR, and BNOT, are the same as those for the
Boolean operators AND, OR, and NOT, respectively, where the Boolean operands TRUE and
FALSE are represented by the integer values 1 and 0, respectively.
<< and >>
These operators shift the first operand (the shift operand) left or right by the number of
bits specified by the second operand (the shift count). The type of the result is the same as
that of the first operand. For right shifting, if the shift operand is signed (S16 or S32), sign
extension is used when shifting. Otherwise, zeros move in from the left. For left shifts,
zeros always move in from the right. Negative shift counts reverse the direction of the
shift.
Relational Operators
The relational operators <, <=, =, <>, >=, and > compare two operands and return a
Boolean result. Unless the comparison is for strict equality (= or <>), the operands must be
members of the same primary type class (INT/BOOL, STR, or PTR).
Comparisons of integers and/or Booleans are based on the normal mathematical order of
the integers, substituting 0 for FALSE and 1 for TRUE.
Comparisons between two long pointers are performed by first comparing their SIDs and,
if equal, comparing their offsets, with each comparison being made as if the pointer parts
were of type U32. Two short pointers are compared as if they were of type U32. When a
short pointer is compared to a long pointer, the short pointer is first converted to a long
pointer, and the comparison is then made between the two long pointers. Extended
addresses behave similarly to long pointers in comparisons.
A comparison between two pointers with different SIDs is considered to be invalid unless
the comparison is for strict equality (= or <>). System Debug recognizes the two special nil
pointers 0 and 0.0. These may only be involved in comparisons for strict equality, and 0 is
considered to be equal to 0.0.
Examples of pointer comparisons are listed below:
wl 1.200 < 1.204 TRUE
c0000200 >= c0000100 TRUE
1.200 < 2.30 invalid