30 Rabbit 2000/3000 Microprocessor
Description
Decrements the data in word register ss (any of the word registers BC, DE, HL, or SP).
Description
This instruction’s mnemonic stands for Decrement and Jump if Not Zero. It decrements the data in register B
then, if the data in B does not equal 0, it adds the 8-bit signed constant e to the Program Counter.
Two is subtracted from the value e so the instruction jumps from the current instruction and not the following
instruction.
DEC ss
Opcode Instruction Clocks Operation
——
0D
1D
2D
3D
DEC ss
DEC BC
DEC DE
DEC HL
DEC SP
2
2
2
2
2
ss = ss -1
BC = BC - 1
DE = DE - 1
HL = HL - 1
SP = SP - 1
Flags ALTD I/O
S Z L/V C F R SP S D
- - - - •
DJNZ e
Opcode Instruction Clocks Operation
10 e-2 DJNZ e 5 (2,2,1) B = B-1; if {B != 0} PC = PC + e
Flags ALTD I/O
S Z L/V C F R SP S D
- - - - •