Prev: 16D4 Up: Map Next: 16E5
16DB: THE 'INDEXER' SUBROUTINE
This subroutine is used on several occasions to look through tables.
Input
C Code to look for
HL Base address of the table
Output
HL Address of the second byte of the required table entry (if found)
F Carry flag is set if the code is found
INDEXER_1 16DB INC HL Move on to consider the next pair of entries.
The main entry point is here and is used by the routines at CHAN_FLAG, CLOSE_2, OPEN_2, SCANNING and S_LETTER.
INDEXER 16DC LD A,(HL) Fetch the first of a pair of entries but return if it is zero - the end marker.
16DD AND A
16DE RET Z
16DF CP C Compare it to the supplied code.
16E0 INC HL Point to the second entry.
16E1 JR NZ,INDEXER_1 Jump back if the correct entry has not been found.
16E3 SCF The carry flag is set upon a successful search.
16E4 RET
Prev: 16D4 Up: Map Next: 16E5