DEC, DECSZ, DJNZ

NOTE: These items have been discontinued for a long time.
We no longer support these products or offer alternatives.

We retain these pages so that users can see what their existing tools support and to provide download links to the final documentation and software versions. We have a few replacement parts left, but not many. Available items have an 'ADD to CART' or 'Buy Now' button next to them. Otherwise they are not available.

logo has a few items in stock as well.

 

DEC        fr        Decrement fr


Words:        1        Cycles:        1                Affects:        Z

 

Operation:        Fr is decremented. Z will be set to 1 if the result was 0, otherwise Z will be cleared to 0.

 

Coding:        DECF                fr,1

 

 

DECSZ        fr        Decrement fr and skip if zero


Words:        1        Cycles:        1 or 2 (skip)        Affects:        none

 

Operation:        Fr is decremented. The next instruction word will be skipped if the result was 0.

 

Coding:        DECFSZ        fr,1

 

Note:        Only one word is skipped by this instruction. To avoid strange results, make sure that any instruction following DECSZ is a single-word instruction.

 

 

DJNZ        fr,addr9        Decrement fr and jump if not zero


Words:        2        Cycles:        2 or 3 (jump)        Affects:        none

 

Operation:        Fr is decremented. If the result is not 0, a jump to addr9 is executed.

 

Coding:        DECFSZ        fr,1

       GOTO        addr9