Sherlock: annotated disassembly

Routines

Prev: A63A Up: Map Next: A65A
A63F: Codes $1D and $1E (and $A647): finish a sentence
Addresses named in the title: A647.
Jumped to rather than called (A62F). D = $60 ($1D) or $30 ($1E), or, entered at A647, D from a word reference just printed by A887. Then: with D bit 6 set, a newline (A2A2); with bit 4 set, a full stop and a newline.
Input
D Bit 6: no full stop; bit 4: full stop and new line
Output
F From the new line
A Changed
A63F LD D,$60 Load D with $60 - Code $1D: D = $60 (end of sentence, new line)
A641 JR $A64A Skip ahead to A64A
A643 LD D,$30 Load D with $30 - Code $1E: D = $30 (full stop and new line)
A645 JR $A64A Skip ahead to A64A
This entry point is used by the routine at A5CD.
A647 CALL $A887 Entry: print the word at DE (A887), D left as it was
A64A LD A,$2E A = '.'
A64C BIT 6,D Test bit 6 of D - D bit 6 set: no full stop, straight to the new line
A64E JR NZ,$A657 If bit 6 of D is set, skip ahead to A657
A650 BIT 4,D Test bit 4 of D - D bit 4 set: print the full stop (A9B7)
A652 CALL NZ,$A9B7 If bit 4 of D is set, call the routine "Print character A, a word at a time (word wrap)" (A9B7)
A655 BIT 4,D ...and a newline (A2A2)
A657 CALL NZ,$A2A2 Then start a new line (A2A2) if the bit was set
Prev: A63A Up: Map Next: A65A