
MOTOROLA
6-14
CENTRAL PROCESSING UNIT
M68HC11
REFERENCE MANUAL
6.3.1.4 Logical Operations
This group of instructions is used to perform the boolean logical operations AND, in-
clusive OR, exclusive OR, and one’s complement.
6.3.1.5 Data Testing and Bit Manipulation
This group of instructions is used to operate on operands as small as a single bit, but
these instructions can also operate on any combination of bits within any 8-bit location
in the 64-Kbyte memory space. The bit test (BITA or BITB) instructions perform an
AND operation within the CPU to update condition code bits without altering either op-
erand. The BSET and BCLR instructions read the operand, manipulate selected bits
within the operand, and write the result back to the operand address. Some care is re-
quired when read-modify-write instructions such as BSET and BCLR are used on I/O
and control register locations because the physical location read is not always the
same as the location written.
6.3.1.6 Shifts and Rotates
All the shift and rotate functions in the M68HC11 CPU involve the carry bit in the CCR
in addition to the 8- or 16-bit operand in the instruction, which permits easy extension
to multiple-word operands. Also, by setting or clearing the carry bit before a shift or ro-
tate instruction, the programmer can easily control what will be shifted into the opened
end of an operand. The arithmetic shift right (ASR) instruction maintains the original
value of the MSB of the operand, which facilitates manipulation of two’s-complement
(signed) numbers.
Function
Mnemon-
ic
ANDA
ANDB
BITA
BITB
COM
COMA
COMB
EORA
EORB
ORAA
ORAB
IMM
DIR
EXT
INDX
INDY
INH
AND A with Memory
AND B with Memory
Bit(s) Test A with Memory
Bit(s) Test B with Memory
One’s Complement Memory Byte
One’s Complement A
One’s Complement B
OR A with Memory (Exclusive)
OR B with Memory (Exclusive)
OR A with Memory (Inclusive)
OR B with Memory (Inclusive)
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Function
Mnemonic
BITA
BITB
BCLR
BSET
BRCLR
BRSET
IMM
X
X
DIR
X
X
X
X
X
X
EXT
X
X
INDX
X
X
X
X
X
X
INDY
X
X
X
X
X
X
Bit(s) Test A with Memory
Bit(s) Test B with Memory
Clear Bit(s) in Memory
Set Bit(s) in Memory
Branch if Bit(s) Clear
Branch if Bit(s) Set