![Samsung S3F80JB Скачать руководство пользователя страница 167](http://html.mh-extra.com/html/samsung/s3f80jb/s3f80jb_user-manual_340834167.webp)
S3F80JB
INSTRUCTION SET
6-39
DJNZ
—
Decrement and Jump if Non-Zero
DJNZ
r,dst
Operation:
r
←
r – 1
If r
≠
0, PC
←
PC + dst
The working register being used as a counter is decremented. If the contents of the register are
not logic zero after decrementing, the relative address is added to the program counter and
control passes to the statement whose address is now in the PC. The range of the relative
address is +127 to –128, and the original value of the PC is taken to be the address of the
instruction byte following the DJNZ statement.
NOTE:
In case of using DJNZ instruction, the working register being used as a counter should be set at
the one of location 0C0H to 0CFH with SRP, SRP0, or SRP1 instruction.
Flags:
No flags are affected.
Format:
Bytes Cycles Opcode
(Hex)
Addr Mode
dst
r | opc
dst
2
8 (jump taken)
rA
RA
8 (no jump)
r = 0 to F
Example:
Given: R1 = 02H and LOOP is the label of a relative address:
SRP
#0C0H
DJNZ R1,LOOP
DJNZ is typically used to control a "loop" of instructions. In many cases, a label is used as the
destination operand instead of a numeric relative address value. In the example, working register
R1 contains the value 02H, and LOOP is the label for a relative address.
The statement "DJNZ R1, LOOP" decrements register R1 by one, leaving the value 01H.
Because the contents of R1 after the decrement are non-zero, the jump is taken to the relative
address specified by the LOOP label.
Содержание S3F80JB
Страница 1: ...S3F80JB 8 BIT CMOS MICROCONTROLLERS USER S MANUAL Revision 1 1 ...
Страница 327: ...ELECTRICAL DATA 8MHz S3F80JB 18 14 NOTES ...
Страница 339: ...FLASH APPLICATION NOTES S3F80JB Programming By Tool ...
Страница 341: ...S3F80JB 2 This is only an example for setting Vdd This is SPW2 which is one of OPT MTP Writers ...
Страница 342: ...Important Note Subject Toggling phenomenon when serial writing programming on the S3F80JB ...