Sherlock: annotated disassembly

Routines

Prev: A7EB Up: Map Next: A82F
A80E: Print word reference DE (code $04's printer)
Through A7D0, then as a dictionary word (A887) with flag nibble $5 unless it is empty; ORs A7EA into $A026.
Input
DE A word reference
Output
The word printed, as a noun ($A887)
$A026 Marked if the word is not YOU
A80E PUSH DE Save DE on the stack - Print the word's preceding space/capital handling first (A7D0)
A80F CALL $A7D0 Call the routine "Print an article, or note whether the word is YOU" (A7D0)
A812 POP DE Restore DE from the stack
A813 LD A,$50 Load A with $50 - Class $50 (a noun) is put in the top nibble of D
This entry point is used by the routine at D405.
A815 PUSH AF Save AF on the stack
A816 LD A,D Copy D into A
A817 AND $0F Keep only bits 0, 1, 2, 3 of A (mask $0F)
A819 LD D,A Copy A into D
A81A POP AF Restore AF from the stack
A81B OR D Set in A the bits that are set in D
A81C LD D,A Copy A into D
A81D AND $0F Keep only bits 0, 1, 2, 3 of A (mask $0F) - Nothing there (D and E zero apart from the class)? Return
A81F OR E Set in A the bits that are set in E
A820 RET Z If the result is zero, return
A821 CALL $A887 Print the word (A887)
A824 LD A,($A7EA) Read "A7D0: set when the word was not YOU" (A7EA) into A - Note the print state of the word's last letter (A7EA) in $A026
A827 PUSH HL Save HL on the stack
A828 LD HL,$A026 Point HL at $A026 in "Game variables"
A82B OR (HL) Set in A the bits that are set in the byte at $A026 in "Game variables"
A82C LD (HL),A Store A at the address HL points to
A82D POP HL Restore HL from the stack
A82E RET Return to the caller
Prev: A7EB Up: Map Next: A82F