EasyManua.ls Logo

SONIX SN8P2624 - 2.1.4.8 Y, Z Registers

SONIX SN8P2624
94 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SN8P2624
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 31 Version 0.3
2.1.4.8 Y, Z REGISTERS
The Y and Z registers are the 8-bit buffers. There are three major functions of these registers.
z can be used as general working registers
z can be used as RAM data pointers with @YZ register
z can be used as ROM data pointer with the MOVC instruction for look-up table
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
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
After reset - - - - - - - -
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
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
After reset - - - - - - - -
¾ Example: Uses Y, Z register as the data pointer to access data in the RAM address 025H of bank0.
B0MOV Y, #00H ; To set RAM bank 0 for Y register
B0MOV Z, #25H ; To set location 25H for Z register
B0MOV A, @YZ ; To read a data into ACC
¾ Example: Uses the Y, Z register as data pointer to clear the RAM data.
B0MOV Y, #0 ; Y = 0, bank 0
B0MOV Z, #07FH ; Z = 7FH, the last address of the data memory area
CLR_YZ_BUF:
CLR @YZ ; Clear @YZ to be zero
DECMS Z ; Z – 1, if Z= 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
…

Table of Contents