Specifications
mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 9: Instruction Set
Syntax: [label] DECF f, d
Description: Decrement register f by one. If d = w or d = 0, the result is stored in the W
register. If d = f or d = 1, the result is stored in register f.
Operation: (f) - 1 -> d
Operand: 0 ≤ f ≤ 127, d[0,1]
Status affected: Z
Number of cycles: 1
EXAMPLE 1:
....
[label] DECF REG,f
Before instruction execution: REG = 0x01
Z = 0
After instruction: REG = 0x00
Z = 1
EXAMPLE 2:
....
[label] DECF REG,w
Before instruction execution: REG = 0x13
W = x, Z = 0
After instruction: REG = 0x13
W = 0x12, Z = 0
DECFSZ - Decrement f, Skip if 0
Syntax: [label] DECFSZ f, d
Description: Decrement register f by one. If d = w or d = 0, the result is stored in the W
http://www.mikroe.com/en/books/picmcubook/ch9/ (16 of 35)5/3/2009 11:35:12 AM