Re: [stella] An exercise in minimalism...

Subject: Re: [stella] An exercise in minimalism...
From: Christopher Tumber <christophertumber@xxxxxxxxxx>
Date: Mon, 23 Jun 2003 00:57:18 -0400
Maybe it's just late and I should be sleeping, but...

Some time ago, Andrew wrote:

>I dug up my earlier posting regarding an efficient startup.
>Here's my best...
>
>
>    ; CLEARS ALL VARIABLES, STACK
>    ; INIT STACK POINTER
>    ; ALSO CLEARS TIA REGISTERS
>    ; DOES THIS BY "WRAPPING" THE STACK - UNUSUAL
>
>    LDX #0
>    TXS
>    PHA            ; BEST WAY TO GET SP=$FF, X=0
>
>    TXA
>CLEAR PHA
>    DEX
>    BNE CLEAR
>
>    ; 9 BYTES TOTAL FOR CLEARING STACK, MEMORY
>    ; STACK POINTER NOW $FF, A=X==0



How about:

    LDX #$FF
    TXS 
    INX            ; BETTER WAY TO GET SP=$FF, X=0 

    TXA 
CLEAR PHA 
    DEX
    BNE CLEAR 

    ; 9 BYTES TOTAL FOR CLEARING STACK, MEMORY 
    ; STACK POINTER NOW $FF, A=X==0 
    ; BUT 1 CYCLE FASTER


<Ducks>


Chris...

----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread