SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 24
Version 1.0
Y, Z REGISTERS
The Y and Z registers are 8-bit buffers. There are three major functions of these registers. First, Y and Z registers can
be working registers. Second, these two registers can be used as data pointers as @YZ register. Third, the registers
can be address ROM location in order to look-up ROM data.
Y initial value = 0000 0000
084H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Y
YBIT7 YBIT6 YBIT5 YBIT4 YBIT3 YBIT2 YBIT1 YBIT0
R/W R/W R/W R/W R/W R/W R/W R/W
Z initial value = 0000 0000
083H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Z
ZBIT7 ZBIT6 ZBIT5 ZBIT4 ZBIT3 ZBIT2 ZBIT1 ZBIT0
R/W R/W R/W R/W R/W R/W R/W R/W
The @YZ is data point_1 index buffer located at address E7H in RAM bank 0. It employs Y and Z registers to
addressing RAM location in order to read/write data through @YZ. The Lower 4-bit of Y register is pointed to RAM
bank number and Z register is pointed to RAM address number, respectively. The higher 4-bit data of Y register is
truncated in RAM indirectly access mode.
Example: Reading a data from RAM address 25H of bank 1, it can use indirectly addressing mode to
access data as following.
B0MOV Y, #01H ; To set RAM bank 1 for Y register
B0MOV Z, #25H ; To set location 25H for Z register
B0MOV A, @YZ ; To read a data into ACC
Example: Clear general-purpose data memory area of bank 1 using @YZ register.
MOV
A,
#1
B0MOV Y, A
; Y = 1, bank 1
MOV
A,
#07FH
B0MOV Z, A
; Y = 7FH, the last address of the data memory area
CLR_YZ_BUF:
CLR
@YZ
; Clear @YZ to be zero
DECMS Z
; Y – 1, if Y= 0, finish the routine
JMP
CLR_YZ_BUF ; Not zero
CLR
@YZ
END_CLR:
; End of clear general purpose data memory area of bank 0
.