SN8P2624
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 30 Version 0.3
2.1.4.7 H, L REGISTERS
The H and L registers are the 8-bit buffers. There are two major functions of these registers.
z can be used as general working registers
z can be used as RAM data pointers with @HL register
081H Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
H
HBIT7 HBIT6 HBIT5 HBIT4 HBIT3 HBIT2 HBIT1 HBIT0
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
After reset X X X X X X X X
080H Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
L
LBIT7 LBIT6 LBIT5 LBIT4 LBIT3 LBIT2 LBIT1 LBIT0
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
After reset X X X X X X X 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 H, #00H ; To set RAM bank 0 for H register
B0MOV L, #20H ; To set location 20H for L register
B0MOV A, @HL ; 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 @HL ; Clear @HL to be zero
DECMS L ; L – 1, if L = 0, finish the routine
JMP CLR_HL_BUF ; Not zero
CLR @HL
END_CLR: ; End of clear general purpose data memory area of bank 0
…
…