© 2000 Scenix Semiconductor, Inc. All rights reserved.
SX Users Manual Rev. 3.1
Chapter 3 Instruction Set
Add W to fr
fr = fr + W
C, DC, Z
0001 111f ffff
This instruction adds the contents of W to the contents of the specified file register
and writes the 8-bit result into the same file register. W is left unchanged. The reg-
ister 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 the file register. 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.
If the CF bit in the FUSEX configuration register has been programmed to 0, this
instruction also adds the C bit as a carry-in input:
fr = fr + W + C
This example adds the contents of W to file register 12h. For example, if the file
register contains 7Fh and W contains 02h, this instruction adds 02h to 7Fh and
writes the result, 81h, into the file register; and clears the C and Z bits. It sets the
DC bit because of the carry from bit 3 to bit 4.