SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
2.2.5 H, L REGISTERS
The H and L registers are the 8-bit buffers. There are two major functions of these registers.
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
-
Bit 6
HBIT6
R/W
-
Bit 5
HBIT5
R/W
-
Bit 4
HBIT4
R/W
-
Bit 3
HBIT3
R/W
-
Bit 2
HBIT2
R/W
-
Bit 1
HBIT1
R/W
-
Bit 0
HBIT0
R/W
-
080H
L
Read/Write
After reset
Bit 7
LBIT7
R/W
-
Bit 6
LBIT6
R/W
-
Bit 5
LBIT5
R/W
-
Bit 4
LBIT4
R/W
-
Bit 3
LBIT3
R/W
-
Bit 2
LBIT2
R/W
-
Bit 1
LBIT1
R/W
-
Bit 0
LBIT0
R/W
-
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:
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_CLR:
; End of clear general purpose data memory area of bank 0
…
…
SONiX TECHNOLOGY CO., LTD
Page 29
Version 2.0