ld hl,$fc00 ;address of start
; of video memory
ld b,$10*8 ;do 8 rows (16
; bytes in each row)
loop:
ld (hl),%11111111 ;what to put at
; that address
djnz loop ;repeat until b=$00
We keep filling the same byte (the byte at $fc00) over and over again
with %11111111. We need to increase hl (inc hl ) so it points
to the next byte after each successive loop.
Speed up the routine by preloading a with the value
to fill (hl) with before we start the loop.
| ld hl,$fc00 ;start address of
; video memory
ld b,$10*8 ;do 8 rows (16 bytes
; per row)
ld a,%11111111 ;what to put at that
; address
loop:
ld (hl),a ;load up that address
inc hl ;increase to next address
djnz loop ;repeat until b=$00
| |