CPU16
REFERENCE MANUAL
SYSTEM RESOURCES
MOTOROLA
3-7
3.3.2.5 Adding Immediate Data to Registers
XK, YK, ZK, and SK are automatically modified when an AIX, AIY, AIZ, or AIS instruc-
tion causes an overflow from the corresponding register. The byte addresses con-
tained in the registers have a range of $0000 to $FFFF. If the operation results in a
value below $0000 or above $FFFF, the associated extension field is decremented or
incremented by the amount of overflow.
3.3.3 Program Counter Address Extension
The PK field cannot be altered by direct transfer or exchange like other address exten-
sion fields, but a number of instructions and addressing modes affect the program
counter and its associated extension field.
PK is automatically modified when an operation causes an overflow from the PC. The
PC has a range of $0000 to $FFFF. If it is decremented below $0000 or incremented
above $FFFF, PK is also incremented or decremented.
3.3.3.1 Effect of Jump Instructions on PK : PC
There are two forms of jump instruction in the CPU16 instruction set. Both use special
addressing modes that replace PK : PC with a 20-bit effective address, but do not af-
fect other address extension fields.
JMP causes an unconditional change in program execution. The effective address is
placed in PK : PC and execution continues at the new address.
JSR causes a branch to a subroutine. After the contents of the program counter and
the condition code register are stacked, the effective address is placed in PK : PC and
execution continues at the new address.
See
SECTION 5 INSTRUCTION SET
for detailed information about jump instructions.
3.3.3.2 Effect of Branch Instructions on PK : PC
The CPU16 instruction set includes a number of branch instructions. All add an offset
to the program counter when a branch is taken. The size of offset differs, but in all cas-
es, PK is automatically modified when addition of the offset causes PC overflow. The
PC has a range of $0000 to $FFFF. If it is decremented below $0000 or incremented
above $FFFF, PK is also decremented or incremented. Pipelining affects the actual
offset from the instruction. See
SECTION 5 INSTRUCTION SET
for detailed informa-
tion about branch instructions.
3.3.4 Effective Addresses and Extension Fields
It is important to distinguish address extension field values from effective address val-
ues. Effective address calculation is a part of addressing mode operation. Indexed and
accumulator offset addressing modes can generate effective addresses that cross
bank boundaries — ADDR[19:16] are changed to make an access, but extension field
values do not change as a result of the operation. See
SECTION 4 DATA TYPES
AND ADDRESSING MODES
for more information.
Table 3-1
summarizes the effects
of various operations on address lines and address extension fields.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.