Semiconductor Group
4-5
1998-04-01
Instruction Set
C500 Family
4.2.3
Logic Instructions
The C500 family microcontrollers perform basic logic operations on both bit and byte operands.
Single-Operand Operations
Ð CLR sets A or any directly addressable bit to zero (0).
Ð SETB sets any directly bit-addressable bit to one (1).
Ð CPL is used to complement the contents of the A register without affecting any flag, or any
directly addressable bit location.
Ð RL, RLC, RR, RRC, SWAP are the five operations that can be performed on A. RL, rotate left,
RR, rotate right, RLC, rotate left through carry, RRC, rotate right through carry, and SWAP,
rotate left four. For RLC and RRC the CY flag becomes equal to the last bit rotated out. SWAP
rotates A left four places to exchange bits 3 through 0 with bits 7 through 4.
Two-Operand Operations
Ð ANL performs bitwise logical AND of two operands (for both bit and byte operands) and
returns the result to the location of the first operand.
Ð ORL performs bitwise logical OR of two source operands (for both bit and byte operands) and
returns the result to the location of the first operand.
Ð XRL performs logical Exclusive OR of two source operands (byte operands) and returns the
result to the location of the first operand.
4.2.4
Control Transfer Instructions
There are three classes of control transfer operations: unconditional calls, returns, jumps,
conditional jumps, and interrupts. All control transfer operations, some upon a specific condition,
cause the program execution to continue a non-sequential location in program memory.