SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 23
Version 1.0
WORKING REGISTERS
The locations 80H to 86H of RAM bank 0 stores the specially defined registers such as register H, L, R, X, Y, Z and
PFLAG, respectively shown in the following table. These registers can be the general purpose of working buffer and
also use to access ROM’s and RAM’s data. For instance, all of the ROM’s table can be looked-up with R, X, Y and Z
registers. The data of RAM memory can be indirectly accessed with H, L, Y and Z registers.
80H
81H
82H
83H
84H
85H
86H
RAM
L H R Z Y X
PFLAG
R/W R/W R/W R/W R/W R/W R/W
H, L REGISTERS
The H-register and L-register are 8-bit register with two major functions. One is as working register and the other is to
be data pointer to access RAM’s data. The @HL located at address E6H in bank 0 is indirect data buffer. H and L
register addresses RAM location in order to read/write data through @HL. The Lower 4-bit of H register is pointed to
RAM bank number and L register is pointed to RAM address number, respectively. The higher 4-bit data of H register
is truncated in RAM indirectly access mode.
H initial value = 0000 0000
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
R/W R/W R/W R/W R/W R/W R/W R/W
L initial value = 0000 0000
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
R/W R/W R/W R/W R/W R/W R/W R/W
Example: Reading 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
MOV
A,
#07FH
B0MOV L, A
; 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
.
.
.
.