
Handshake Solutions
HT80C51 User Manual
80C51 Family Instruction Set – Instruction definitions
Page 110 of 132
© Philips Electronics N.V. 2005
JZ rel
Function: Jump if Accumulator Zero
Description: If all bits of the Accumulator are zero, branch to the indicated address; otherwise proceed with the
next instruction. The branch destination is computed by adding the signed relative-displacement in
the second instruction byte to the PC, after incrementing the PC twice. The Accumulator is not
modified. No flags are affected.
Example: The Accumulator originally holds 01H. The instruction sequence,
JZ LABEL1
DEC A
JZ LABEL2
will change the Accumulator to 00H and cause program execution to continue at the instruction
identified by the label LABEL2.
Bytes: 2
Cycles: 2
Encoding:
Operation: JZ
(PC)
← (PC) + 2
IF A = 0
THEN
(PC)
← (PC) + rel
LCALL addr16
Function: Long Call
Description: LCALL calls a subroutine located at the indicated address. The instruction adds three to the pro-
gram counter to generate the address of the next instruction and then pushes the 16-bit result
onto the stack (low byte first), incrementing the Stack Pointer by two. The high-order and low-
order bytes of the PC are then loaded, respectively, with the second and third bytes of the LCALL
instruction. Program execution continues with the instruction at this address. The subroutine may
therefore begin anywhere in the full 64k-byte program memory address space. No flags are af-
fected.
Example: Initially the Stack Pointer equals 07H. The label “SUBRTN” is assigned to program memory loca-
tion 1234H. After executing the instruction,
LCALL SUBRTN
at location 0123H, the Stack Pointer will contain 09H, internal RAM locations 08H and 09H will
contain 26H and 01H, and the PC will contain 1235H.
Bytes: 3
Cycles: 2
Encoding:
Operation: LCALL
(PC)
← (PC) + 3
(SP)
← (SP) + 1
((SP))
← (PC7-0)
(SP)
← (SP) + 1
((SP))
← (PC15-8)
(PC)
← addr15-0
0
1
1
0
0
0
0
0
rel. address
0
0
0
1
0
0
1
0
addr15-addr8
addr7-addr0