SX User’s Manual Rev. 3.1 68 © 2000 Scenix Semiconductor, Inc. All rights reserved. www.scenix.com Chapter 3 Instruction Set 3.6.2 ADD W,fr Add fr to W Operation: W =W + fr Bits affected: C, DC, Z Opcode: 0001 110f ffff Description: 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 bit is set and the lower eight bits of the
result are written to W. Otherwise, the C bit is cleared.
If there is a carry from bit 3 to bit 4, the DC (digit carry) bit is set. Otherwise, the
bit is cleared.
If the result of addition is 00h, the Z bit is set. Otherwise, the bit is cleared. An
addition result of 100h is considered zero and therefore sets the Z bit.
Config. Option: If the CF bit in the FUSEX register has been programmed to 0, this instruction also
adds the C bit 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 bit because of the
carry out of bit 7, and clears the DC bit because there is no carry from bit 3 to bit 4.
The Z bit is cleared because the result is nonzero.