Re: [stella] A question about ROR and ROL

Subject: Re: [stella] A question about ROR and ROL
From: "Matthew W. Miller" <mattm@xxxxxxxxxxx>
Date: Tue, 14 Sep 1999 22:49:26 -0400 (EDT)
On Tue, 14 Sep 1999, Pete Holland wrote:

>Does ROR, when it rotates the bits, rotate them all, or does it just
>move them over and, any bits at the end, just dump them?  It seems like
>ASL and LSR do the later, and I can't image redundant commands in
>computer programming, but I just want to make sure.

ROL rotates the memory/accumulator and Carry left one bit, in a circle:

.--------------------------.
`-- C <- 7 6 5 4 3 2 1 0 <-'

ROR, right one bit in a circle:

.--------------------------.
`-> C -> 7 6 5 4 3 2 1 0 --'

ASL shifts memory/accumulator left one bit, sets bit 0 to 0, and moves the
former bit 7 to Carry:

C <- 7 6 5 4 3 2 1 0 <- #0

LSR shifts memory/accumulator right one bit, sets bit 7 to 0, and moves
the former bit 0 to Carry:

#0 -> 7 6 5 4 3 2 1 0 -> C

Matthew W. Miller -- mattm@xxxxxxxxxxx


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

Current Thread