Instruction Set ArchitectureIP2022 Users Manual
136
www.ubicom.com
DEC W,fr
Decrement fr into W
Operation:
W = fr - 1
Bits affected:
Z
Opcode:
0000 110f ffff ffff
Description:
This instruction decrements the value in the
specified register file by one and moves the 8-bit
result into W. The data memory location is left
unchanged.
If the data memory location holds 0x01, the value
moved into W is 0x00 and the Z bit is set.
Otherwise, the Z bit is cleared.
Cycles:
1
Example:
dec w,0x099
This example decrements the value in the data
memory location at 0x099 and moves the result
into W. For example, if the data memory location
holds 0x75, the value 0x74 is loaded into W, and
the Z bit is cleared. The data memory location still
holds 0x75 after execution of the instruction.