M68HC11
REFERENCE MANUAL
CENTRAL PROCESSING UNIT
MOTOROLA
6-11
Examples of the relative addressing mode are shown in the following assembly-lan-
guage statements:
Machine Code
20 00
22 FC
24 04
Label
THERE
WHERE
Operation
BRA
BHI
BCC
Operand
WHERE
THERE
LBCC
Comments
FORWARD BRANCH
BACKWARD BRANCH
L-O-N-G BCC
27 FE
27 FE
7E 10 00
HANG
BEQ
BEQ
JMP
HANG
*
$1000
BRANCH TO SELF
"*" MEANS "HERE"
LBCC
8D F7
BSR
HANG
6.3 M68HC11 Instruction Set
This section is intended to explain the basic capabilities and organization of the in-
struction set. For this discussion, the instruction set is divided into functional groups of
instructions. Some instructions will appear in more than one functional group. For ex-
ample, transfer accumulator A to CCR (TAP) appears in the CCR group and in the
load/store/transfer subgroup of accumulator/memory instructions. Detailed explana-
tions of each instruction are given in
APPENDIX A INSTRUCTION SET DETAILS
.
To expand the number of instructions used in the M68HC11 CPU, a prebyte mecha-
nism that affects certain instructions has been added. Most of the instructions affected
are associated with index register Y. Instructions that do not require a prebyte reside
in page 1 of the opcode map. Instructions requiring a prebyte reside in pages 2, 3, and
4 of the opcode map. The opcode-map prebyte codes are $18 for page 2, $1A for page
3, and $CD for page 4. A prebyte code applies only to the opcode immediately follow-
ing it. That is, all instructions are assumed to be single-byte opcodes unless the first
byte of the instruction happens to correspond to one of the three prebyte codes rather
than a page 1 opcode.
6.3.1 Accumulator and Memory Instructions
Most of these instructions use two operands. One operand is either an accumulator or
an index register; whereas, the second operand is usually obtained from memory us-
ing one of the addressing modes discussed earlier. These accumulator memory in-
structions can be divided into six subgroups: 1) loads, stores, and transfers, 2)
arithmetic operations, 3) multiply and divide, 4) logical operations, 5) data testing and
bit manipulation, and 6) shifts and rotates. These instructions are discussed in the fol-
lowing tables and paragraphs.
6.3.1.1 Loads, Stores, And Transfers
Almost all MCU activities involve transferring data from memories or peripherals into
the CPU or transferring results from the CPU into memory or I/O devices. The load,
store, and transfer instructions associated with the accumulators are summarized in
the following table. There are additional load, store, push, and pull instructions asso-
ciated with the index registers and stack pointer register (see
6.3.2 Stack and Index
Register Instructions
).