Sherlock: annotated disassembly

Routines

Prev: D99E Up: Map Next: D9C3
D9B7: Rub out the typed line
Prints a backspace ($08), steps HL back and counts B up, until B reaches $80 (at once if bit 7 is already set).
Input
HL The line end
B The count (bit 7 set means finished)
Output
HL Back to the start
B Up to $80
D9B7 BIT 7,B Test bit 7 of B - B bit 7 set: finished
D9B9 RET NZ If bit 7 of B is set, return
D9BA LD A,$08 Load A with $08 - Print a backspace (8) (A9B7)
D9BC CALL $A9B7 Call the routine "Print character A, a word at a time (word wrap)" (A9B7)
D9BF INC B Add one to B - B up, HL back: repeat
D9C0 DEC HL Step HL back one byte
D9C1 JR $D9B7 Go back to the routine "Rub out the typed line" (D9B7)
Prev: D99E Up: Map Next: D9C3