Jameco Electronics 2000 Manuel D’Utilisation
User’s Manual
35
3.3.4 Register-to-Register Move
Any of the 8-bit registers, A, B, C, D, E, H, and L, can be moved to any other 8-bit regis-
ter, for example:
ter, for example:
LD A,c
LD d,b
LD e,l
The alternate 8-bit registers can be a destination, for example:
LD a’,c
LD d’,b
These instructions are unique to the Rabbit and require 2 bytes and four clocks because of
the required prefix byte. Instructions such as
the required prefix byte. Instructions such as
LD A,d’
or
LD d’,e’
are not allowed.
Several 16-bit register-to-register move instructions are available. Except as noted, these
instructions all require 2 bytes and four clocks. The instructions are listed below.
instructions all require 2 bytes and four clocks. The instructions are listed below.
LD dd’,BC ; where dd’ is any of HL’, DE’, BC’ (2 bytes, 4 clocks)
LD dd’,DE
LD IX,HL
LD IY,HL
LD HL,IY
LD HL,IX
LD SP,HL ; 1-byte, 2 clocks
LD SP,IX
LD SP,IY
Other 16-bit register moves can be constructed by using 2-byte moves.
3.3.5 Register Exchanges
Exchange instructions are very powerful because two (or more) moves are accomplished
with one instruction. The following register exchange instructions are implemented.
with one instruction. The following register exchange instructions are implemented.
EX af,af’ ; exchange af with af’
EXX ; exchange HL, DE, BC with HL’, DE’, BC’
EX DE,HL ; exchange DE and HL
The following instructions are unique to the Rabbit.
EX DE’,HL ; 1 byte, 2 clocks
EX DE, HL’ ; 2 bytes, 4 clocks
EX DE’, HL’ ; 2 bytes, 4 clocks
The following special instructions (Rabbit and Z180/Z80) exchange the 16-bit word on
the top of the stack with the HL register. These three instructions are each 2 bytes and 15
clocks.
the top of the stack with the HL register. These three instructions are each 2 bytes and 15
clocks.
EX (SP),HL
EX (SP),IX
EX (SP),IY