
Instruction Set
4-101
JMP
JMP
Examples
This example uses the integer in DX to determine the course of action. CMP and JL
implement a construct equivalent to a C-language
if statement. CMP, JG, and JMP
implement an
if-else statement.
Tips
JMP is the only jump instruction that transfers execution to a far address (modifies both
CS and IP).
Related Instructions
If you want to
See
Call a procedure
CALL
; branch according to the value of the integer in DX
CMP
DX,0
; is DX negative?
JL
NEAR_NEG
; if so, jump to near label
JG
NEAR_POS
; if DX > 0, jump to near label
JMP
FAR_ZERO
; else, jump to far label (DX is 0)
NEAR_NEG:
...
NEAR_POS:
...
; different code segment
FAR_ZERO:
...
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...