Sherlock: annotated disassembly

Routines

Prev: BF08 Up: Map Next: BF45
BF1C: Print a case statement: thing, relation, thing
IX is a statement record of the case table (9965): prints the first thing's name (A4BC, D3E8), the relation's verb words from the table at 994D (BF45; relation 0 prints AND), then the second thing. Used by message code $05 (A711).
Input
IX A statement record of the case table
Output
The statement printed: thing, relation, thing
BF1C LD A,(IX+$00) Read the first byte of the record at IX into A - The statement's subject: thing +0 ... its name words (A4BC, +7)
BF1F CALL $A4BC Call the routine "HL = thing A's record + 7" (A4BC)
BF22 PUSH HL Save HL on the stack
BF23 POP IY Restore IY from the stack
BF25 CALL $D3E8 Print them (D3E8)
BF28 CALL $BF45 The relation word, from the table at 994D (BF45)
BF2B JR Z,$BF3D Relation 0: print the word $005D instead
BF2D CALL $A887 Print the relation word (A887)
BF30 LD A,(IX+$02) Read byte +2 of the record at IX into A - The statement's object (+2): its name words
BF33 CALL $A4BC Call the routine "HL = thing A's record + 7" (A4BC)
BF36 PUSH HL Save HL on the stack
BF37 POP IY Restore IY from the stack
BF39 CALL $D3E8 Call the routine "Print the name words at IY" (D3E8)
BF3C RET Return to the caller - Done
BF3D LD DE,$005D Load DE with $005D
BF40 CALL $A887 Call A887 (inside "Print the dictionary word that HL refers to")
BF43 JR $BF30 Go back to BF30
Prev: BF08 Up: Map Next: BF45