159
CHAPTER 9. INSTRUCTION SET
9.4 INSTRUCTION FUNCTIONS AND APPLICATION
9.4.1 Move Instructions
MOV A, #n4
Function: A n4; n4 = I3 to I0 : 0 to FH
Moves 4-bit immediate data n4 to the A register (4-bit accumulator).
This instruction has a stacking effect (group A). When placed after a MOV A, #n4 or MOV XA, #n8 instruction,
stack instructions following the executed instruction are processed as NOP.
Application examples: Set 0BH into accumulator.
MOV A, #0BH
Select the data to be output at Port 3 from 0 to 2.
A0: MOV A, #0
A1: MOV A, #1
A2: MOV A, #2
OUT PORT 3, A
MOV rp, #n8
Function: rp n8; n8 = I7 to I0 : 00H to FFH
Moves 8-bit immediate data n8 to register pair rp (XA, HL).
This instruction has a stacking effect. There are two stacking effects: Group A (MOV A, #n4 instruction and
MOV XA, #n8 instruction), and group B (MOV HL, #n8 instruction). When instructions of the same group are
placed consecutively, the stack instructions after the executed instruction are processed as NOP.
Application example: Set 5FH into register pair HL.
MOV HL, #5FH
MOV A, @HL
Function: A (HL)
Moves the data memory contents addressed by the contents of register pair HL to the A register.
Application example: Move the data of address 3EH to the A register.
MOV HL, #3EH
MOV A, @HL