Sherlock: annotated disassembly

Routines

Prev: D1DB Up: Map Next: D206
D1DC: Does this object list verb A in its own action list?
IX = an entity record, A = a verb number. Skips the record's fixed part (15 bytes plus the n location bytes, n being byte 0) to reach its own action list: two-byte (verb, shared action index) pairs ended by $FF or $00. Returns carry set with IX on the matching pair, or carry clear if the verb is not listed.
Input
IX An entity record
A A verb number
Output
F Carry set with IX on the verb's pair if listed; carry clear if not
D1DC PUSH DE Skip the record's fixed part: 15 + n bytes
D1DD LD D,A Keep A in D
D1DE LD A,(IX+$00) E = the record's size byte + 15
D1E1 ADD A,$0F Add $0F to A
D1E3 LD E,A Copy A into E
D1E4 LD A,D Copy D into A
D1E5 LD D,$00 D = 0; IX = IX + DE
D1E7 ADD IX,DE Add DE to IX
D1E9 POP DE Restore DE
D1EA CP (IX+$00) Is this pair for our verb?
D1ED JR Z,$D1FF Yes: found
D1EF INC (IX+$00) Is this byte the $FF terminator?
D1F2 JR Z,$D201 If the first byte of the record at IX has become zero, skip ahead to D201
D1F4 DEC (IX+$00) ...or the $00 terminator?
D1F7 JR Z,$D204 If the first byte of the record at IX has become zero, skip ahead to D204
D1F9 INC IX Neither: next pair
D1FB INC IX Step IX on to the next byte
D1FD JR $D1EA Go back to D1EA
D1FF SCF Found: carry set, IX on the pair
D200 RET Return to the caller
D201 DEC (IX+$00) Put the $FF back
D204 XOR A Not listed: carry clear
D205 RET Return to the caller
Prev: D1DB Up: Map Next: D206