DJNZ decrements the value of register by 1. If the initial value of register is 0, decrementing the value will cause it to reset to 255 (0xFF Hex). If the new value of register is not 0 the program will branch to the address indicated by addr. If the new value of register is 0 program flow continues with the instruction following the DJNZ instruction.
Syntax : DJNZ register,addr
Example : DJNZ R0,#40H
It decrements the data in R0 by 1. After this If R0 is not 0 then it will jump to krm otherwise program continues by next instructions.
Syntax : DJNZ register,addr
Example : DJNZ R0,#40H
It decrements the data in R0 by 1. After this If R0 is not 0 then it will jump to krm otherwise program continues by next instructions.
- Instruction
- Opcode
- Bytes
- Flags
- DJNZ iram_addr,addr
- 0xD5
- 3
- None
- DJNZ R0,addr
- 0xD8
- 2
- None
- DJNZ R1,addr
- 0xD9
- 2
- None
- DJNZ R2,addr
- 0xDA
- 2
- None
- DJNZ R3,addr
- 0xDB
- 2
- None
- DJNZ R4,addr
- 0xDC
- 2
- None
- DJNZ R5,addr
- 0xDD
- 2
- None
- DJNZ R6,addr
- 0xDE
- 2
- None
- DJNZ R7,addr
- 0xDF
- 2
- None