Prev: 51000 Up: Map Next: 51046
51036: Get Table Entry
Input
A The number of the entry
BC The address of the table
Output
HL The word from the table
Find the address of the entry.
GetTableEntry 51036 LD L,A Put the number of the entry in HL.
51037 LD H,0
51039 ADD HL,HL Double it.
51040 ADD HL,BC Add the address of the table.
Fetch the word.
51041 LD A,(HL) Fetch the low byte.
51042 INC HL Move on to the high byte.
51043 LD H,(HL) Fetch it into H.
51044 LD L,A Put the low byte in L and return.
51045 RET
View the equivalent code in;
Prev: 51000 Up: Map Next: 51046