please dont rip this site

SX Embedded Controller Instruction

ADD W,fr

Description: Add fr into W
Operation: W += fr
Flags affected: C DC Z
Registers affected: W
Sources referenced: fr
Cycles: 1
Opcode:
Details: SX Users Manual page # 70
Microchip PIC syntax: ADDWF fr,0
Notes:

This instruction adds the contents of the specified file register to the contents of W and writes the 8- bit result into W. The file register is left unchanged. The register contents are treated as unsigned values.

If the result of addition exceeds FFh, the C flag is set and the lower eight bits of the result are written to W. Otherwise, the C flag is cleared.

If there is a carry from bit 3 to bit 4, the DC (digit carry) flag is set. Otherwise, the flag is cleared.

If the result of addition is 00h, the Z flag is set. Otherwise, the flag is cleared. An addition result of 100h is considered zero and therefore sets the Z flag.

Affected by the the CF_ bit in FUSEX (DEVICE CARRYX).: If the CF bit in the FUSEX register has been programmed to 0, this instruction also adds the C flag as a carry- in input: W = W + fr + C

Cycles: 1

Example: add W,$ 12

This example adds the contents of file register 12h to W. For example, if the file register contains 81h and W contains 82h, this instruction adds 81h to 82h and writes the lower eight bits of the result, 03h, into W. It sets the C flag because of the carry out of bit 7, and clears the DC flag because there is no carry from bit 3 to bit 4. The Z flag is cleared because the result is nonzero.

See also:


file: /Techref/SCENIX/inst/addwfr.htm, 3KB, , updated: 2004/4/5 18:35, local time: 2024/4/18 02:25,
TOP NEW HELP FIND: 
3.133.109.211:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://www.sxlist.com/TECHREF/SCENIX/inst/addwfr.htm"> SX Embedded Controller Instruction - ADD W,fr</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to www.sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .