Djnz – Texas Instruments MSC1210 User Manual

Page 294

Advertising
background image

8052 Instruction Set

E-10

DJNZ

Decrement and Jump if Not Zero

Syntax

DJNZ register,relAddr

Instructions

OpCode

Bytes

Cycles

Flags

DJNZ direct,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

DJNZ decrements the value of register by 1. If the initial value of register is 0,
decrementing the value causes it to reset to 255 (0xFF

H

). If the new value of

register is not 0, the program branchs to the address indicated by relAddr. If
the new value of register is 0, program flow continues with the instruction fol-
lowing the DJNZ instruction.

See also: DEC, JZ, JNZ

Advertising