piclist 1998\10\26\053206a >
Thread: What's the difference between d and f?
picon face BY : Russell McMahon email (remove spam text)


Simple concept. Harder to explain.
Many PIC instructions can two possible destinations which you can
select between for the results of the operation. These are either
0    The W register or
1    The register which sourced the original data.
In such cases the instruction sequence is suffixed either with a 0 if
you want the data to end up in W or with a 1 if you want the data to
end up back in the register you started out with.
An example will (hopefully) make this clearer.

   movlw        5                    Place a 5 in W
   MOVWF    counter        Move the 5 into "COUNTER"
   movlw        1                    Place a 1 in W
   addwf        counter, 1    Add W to COUNTER
                                           Place the result in

In the line "addwf   counter,1" the final "1" told the PIC to add the
results of the add into COUNTER
ie 5+1=6. Place the 6 in counter. W will still contain "1".

If the instruction had read "addwf  counter,0" then the result would
have been placed in W. W would now contain "6" and COUNTER will still
contain "5"

This is a real part of the PIC instruction - not just an assembler

       Russell McMahon

{Original Message removed}
<11cb01be00c7$eb5ec0e0$313061cb@mkbs> 7bit

See also: www.piclist.com/techref/index.htm?key=whats+difference
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) What's the difference between d and f?

month overview.

new search...