SN8P2604A
8-Bit Micro-Controller
2.1.4.6 H, L REGISTERS
The H and L registers are the 8-bit buffers. There are two major functions of these registers.
z
z
can be used as general working registers
can be used as RAM data pointers with @HL register
081H
H
Read/Write
After reset
Bit 7
HBIT7
R/W
X
Bit 6
HBIT6
R/W
X
Bit 5
HBIT5
R/W
X
Bit 4
HBIT4
R/W
X
Bit 3
HBIT3
R/W
X
Bit 2
HBIT2
R/W
X
Bit 1
Bit 0
HBIT0
R/W
X
HBIT1
R/W
X
080H
L
Read/Write
After reset
Bit 7
LBIT7
R/W
X
Bit 6
LBIT6
R/W
X
Bit 5
LBIT5
R/W
X
Bit 4
LBIT4
R/W
X
Bit 3
LBIT3
R/W
X
Bit 2
LBIT2
R/W
X
Bit 1
LBIT1
R/W
X
Bit 0
LBIT0
R/W
X
Example: If want to read a data from RAM address 20H of bank_0, it can use indirectly addressing mode to
access data as following.
B0MOV
B0MOV
B0MOV
H, #00H
L, #20H
A, @HL
; To set RAM bank 0 for H register
; To set location 20H for L register
; To read a data into ACC
Example: Clear general-purpose data memory area of bank 0 using @HL register.
CLR
H
; H = 0, bank 0
B0MOV
L, #07FH
; L = 7FH, the last address of the data memory area
CLR_HL_BUF:
END_CLR:
CLR
DECMS
JMP
@HL
L
CLR_HL_BUF
; Clear @HL to be zero
; L – 1, if L = 0, finish the routine
; Not zero
CLR
@HL
; End of clear general purpose data memory area of bank 0
…
…
SONiX TECHNOLOGY CO., LTD
Page 31
Version 0.3