Prev: D34E Up: Map Next: D36A
D351: Search The Table
Used by the routine at SearchTwoByteTable.
Searches the table for the id in hand.
SearchTable D351 PUSH IX Use the command as the count.
D353 POP HL
D354 LD B,A
D355 LD D,$00 Reset D to 00 for the length offset calculation.
SearchTable_Loop D357 LD A,(HL) Fetch a byte from the table.
D358 CP B Go to SearchTable_Return if this entry is the wanted id.
D359 JR Z,SearchTable_Return
D35B CP $FF Jump to SearchTable_Return if this table entry is the end marker.
D35D JR Z,SearchTable_Return
D35F ADD HL,DE Move to the next table entry.
D360 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 D363 PUSH HL See whether this table entry is the end marker.
D364 POP IX
D366 CP $FF
D368 EXX Switch back to the normal registers.
D369 RET Return.
Prev: D34E Up: Map Next: D36A