English
Language : 

45111 Datasheet, PDF (104/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
10 SX Special Features and Coding Tips
The following code snippet demonstrates this:
RESET Main
Idx
EQU $08
; Define index symbol
Table
; 8-bit data table
;
ORG $0
JMP PC+W
RETW 'ABCDEFG'
RETW 10, 100, 255, 0
; Jump into the table
; Store text
; Store numbers
Main
MOV Idx, #$FF
; Reset table index
MainLoop
INC
MOV
CALL
Idx
W, Idx
Table
; Increment table index
; Retrieve data
If 8-bit or 12-bit data is required, the DW method may be used to create the data table. This method uses
a set of DW (Define Word) directives each of which place a 12-bit data value in program memory. By
moving a 12-bit index value to M and W (upper 4 bits of address in M) and executing an IREAD
command, M and W are replaced with the 12-bit data value.
To create an 8-bit or 12-bit data table with the DW directive:
1) Set the table’s location and insert a label.
2) Add as many DW directives as necessary.
When data is needed from the table, move the index value of the desired item (in relation to the label) to
M and W and execute an IREAD. Upon returning, the 12-bit value is in M and W.
Page 104 • SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc.