Programming Reference

Read an input port and compare to a value. If the values are equal, then jump to a label somewhere else in the program.
This command operates by reading all four bits of the input port.

Code Example

Meaning

P2?[0 0 0 1]:label1

If input port P2 is equal to 0 0 0 1, then jump to label1

P2?[0 1 0 0]:label2

If input port P2 is equal to 0 1 0 0, then jump to label2

P2?[1 0 1 0]:label3

If input port P2 is equal to 1 0 1 0, then jump to label3

P2?[1 0 x x]:label4


If input port P2 is equal to 1 0 x x , then jump to label4. An 'x' means that a
bit location will be ignored when comparing the value. In this example, input pins
P2.1 and P2.0 will be ignored, and the condition will be true as long as P2.3 is
equal to 1 and P2.2 is equal to 0.


This command works with ports P1, P2, and P3.