JMP
JUMP
UNCONDITIONALLY
JMP
Operation:
if
Inter-Segment
then
(CS)
~
SEG
(IP)
~
DEST
Description:
JMP target
JMP
unconditionally transfers control to the
target location. Unlike a
CALL
instruction,
JMP
does
not
save any
information
on
the
stack; no return to the instruction following
the
JMP
is
expected. Like
CALL,
the address
of the target operand may be obtained from
the instruction itself (direct
JMP),
or from
memory
or
a register referenced by the instruc-
tion (indirect
JMP).
An intrasegment direct
JMP
changes the
instruction pointer by adding the relative
displacement
of
the target from the
JMP
instruction.
If
the assembler can determine
that the target
is
within
127
bytes
of
the
JMP,
it automatically generates a two-byte instruc-
tion form called a
SHORT
JMP;
otherwise, it
generates a
NEAR
JMP
that
can address a
target within ±32k. Intrasegment direct
JMPS
are self-relative
and
appropriate in position-
2-97
Flags Affected:
None
independent
(dynamically
relocatable)
routines in which the
JMP
and
its target are
moved together in the same segment.
An intrasegment indirect
JMP
may be made
either through memory or a 16-bit general
register. In the first case, the word content
referenced by the instruction replaces the
instruction pointer. In the second case, the
new
IP
value
is
taken from the register named
in the instruction.
An intersegment direct
JMP
replaces
IP
and
CS
with values contained in the instruction.
An inter segment indirect
JMP
may be made
only through memory. The first word
of
the
doubleword pointer referenced by the
instruc-
tion replaces
IP
and
the second word replaces
CS.