125 / 132 page

HT80C51 User Manual
80C51 Family Instruction Set – Instruction definitions
Handshake Solutions
© Philips Electronics N.V. 2005
Page 125 of 132
SETB <bit>
Function: Set Bit
Description: SETB sets the indicated bit to one. SETB can operate on the carry flag or any directly address-
able bit. No other flags are affected.
Example: The carry flag is cleared. Output Port 1 has been written with the value 34H (00110100B). The
instructions,
SETB C
SETB P1.0
will leave the carry flag set to 1 and change the data output on Port 1 to 35H (00110101B).
SETB C
Bytes: 1
Cycles: 1
Encoding:
Operation: SETB
(C)
← 1
SETB bit
Bytes: 2
Cycles: 1
Encoding:
Operation: SETB
(bit)
← 1
SJMP rel
Function: Short Jump
Description: Program control branches unconditionally to the address indicated. The branch destination is
computed by adding the signed displacement in the second instruction byte to the PC, after in-
crementing the PC twice. Therefore, the range of destinations allowed is from 128 bytes preced-
ing this instruction to 127 bytes following it.
Example: The label “RELADR” is assigned to an instruction at program memory location 0123H. The in-
struction,
SJMP RELADR
will assemble into location 0100H. After the instruction is executed, the PC will contain the value
0123H. ( Note: Under the above conditions the instruction following SJMP will be at 102H. There-
fore, the displacement byte of the instruction will be the relative offset (0123H-0102H) = 21H. Put
another way, an SJMP with a displacement of 0FEH would be a one-instruction infinite loop.)
Bytes: 2
Cycles: 2
Encoding:
Operation: SJMP
(PC)
← (PC) + 2
(PC)
← (PC) + rel
1
1
0
1
0
0
1
1
1
1
0
1
0
0
1
0
bit address
1
0
0
0
0
0
0
0
rel. address