Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

MICROCONTROLLER TUTORIALS - 8052

Videos

Products

Sitemap

Circuits

Tutorials

8051

Introduction

Chapter 1
Types of Memory

Chapter 2
Special Function Registers

Chapter 3
Basic Registers

Chapter 4
Addressing Modes

Chapter 5
Program Flow

Chapter 6
Low Level Information

Chapter 7
Timers

Chapter 8
Serial Port Operations

Chapter 9
Interrupts

Additional Features in 8052

8052 Instruction Set

8051 / 8052 Microcontroller
Instruction Set 
DJNZ - Decrement Register and Jump if not Zero

Operation: DJNZ
Function: Decrement and Jump if Not Zero
Syntax: DJNZ register,reladdr

 

Instructions OpCode Bytes Cycles Flags
DJNZ iram addr,reladdr 0xD5 3 2 None
DJNZ R0,reladdr 0xD8 2 2 None
DJNZ R1,reladdr 0xD9 2 2 None
DJNZ R2,reladdr 0xDA 2 2 None
DJNZ R3,reladdr 0xDB 2 2 None
DJNZ R4,reladdr 0xDC 2 2 None
DJNZ R5,reladdr 0xDD 2 2 None
DJNZ R6,reladdr 0xDE 2 2 None
DJNZ R7,reladdr 0xDF 2 2 None

 

Description: 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 relative addr. If the new value of register is 0 program flow continues with the instruction following the DJNZ instruction.

See Also: DEC, JZ, JNZ, Instruction Set

 
  <<< Click here to come back on (8051 / 8052 - Instruction Set)
 

<<<<  Back to 8051 / 52  Microcontroller Tutorial