© 2000 Scenix Semiconductor, Inc. All rights reserved.
SX Users Manual Rev. 3.1
Chapter 3 Instruction Set
Move (fr-W) to W
W = fr - W
C, DC, Z
0000 100f ffff
This instruction subtracts the contents of W from the contents of the specified file
register 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 subtraction is negative (W is larger than fr), the C bit is cleared to 0
and the lower eight bits of the result are written to W. Otherwise, the C bit is set to 1.
If there is a borrow from bit 3 to bit 4, the DC (digit carry) bit is cleared to 0.
Otherwise, the bit is set to 1.
If the result of subtraction is 00h, the Z bit is set. Otherwise, the bit is cleared.
If the CF bit in the FUSEX configuration register has been programmed to 0, this
instruction also subtracts the complement of the C bit as a borrow-in input:
W = fr - W - /C
This example subtracts the contents of W from global file register 0Dh and moves
the result into W. For example, if the file register contains 35h and W contains 06h,
this instruction subtracts 06h from 35h and writes the result, 2Fh, into W. It also sets
the C bit, clears the DC bit, and clears the Z bit. The file register is left unchanged.