Sherlock: annotated disassembly

Routines

Prev: BF1C Up: Map Next: BF59
BF45: DE = the words for a statement's relation (+1)
Relation n (1-11) gives entry n-1 of 994D, returned NZ; 0 returns Z.
Input
IX A statement record
Output
DE The relation's words
F NZ if there is one; Z if the relation is 0
BF45 LD A,(IX+$01) Read byte +1 of the record at IX into A - The statement's relation number (+1)
BF48 AND A Clear the carry flag for the caller (A is unchanged)
BF49 RET Z 0: none, return Z
BF4A DEC A Subtract one from A - Relation 1-11 into an index
BF4B LD E,A Copy A into E
BF4C LD D,$00 Load D with $00
BF4E LD HL,$994D Point HL at "The case's relation words" (994D) - Table of relation words at 994D, 2 bytes each
BF51 ADD HL,DE Add DE to HL
BF52 ADD HL,DE Add DE to HL
BF53 LD E,(HL) Read the byte HL points at into E - DE = the word reference
BF54 INC HL Step HL on to the next byte
BF55 LD D,(HL) Read the byte HL points at into D
BF56 OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller - NZ: found
BF58 RET Return to the caller
Prev: BF1C Up: Map Next: BF59