Chapter 2: TI-83 Plus Specific Information 45
TI-83 Plus Developer Guide Third Release May 28, 2002
HL register = offset on the ROM page to the byte(s) to copy
Routines:
LoadCIndPaged
Copies a byte from the archive to C
C = byte from archive
B, HL = intact
LoadDEIndPaged
Copies two bytes from the archive to DE
E = first byte read
D = second byte read
B, HL = location of the second byte, crossing a ROM
page boundary is handled
Recommended support routines that an application should include as part of
the application.
LoadCIndPaged_inc:
B_CALL LoadCIndPaged ; read byte from archive
;
; fall thru and INC pointer past byte read
;
inc_BHL:
INC HL ; increment offset in page
BIT 7,h ; cross page boundary?
RET Z ; no, B, HL = ROM page and
; offset
;
INC B ; increase ROM page number
RES 7,H
set 6,H ; adjust offset to be in
; 4000h to 7FFFh
RET
;
LoadDEIndPaged_inc:
B_CALL LoadDEIndPaged ; read 2 bytes from
; archive
JR inc_BHL ; move pointer to byte
; after 2 read
– Cached
This method provides management of the ROM page and offset of data in the
archive while reading multiple bytes. These values are stored in predefined
system RAM locations. A 16 byte RAM cache is used to queue up consecutive
data from the archive. There are two routines used.
SetupPagedPtr
Sets the initial value of the system RAM used to track
the current read location and the current amount of data
in the cache. This must be called before any data is
actually read.
Inputs: B register = ROM page of first byte to copy.
HL register = offset on the ROM page to the first byte(s) to copy.