.org $2000 buf: .org $0 ptr: .qword $0 ptr2: .qword $0 .org $8000 reset: cps ldx.w #$FFFF txs start: ldy #0 ldb #0 tyx lda.w #buf sta.q ptr adc #8 sta.q ptr2 ;inb ;stb $C010 ;deb @bench: jsr clr_buf bra @bench clr_buf: tba ; Reset the Accumulator. cpy.w #$1FFF ; Did we clear all of the screen buffer? bcs @end ; Yes, so we're done. sta.q (ptr), y ; No, so clear eight bytes. sta.q (ptr2), y ; Clear eight more bytes. tya ; Copy the buffer index. adc #$10 ; Increment the index by 16. tay ; Update the index. bra clr_buf ; Keep looping. @end: tay ; Set the index back to zero. rts ; End of clr_buf. ;.org $C010 ;.byte $1 .org $FFC0 .qword reset a d