SN8P1829
8-Bit MCU build-in 12-bit ADC + PGIA + Charge-pump Reg 128 dots LCD driver
SONiX TECHNOLOGY CO., LTD
Page 18
Version 1.0
The other coding style of look-up table is to add Y or Z index register by accumulator. Be careful if carry happens.
Refer the following example for detailed information:
Example: Increase Y and Z register by B0ADD/ADD instruction
B0MOV
Y, #TABLE1$M
; To set look-up table’s middle address.
B0MOV
Z, #TABLE1$L
; To set look-up table’s low address.
B0MOV
A, BUF
; Z = Z + BUF.
B0ADD Z,
A
B0BTS1
FC
; Check the carry flag.
JMP
GETDATA
; FC = 0
INCMS
Y
; FC = 1. Y+1.
NOP
GETDATA:
;
MOVC
; To look-up data. If BUF = 0, data is 0x0035
; If BUF = 1, data is 0x5105
; If BUF = 2, data is 0x2012
.
.
.
.
;
TABLE1:
DW
0035H
; To define a word (16 bits) data.
DW
5105H
; “
DW
2012H
; “