MOTOROLA
7-6
INSTRUCTION PROCESS
CPU16
REFERENCE MANUAL
At the time an instruction that causes a change in program flow executes, PK : PC
point to FWA
+
$0006. During execution of an instruction that causes a change of flow,
PK : PC is loaded with the FWA of the new instruction stream. However, stages A and
B still contain words from the old instruction stream. Process steps A through C must
be performed prior to execution from the new instruction stream.
7.3.2.1 Jumps
Jump instructions cause an immediate, unconditional change in program flow. The
CPU16 jump instruction uses 20-bit extended and indexed addressing modes. It con-
sists of an 8-bit opcode with a 20-bit argument.
7.3.2.2 Branches
Branch instructions cause a change in program flow when a specific precondition is
met. The CPU16 supports 8-bit relative displacement (short), and 16-bit relative dis-
placement (long) branch instructions, as well as specialized bit condition branches that
use indexed addressing modes.
Short branch instructions consist of an 8-bit opcode and an 8-bit operand contained in
one word. Long branch instructions consist of an 8-bit prebyte and an 8-bit opcode in
one word, followed by an operand word. Bit condition branches consist of an 8-bit op-
code and an 8-bit operand in one word, followed by one or two operand words.
At the time a branch instruction is executed, PK : PC point to an address equal to the
address of the instruction plus $0006. The range of displacement for each type of
branch is relative to this value, not to the address of the instruction. In addition, be-
cause prefetches are automatically aligned to word boundaries, only even offsets are
valid — an odd offset value is rounded down.
The numeric range of short branch and 8-bit indexed offset values is $80 (–128) to $7F
(127). Due to word-alignment, maximum positive offset is $7E. At maximum positive
offset, displacement from the branch instruction is 132. At maximum negative offset
($80), displacement is –122.
The numeric range of long branch and 16-bit indexed offset values is $8000 (–32768)
to $7FFF (32767). Due to word-alignment, maximum positive offset is $7FFE. At max-
imum positive offset, displacement from the instruction is 32772. At maximum nega-
tive offset ($8000), displacement is –32762.
7.3.2.3 Subroutines
Subroutine instructions optimize the process of temporarily executing instructions from
another instruction stream, usually to perform a particular task. The CPU16 can
branch or jump to subroutines. A single instruction returns to the original instruction
stream.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.