Searching \ for 'RRF and RLF instructions' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=rrf+rlf+instructions
Search entire site for: 'RRF and RLF instructions'.

Truncated match.
PICList Thread
'RRF and RLF instructions'
1997\11\04@144838 by Herbert Graf

picon face
   I am a little confused about these two instructions. I know what they
do, but my confusion is in the handling of the carry flag. The manual says
shift through carry, which I interperate to meaning that if bit 7 is set and
you RLF the carry flag is set. But when I read the MPASM manual it has a
diagram that suggests if you set the carry flag and RLF bit0 of the file
register is set, is this what happens? It would be very usefull for my
purposes if this is how it worked. TTYL

1997\11\04@150758 by Andrew Warren

face
flavicon
face
Herbert Graf <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> I am a little confused about these two instructions. I know what
> they do, but my confusion is in the handling of the carry flag. The
> manual says shift through carry, which I interperate to meaning
> that if bit 7 is set and you RLF the carry flag is set. But when I
> read the MPASM manual it has a diagram that suggests if you set the
> carry flag and RLF bit0 of the file register is set, is this what
> happens? It would be very usefull for my purposes if this is how it
> worked.

Herbert:

That's how it works.

The manual doesn't actually say, "shift through carry"; it says
"ROTATE through carry"... The carry gets shifted in at one end of
the register, each bit in the register is shifted over, and the
bit that gets shifted out of the register goes into the carry:

   RLF (Rotate Left through carry):
                                _______
                               |       |
   +-------------------------> | Carry | --------------------------+
   |                           |_______|                           |
   |    ______ ______ ______ ______ ______ ______ ______ ______    |
   |   |      |      |      |      |      |      |      |      |   |
   +-- | bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 | <-+
       |______|______|______|______|______|______|______|______|



   RRF (Rotate Right through carry):
                                _______
                               |       |
   +-------------------------- | Carry | <-------------------------+
   |                           |_______|                           |
   |    ______ ______ ______ ______ ______ ______ ______ ______    |
   |   |      |      |      |      |      |      |      |      |   |
   +-> | bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 | --+
       |______|______|______|______|______|______|______|______|

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1997\11\04@152226 by ndie Ohtsji [4555]

flavicon
face
Hello,

Just wondering.....
Is there any way to reset Carry back to zero without using RRF or RLF?
Something similar to CLRW (which sets Z).  Simple single command?  Tricks?
Can't find anything in instruction set.



Thanks in advance,

