HT82M75REW/HT82K75REW
Rev. 1.00
14
June 11, 2010
tempreg1
db
?
; temporary register #1
tempreg2
db
?
; temporary register #2
:
:
mov
a,06h
; initialise table pointer - note that this address
; is referenced
mov
tblp,a
; to the last page or present page
:
:
tabrdl
tempreg1
; transfers value in table referenced by table pointer
; to tempregl
; data at prog. memory address
²
F06H
²
transferred to
; tempreg1 and TBLH
dec
tblp
; reduce value of table pointer by one
tabrdl
tempreg2
; transfers value in table referenced by table pointer
; to tempreg2
; data at prog.memory address
²
F05H
²
transferred to
; tempreg2 and TBLH
; in this example the data
²
1AH
²
is transferred to
; tempreg1 and data
²
0FH
²
to register tempreg2
; the value
²
00H
²
will be transferred to the high byte
; register TBLH
:
:
org
F00h
; sets initial address of last page
dc
00Ah, 00Bh, 00Ch, 00Dh, 00Eh, 00Fh, 01Ah, 01Bh
:
:
Because the TBLH register is a read-only register and cannot be restored, care should be taken to ensure its protection
if both the main routine and Interrupt Service Routine use the table read instructions. If using the table read instructions,
the Interrupt Service Routines may change the value of TBLH and subsequently cause errors if used again by the main
routine. As a rule it is recommended that simultaneous use of the table read instructions should be avoided. However,
in situations where simultaneous use cannot be avoided, the interrupts should be disabled prior to the execution of any
main routine table-read instructions. Note that all table related instructions require two instruction cycles to complete
their operation.
electronic components distributor