Re: [stella] 6502 basics: signed LSR

Subject: Re: [stella] 6502 basics: signed LSR
From: "Andrew Davie" <atari2600@xxxxxxxxxxxxx>
Date: Mon, 16 Feb 2004 08:15:58 +1100
Less bytes (just!), more cycles...

    lda var
    asl a
    ror var

"Efficient" can mean different things, so the above may be useful, too :)
Cheers
A

----- Original Message ----- 
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
To: <stella@xxxxxxxxxxx>
Sent: Monday, February 16, 2004 6:10 AM
Subject: Re: [stella] 6502 basics: signed LSR


> KirkIsrael wrote:
>
> > Is there a better way of dividing a signed 1-byte integer
> > by 2 than this? (which says, if var is positive, just do LSR,
> > otherwise LSR and OR w/ -128 i.e. #%10000000 )
>
> Yup:
>
>   lda var
>   cmp #$80
>   ror
>   sta var
>
> Have fun!
> Thomas
> _______________________________________________________
> Thomas Jentzsch         | *** Every bit is sacred ! ***
> tjentzsch at web dot de |
>
> --------------------------------------------------------------------------
--------------------
> Archives (includes files) at http://www.biglist.com/lists/stella/archives/
> Unsub & more at http://www.biglist.com/lists/stella/
>
>
>


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


Current Thread