Code:
Code: Select all
ldx #$ff
lda #$01
drawPixel:
dex
cpx #$00
sta $0200,x
sta $0300,x
sta $0400,x
sta $0500,x
bne drawPixel
brk
Code: Select all
ldx #$ff
lda #$01
drawPixel:
dex
cpx #$00
sta $0200,x
sta $0300,x
sta $0400,x
sta $0500,x
bne drawPixel
brk
Code: Select all
ldx #$ff
lda #$00 ; changed $ff to $00 so the first writes are to $xxff
drawPixel:
dex
; removed cpx #$00 as it is redundant
sta $0200,x
sta $0300,x
sta $0400,x
sta $0500,x
bne drawPixel
brk
Code: Select all
LDX #$00
TXA ; reuse the value from XR and copy it to AC to clear - saves a byte
L1 STA $0200,X
STA $0300,X
STA $0400,X
STA $0500,X
INX ; count from 0 to $ff and overflow to 0 again
BNE L1 ; loop as long as 0 is not yet reached again
BRK
Code: Select all
ldx #$ff
lda #$00 ; changed $ff to $00 so the first writes are to $xxff
drawPixel:
dex
; removed cpx #$00 as it is redundant
sta $0200,x
sta $0300,x
sta $0400,x
sta $0500,x
bne drawPixel
brk
Code: Select all
ldx #$ff
lda #$00 ; changed $ff to $00 so the first writes are to $xxff
drawPixel:
dex
; removed cpx #$00 as it is redundant
sta $0200,x
sta $0300,x
sta $0400,x
sta $0500,x
bne drawPixel
brk
Code: Select all
LDX #$00
TXA ; reuse the value from XR and copy it to AC to clear - saves a byte
L1 STA $0200,X
STA $0300,X
STA $0400,X
STA $0500,X
INX ; count from 0 to $ff and overflow to 0 again
BNE L1 ; loop as long as 0 is not yet reached again
BRK