
MOTOROLA
6-16
CENTRAL PROCESSING UNIT
M68HC11
REFERENCE MANUAL
The exchange D with X (XGDX) and exchange D with Y (XGDY) provide a simple way
of transferring a pointer value from a 16-bit index register to accumulator D, which has
more powerful 16-bit arithmetic capabilities than the 16-bit index registers. Since these
are bidirectional exchanges, the original value of accumulator D is automatically pre-
served in the index register while the pointer is being manipulated in accumulator D.
When pointer calculations are finished, another exchange simultaneously updates the
index register and restores accumulator D to its former value.
The transfers between an index register and the stack pointer deserve additional com-
ment. The stack pointer always points at the next free location on the stack as opposed
to the last item that was pushed onto the stack. The usual reason for transferring the
stack pointer value into an index register is to allow indexed addressing access to in-
formation that was formerly pushed onto the stack. In such cases, the address pointed
to by the stack pointer is of no value since nothing has yet been stored at that location.
This fact explains why the value in the stack pointer is incremented during transfers to
an index register. There is a corresponding decrement of a 16-bit value as it is trans-
ferred from an index register to the stack pointer.
Function
Mnemonic
ABX
ABY
CPX
CPY
DES
DEX
DEY
INS
INX
INY
LDX
LDY
LDS
PULX
PULY
PSHX
PSHY
STX
STY
STS
TSX
TSY
TXS
TYS
XGDX
XGDY
IMM
DIR
EXT
INDX
INDY
INH
X
X
Add Accumulator B to X
Add Accumulator B to Y
Compare X to Memory (16 Bit)
Compare Y to Memory (16 Bit)
Decrement Stack Pointer
Decrement Index Register X
Decrement Index Register Y
Increment Stack Pointer
Increment Index Register X
Increment Index Register Y
Load Index Register X
Load Index Register Y
Load Stack Pointer
Pull X from Stack
Pull Y from Stack
Push X onto Stack
Push Y onto Stack
Store Index Register X
Store Index Register Y
Store Stack Pointer
Transfer SP to X
Transfer SP to Y
Transfer X to SP
Transfer Y to SP
Exchange D with X
Exchange D with Y
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
X
X
X
X
X
X
X
X
X
X
X