Knowledge Base

mm = mm - 1; PC = (mm != 0) ? LLLL : (PC + 1)

(A FastTrack instruction) “Decrement Memory, go if non-zero”

Decrements the contents of (number in) data memory location mm and tests the result. If the result is non-zero, performs a GoTo to the program line named LLLL. If the result is zero, the program continues at the next program line (i.e. does not GoTo).  This is an unsigned 8-bit decrement, so 0 decremented becomes 255.

mm must be a valid data memory (RAM) address (depending on which controller you are using). LLLL must be a label (name) used on a program line.

+ From dialect 16 the address argument will be jndexed when executed inside a MultiTrack task and will be indexed if the instruction is preceded by the IasJ: precode.

Dialect restriction: This instruction is not implemented on boards prior to dialect D=7, but can be used on older boards via automatic translation by SPLat/PC.

The shorter form (alias) DMGNZ may also be used.

Indexing: From dialect 15 this instruction can be indexed by adding ‘i’ in front of it.

See also SetMem