Instruction Set
C500 Family
Semiconductor Group
4-72
1998-04-01
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 incrementing the PC twice. Therefore, the range of
destinations allowed is from 128 bytes preceding this instruction to 127 bytes
following it.
Example:
The label ÓRELADRÓ is assigned to an instruction at program memory location
0123H. The instruction
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.
Therefore, the displacement byte of the instruction will be the relative offset (0123H-
0102H) = 21H. In other words, an SJMP with a displacement of 0FEH would be a
one-instruction infinite loop.
Operation:
SJMP
(PC)
¬
(PC) + 2
(PC)
¬
(PC) + rel
Bytes:
2
Cycles:
2
Encoding:
1 0 0 0
0 0 0 0
rel. address