Code: Select all
define scrLow $00
define scrHigh $01
define color #1
lda #0
sta scrLow
lda #$02
sta scrHigh
ldx #0
ldy #1
fill: lda scrColor ; set the color
sta (scrLow,x) ; put it on the screen
lda scrLow ; load the low byte
clc ; clear the carry
adc #1 ; add one to low byte
sta scrLow ; store low byte
lda scrHigh ; load the high byte
adc #0 ; add carry to high byte
sta scrHigh ; store it
cmp #$06 ; compare high byte
bne fill ; != so increment low byte
lda scrLow ; load low byte
cmp #$00 ; compare low byte
bne fill ; != so increment low byte
end: brk