Prev: 54094 Up: Map Next: 54122
54097: Search The Table
Used by the routine at SearchTwoByteTable.
Searches the table for the id in hand.
SearchTable 54097 PUSH IX Use the command as the count.
54099 POP HL
54100 LD B,A
54101 LD D,0 Reset D to 0 for the length offset calculation.
SearchTable_Loop 54103 LD A,(HL) Fetch a byte from the table.
54104 CP B Go to SearchTable_Return if this entry is the wanted id.
54105 JR Z,SearchTable_Return
54107 CP 255 Jump to SearchTable_Return if this table entry is the end marker.
54109 JR Z,SearchTable_Return
54111 ADD HL,DE Move to the next table entry.
54112 JP SearchTable_Loop Jump back to SearchTable_Loop to check the next table entry.
See whether this byte is the end marker before returning.
Either the table ID was matched, or the terminator was reached.
SearchTable_Return 54115 PUSH HL See whether this table entry is the end marker.
54116 POP IX
54118 CP 255
54120 EXX Switch back to the normal registers.
54121 RET Return.
Prev: 54094 Up: Map Next: 54122