DESCRIPTION OF INSTRUCTIONS

36. DJNZ data address, code address (Decrement memory, and jump if not zero)

 

 

7

 

 

 

 

 

 

 

 

 

0

 

Instruction code

:

1

 

1

0

1

 

 

0

1

0

1

Byte 1

 

 

7

 

 

 

 

 

 

 

 

 

0

 

Data address

 

a7

a6

a5

a4

 

 

a3

a2

a1

a0

Byte 2

 

 

7

 

 

 

 

 

 

 

 

 

0

 

Relative offset

 

R7

R6

R5

R4

 

 

R3

R2

R1

R0

Byte 3

Operations

: (PC)(PC)+3

 

 

 

 

 

 

 

 

 

 

(data address)(data address)–1

 

 

 

 

 

IF (data address)0

 

 

 

 

 

 

 

 

 

THEN

 

 

 

 

 

 

 

 

 

 

 

 

(PC)(PC)+relative offset

 

 

 

 

Number of bytes

: 3

 

 

 

 

 

 

 

 

 

 

 

Number of cycles

: 2

 

 

 

 

 

 

 

 

 

 

 

Flags

:

C

AC

F0

RS1

 

 

RS0

OV

F1

P

 

(PSW)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Description

 

 

 

 

 

 

 

 

 

 

: The specified data address contents are decremented by 1.

 

 

Control is shifted to a relative jump address if data address

contents are not 0 as a result of the decrement. Control is shifted to the next address following this instruction if the result is 0.

287

Page 294
Image 294
Sonic Alert msm83c154s, msm80154s, msm85c154hvs user manual 287