![NEC mPD17120 Subseries User Manual Download Page 43](http://html.mh-extra.com/html/nec/mpd17120-subseries/mpd17120-subseries_user-manual_249259043.webp)
CHAPTER 4 PROGRAM MEMORY (ROM)
28
(1) Constant data table
Example 1 shows an example of code used to reference a constant data table.
Example 1. Code used for reading the values recorded in a constant data table. The value specified
by an OFFSET value is read.
OFFSET
MEM
0.00H
; Storing area for the offset address.
; BANK0
MOV
RPH,#0
; Register pointer 7 is used to specify that
MOV
RPL,#7 SHL 1
; operation results be stored in row address 7.
ROMREF:
; BANK0
; Stores the start address of the constant data
; table in the address register (AR).
MOV
AR3, #.DL.TABLE SHR 12 AND 0FH
MOV
AR2, #.DL.TABLE SHR 8 AND 0FH
MOV
AR1, #.DL.TABLE SHR 4 AND 0FH
MOV
AR0, #.DL.TABLE AND 0FH
ADD
AR0, OFFSET
; Adds the offset address.
ADDC
AR1, #0
ADDC
AR2, #0
ADDC
AR3, #0
MOVT
DBF, @AR
; Executes the table reference instruction.
TABLE:
DW
0001H
DW
0002H
DW
0004H
DW
0008H
DW
0010H
DW
0020H
DW
0040H
DW
0080H
DW
0100H
DW
0200H
DW
0400H
DW
0800H
DW
1000H
DW
2000H
DW
4000H
DW
8000H
END
Summary of Contents for mPD17120 Subseries
Page 15: ... x MEMO ...
Page 23: ... MEMO 8 ...
Page 45: ... MEMO 30 ...
Page 49: ... MEMO 34 ...
Page 55: ... MEMO 40 ...
Page 93: ... MEMO 78 ...
Page 99: ... MEMO 84 ...
Page 102: ...CHAPTER 11 ARITHMETIC AND LOGIC UNIT 87 MEMO ...
Page 119: ... MEMO 104 ...
Page 175: ... MEMO 160 ...
Page 199: ... MEMO 184 ...
Page 265: ... MEMO 250 ...
Page 281: ...266 MEMO ...
Page 285: ... MEMO 270 ...
Page 289: ... MEMO 274 ...