Sherlock: annotated disassembly

Routines

Prev: C0FE Up: Map Next: C128
C10F: Set the border, then clear the screen and attributes
Sets the border to white, then fills the whole display file (6,144 bytes at $4000) with zero and the whole attribute file (768 bytes at $5800) with $38 (INK 0 / PAPER 7: black on white, no bright, no flash) - i.e. a standard CLS.
Hooking every write to screen memory during boot shows exactly 6,144 writes at this routine's first LDIR and 767-768 at its second, matching the display and attribute file sizes exactly.
Output
The screen cleared, the attributes black on white and the border white
C10F LD A,$07 White border while we clear the screen
C111 OUT ($FE),A Write A to port ($FE)
C113 LD HL,$4000 HL, DE = display file, one byte apart (for the LDIR fill)
C116 LD DE,$4001 Load DE with $4001
C119 LD BC,$1800 BC = 6144, the whole display file
C11C LD (HL),$00 Seed the first byte with 0...
C11E LDIR ...then copy it across the rest
C120 LD BC,$02FF BC = 767, the rest of the attribute file
C123 LD (HL),$38 Seed the first attribute byte (black on white)...
C125 LDIR ...then copy it across the rest
C127 RET Return to the caller
Prev: C0FE Up: Map Next: C128