cardiograph-computer/test-programs/fill-display.asm

25 lines
610 B
NASM

;; Fill display with $FF
; updated for 5x5 display
=*px $24
=fill $25
; Initialize variables...
LDA $00 ; (Address for the first px on the display)
STO =*px ; Pointer to current px
LDA $FF ; ($FF is 'on', $00 is 'off')
STO =fill ; Stash value to fill with
@paint
LDA (=fill) ; (A = mem[fill] = $FF)
STO (=*px) ; Paint pixel (mem[mem[*px]] = A = $FF)
LDA (=*px) ; Increment pixel pointer...
ADD $01
STO =*px
LDA (=*px) ; Test whether to loop or not...
SUB $19 ; if *px - $19 == 0, we've reached the end
FHP 2 ; (Zero flag is #2)
JMP @paint
END