int&
MCS”-51 PROGRAMMER’SGUIDE AND INSTRUCTIONSET
DJNZ direct@
Byte=
Cycles
Encoding:
Operation:
INC <byte>
3
2
1101
0101
I ‘irw’addressI EiEl
DJNZ
(PC)+ (PC) + 2
(direct)+ (direct) – 1
IF (direot) >0 or (direct) <0
THEN
(PC)-(PC) + ml
Function:
Incmsnent
Description: INC incrementsthe indicatedvariableby 1.An originalvalueofOFFHwilloverflowto OOH.
No figs are affected.Threeaddressingmodesare allowed:register,direct, or register-indirect.
Note.”When this instructionis used to modifyan output port, the value used ss the original
port data willbe read fromthe outputdata latch, notthe inputpins.
Exsmple: RegisterOcontains7EH (01111111OB).Internal RAM locations7EHand 7FHmntain OFFH
and 40H,respectively.The instructionsequence,
INC @RO
INC RO
INC @RO
willleaveregisterOsetto 7FHandinternalRAMlocations7EHand7FHholding(respective-
ly) (XIHand 41H.
INC A
Bytes: 1
cycles: 1
Encoding:
0000 0100
Operstion:
INC
(A) + (A) + 1
2-44