-Randie
                                   ________
  Randie Ohtsji                   / ____/ /__  ____  ____ ___  _________
  email: rohtsjispamKILLspamglenayre.com    / /___/ / _ \/ __ \/ __ `/ / / / __/ _ \
  Glenayre R & D                / /_\ / /  __/ / / / /_/ / /_/ / / /  __/
  Vancouver, B.C.  CANADA       \____/_/\___/_/ /_/\__,_/\__  /_/  \___/
  Phone: (604) 293-1611 x4555      ________________________/ /
  Fax:   (604) 293-4317           /_________________________/

1997\11\04@170351 by Shannon Spurling

flavicon
face
At 02:33 PM 11/4/97 -0500, you wrote:
>    I am a little confused about these two instructions. I know what they
>do, but my confusion is in the handling of the carry flag. The manual says
>shift through carry, which I interperate to meaning that if bit 7 is set and
>you RLF the carry flag is set. But when I read the MPASM manual it has a
>diagram that suggests if you set the carry flag and RLF bit0 of the file
>register is set, is this what happens? It would be very usefull for my
>purposes if this is how it worked. TTYL

This is really stands for rotate through carry. You roll the bits out the
one side, into the carry bit, and back in the other side. Most MPUs,CPUs,
and MCUs have a similar instruction. A shift is just moving the bits out of
the byte with out moving any thing in, or moving it in from a bit flag. Two
different but similar concepts, but the documentation seams to have them
confused.

Shannon Spurling
MOREnet
Network Operations
.....shannonKILLspamspam.....more.net
1805 E. Walnut Street
Columbia, MO 65201
(573) 882-4548

/**** "My spelling is Wobbly.  It's good spelling but it ****/
/**** Wobbles, and the letters get in the wrong places." ****/
/****                     A. A. Milne (1882-1958)                  ****/

1997\11\04@174618 by Herbert Graf

picon face
-----Original Message-----
From: Shannon Spurling <EraseMEshannonspam_OUTspamTakeThisOuTMORE.NET>
To: PICLISTspamspam_OUTMITVMA.MIT.EDU <@spam@PICLISTKILLspamspamMITVMA.MIT.EDU>
Date: Tuesday, November 04, 1997 17:04
Subject: Re: RRF and RLF instructions


>At 02:33 PM 11/4/97 -0500, you wrote:
>>    I am a little confused about these two instructions. I know what they
>>do, but my confusion is in the handling of the carry flag. The manual says
>>shift through carry, which I interperate to meaning that if bit 7 is set
and
{Quote hidden}

   OK, so does the carry count as the 9th bit? So instead of rotating from
bit7 to bit0, bit7 goes to carry and what was in carry goes to bit0? Thanks
in advance. TTYL

BTW. The reason I care is because I am using the instructions for serial
purposes and if they did behave the way I just described it would be much
easier for me to implement my routines. TTYL

1997\11\04@175632 by Shannon Spurling

flavicon
face
At 05:29 PM 11/4/97 -0500, you wrote:

>    OK, so does the carry count as the 9th bit? So instead of rotating from
>bit7 to bit0, bit7 goes to carry and what was in carry goes to bit0? Thanks
>in advance. TTYL

YES
Shannon Spurling
MOREnet
Network Operations
KILLspamshannonKILLspamspammore.net
1805 E. Walnut Street
Columbia, MO 65201
(573) 882-4548

/**** "My spelling is Wobbly.  It's good spelling but it ****/
/**** Wobbles, and the letters get in the wrong places." ****/
/****                     A. A. Milne (1882-1958)                  ****/

1997\11\04@190335 by Andrew Warren

face
flavicon
face
Herbert Graf <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> so does the carry count as the 9th bit? So instead of rotating from
> bit7 to bit0, bit7 goes to carry and what was in carry goes to
> bit0?

   Yes.

   -Andy

=== Andrew Warren - spamBeGonefastfwdspamBeGonespamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1997\11\04@222344 by David W. Duley

picon face
In a message dated 97-11-04 15:23:20 EST, you write:

<<
Hello,

Just wondering.....
Is there any way to reset Carry back to zero without using RRF or RLF?
Something similar to CLRW (which sets Z).  Simple single command?  Tricks?
Can't find anything in instruction set.
 >>
How bout:
    bcf status,carry

Works for me!

Dave Duley

1997\11\05@081622 by Tom Handley

picon face
  Randie, use the following:

     Microchip   Parallax
     BCF   3,0   CLC        ; Clear Carry
     BSF   3,0   STC        ; Set Carry

  In the Microchip syntax, the "3,0" means clear/set register 3, Bit 0
(Status register, Carry Bit). The Parallax syntax is just a macro for the
Microchip syntax. You should check out Microchip's Web site and download
their MPASM and related device documentation.

     http://www.microchip.com/

  - Tom

At 12:19 PM 11/4/97 -0800, you wrote:
{Quote hidden}

1997\11\05@081631 by Tom Handley

picon face
  Shannon, that's exactly how it works. Do you have any of the Microchip
data books or device (*.pdf) files? I ask this as the "RRF/RLF"
instructions are clearly documented in both the books and the device data
files, with a diagram showing the rotation through the Carry Bit.

  For a RRF, the MSB Bit 7 goes to the Carry and what was in the Carry
goes to the LSB Bit 0. For a RLF, the LSB Bit 0 goes to the Carry and what
was in the Carry goes to the MSB Bit 7.

  - Tom

At 05:29 PM 11/4/97 -0500, you wrote:
>{Original Message removed}

1997\11\05@121953 by Herbert Graf

picon face
-----Original Message-----
From: David W. Duley <RemoveMEDREITEKspamTakeThisOuTAOL.COM>
To: PICLISTEraseMEspam.....MITVMA.MIT.EDU <EraseMEPICLISTspamMITVMA.MIT.EDU>
Date: Wednesday, November 05, 1997 01:47
Subject: Re: RRF and RLF instructions


> Is there any way to reset Carry back to zero without using RRF or RLF?
> Something similar to CLRW (which sets Z).  Simple single command?  Tricks?
> Can't find anything in instruction set.
>  >>
>How bout:
>     bcf status,carry


   If you are using MPASM, you can use CLRC, which is automatically
translated to BCF 3, 0. TTYL

1997\11\09@213626 by Marc Heuler

flavicon
face
Hi Randie (Randie Ohtsji [4555]), in
<RemoveME199711042019.MAA27939EraseMEspamEraseMEglenvan.glenayre.com> on Nov 4 you wrote:

> Is there any way to reset Carry back to zero without using RRF or RLF?

       bcf     STATUS,C

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...