Sherlock: annotated disassembly

Routines

Prev: A7C5 Up: Map Next: A7EA
A7D0: Print an article, or note whether the word is YOU
Sets A7EA to 1 unless DE is a word reference to YOU ($09EE). When DE is not a word reference at all (bit 7 of D clear) it is an article code: A7EB prints THE, A, AN or SOME from A24D - or from A255, all THE but SOME, when $A027 or A2AA is set. Also used by $D0E3, $D3F1 and $D40E.
Input
DE A word reference or an article code
Output
$A7EA 1 unless the word is YOU
F Z if the word is YOU
A7D0 XOR A Clear A to zero (and the carry flag) - A7EA = 0: the word is not YOU
A7D1 LD ($A7EA),A Store A in "A7D0: set when the word was not YOU" (A7EA)
A7D4 BIT 7,D Test bit 7 of D - Bit 7 of D clear: print the article by code (A7EB)
A7D6 JR Z,$A7EB If bit 7 of D is clear, skip ahead to the routine "Print the article for article code DE" (A7EB)
A7D8 LD A,E Copy E into A - Is the word reference $09EE (YOU)? Then print nothing
A7D9 LD HL,$09EE Load HL with $09EE
A7DC CP L Compare A with L
A7DD JR NZ,$A7E4 If A differs from L, skip ahead to A7E4
A7DF LD A,D Copy D into A
A7E0 AND $0F Keep only bits 0, 1, 2, 3 of A (mask $0F)
A7E2 CP H Compare A with H
A7E3 RET Z If A equals H, return
A7E4 LD A,$01 Load A with $01 - Otherwise note a word that is not YOU (A7EA = 1) and return
A7E6 LD ($A7EA),A Store A in "A7D0: set when the word was not YOU" (A7EA)
A7E9 RET Return to the caller
Prev: A7C5 Up: Map Next: A7EA