SN8P1700
8-bit micro-controller build-in 12-bit ADC
Y, Z REGISTERS
The Y and Z registers are the 8-bit buffers. There are three major functions of these registers. First, Y and Z registers
can be used as working registers. Second, these two registers can be used as data pointers for @YZ register. Third,
the registers can be address ROM location in order to look-up ROM data.
Y initial value = 0000 0000
084H
Y
Bit 7
YBIT7
R/W
Bit 6
YBIT6
R/W
Bit 5
YBIT5
R/W
Bit 4
YBIT4
R/W
Bit 3
YBIT3
R/W
Bit 2
YBIT2
R/W
Bit 1
YBIT1
R/W
Bit 0
YBIT0
R/W
Z initial value = 0000 0000
083H
Z
Bit 7
ZBIT7
R/W
Bit 6
ZBIT6
R/W
Bit 5
ZBIT5
R/W
Bit 4
ZBIT4
R/W
Bit 3
ZBIT3
R/W
Bit 2
ZBIT2
R/W
Bit 1
ZBIT1
R/W
Bit 0
ZBIT0
R/W
The @YZ that 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 ACC. 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: If want to read a data from RAM address 25H of bank 1, it can use indirectly addressing mode to
access data as following.
B0MOV
B0MOV
B0MOV
Y, #01H
Z, #25H
A, @YZ
; To set RAM bank 1 for Y register
; To set location 25H for Z register
; To read a data into ACC
ꢃExample: Clear general-purpose data memory area of bank 1 using @YZ register.
MOV
A, #1
B0MOV
MOV
B0MOV
Y, A
A, #07FH
Z, A
; Y = 1, bank 1
; Y = 7FH, the last address of the data memory area
CLR_YZ_BUF:
CLR
@YZ
; Clear @YZ to be zero
DECMS
JMP
Z
; Y – 1, if Y= 0, finish the routine
; Not zero
CLR_YZ_BUF
CLR
.
@YZ
END_CLR:
; End of clear general purpose data memory area of bank 0
ꢂ
Note: Please consult the “LOOK-UP TABLE DESCRIPTION” about Y, Z register look-up table application.
SONiX TECHNOLOGY CO., LTD
Page 37
Revision 1.94