[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Screen Holes (was: Prodos Woes)
"Paul R. Santa-Maria" <paulrsm@buckeye-express.com> writes:
>About a minute after I posted I realized I could trim it by
>one instruction. My second version is the same size as yours.
> LDX #$F8
>L1 LDA $6000-1,X
> STA $0400-1,X
> LDA $6100-1,X
> STA $0500-1,X
> LDA $6200-1,X
> STA $0600-1,X
> LDA $6300-1,X
> STA $0700-1,X
> DEX
> BEQ L2 ;=>DONE
> CPX #$80
> BNE L1 ;=>DO NOT SKIP
> LDX #$78
> BNE L1 ;=>ALWAYS
>L2 RTS
>But I think I like yours better.
As I posted earlier in the "Prodos woes" thread, you can make
it even shorter by moving the decrement to the end of the loop.
ldy #$f8
loop
lda $6000-1,y
sta $400-1,y
lda $6100-1,y
sta $500-1,y
lda $6200-1,y
sta $600-1,y
lda $6300-1,y
sta $700-1,y
cpy #$81
bne skip
ldy #$79
skip
dey
bne loop
rts
--
David Wilson School of IT & CS, Uni of Wollongong, Australia