The following was inadvertently sent to me by John Payson; I'm
forwarding it to the PICLIST.
-Andy
------- Forwarded Message Follows -------
From: John Payson <spam_OUTsupercatTakeThisOuT
Mcs.Net>
Subject: Re: rlf on W OK?
To: .....fastfwdKILLspam
@spam@ix.netcom.com
Date: Thu, 16 Jan 1997 00:03:39 -0600 (CST)
[Andy Warren]:
{Quote hidden}> Scott Horton <
PICLIST
KILLspamMITVMA.MIT.EDU> wrote:
>
> > Please excuse the elementary question but.... Is it OK/ can I do a
> > rotate left through carry on the W register?
> >
> > rlf W
> >
> > OK or not?
>
> Not.
>
> The MPASM assembler will accept that line without producing any
> errors (for reasons that I'm too tired to explain), but the
> reults will be far from what you expected.
Rather than treating the letters W and F as special cases when they
occur as the second operand of an instruction [e.g. rlf foo,w] the
MPASM assembler just has them defined as "0" and "1". Thus, "rlf w"
is equivalent to "rlf 0" which is in turn equivalent to "rlf INDF,f".
BTW, IMHO while I like some of Microchip's mnemonics, some things can
be a bit confusing and provide major room for flubbing. Some
beginners might benefit (if using an assembler that supports such
things) from defining some macros such as:
ifbit -> btfsc
ifnot -> btfss
loadw -> movf ,w
stow -> movwf
or at least bearing them in mind when writing code.