Intel 80287, 80286 manual Jg/Jnle, Jge/Jnl, Jl/Jnge, Jle/Jng, Jno, Jns

Models: 80287 80286

1 515
Download 515 pages 45.04 Kb
Page 76
Image 76

BASIC INSTRUCTION SET

3.6.2.1 CONDITIONAL JUMP INSTRUCTIONS

Table 3·3 shows the conditional transfer mnemonics and their interpretations. The conditional jumps that are listed as pairs are actually the same instruction. The assembler provides the alternate mnemon- ics for greater clarity within a program listing.

3.6.2.2 LOOP INSTRUCTIONS

The loop instructions are conditional jumps that use a value placed in ex to specify the number of repetitions of a software loop. All loop instructions automatically decrement ex and terminate the loop when ex=0. Four of the five loop instructions specify a condition of ZF that terminates the loop before ex decrements to zero.

LOOP (Loop While ex Not Zero) is a conditional transfer that auto-decrements the ex register before testing ex for the branch condition. If ex is non-zero, the program branches to the target label speci- fied in the instruction. The LOOP instruction causes the repetition of a code section until the operation of the LOOP instruction decrements ex to a value of zero. If LOOP finds ex=0, control transfers to the instruction immediately following the LOOP instruction. If the value of ex is initially zero, then the LOOP executes 65,536 times.

Example: LOOP START_LOOP. Each time the program encounters this instruction, it decrements ex and then tests it. If the value of ex is non-zero, then: the program branches to the instruction labeled START_LOOP. If the value in ex is zero, then the program continues with the instruction that follows the LOOP instruction.

Table 3-3.Interpretation of Conditional Transfers

Unsigned Conditional Transfers

Mnemonic

Condition Tested

"Jump If..."

JA/JNBE

JAE/JNB

JB/JNAE

JBE/JNA JC JE/JZ

JNC JNE/JNZ JNP/JPO JP/JPE

....-----:-

.".IIVIl.V .......

(CF or ZF) = 0 CF = 0

CF = 1

(CF or ZF) = 1 CF = 1

ZF = 1

CF = 0

ZF = 0

PF = 0

PF = 1

Signed Conditional Transfers

C~!'!!!!t!o!'! T~~t~('I

above/not below nor equal above or equal/not below below/not above nor equal below or equal/not above

carry

equal/zero not carry

not equal/not zero not parity/parity odd parity/parity even

"Jump If. .."

JG/JNLE

((SF xor OF) or ZF) = 0

greater/not less nor equal

JGE/JNL

(SF xor OF) = 0

greater or equal/not les~

JL/JNGE

(SF xor OF) = 0

less/not greater nor equal

JLE/JNG

((SF xor OF) or ZF) = 1

less or equal/not greater

JNO

OF = 0

not overflow

JNS

SF = 0

not sign (positive, including 0)

JO

OF = 1

overflow

JS

SF = 1

sign (negative)

3-20

Page 76
Image 76
Intel 80287, 80286 manual Jg/Jnle, Jge/Jnl, Jl/Jnge, Jle/Jng, Jno, Jns