0% found this document useful (0 votes)
75 views50 pages

80x86 Instruction Set

HTML version of the file intel.doc from the PC Game Programmer's guide was produced by Zack Smith, Fancy HTML modifications are copyright (c)2005 by Zack T Smith, all rights reserved. Information provided in the hope that it will be useful, but without any warranty; it is provided AS-IS, without even the implied warranty of fitness for a particular purpose.

Uploaded by

Denise Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views50 pages

80x86 Instruction Set

HTML version of the file intel.doc from the PC Game Programmer's guide was produced by Zack Smith, Fancy HTML modifications are copyright (c)2005 by Zack T Smith, all rights reserved. Information provided in the hope that it will be useful, but without any warranty; it is provided AS-IS, without even the implied warranty of fitness for a particular purpose.

Uploaded by

Denise Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

The 8086 / 80286 / 80386 / 80486 Instruction

Set
This HTML version of the file intel.doc from the PC Game Programmer's guide was produced by
Zack Smith, [email protected]. Fancy HTML modifications are copyright 2005 by Zack T Smith,
all rights reserved. This information is provided in the hope that it will be useful, but without any
warranty; it is provided AS-IS, without even the implied warranty of fitness for a particular purpose.
A Instructions
AAA - Ascii Adjust for Addition
Usage: AAA
Modi f i es f l ags: AF CF ( OF, PF, SF, ZF undef i ned)

Changes cont ent s of AL t o val i d unpacked deci mal . The hi gh or der
ni bbl e i s zer oed.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 8 3 4 3 1


AAD - Ascii Adjust for Division
Usage: AAD
Modi f i es f l ags: SF ZF PF ( AF, CF, OF undef i ned)

Used bef or e di vi di ng unpacked deci mal number s. Mul t i pl i es AH by
10 and t he adds r esul t i nt o AL. Set s AH t o zer o. Thi s i nst r uct i on
i s al so known t o have an undocument ed behavi or .

AL : = 10*AH+AL
AH : = 0

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 60 14 19 14 2


AAM - Ascii Adjust for Multiplication

Usage: AAM
Modi f i es f l ags: PF SF ZF ( AF, CF, OF undef i ned)

AH : = AL / 10
AL : = AL mod 10

Used af t er mul t i pl i cat i on of t wo unpacked deci mal number s, t hi s
i nst r uct i on adj ust s an unpacked deci mal number . The hi gh or der
ni bbl e of each byt e must be zer oed bef or e usi ng t hi s i nst r uct i on.
Thi s i nst r uct i on i s al so known t o have an undocument ed behavi or .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 83 16 17 15 2


AAS - Ascii Adjust for Subtraction
Usage: AAS
Modi f i es f l ags: AF CF ( OF, PF, SF, ZF undef i ned)

Cor r ect s r esul t of a pr evi ous unpacked deci mal subt r act i on i n AL.
Hi gh or der ni bbl e i s zer oed.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 8 3 4 3 1

ADC - Add With Carry
Usage: ADC dest , sr c
Modi f i es f l ags: AF CF OF SF PF ZF

Sums t wo bi nar y oper ands pl aci ng t he r esul t i n t he dest i nat i on.
I f CF i s set , a 1 i s added t o t he dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 16+EA 7 7 3 2- 4 ( W88=24+EA)
r eg, mem 9+EA 7 6 2 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem, i mmed 17+EA 7 7 3 3- 6 ( W88=23+EA)
accum, i mmed 4 3 2 1 2- 3


ADD - Arithmetic Addition
Usage: ADD dest , sr c
Modi f i es f l ags: AF CF OF PF SF ZF

Adds " sr c" t o " dest " and r epl aci ng t he or i gi nal cont ent s of " dest " .
Bot h oper ands ar e bi nar y.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 16+EA 7 7 3 2- 4 ( W88=24+EA)
r eg, mem 9+EA 7 6 2 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem, i mmed 17+EA 7 7 3 3- 6 ( W88=23+EA)
accum, i mmed 4 3 2 1 2- 3


AND - Logical And
Usage: AND dest , sr c
Modi f i es f l ags: CF OF PF SF ZF ( AF undef i ned)

Per f or ms a l ogi cal AND of t he t wo oper ands r epl aci ng t he dest i nat i on
wi t h t he r esul t .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 16+EA 7 7 3 2- 4 ( W88=24+EA)
r eg, mem 9+EA 7 6 1 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem, i mmed 17+EA 7 7 3 3- 6 ( W88=23+EA)
accum, i mmed 4 3 2 1 2- 3


ARPL - Adjusted Requested Privilege Level of Selector (286+ PM)
Usage: ARPL dest , sr c
( 286+ pr ot ect ed mode)
Modi f i es f l ags: ZF

Compar es t he RPL bi t s of " dest " agai nst " sr c" . I f t he RPL bi t s
of " dest " ar e l ess t han " sr c" , t he dest i nat i on RPL bi t s ar e set
equal t o t he sour ce RPL bi t s and t he Zer o Fl ag i s set . Ot her wi se
t he Zer o Fl ag i s cl ear ed.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg - 10 20 9 2
mem, r eg - 11 21 9 4

B Instructions
BOUND - Array Index Bound Check (80188+)
Usage: BOUND sr c, l i mi t
Modi f i es f l ags: None

Ar r ay i ndex i n sour ce r egi st er i s checked agai nst upper and l ower
bounds i n memor y sour ce. The f i r st wor d l ocat ed at " l i mi t " i s
t he l ower boundar y and t he wor d at " l i mi t +2" i s t he upper ar r ay bound.
I nt er r upt 5 occur s i f t he sour ce val ue i s l ess t han or hi gher t han
t he sour ce.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16, mem32 - nj =13 nj =10 7 2
r eg32, mem64 - nj =13 nj =10 7 2

- nj = no j ump t aken


BSF - Bit Scan Forward (386+)
Usage: BSF dest , sr c
Modi f i es f l ags: ZF

Scans sour ce oper and f or f i r st bi t set . Set s ZF i f a bi t i s f ound
set and l oads t he dest i nat i on wi t h an i ndex t o f i r st set bi t . Cl ear s
ZF i s no bi t s ar e f ound set . BSF scans f or war d acr oss bi t pat t er n
( 0- n) whi l e BSR scans i n r ever se ( n- 0) .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg - - 10+3n 6- 42 3
r eg, mem - - 10+3n 7- 43 3- 7
r eg32, r eg32 - - 10+3n 6- 42 3- 7
r eg32, mem32 - - 10+3n 7- 43 3- 7


BSR - Bit Scan Reverse (386+)
Usage: BSR dest , sr c
Modi f i es f l ags: ZF

Scans sour ce oper and f or f i r st bi t set . Set s ZF i f a bi t i s f ound
set and l oads t he dest i nat i on wi t h an i ndex t o f i r st set bi t . Cl ear s
ZF i s no bi t s ar e f ound set . BSF scans f or war d acr oss bi t pat t er n
( 0- n) whi l e BSR scans i n r ever se ( n- 0) .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg - - 10+3n 6- 103 3
r eg, mem - - 10+3n 7- 104 3- 7
r eg32, r eg32 - - 10+3n 6- 103 3- 7
r eg32, mem32 - - 10+3n 7- 104 3- 7



BSWAP - Byte Swap (486+)
Usage: BSWAP r eg32
Modi f i es f l ags: none

Changes t he byt e or der of a 32 bi t r egi st er f r ombi g endi an t o
l i t t l e endi an or vi ce ver sa. Resul t l ef t i n dest i nat i on r egi st er
i s undef i ned i f t he oper and i s a 16 bi t r egi st er .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg32 - - - 1 2
BT - Bit Test (386+)
Usage: BT dest , sr c
Modi f i es f l ags: CF

The dest i nat i on bi t i ndexed by t he sour ce val ue i s copi ed i nt o t he
Car r y Fl ag.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16, i mmed8 - - 3 3 4- 8
mem16, i mmed8 - - 6 6 4- 8
r eg16, r eg16 - - 3 3 3- 7
mem16, r eg16 - - 12 12 3- 7

BTC - Bit Test with Compliment (386+)
Usage: BTC dest , sr c
Modi f i es f l ags: CF

The dest i nat i on bi t i ndexed by t he sour ce val ue i s copi ed i nt o t he
Car r y Fl ag af t er bei ng compl i ment ed ( i nver t ed) .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16, i mmed8 - - 6 6 4- 8
mem16, i mmed8 - - 8 8 4- 8
r eg16, r eg16 - - 6 6 3- 7
mem16, r eg16 - - 13 13 3- 7


BTR - Bit Test with Reset (386+)
Usage: BTR dest , sr c
Modi f i es f l ags: CF

The dest i nat i on bi t i ndexed by t he sour ce val ue i s copi ed i nt o t he
Car r y Fl ag and t hen cl ear ed i n t he dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16, i mmed8 - - 6 6 4- 8
mem16, i mmed8 - - 8 8 4- 8
r eg16, r eg16 - - 6 6 3- 7
mem16, r eg16 - - 13 13 3- 7


BTS - Bit Test and Set (386+)
Usage: BTS dest , sr c
Modi f i es f l ags: CF

The dest i nat i on bi t i ndexed by t he sour ce val ue i s copi ed i nt o t he
Car r y Fl ag and t hen set i n t he dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16, i mmed8 - - 6 6 4- 8
mem16, i mmed8 - - 8 8 4- 8
r eg16, r eg16 - - 6 6 3- 7
mem16, r eg16 - - 13 13 3- 7
C Instructions
CALL - Procedure Call
Usage: CALL dest i nat i on
Modi f i es f l ags: None

Pushes I nst r uct i on Poi nt er ( and Code Segment f or f ar cal l s) ont o
st ack and l oads I nst r uct i on Poi nt er wi t h t he addr ess of pr oc- name.
Code cont i nues wi t h execut i on at CS: I P.

Cl ocks
Oper ands 808x 286 386 486

r el 16 ( near , I P r el at i ve) 19 7 7+m 3
r el 32 ( near , I P r el at i ve) - - 7+m 3

r eg16 ( near , r egi st er i ndi r ect ) 16 7 7+m 5
r eg32 ( near , r egi st er i ndi r ect ) - - 7+m 5

mem16 ( near , memor y i ndi r ect ) - 21+EA 11 10+m 5
mem32 ( near , memor y i ndi r ect ) - - 10+m 5

pt r 16: 16 ( f ar , f ul l pt r suppl i ed) 28 13 17+m 18
pt r 16: 32 ( f ar , f ul l pt r suppl i ed) - - 17+m 18
pt r 16: 16 ( f ar , pt r suppl i ed, pr ot . mode) - 26 34+m 20
pt r 16: 32 ( f ar , pt r suppl i ed, pr ot . mode) - - 34+m 20
m16: 16 ( f ar , i ndi r ect ) 37+EA 16 22+m 17
m16: 32 ( f ar , i ndi r ect ) - - 22+m 17
m16: 16 ( f ar , i ndi r ect , pr ot . mode) - 29 38+m 20
m16: 32 ( f ar , i ndi r ect , pr ot . mode) - - 38+m 20

pt r 16: 16 ( t ask, vi a TSS or t ask gat e) - 177 TS 37+TS
m16: 16 ( t ask, vi a TSS or t ask gat e) - 180/ 185 5+TS 37+TS
m16: 32 ( t ask) - - TS 37+TS
m16: 32 ( t ask) - - 5+TS 37+TS

pt r 16: 16 ( gat e, same pr i vi l ege) - 41 52+m 35
pt r 16: 32 ( gat e, same pr i vi l ege) - - 52+m 35
m16: 16 ( gat e, same pr i vi l ege) - 44 56+m 35
m16: 32 ( gat e, same pr i vi l ege) - - 56+m 35

pt r 16: 16 ( gat e, mor e pr i v, no par m) - 82 86+m 69
pt r 16: 32 ( gat e, mor e pr i v, no par m) - - 86+m 69
m16: 16 ( gat e, mor e pr i v, no par m) - 83 90+m 69
m16: 32 ( gat e, mor e pr i v, no par m) - - 90+m 69

pt r 16: 16 ( gat e, mor e pr i v, x par ms) - 86+4x 94+4x+m 77+4x
pt r 16: 32 ( gat e, mor e pr i v, x par ms) - - 94+4x+m 77+4x
m16: 16 ( gat e, mor e pr i v, x par ms) - 90+4x 98+4x+m 77+4x
m16: 32 ( gat e, mor e pr i v, x par ms) - - 98+4x+m 77+4x


CBW - Convert Byte to Word
Usage: CBW
Modi f i es f l ags: None

Conver t s byt e i n AL t o wor d Val ue i n AX by ext endi ng si gn of AL
t hr oughout r egi st er AH.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 3 3 1


CDQ - Convert Double to Quad (386+)
Usage: CDQ
Modi f i es f l ags: None

Conver t s si gned DWORD i n EAX t o a si gned quad wor d i n EDX: EAX by
ext endi ng t he hi gh or der bi t of EAX t hr oughout EDX

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - - 2 3 1
CLC - Clear Carry
Usage: CLC
Modi f i es f l ags: CF

Cl ear s t he Car r y Fl ag.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 2 1


CLD - Clear Direction Flag
Usage: CLD
Modi f i es f l ags: DF

Cl ear s t he Di r ect i on Fl ag causi ng st r i ng i nst r uct i ons t o i ncr ement
t he SI and DI i ndex r egi st er s.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 2 1


CLI - Clear Interrupt Flag (disable)
Usage: CLI
Modi f i es f l ags: I F

Di sabl es t he maskabl e har dwar e i nt er r upt s by cl ear i ng t he I nt er r upt
f l ag. NMI ' s and sof t war e i nt er r upt s ar e not i nhi bi t ed.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 3 5 1

CLTS - Clear Task Switched Flag (286+ privileged)
Usage: CLTS
Modi f i es f l ags: None

Cl ear s t he Task Swi t ched Fl ag i n t he Machi ne St at us Regi st er . Thi s
i s a pr i vi l eged oper at i on and i s gener al l y used onl y by oper at i ng
syst emcode.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - 2 5 7 2


CMC - Complement Carry Flag
Usage: CMC
Modi f i es f l ags: CF

Toggl es ( i nver t s) t he Car r y Fl ag

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 2 1
CMP - Compare
Usage: CMP dest , sr c
Modi f i es f l ags: AF CF OF PF SF ZF

Subt r act s sour ce f r omdest i nat i on and updat es t he f l ags but does
not save r esul t . Fl ags can subsequent l y be checked f or condi t i ons.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 9+EA 7 5 2 2- 4 ( W88=13+EA)
r eg, mem 9+EA 6 6 2 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem, i mmed 10+EA 6 5 2 3- 6 ( W88=14+EA)
accum, i mmed 4 3 2 1 2- 3


CMPS - Compare String (Byte, Word or Doubleword)
Usage: CMPS dest , sr c
CMPSB
CMPSW
CMPSD ( 386+)
Modi f i es f l ags: AF CF OF PF SF ZF

Subt r act s dest i nat i on val ue f r omsour ce wi t hout savi ng r esul t s.
Updat es f l ags based on t he subt r act i on and t he i ndex r egi st er s
( E) SI and ( E) DI ar e i ncr ement ed or decr ement ed dependi ng on t he
st at e of t he Di r ect i on Fl ag. CMPSB i nc/ decr ement s t he i ndex
r egi st er s by 1, CMPSWi nc/ decr ement s by 2, whi l e CMPSD i ncr ement s
or decr ement s by 4. The REP pr ef i xes can be used t o pr ocess
ent i r e dat a i t ems.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

dest , sr c 22 8 10 8 1 ( W88=30)


CMPXCHG - Compare and Exchange
Usage: CMPXCHG dest , sr c ( 486+)
Modi f i es f l ags: AF CF OF PF SF ZF

Compar es t he accumul at or ( 8- 32 bi t s) wi t h " dest " . I f equal t he
" dest " i s l oaded wi t h " sr c" , ot her wi se t he accumul at or i s l oaded
wi t h " dest " .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg - - - 6 2
mem, r eg - - - 7 2

- add 3 cl ocks i f t he " mem, r eg" compar i son f ai l s


CWD - Convert Word to Doubleword
Usage: CWD
Modi f i es f l ags: None

Ext ends si gn of wor d i n r egi st er AX t hr oughout r egi st er DX f or mi ng
a doubl ewor d quant i t y i n DX: AX.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 5 2 2 3 1
CWDE - Convert Word to Extended Doubleword (386+)
Usage: CWDE
Modi f i es f l ags: None

Conver t s a si gned wor d i n AX t o a si gned doubl ewor d i n EAX by
ext endi ng t he si gn bi t of AX t hr oughout EAX.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - - 3 3 1

D Instructions
DAA - Decimal Adjust for Addition
Usage: DAA
Modi f i es f l ags: AF CF PF SF ZF ( OF undef i ned)

Cor r ect s r esul t ( i n AL) of a pr evi ous BCD addi t i on oper at i on.
Cont ent s of AL ar e changed t o a pai r of packed deci mal di gi t s.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 4 3 4 2 1


DAS - Decimal Adjust for Subtraction
Usage: DAS
Modi f i es f l ags: AF CF PF SF ZF ( OF undef i ned)

Cor r ect s r esul t ( i n AL) of a pr evi ous BCD subt r act i on oper at i on.
Cont ent s of AL ar e changed t o a pai r of packed deci mal di gi t s.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 4 3 4 2 1


DEC - Decrement
Usage: DEC dest
Modi f i es f l ags: AF OF PF SF ZF

Unsi gned bi nar y subt r act i on of one f r omt he dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 3 2 2 1 2
mem 15+EA 7 6 3 2- 4
r eg16/ 32 3 2 2 1 1

DIV - Divide
Usage: DI V sr c
Modi f i es f l ags: ( AF, CF, OF, PF, SF, ZF undef i ned)

Unsi gned bi nar y di vi si on of accumul at or by sour ce. I f t he sour ce
di vi sor i s a byt e val ue t hen AX i s di vi ded by " sr c" and t he quot i ent
i s pl aced i n AL and t he r emai nder i n AH. I f sour ce oper and i s a wor d
val ue, t hen DX: AX i s di vi ded by " sr c" and t he quot i ent i s st or ed i n AX
and t he r emai nder i n DX.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 80- 90 14 14 16 2
r eg16 144- 162 22 22 24 2
r eg32 - - 38 40 2
mem8 ( 86- 96) +EA 17 17 16 2- 4
mem16 ( 150- 168) +EA 25 25 24 2- 4 ( W88=158- 176+EA)
mem32 - - 41 40 2- 4
E Instructions
ENTER - Make Stack Frame (80188+)
Usage: ENTER l ocal s, l evel
Modi f i es f l ags: None

Modi f i es st ack f or ent r y t o pr ocedur e f or hi gh l evel l anguage.
Oper and " l ocal s" speci f i es t he amount of st or age t o be al l ocat ed
on t he st ack. " Level " speci f i es t he nest i ng l evel of t he r out i ne.
Pai r ed wi t h t he LEAVE i nst r uct i on, t hi s i s an ef f i ci ent met hod of
ent r y and exi t t o pr ocedur es.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

i mmed16, 0 - 11 10 14 4
i mmed16, 1 - 15 12 17 4
i mmed16, i mmed8 - 12+4( n- 1) 15+4( n- 1) 17+3n 4


ESC - Escape
Usage: ESC i mmed, sr c
Modi f i es f l ags: None

Pr ovi des access t o t he dat a bus f or ot her r esi dent pr ocessor s.
The CPU t r eat s i t as a NOP but pl aces memor y oper and on bus.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

i mmed, r eg 2 9- 20 ? 2
i mmed, mem 2 9- 20 ? 2- 4

H Instructions
HLT - Halt CPU
Usage: HLT
Modi f i es f l ags: None

Hal t s CPU unt i l RESET l i ne i s act i vat ed, NMI or maskabl e i nt er r upt
r ecei ved. The CPU becomes dor mant but r et ai ns t he cur r ent CS: I P
f or l at er r est ar t .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 5 4 1

I Instructions
IDIV - Signed Integer Division
Usage: I DI V sr c
Modi f i es f l ags: ( AF, CF, OF, PF, SF, ZF undef i ned)

Si gned bi nar y di vi si on of accumul at or by sour ce. I f sour ce i s a
byt e val ue, AX i s di vi ded by " sr c" and t he quot i ent i s st or ed i n
AL and t he r emai nder i n AH. I f sour ce i s a wor d val ue, DX: AX i s
di vi ded by " sr c" , and t he quot i ent i s st or ed i n AL and t he
r emai nder i n DX.
Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 101- 112 17 19 19 2
r eg16 165- 184 25 27 27 2
r eg32 - - 43 43 2
mem8 ( 107- 118) +EA 20 22 20 2- 4
mem16 ( 171- 190) +EA 38 30 28 2- 4 ( W88=175- 194)
mem32 - - 46 44 2- 4
IMUL - Signed Multiply
Usage: I MUL sr c
I MUL sr c, i mmed ( 286+)
I MUL dest , sr c, i mmed8 ( 286+)
I MUL dest , sr c ( 386+)
Modi f i es f l ags: CF OF ( AF, PF, SF, ZF undef i ned)

Si gned mul t i pl i cat i on of accumul at or by " sr c" wi t h r esul t pl aced
i n t he accumul at or . I f t he sour ce oper and i s a byt e val ue, i t
i s mul t i pl i ed by AL and t he r esul t st or ed i n AX. I f t he sour ce
oper and i s a wor d val ue i t i s mul t i pl i ed by AX and t he r esul t i s
st or ed i n DX: AX. Ot her var i at i ons of t hi s i nst r uct i on al l ow
speci f i cat i on of sour ce and dest i nat i on r egi st er s as wel l as a
t hi r d i mmedi at e f act or .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 80- 98 13 9- 14 13- 18 2
r eg16 128- 154 21 9- 22 13- 26 2
r eg32 - - 9- 38 12- 42 2
mem8 86- 104 16 12- 17 13- 18 2- 4
mem16 134- 160 24 12- 25 13- 26 2- 4
mem32 - - 12- 41 13- 42 2- 4
r eg16, r eg16 - - 9- 22 13- 26 3- 5
r eg32, r eg32 - - 9- 38 13- 42 3- 5
r eg16, mem16 - - 12- 25 13- 26 3- 5
r eg32, mem32 - - 12- 41 13- 42 3- 5
r eg16, i mmed - 21 9- 22 13- 26 3
r eg32, i mmed - 21 9- 38 13- 42 3- 6
r eg16, r eg16, i mmed - 2 9- 22 13- 26 3- 6
r eg32, r eg32, i mmed - 21 9- 38 13- 42 3- 6
r eg16, mem16, i mmed - 24 12- 25 13- 26 3- 6
r eg32, mem32, i mmed - 24 12- 41 13- 42 3- 6


IN - Input Byte or Word From Port
Usage: I N accum, por t
Modi f i es f l ags: None

A byt e, wor d or dwor d i s r ead f r om" por t " and pl aced i n AL, AX or
EAX r espect i vel y. I f t he por t number i s i n t he r ange of 0- 255
i t can be speci f i ed as an i mmedi at e, ot her wi se t he por t number
must be speci f i ed i n DX. Val i d por t r anges on t he PC ar e 0- 1024,
t hough val ues t hr ough 65535 may be speci f i ed and r ecogni zed by
t hi r d par t y vendor s and PS/ 2' s.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

accum, i mmed8 10/ 14 5 12 14 2
accum, i mmed8 ( PM) 6/ 26 8/ 28/ 27 2
accum, DX 8/ 12 5 13 14 1
accum, DX ( PM) 7/ 27 8/ 28/ 27 1

- 386+ pr ot ect ed mode t i mi ngs depend on pr i vi l ege l evel s.

f i r st number i s t he t i mi ng i f : CPL I OPL
second number i s t he t i mi ng i f : CPL > I OPL or i n VM 86 mode ( 386)
CPL I OPL ( 486)
t hi r d number i s t he t i mi ng when: vi r t ual mode on 486 pr ocessor
- 486 vi r t ual mode al ways r equi r es 27 cycl es
INC - Increment
Usage: I NC dest
Modi f i es f l ags: AF OF PF SF ZF

Adds one t o dest i nat i on unsi gned bi nar y oper and.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 3 2 2 1 2
r eg16 3 2 2 1 1
r eg32 3 2 2 1 1
mem 15+EA 7 6 3 2- 4 ( W88=23+EA)


INS - Input String from Port (80188+)
Usage: I NS dest , por t
I NSB
I NSW
I NSD ( 386+)
Modi f i es f l ags: None

Loads dat a f r ompor t t o t he dest i nat i on ES: ( E) DI ( even i f a
dest i nat i on oper and i s suppl i ed) . ( E) DI i s adj ust ed by t he si ze
of t he oper and and i ncr eased i f t he Di r ect i on Fl ag i s cl ear ed and
decr eased i f t he Di r ect i on Fl ag i s set . For I NSB, I NSW, I NSD no
oper ands ar e al l owed and t he si ze i s det er mi ned by t he mnemoni c.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

dest , por t - 5 15 17 1
dest , por t ( PM) - 5 9/ 29 10/ 32/ 30 1
none - 5 15 17 1
none ( PM) - 5 9/ 29 10/ 32/ 30 1

- 386+ pr ot ect ed mode t i mi ngs depend on pr i vi l ege l evel s.

f i r st number i s t he t i mi ng i f : CPL I OPL
second number i s t he t i mi ng i f : CPL > I OPL
t hi r d number i s t he t i mi ng i f : vi r t ual mode on 486 pr ocessor


INT - Interrupt
Usage: I NT num
Modi f i es f l ags: TF I F

I ni t i at es a sof t war e i nt er r upt by pushi ng t he f l ags, cl ear i ng t he
Tr ap and I nt er r upt Fl ags, pushi ng CS f ol l owed by I P and l oadi ng
CS: I P wi t h t he val ue f ound i n t he i nt er r upt vect or t abl e. Execut i on
t hen begi ns at t he l ocat i on addr essed by t he new CS: I P

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

3 ( const ant ) 52/ 72 23+m 33 26 2
3 ( pr ot . mode, same pr i v. ) - 40+m 59 44 2
3 ( pr ot . mode, mor e pr i v. ) - 78+m 99 71 2
3 ( f r omVM86 t o PL 0) - - 119 82 2
3 ( pr ot . mode vi a t ask gat e) - 167+m TS 37+TS 2
i mmed8 51/ 71 23+m 37 30 1
i mmed8 ( pr ot . mode, same pr i v. ) - 40+m 59 44 1
i mmed8 ( pr ot . mode, mor e pr i v. ) - 78+m 99 71 1
i mmed8 ( f r omVM86 t o PL 0) - - 119 86 1
i mmed8 ( pr ot . mode, vi a t ask gat e) - 167+m TS 37+TS 1
INTO - Interrupt on Overflow
Usage: I NTO
Modi f i es f l ags: I F TF

I f t he Over f l ow Fl ag i s set t hi s i nst r uct i on gener at es an I NT 4
whi ch causes t he code addr essed by 0000: 0010 t o be execut ed.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none: j ump 53/ 73 24+m 35 28 1
no j ump 4 3 3 3
( pr ot . mode, same pr i v. ) - - 59 46 1
( pr ot . mode, mor e pr i v. ) - - 99 73 1
( f r omVM86 t o PL 0) - - 119 84 1
( pr ot . mode, vi a t ask gat e) - TS 39+TS 1


INVD - Invalidate Cache (486+)
Usage: I NVD
Modi f i es f l ags: none

Fl ushes CPU i nt er nal cache. I ssues speci al f unct i on bus cycl e
whi ch i ndi cat es t o f l ush ext er nal caches. Dat a i n wr i t e- back
ext er nal caches i s l ost .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - - - 4 2

INVLPG - Invalidate Translation Look-Aside Buffer Entry (486+)
Usage: I NVLPG
Modi f i es f l ags: none

I nval i dat es a si ngl e page t abl e ent r y i n t he Tr ansl at i on
Look- Asi de Buf f er . I nt el war ns t hat t hi s i nst r uct i on may be
i mpl ement ed di f f er ent l y on f ut ur e pr ocessor s.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - - - 12 2

- t i mi ng i s f or TLB ent r y hi t onl y.


IRET/IRETD - Interrupt Return
Usage: I RET
I RETD ( 386+)
Modi f i es f l ags: AF CF DF I F PF SF TF ZF

Ret ur ns cont r ol t o poi nt of i nt er r upt i on by poppi ng I P, CS
and t hen t he Fl ags f r omt he st ack and cont i nues execut i on at
t hi s l ocat i on. CPU except i on i nt er r upt s wi l l r et ur n t o t he
i nst r uct i on t hat cause t he except i on because t he CS: I P pl aced
on t he st ack dur i ng t he i nt er r upt i s t he addr ess of t he of f endi ng
i nst r uct i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

i r et 32/ 44 17+m 22 15 1
i r et ( pr ot . mode) - 31+m 38 15 1
i r et ( t o l ess pr i vi l ege) - 55+m 82 36 1
i r et ( di f f er ent t ask, NT=1) - 169+m TS TS+32 1
i r et d - - 22/ 38 15 1
i r et d ( t o l ess pr i vi l ege) - - 82 36 1
i r et d ( t o VM86 mode) - - 60 15 1
i r et d ( di f f er ent t ask, NT=1) - - TS TS+32 1

- 386 t i mi ngs ar e l i st ed as r eal - mode/ pr ot ect ed- mode
J Instructions
Jxx - Jump Instructions Table
Mnemoni c Meani ng J ump Condi t i on

J A J ump i f Above CF=0 and ZF=0
J AE J ump i f Above or Equal CF=0
J B J ump i f Bel ow CF=1
J BE J ump i f Bel ow or Equal CF=1 or ZF=1
J C J ump i f Car r y CF=1
J CXZ J ump i f CX Zer o CX=0
J E J ump i f Equal ZF=1
J G J ump i f Gr eat er ( si gned) ZF=0 and SF=OF
J GE J ump i f Gr eat er or Equal ( si gned) SF=OF
J L J ump i f Less ( si gned) SF ! = OF
J LE J ump i f Less or Equal ( si gned) ZF=1 or SF ! = OF
J MP Uncondi t i onal J ump uncondi t i onal
J NA J ump i f Not Above CF=1 or ZF=1
J NAE J ump i f Not Above or Equal CF=1
J NB J ump i f Not Bel ow CF=0
J NBE J ump i f Not Bel ow or Equal CF=0 and ZF=0
J NC J ump i f Not Car r y CF=0
J NE J ump i f Not Equal ZF=0
J NG J ump i f Not Gr eat er ( si gned) ZF=1 or SF ! = OF
J NGE J ump i f Not Gr eat er or Equal ( si gned) SF ! = OF
J NL J ump i f Not Less ( si gned) SF=OF
J NLE J ump i f Not Less or Equal ( si gned) ZF=0 and SF=OF
J NO J ump i f Not Over f l ow ( si gned) OF=0
J NP J ump i f No Par i t y PF=0
J NS J ump i f Not Si gned ( si gned) SF=0
J NZ J ump i f Not Zer o ZF=0
J O J ump i f Over f l ow ( si gned) OF=1
J P J ump i f Par i t y PF=1
J PE J ump i f Par i t y Even PF=1
J PO J ump i f Par i t y Odd PF=0
J S J ump i f Si gned ( si gned) SF=1
J Z J ump i f Zer o ZF=1

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

J x: j ump 16 7+m 7+m 3 2
no j ump 4 3 3 1
J x near - l abel - - 7+m 3 4
no j ump - - 3 1

- I t ' s a good pr ogr ammi ng pr act i ce t o or gani ze code so t he
expect ed case i s execut ed wi t hout a j ump si nce t he act ual
j ump t akes l onger t o execut e t han f al l i ng t hr ough t he t est .
- see J CXZ and J MP f or t hei r r espect i ve t i mi ngs

JCXZ/JECXZ - Jump if Register (E)CX is Zero
Usage: J CXZ l abel
J ECXZ l abel ( 386+)
Modi f i es f l ags: None

Causes execut i on t o br anch t o " l abel " i f r egi st er CX i s zer o. Uses
unsi gned compar i si on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

l abel : j ump 18 8+m 9+m 8 2
no j ump 6 4 5 5
JMP - Unconditional Jump
Usage: J MP t ar get
Modi f i es f l ags: None

Uncondi t i onal l y t r ansf er s cont r ol t o " l abel " . J umps by def aul t
ar e wi t hi n - 32768 t o 32767 byt es f r omt he i nst r uct i on f ol l owi ng
t he j ump. NEAR and SHORT j umps cause t he I P t o be updat ed whi l e FAR
j umps cause CS and I P t o be updat ed.

Cl ocks
Oper ands 808x 286 386 486

r el 8 ( r el at i ve) 15 7+m 7+m 3
r el 16 ( r el at i ve) 15 7+m 7+m 3
r el 32 ( r el at i ve) - - 7+m 3
r eg16 ( near , r egi st er i ndi r ect ) 11 7+m 7+m 5
r eg32 ( near , r egi st er i ndi r ect ) - - 7+m 5
mem16 ( near , memi ndi r ect ) 18+EA 11+m 10+m 5
mem32 ( near , memi ndi r ect ) 24+EA 15+m 10+m 5
pt r 16: 16 ( f ar , dwor d i mmed) - - 12+m 17
pt r 16: 16 ( f ar , PM dwor d i mmed) - - 27+m 19
pt r 16: 16 ( cal l gat e, same pr i v. ) - 38+m 45+m 32
pt r 16: 16 ( vi a TSS) - 175+m TS 42+TS
pt r 16: 16 ( vi a t ask gat e) - 180+m TS 43+TS
mem16: 16 ( f ar , i ndi r ect ) - - 43+m 13
mem16: 16 ( f ar , PM i ndi r ect ) - - 31+m 18
mem16: 16 ( cal l gat e, same pr i v. ) - 41+m 49+m 31
mem16: 16 ( vi a TSS) - 178+m 5+TS 41+TS
mem16: 16 ( vi a t ask gat e) - 183+m 5+TS 42+TS
pt r 16: 32 ( f ar , 6 byt e i mmed) - - 12+m 13
pt r 16: 32 ( f ar , PM 6 byt e i mmed) - - 27+m 18
pt r 16: 32 ( cal l gat e, same pr i v. ) - - 45+m 31
pt r 16: 32 ( vi a TSS) - - TS 42+TS
pt r 16: 32 ( vi a t ask st at e) - - TS 43+TS
m16: 32 ( f ar , addr ess at dwor d) - - 43+m 13
m16: 32 ( f ar , addr ess at dwor d) - - 31+m 18
m16: 32 ( cal l gat e, same pr i v. ) - - 49+m 31
m16: 32 ( vi a TSS) - - 5+TS 41+TS
m16: 32 ( vi a t ask st at e) - - 5+TS 42+TS

L Instructions
LAHF - Load Register AH From Flags
Usage: LAHF

Modi f i es Fl ags: None

Copi es bi t s 0- 7 of t he f l ags r egi st er i nt o AH.
Thi s i ncl udes f l ags AF, CF, PF, SF and ZF ot her bi t s
ar e undef i ned.

AH : = SF ZF xx AF xx PF xx CF
Timing:
Clocks
operands
286 386 486 Size in Bytes
none 2 2 3 1
LAR - Load Access Rights (286+ protected)
Usage: LAR dest , sr c

Modi f i es Fl ags: ZF

The hi gh byt e of t he of t he dest i nat i on r egi st er i s over wr i t t en
by t he val ue of t he access r i ght s byt e and t he l ow or der byt e
i s zer oed dependi ng on t he sel ect i on i n t he sour ce oper and.
The Zer o Fl ag i s set i f t he l oad oper at i on i s successf ul .
Timing:
Clocks operands 286 386 486 Size Bytes
reg16,reg16 14 15 11 3
reg32,reg32 15 11 3
reg16,mem16 16 16 11 3-7
reg32,mem32 16 11 3-7
LEA - Load Effective Address
Usage: LEA dest , sr c

Modi f i es Fl ags: None

Tr ansf er s of f set addr ess of " sr c" t o t he dest i nat i on r egi st er .

Timing:
Clocks operands 286 386 486 Size Bytes
reg,mem 3 2 1 2-4
LEAVE - Restore Stack for Procedure Exit (80188+)
Usage: LEAVE

Modi f i es Fl ags: LEAVE

Rel eases t he l ocal var i abl es cr eat ed by t he pr evi ous ENTER
i nst r uct i on by r est or i ng SP and BP t o t hei r condi t i on bef or e
t he pr ocedur e st ack f r ame was i ni t i al i zed.

Timing:
Clocks operands 286 386 486 Size Bytes
none 5 4 5 1
LES - Load Pointer Using ES
Usage: LES dest , sr c

Modi f i es Fl ags: None

Loads 32- bi t poi nt er f r ommemor y sour ce t o dest i nat i on
r egi st er and ES. The of f set i s pl aced i n t he dest i nat i on
r egi st er and t he segment i s pl aced i n ES. To use t hi s
i nst r uct i on t he wor d at t he l ower memor y addr ess must
cont ai n t he of f set and t he wor d at t he hi gher addr ess
must cont ai n t he segment . Thi s si mpl i f i es t he l oadi ng
of f ar poi nt er s f r omt he st ack and t he i nt er r upt vect or t abl e.

Timing:
Clocks operands 286 386 486 Size Bytes
reg,mem 7 7 6 2-4
reg,mem (PM) 22 12 5-7
LFS - Load Pointer Using FS
Usage: LFS dest , sr c

Modi f i es Fl ags: None

Loads 32- bi t poi nt er f r ommemor y sour ce t o dest i nat i on
r egi st er and FS. The of f set i s pl aced i n t he dest i nat i on
r egi st er and t he segment i s pl aced i n FS. To use t hi s
i nst r uct i on t he wor d at t he l ower memor y addr ess must
cont ai n t he of f set and t he wor d at t he hi gher addr ess must
cont ai n t he segment . Thi s si mpl i f i es t he l oadi ng of f ar poi nt er s
f r omt he st ack and t he i nt er r upt vect or t abl e.

Timing:
Clocks operands 286 386 486 Size Bytes
reg,mem 7 6 5-7
reg,mem (PM) 22 12 5-7
LGDT - Load Global Descriptor Table (286+ privileged)
Usage: LGDT sr c

Modi f i es Fl ags: None

Loads a val ue f r oman oper and i nt o t he Gl obal Descr i pt or Tabl e
( GDT) r egi st er .

Timing:
Clocks operands 286 386 486 Size Bytes
mem64 11 11 11 5
LGS - Load Pointer Using GS (386+)
Usage: LGS dest , sr c

Modi f i es Fl ags: None

Loads 32- bi t poi nt er f r ommemor y sour ce t o dest i nat i on
r egi st er and GS. The of f set i s pl aced i n t he dest i nat i on
r egi st er and t he segment i s pl aced i n GS. To use t hi s
i nst r uct i on t he wor d at t he l ower memor y addr ess must
cont ai n t he of f set and t he wor d at t he hi gher addr ess must
cont ai n t he segment . Thi s si mpl i f i es t he l oadi ng of f ar poi nt er s
f r omt he st ack and t he i nt er r upt vect or t abl e.
Timing:
Clocks operands 286 386 486 Size Bytes
reg,mem 7 6 5-7
reg,mem (PM) 22 12 5-7
LIDT - Load Interrupt Descriptor Table (286+ privileged)
Usage: LI DT sr c

Modi f i es Fl ags: None

Loads a val ue f r oman oper and i nt o t he I nt er r upt Descr i pt or
Tabl e ( I DT) r egi st er .

Timing:
Clocks operands 286 386 486 Size Bytes
mem64 12 11 11 5
LLDT - Load Local Descriptor Table (286+ privileged)
Usage: LLDT sr c

Modi f i es Fl ags: None

Loads a val ue f r oman oper and i nt o t he Local Descr i pt or Tabl e
Regi st er ( LDTR) .

Timing:
Clocks operands 286 386 486 Size Bytes
reg16 17 20 11 3
mem16 19 24 11 5
LMSW - Load Machine Status Word (286+ privileged)
Usage: LMSWsr c

Modi f i es Fl ags: None

Loads t he Machi ne St at us Wor d ( MSW) f r omdat a f ound at
" sr c" .

Timing:
Clocks operands 286 386 486 Size Bytes
reg16 3 10 13 3
mem16 6 13 13 5
LOCK - Lock Bus
Usage: LOCK
LOCK: ( 386+ pr ef i x)

Modi f i es Fl ags: None

Thi s i nst r uct i on i s a pr ef i x t hat causes t he CPU asser t bus l ock
si gnal dur i ng t he execut i on of t he next i nst r uct i on. Used t o
avoi d t wo pr ocessor s f r omupdat i ng t he same dat a l ocat i on.
The 286 al ways asser t s l ock dur i ng an XCHG wi t h memor y
oper ands. Thi s shoul d onl y be used t o l ock t he bus pr i or t o
XCHG, MOV, I N and OUT i nst r uct i ons.

Timing:
Clocks operands 286 386 486 Size Bytes
none 0 0 1 1
LODS - Load String (Byte, Word or Double)
Usage: LODS sr c
LODSB
LODSW
LODSD ( 386+)

Modi f i es Fl ags: None

Tr ansf er s st r i ng el ement addr essed by DS: SI ( even i f
an oper and i s suppl i ed) t o t he accumul at or . SI i s i ncr ement ed
based on t he si ze of t he oper and or based on t he i nst r uct i on
used. I f t he Di r ect i on Fl ag i s set SI i s decr ement ed, i f
t he Di r ect i on Fl ag i s cl ear SI i s i ncr ement ed. Use wi t h REP
pr ef i xes.

Timing:
Clocks operands 286 386 486 Size Bytes
src 5 5 5 1
LOOP - Decrement CX and Loop if CX Not Zero
Usage: LOOP l abel

Modi f i es Fl ags: None

Decr ement s CX by 1 and t r ansf er s cont r ol t o " l abel " i f CX
i s not Zer o. The " l abel " oper and must be wi t hi n - 128 or 127
byt es of t he i nst r uct i on f ol l owi ng t he l oop i nst r uct i on

Timing:
Clocks operands 286 386 486 Size Bytes
label: jump 8+m 11+m 6 2
no jump 4 ? 2 2
LOOPE/LOOPZ - Loop While Equal / Loop While Zero
Usage: LOOPE l abel
LOOPZ l abel

Modi f i es Fl ags: None

Decr ement s CX by 1 ( wi t hout modi f yi ng t he f l ags) and
t r ansf er s cont r ol t o " l abel " i f CX ! = 0 and t he Zer o Fl ag i s set .
The " l abel " oper and must be wi t hi n - 128 or 127 byt es of
t he i nst r uct i on f ol l owi ng t he l oop i nst r uct i on.

Timing:
Clocks operands 286 386 486 Size Bytes
label: jump 8+m 11+m 9 2
no jump 4 ? 6 2
LOOPNE/LOOPNZ - Loop While Not Equal / Loop While Not Zero
Usage: LOOPNZ l abel
LOOPNE l abel

Modi f i es Fl ags: None

Decr ement s CX by 1 ( wi t hout modi f yi ng t he f l ags) and
t r ansf er s cont r ol t o " l abel " i f CX ! = 0 and t he Zer o Fl ag
i s cl ear . The " l abel " oper and must be wi t hi n - 128 or 127
byt es of t he i nst r uct i on f ol l owi ng t he l oop i nst r uct i on.

Timing:
Clocks operands 286 386 486 Size Bytes
label: jump 8+m 11+m 9 2
no jump 4 ? 6 2
LSL - Load Segment Limit (286+ protected)
Usage: LSL dest , sr c

Modi f i es Fl ags: ZF

Loads t he segment l i mi t of a sel ect or i nt o t he dest i nat i on
r egi st er i f t he sel ect or i s val i d and vi si bl e at t he cur r ent
pr i vi l ege l evel . I f l oadi ng i s successf ul t he Zer o Fl ag i s set ,
ot her wi se i t i s cl ear ed.

Timing:
Clocks operands 286 386 486 Size Bytes
386 times are listed "byte granular" / "page granular"
reg16,reg16 14 20/25 10 3
reg32,reg32 20/25 10 3
reg16,mem16 16 21/26 10 5
reg32,mem32 21/26 10 5
LSS - Load Pointer Using SS (386+)
Usage: LSS dest , sr c

Modi f i es Fl ags: None

Loads 32- bi t poi nt er f r ommemor y sour ce t o dest i nat i on
r egi st er and SS. The of f set i s pl aced i n t he dest i nat i on
r egi st er and t he segment i s pl aced i n SS. To use t hi s
i nst r uct i on t he wor d at t he l ower memor y addr ess must
cont ai n t he of f set and t he wor d at t he hi gher addr ess must
cont ai n t he segment . Thi s si mpl i f i es t he l oadi ng of f ar poi nt er s
f r omt he st ack and t he i nt er r upt vect or t abl e.

Timing:
Clocks operands 286 386 486 Size Bytes
reg,mem 7 6 5-7
reg,mem (PM) 22 12 5-7
LTR - Load Task Register (286+ privileged)
Usage: LTR sr c

Modi f i es Fl ags: None

Loads t he cur r ent t ask r egi st er wi t h t he val ue speci f i ed i n " sr c" .

Timing:
Clocks operands 286 386 486 Size Bytes
reg16 17 23 20 3
mem16 19 27 20 5
M Instructions
MOV - Move Byte or Word
Usage: MOV dest , sr c
Modi f i es f l ags: None

Copi es byt e or wor d f r omt he sour ce oper and t o t he dest i nat i on
oper and. I f t he dest i nat i on i s SS i nt er r upt s ar e di sabl ed except
on ear l y buggy 808x CPUs. Some CPUs di sabl e i nt er r upt s i f t he
dest i nat i on i s any of t he segment r egi st er s

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 2 2 2 1 2
mem, r eg 9+EA 3 2 1 2- 4 ( W88=13+EA)
r eg, mem 8+EA 5 4 1 2- 4 ( W88=12+EA)
mem, i mmed 10+EA 3 2 1 3- 6 ( W88=14+EA)
r eg, i mmed 4 2 2 1 2- 3
mem, accum 10 3 2 1 3 ( W88=14)
accum, mem 10 5 4 1 3 ( W88=14)
segr eg, r eg16 2 2 2 3 2
segr eg, mem16 8+EA 5 5 9 2- 4 ( W88=12+EA)
r eg16, segr eg 2 2 2 3 2
mem16, segr eg 9+EA 3 2 3 2- 4 ( W88=13+EA)
r eg32, CR0/ CR2/ CR3 - - 6 4
CR0, r eg32 - - 10 16
CR2, r eg32 - - 4 4 3
CR3, r eg32 - - 5 4 3
r eg32, DR0/ DR1/ DR2/ DR3 - 22 10 3
r eg32, DR6/ DR7 - - 22 10 3
DR0/ DR1/ DR2/ DR3, r eg32 - 22 11 3
DR6/ DR7, r eg32 - - 16 11 3
r eg32, TR6/ TR7 - - 12 4 3
TR6/ TR7, r eg32 - - 12 4 3
r eg32, TR3 3
TR3, r eg32 6

- when t he 386 speci al r egi st er s ar e used al l oper ands ar e 32 bi t s
MOVS - Move String (Byte or Word)
Usage: MOVS dest , sr c
MOVSB
MOVSW
MOVSD ( 386+)
Modi f i es f l ags: None

Copi es dat a f r omaddr essed by DS: SI ( even i f oper ands ar e gi ven) t o
t he l ocat i on ES: DI dest i nat i on and updat es SI and DI based on t he
si ze of t he oper and or i nst r uct i on used. SI and DI ar e i ncr ement ed
when t he Di r ect i on Fl ag i s cl ear ed and decr ement ed when t he Di r ect i on
Fl ag i s Set . Use wi t h REP pr ef i xes.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

dest , sr c 18 5 7 7 1 ( W88=26)
MOVSX - Move with Sign Extend (386+)
Usage: MOVSX dest , sr c
Modi f i es f l ags: None

Copi es t he val ue of t he sour ce oper and t o t he dest i nat i on r egi st er
wi t h t he si gn ext ended.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg - - 3 3 3
r eg, mem - - 6 3 3- 7
MOVZX - Move with Zero Extend (386+)
Usage: MOVZX dest , sr c
Modi f i es f l ags: None

Copi es t he val ue of t he sour ce oper and t o t he dest i nat i on r egi st er
wi t h t he zer oes ext ended.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg - - 3 3 3
r eg, mem - - 6 3 3- 7
MUL - Unsigned Multiply
Usage: MUL sr c
Modi f i es f l ags: CF OF ( AF, PF, SF, ZF undef i ned)

Unsi gned mul t i pl y of t he accumul at or by t he sour ce. I f " sr c" i s
a byt e val ue, t hen AL i s used as t he ot her mul t i pl i cand and t he
r esul t i s pl aced i n AX. I f " sr c" i s a wor d val ue, t hen AX i s
mul t i pl i ed by " sr c" and DX: AX r ecei ves t he r esul t . I f " sr c" i s
a doubl e wor d val ue, t hen EAX i s mul t i pl i ed by " sr c" and EDX: EAX
r ecei ves t he r esul t . The 386+ uses an ear l y out al gor i t hmwhi ch
makes mul t i pl yi ng any si ze val ue i n EAX as f ast as i n t he 8 or 16
bi t r egi st er s.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 70- 77 13 9- 14 13- 18 2
r eg16 118- 113 21 9- 22 13- 26 2
r eg32 - - 9- 38 13- 42 2- 4
mem8 ( 76- 83) +EA 16 12- 17 13- 18 2- 4
mem16 ( 124- 139) +EA 24 12- 25 13- 26 2- 4
mem32 - - 12- 21 13- 42 2- 4
N Instructions
NEG - Two's Complement Negation
Usage: NEG dest
Modi f i es f l ags: AF CF OF PF SF ZF

Subt r act s t he dest i nat i on f r om0 and saves t he 2s compl ement of
" dest " back i nt o " dest " .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg 3 2 2 1 2
mem 16+EA 7 6 3 2- 4 ( W88=24+EA)


NOP - No Operation (90h)
Usage: NOP
Modi f i es f l ags: None

Thi s i s a do not hi ng i nst r uct i on. I t r esul t s i n occupat i on of bot h
space and t i me and i s most usef ul f or pat chi ng code segment s.
( Thi s i s t he or i gi nal XCHG AL, AL i nst r uct i on)

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 3 3 3 1 1

NOT - One's Compliment Negation (Logical NOT)
Usage: NOT dest
Modi f i es f l ags: None

I nver t s t he bi t s of t he " dest " oper and f or mi ng t he 1s compl ement .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg 3 2 2 1 2
mem 16+EA 7 6 3 2- 4 ( W88=24+EA)


O Instructions
OR - Inclusive Logical OR
Usage: OR dest , sr c
Modi f i es f l ags: CF OF PF SF ZF ( AF undef i ned)

Logi cal i ncl usi ve OR of t he t wo oper ands r et ur ni ng t he r esul t i n
t he dest i nat i on. Any bi t set i n ei t her oper and wi l l be set i n t he
dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 16+EA 7 7 3 2- 4 ( W88=24+EA)
r eg, mem 9+EA 7 6 2 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem8, i mmed8 17+EA 7 7 3 3- 6
mem16, i mmed16 25+EA 7 7 3 3- 6
accum, i mmed 4 3 2 1 2- 3

OUT - Output Data to Port
Usage: OUT por t , accum
Modi f i es f l ags: None

Tr ansf er s byt e i n AL, wor d i n AX or dwor d i n EAX t o t he speci f i ed
har dwar e por t addr ess. I f t he por t number i s i n t he r ange of 0- 255
i t can be speci f i ed as an i mmedi at e. I f gr eat er t han 255 t hen t he
por t number must be speci f i ed i n DX. Si nce t he PC onl y decodes 10
bi t s of t he por t addr ess, val ues over 1023 can onl y be decoded by
t hi r d par t y vendor equi pment and al so map t o t he por t r ange 0- 1023.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

i mmed8, accum 10/ 14 3 10 16 2
i mmed8, accum( PM) - - 4/ 24 11/ 31/ 29 2
DX, accum 8/ 12 3 11 16 1
DX, accum( PM) - - 5/ 25 10/ 30/ 29 1

- 386+ pr ot ect ed mode t i mi ngs depend on pr i vi l ege l evel s.

f i r st number i s t he t i mi ng when: CPL I OPL
second number i s t he t i mi ng when: CPL > I OPL
t hi r d number i s t he t i mi ng when: vi r t ual mode on 486 pr ocessor



OUTS - Output String to Port (80188+)
Usage: OUTS por t , sr c
OUTSB
OUTSW
OUTSD ( 386+)
Modi f i es f l ags: None

Tr ansf er s a byt e, wor d or doubl ewor d f r om" sr c" t o t he har dwar e
por t speci f i ed i n DX. For i nst r uct i ons wi t h no oper ands t he " sr c"
i s l ocat ed at DS: SI and SI i s i ncr ement ed or decr ement ed by t he
si ze of t he oper and or t he si ze di ct at ed by t he i nst r uct i on f or mat .
When t he Di r ect i on Fl ag i s set SI i s decr ement ed, when cl ear , SI i s
i ncr ement ed. I f t he por t number i s i n t he r ange of 0- 255 i t can
be speci f i ed as an i mmedi at e. I f gr eat er t han 255 t hen t he por t
number must be speci f i ed i n DX. Si nce t he PC onl y decodes 10 bi t s
of t he por t addr ess, val ues over 1023 can onl y be decoded by t hi r d
par t y vendor equi pment and al so map t o t he por t r ange 0- 1023.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

por t , sr c - 5 14 17 1
por t , sr c ( PM) - - 8/ 28 10/ 32/ 30 1

- 386+ pr ot ect ed mode t i mi ngs depend on pr i vi l ege l evel s.

f i r st number i s t he t i mi ng when: CPL I OPL
second number i s t he t i mi ng when: CPL > I OPL
t hi r d number i s t he t i mi ng when: vi r t ual mode on 486 pr ocessor


P Instructions
POP - Pop Word off Stack
Usage: POP dest
Modi f i es f l ags: None

Tr ansf er s wor d at t he cur r ent st ack t op ( SS: SP) t o t he dest i nat i on
t hen i ncr ement s SP by t wo t o poi nt t o t he new st ack t op. CS i s not
a val i d dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16 8 5 4 4 1
r eg32 4 - - 4 1
segr eg 8 5 7 3 1
mem16 17+EA 5 5 6 2- 4
mem32 5 - - 6 2- 4

POPA/POPAD - Pop All Registers onto Stack (80188+)
Usage: POPA
POPAD ( 386+)
Modi f i es f l ags: None

Pops t he t op 8 wor ds of f t he st ack i nt o t he 8 gener al pur pose 16/ 32
bi t r egi st er s. Regi st er s ar e popped i n t he f ol l owi ng or der : ( E) DI ,
( E) SI , ( E) BP, ( E) SP, ( E) DX, ( E) CX and ( E) AX. The ( E) SP val ue popped
f r omt he st ack i s act ual l y di scar ded.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - 19 24 9 1


POPF/POPFD - Pop Flags off Stack
Usage: POPF
POPFD ( 386+)
Modi f i es f l ags: al l f l ags

Pops wor d/ doubl ewor d f r omst ack i nt o t he Fl ags Regi st er and t hen
i ncr ement s SP by 2 ( f or POPF) or 4 ( f or POPFD) .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 8/ 12 5 5 9 1 ( W88=12)
none ( PM) - - 5 6 1

PUSH - Push Word onto Stack
Usage: PUSH sr c
PUSH i mmed ( 80188+ onl y)
Modi f i es f l ags: None

Decr ement s SP by t he si ze of t he oper and ( t wo or f our , byt e val ues
ar e si gn ext ended) and t r ansf er s one wor d f r omsour ce t o t he st ack
t op ( SS: SP) .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16 11/ 15 3 2 1 1
r eg32 - - 2 1 1
mem16 16+EA 5 5 4 2- 4 ( W88=24+EA)
mem32 - - 5 4 2- 4
segr eg 10/ 14 3 2 3 1
i mmed - 3 2 1 2- 3



PUSHA/PUSHAD - Push All Registers onto Stack (80188+)
Usage: PUSHA
PUSHAD ( 386+)
Modi f i es f l ags: None

Pushes al l gener al pur pose r egi st er s ont o t he st ack i n t he f ol l owi ng
or der : ( E) AX, ( E) CX, ( E) DX, ( E) BX, ( E) SP, ( E) BP, ( E) SI , ( E) DI . The
val ue of SP i s t he val ue bef or e t he act ual push of SP.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - 19 24 11 1

PUSHF/PUSHFD - Push Flags onto Stack
Usage: PUSHF
PUSHFD ( 386+)
Modi f i es f l ags: None

Tr ansf er s t he Fl ags Regi st er ont o t he st ack. PUSHF saves a 16 bi t
val ue whi l e PUSHFD saves a 32 bi t val ue.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 10/ 14 3 4 4 1
none ( PM) - - 4 3 1


R Instructions
RCL - Rotate Through Carry Left
Usage: RCL dest , count
Modi f i es f l ags: CF OF

+- - - - - +- - - - - - - - - - - - - - - - - - - - - - - +
+- - - | C | 7 <- - - - - - - - - - - - - - - - 0 | <- - +
| +- - - - - +- - - - - - - - - - - - - - - - - - - - - - - + |
| |
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

Rot at es t he bi t s i n t he dest i nat i on t o t he l ef t " count " t i mes wi t h
al l dat a pushed out t he l ef t si de r e- ent er i ng on t he r i ght . The
Car r y Fl ag hol ds t he l ast bi t r ot at ed out .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, 1 2 2 9 3 2
mem, 1 15+EA 7 10 4 2- 4 ( W88=23+EA)
r eg, CL 8+4n 5+n 9 8- 30 2
mem, CL 20+EA+4n 8+n 10 9- 31 2- 4 ( W88=28+EA+4n)
r eg, i mmed8 - 5+n 9 8- 30 3
mem, i mmed8 - 8+n 10 9- 31 3- 5

RCR - Rotate Through Carry Right
Usage: RCR dest , count
Modi f i es f l ags: CF OF

+- - - - - - - - - - - - - - - - - - - - - - - +- - - - - +
+- - >| 7 - - - - - - - - - - - - - - - - > 0 | C | - - - +
| +- - - - - - - - - - - - - - - - - - - - - - - +- - - - - + |
| |
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

Rot at es t he bi t s i n t he dest i nat i on t o t he r i ght " count " t i mes wi t h
al l dat a pushed out t he r i ght si de r e- ent er i ng on t he l ef t . The
Car r y Fl ag hol ds t he l ast bi t r ot at ed out .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, 1 2 2 9 3 2
mem, 1 15+EA 7 10 4 2- 4 ( W88=23+EA)
r eg, CL 8+4n 5+n 9 8- 30 2
mem, CL 20+EA+4n 8+n 10 9- 31 2- 4 ( W88=28+EA+4n)
r eg, i mmed8 - 5+n 9 8- 30 3
mem, i mmed8 - 8+n 10 9- 31 3- 5
REP - Repeat String Operation
Usage: REP
Modi f i es f l ags: None

Repeat s execut i on of st r i ng i nst r uct i ons whi l e CX ! = 0. Af t er
each st r i ng oper at i on, CX i s decr ement ed and t he Zer o Fl ag i s
t est ed. The combi nat i on of a r epeat pr ef i x and a segment over r i de
on CPU' s bef or e t he 386 may r esul t i n er r or s i f an i nt er r upt occur s
bef or e CX=0. The f ol l owi ng code shows code t hat i s suscept i bl e t o
t hi s and how t o avoi d i t :

agai n: r ep movs byt e pt r ES: [ DI ] , ES: [ SI ] ; vul ner abl e i nst r .
j cxz next ; cont i nue i f REP successf ul
l oop agai n ; i nt er r upt goof ed count
next :

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 1


REPE/REPZ - Repeat Equal / Repeat Zero
Usage: REPE
REPZ
Modi f i es f l ags: None

Repeat s execut i on of st r i ng i nst r uct i ons whi l e CX ! = 0 and t he Zer o
Fl ag i s set . CX i s decr ement ed and t he Zer o Fl ag t est ed af t er
each st r i ng oper at i on. The combi nat i on of a r epeat pr ef i x and a
segment over r i de on pr ocessor s ot her t han t he 386 may r esul t i n
er r or s i f an i nt er r upt occur s bef or e CX=0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 1


REPNE/REPNZ - Repeat Not Equal / Repeat Not Zero
Usage: REPNE
REPNZ
Modi f i es f l ags: None

Repeat s execut i on of st r i ng i nst r uct i ons whi l e CX ! = 0 and t he Zer o
Fl ag i s cl ear . CX i s decr ement ed and t he Zer o Fl ag t est ed af t er
each st r i ng oper at i on. The combi nat i on of a r epeat pr ef i x and a
segment over r i de on pr ocessor s ot her t han t he 386 may r esul t i n
er r or s i f an i nt er r upt occur s bef or e CX=0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 1
RET/RETF - Return From Procedure
Usage: RET nByt es
RETF nByt es
RETN nByt es
Modi f i es f l ags: None

Tr ansf er s cont r ol f r oma pr ocedur e back t o t he i nst r uct i on addr ess
saved on t he st ack. " n byt es" i s an opt i onal number of byt es t o
r el ease. Far r et ur ns pop t he I P f ol l owed by t he CS, whi l e near
r et ur ns pop onl y t he I P r egi st er .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r et n 16/ 20 11+m 10+m 5 1
r et n i mmed 20/ 24 11+m 10+m 5 3
r et f 26/ 34 15+m 18+m 13 1
r et f ( PM, same pr i v. ) - 32+m 18 1
r et f ( PM, l esser pr i v. ) - 68 33 1
r et f i mmed 25/ 33 15+m 18+m 14 3
r et f i mmed ( PM, same pr i v. ) 32+m 17 1
r et f i mmed ( PM, l esser pr i v. ) 68 33 1


ROL - Rotate Left
Usage: ROL dest , count
Modi f i es f l ags: CF OF

+- - - + +- - - - - - - - - - - - - - - - - - - - - - - +
| C | <- - - +- - | 7 <- - - - - - - - - - - - - - - - 0 | <- - +
+- - - + | +- - - - - - - - - - - - - - - - - - - - - - - + |
| |
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

Rot at es t he bi t s i n t he dest i nat i on t o t he l ef t " count " t i mes wi t h
al l dat a pushed out t he l ef t si de r e- ent er i ng on t he r i ght . The
Car r y Fl ag wi l l cont ai n t he val ue of t he l ast bi t r ot at ed out .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, 1 2 2 3 3 2
mem, 1 15+EA 7 7 4 2- 4 ( W88=23+EA)
r eg, CL 8+4n 5+n 3 3 2
mem, CL 20+EA+4n 8+n 7 4 2- 4 ( W88=28+EA+4n)
r eg, i mmed8 - 5+n 3 2 3
mem, i mmed8 - 8+n 7 4 3- 5


ROR - Rotate Right
Usage: ROR dest , count
Modi f i es f l ags: CF OF

+- - - - - - - - - - - - - - - - - - - - - - - + +- - - +
+- - >| 7 - - - - - - - - - - - - - - - - > 0 | - - - +- - - >| C |
| +- - - - - - - - - - - - - - - - - - - - - - - + | +- - - +
| |
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

Rot at es t he bi t s i n t he dest i nat i on t o t he r i ght " count " t i mes wi t h
al l dat a pushed out t he r i ght si de r e- ent er i ng on t he l ef t . The
Car r y Fl ag wi l l cont ai n t he val ue of t he l ast bi t r ot at ed out .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, 1 2 2 3 3 2
mem, 1 15+EA 7 7 4 2- 4 ( W88=23+EA)
r eg, CL 8+4n 5+n 3 3 2
mem, CL 20+EA+4n 8+n 7 4 2- 4 ( W88=28+EA+4n)
r eg, i mmed8 - 5+n 3 2 3
mem, i mmed8 - 8+n 7 4 3- 5
S Instructions
SAHF - Store AH Register into FLAGS
Usage: SAHF
Modi f i es f l ags: AF CF PF SF ZF

Tr ansf er s bi t s 0- 7 of AH i nt o t he Fl ags Regi st er . Thi s i ncl udes
AF, CF, PF, SF and ZF.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 4 2 3 2 1

SAL/SHL - Shift Arithmetic Left / Shift Logical Left
Usage: SAL dest , count
SHL dest , count
Modi f i es f l ags: CF OF PF SF ZF ( AF undef i ned)

+- - - + +- - - - - - - - - - - - - - - - - - - - - - - +
| C | <- - | 7 <- - - - - - - - - - - - - - - - 0 | <- - 0
+- - - + +- - - - - - - - - - - - - - - - - - - - - - - +

Shi f t s t he dest i nat i on l ef t by " count " bi t s wi t h zer oes shi f t ed
i n on r i ght . The Car r y Fl ag cont ai ns t he l ast bi t shi f t ed out .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, 1 2 2 3 3 2
mem, 1 15+EA 7 7 4 2- 4 ( W88=23+EA)
r eg, CL 8+4n 5+n 3 3 2
mem, CL 20+EA+4n 8+n 7 4 2- 4 ( W88=28+EA+4n)
r eg, i mmed8 - 5+n 3 2 3
mem, i mmed8 - 8+n 7 4 3- 5

SAR - Shift Arithmetic Right
Usage: SAR dest , count
Modi f i es f l ags: CF OF PF SF ZF ( AF undef i ned)

+- - - - - - - - - - - - - - - - - - - - - - - + +- - - +
+- - >| 7 - - - - - - - - - - - - - - - - > 0 | - - >| C |
| +- - - - - - - - - - - - - - - - - - - - - - - + +- - - +
| |
+- - - - - +

Shi f t s t he dest i nat i on r i ght by " count " bi t s wi t h t he cur r ent si gn
bi t r epl i cat ed i n t he l ef t most bi t . The Car r y Fl ag cont ai ns t he
l ast bi t shi f t ed out .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, 1 2 2 3 3 2
mem, 1 15+EA 7 7 4 2- 4 ( W88=23+EA)
r eg, CL 8+4n 5+n 3 3 2
mem, CL 20+EA+4n 8+n 7 4 2- 4 ( W88=28+EA+4n)
r eg, i mmed8 - 5+n 3 2 3
mem, i mmed8 - 8+n 7 4 3- 5
SBB - Subtract with Borrow/Carry
Usage: SBB dest , sr c
Modi f i es f l ags: AF CF OF PF SF ZF

Subt r act s t he sour ce f r omt he dest i nat i on, and subt r act s 1 ext r a i f
t he Car r y Fl ag i s set . Resul t s ar e r et ur ned i n " dest " .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 16+EA 7 6 3 2- 4 ( W88=24+EA)
r eg, mem 9+EA 7 7 2 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem, i mmed 17+EA 7 7 3 3- 6 ( W88=25+EA)
accum, i mmed 4 3 2 1 2- 3


SCAS - Scan String (Byte, Word or Doubleword)
Usage: SCAS st r i ng
SCASB
SCASW
SCASD ( 386+)
Modi f i es f l ags: AF CF OF PF SF ZF

Compar es val ue at ES: DI ( even i f oper and i s speci f i ed) f r omt he
accumul at or and set s t he f l ags si mi l ar t o a subt r act i on. DI i s
i ncr ement ed/ decr ement ed based on t he i nst r uct i on f or mat ( or
oper and si ze) and t he st at e of t he Di r ect i on Fl ag. Use wi t h REP
pr ef i xes.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

st r i ng 15 7 7 6 1 ( W88=19)


SETAE/SETNB - Set if Above or Equal / Set if Not Below (386+)
Usage: SETAE dest
SETNB dest
( unsi gned, 386+)
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Car r y Fl ag i s cl ear
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETB/SETNAE - Set if Below / Set if Not Above or Equal (386+)
Usage: SETB dest
SETNAE dest
( unsi gned, 386+)
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Car r y Fl ag i s set
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3
SETBE/SETNA - Set if Below or Equal / Set if Not Above (386+)
Usage: SETBE dest
SETNA dest
( unsi gned, 386+)
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Car r y Fl ag or t he Zer o
Fl ag i s set , ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETE/SETZ - Set if Equal / Set if Zero (386+)
Usage: SETE dest
SETZ dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Zer o Fl ag i s set ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETNE/SETNZ - Set if Not Equal / Set if Not Zero (386+)
Usage: SETNE dest
SETNZ dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Zer o Fl ag i s cl ear ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETL/SETNGE - Set if Less / Set if Not Greater or Equal (386+)
Usage: SETL dest
SETNGE dest
( si gned, 386+)
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Si gn Fl ag i s not equal
t o t he Over f l ow Fl ag, ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3
SETGE/SETNL - Set if Greater or Equal / Set if Not Less (386+)
Usage: SETGE dest
SETNL dest
( si gned, 386+)
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Si gn Fl ag equal s t he
Over f l ow Fl ag, ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETLE/SETNG - Set if Less or Equal / Set if Not greater or Equal (386+)
Usage: SETLE dest
SETNG dest
( si gned, 386+)
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Zer o Fl ag i s set or t he
Si gn Fl ag i s not equal t o t he Over f l ow Fl ag, ot her wi se set s t he
oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETG/SETNLE - Set if Greater / Set if Not Less or Equal (386+)
Usage: SETG dest
SETNLE dest
( si gned, 386+)
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Zer o Fl ag i s cl ear or t he
Si gn Fl ag equal s t o t he Over f l ow Fl ag, ot her wi se set s t he oper and
t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETS - Set if Signed (386+)
Usage: SETS dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Si gn Fl ag i s set , ot her wi se
set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3
SETNS - Set if Not Signed (386+)
Usage: SETNS dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Si gn Fl ag i s cl ear ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3

SETC - Set if Carry (386+)
Usage: SETC dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Car r y Fl ag i s set ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETNC - Set if Not Carry (386+)
Usage: SETNC dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Car r y Fl ag i s cl ear ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETO - Set if Overflow (386+)
Usage: SETO dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Over f l ow Fl ag i s set ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETNO - Set if Not Overflow (386+)
Usage: SETNO dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Over f l ow Fl ag i s cl ear ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3
SETP/SETPE - Set if Parity / Set if Parity Even (386+)
Usage: SETP dest
SETPE dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Par i t y Fl ag i s set ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SETNP/SETPO - Set if No Parity / Set if Parity Odd (386+)
Usage: SETNP dest
SETPO dest
Modi f i es f l ags: none

Set s t he byt e i n t he oper and t o 1 i f t he Par i t y Fl ag i s cl ear ,
ot her wi se set s t he oper and t o 0.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg8 - - 4 3 3
mem8 - - 5 4 3


SGDT - Store Global Descriptor Table (286+ privileged)
Usage: SGDT dest
Modi f i es f l ags: none

St or es t he Gl obal Descr i pt or Tabl e ( GDT) Regi st er i nt o t he
speci f i ed oper and.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

mem64 - 11 9 10 5


SIDT - Store Interrupt Descriptor Table (286+ privileged)
Usage: SI DT dest
Modi f i es f l ags: none

St or es t he I nt er r upt Descr i pt or Tabl e ( I DT) Regi st er i nt o t he
speci f i ed oper and.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

mem64 - 12 9 10 5


SHL - Shift Logical Left
See: SAL
SHR - Shift Logical Right
Usage: SHR dest , count
Modi f i es f l ags: CF OF PF SF ZF ( AF undef i ned)

+- - - - - - - - - - - - - - - - - - - - - - - + +- - - +
0- - >| 7 - - - - - - - - - - - - - - - - > 0 | - - >| C |
+- - - - - - - - - - - - - - - - - - - - - - - + +- - - +

Shi f t s t he dest i nat i on r i ght by " count " bi t s wi t h zer oes shi f t ed
i n on t he l ef t . The Car r y Fl ag cont ai ns t he l ast bi t shi f t ed out .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, 1 2 2 3 2
mem, 1 15+EA 7 7 2- 4 ( W88=23+EA)
r eg, CL 8+4n 5+n 3 2
mem, CL 20+EA+4n 8+n 7 2- 4 ( W88=28+EA+4n)
r eg, i mmed8 - 5+n 3 3
mem, i mmed8 - 8+n 7 3- 5


SHLD/SHRD - Double Precision Shift (386+)
Usage: SHLD dest , sr c, count
SHRD dest , sr c, count
Modi f i es f l ags: CF PF SF ZF ( OF, AF undef i ned)

SHLD shi f t s " dest " t o t he l ef t " count " t i mes and t he bi t posi t i ons
opened ar e f i l l ed wi t h t he most si gni f i cant bi t s of " sr c" . SHRD
shi f t s " dest " t o t he r i ght " count " t i mes and t he bi t posi t i ons
opened ar e f i l l ed wi t h t he l east si gni f i cant bi t s of t he second
oper and. Onl y t he 5 l ower bi t s of " count " ar e used.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16, r eg16, i mmed8 - - 3 2 4
r eg32, r eg32, i mmed8 - - 3 2 4
mem16, r eg16, i mmed8 - - 7 3 6
mem32, r eg32, i mmed8 - - 7 3 6
r eg16, r eg16, CL - - 3 3 3
r eg32, r eg32, CL - - 3 3 3
mem16, r eg16, CL - - 7 4 5
mem32, r eg32, CL - - 7 4 5


SLDT - Store Local Descriptor Table (286+ privileged)
Usage: SLDT dest
Modi f i es f l ags: none

St or es t he Local Descr i pt or Tabl e ( LDT) Regi st er i nt o t he
speci f i ed oper and.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16 - 2 2 2 3
mem16 - 2 2 3 5


SMSW - Store Machine Status Word (286+ privileged)
Usage: SMSW dest
Modi f i es f l ags: none

St or e Machi ne St at us Wor d ( MSW) i nt o " dest " .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16 - 2 10 2 3
mem16 - 3 3 3 5
STC - Set Carry
Usage: STC
Modi f i es f l ags: CF

Set s t he Car r y Fl ag t o 1.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 2 1


STD - Set Direction Flag
Usage: STD
Modi f i es f l ags: DF

Set s t he Di r ect i on Fl ag t o 1 causi ng st r i ng i nst r uct i ons t o
aut o- decr ement SI and DI i nst ead of aut o- i ncr ement .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 2 1


STI - Set Interrupt Flag (Enable Interrupts)
Usage: STI
Modi f i es f l ags: I F

Set s t he I nt er r upt Fl ag t o 1, whi ch enabl es r ecogni t i on of al l
har dwar e i nt er r upt s. I f an i nt er r upt i s gener at ed by a har dwar e
devi ce, an End of I nt er r upt ( EOI ) must al so be i ssued t o enabl e
ot her har dwar e i nt er r upt s of t he same or l ower pr i or i t y.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 2 2 2 5 1


STOS - Store String (Byte, Word or Doubleword)
Usage: STOS dest
STOSB
STOSW
STOSD
Modi f i es f l ags: None

St or es val ue i n accumul at or t o l ocat i on at ES: ( E) DI ( even i f oper and
i s gi ven) . ( E) DI i s i ncr ement ed/ decr ement ed based on t he si ze of
t he oper and ( or i nst r uct i on f or mat ) and t he st at e of t he Di r ect i on
Fl ag. Use wi t h REP pr ef i xes.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

dest 11 3 4 5 1 ( W88=15)


STR - Store Task Register (286+ privileged)
Usage: STR dest
Modi f i es f l ags: None

St or es t he cur r ent Task Regi st er t o t he speci f i ed oper and.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16 - 2 2 2 3
mem16 - 3 2 3 5
SUB - Subtract
Usage: SUB dest , sr c
Modi f i es f l ags: AF CF OF PF SF ZF

The sour ce i s subt r act ed f r omt he dest i nat i on and t he r esul t i s
st or ed i n t he dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 16+EA 7 6 3 2- 4 ( W88=24+EA)
r eg, mem 9+EA 7 7 2 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem, i mmed 17+EA 7 7 3 3- 6 ( W88=25+EA)
accum, i mmed 4 3 2 1 2- 3

T Instructions
TEST - Test For Bit Pattern
Usage: TEST dest , sr c
Modi f i es f l ags: CF OF PF SF ZF ( AF undef i ned)

Per f or ms a l ogi cal AND of t he t wo oper ands updat i ng t he f l ags
r egi st er wi t hout savi ng t he r esul t .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 1 1 2
r eg, mem 9+EA 6 5 1 2- 4 ( W88=13+EA)
mem, r eg 9+EA 6 5 2 2- 4 ( W88=13+EA)
r eg, i mmed 5 3 2 1 3- 4
mem, i mmed 11+EA 6 5 2 3- 6
accum, i mmed 4 3 2 1 2- 3

V Instructions
VERR - Verify Read (286+ protected)
Usage: VERR sr c
Modi f i es f l ags: ZF

Ver i f i es t he speci f i ed segment sel ect or i s val i d and i s r eadabl e
at t he cur r ent pr i vi l ege l evel . I f t he segment i s r eadabl e,
t he Zer o Fl ag i s set , ot her wi se i t i s cl ear ed.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16 - 14 10 11 3
mem16 - 16 11 11 5

VERW - Verify Write (286+ protected)
Usage: VERW sr c
Modi f i es f l ags: ZF

Ver i f i es t he speci f i ed segment sel ect or i s val i d and i s r at abl e
at t he cur r ent pr i vi l ege l evel . I f t he segment i s wr i t abl e,
t he Zer o Fl ag i s set , ot her wi se i t i s cl ear ed.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg16 - 14 15 11 3
mem16 - 16 16 11 5
W Instructions
WAIT/FWAIT - Event Wait
Usage: WAI T
FWAI T
Modi f i es f l ags: None

CPU ent er s wai t st at e unt i l t he copr ocessor si gnal s i t has f i ni shed
i t s oper at i on. Thi s i nst r uct i on i s used t o pr event t he CPU f r om
accessi ng memor y t hat may be t empor ar i l y i n use by t he copr ocessor .
WAI T and FWAI T ar e i dent i cal .

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none 4 3 6+ 1- 3 1


WBINVD - Write-Back and Invalidate Cache (486+)
Usage: WBI NVD
Modi f i es f l ags: None

Fl ushes i nt er nal cache, t hen si gnal s t he ext er nal cache t o wr i t e
back cur r ent dat a f ol l owed by a si gnal t o f l ush t he ext er nal cache.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

none - - - 5 2


X Instructions
XCHG - Exchange
Usage: XCHG dest , sr c
Modi f i es f l ags: None

Exchanges cont ent s of sour ce and dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 4 3 3 3 2
mem, r eg 17+EA 5 5 5 2- 4 ( W88=25+EA)
r eg, mem 17+EA 5 5 3 2- 4 ( W88=25+EA)
accum, r eg 3 3 3 3 1
r eg, accum 3 3 3 3 1

XLAT/XLATB - Translate
Usage: XLAT t r ansl at i on- t abl e
XLATB ( masm5. x)
Modi f i es f l ags: None

Repl aces t he byt e i n AL wi t h byt e f r oma user t abl e addr essed by
BX. The or i gi nal val ue of AL i s t he i ndex i nt o t he t r ansl at e t abl e.
The best way t o descr i be t hi s i s MOV AL, [ BX+AL]

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

t abl e of f set 11 5 5 4 1

XOR - Exclusive OR
Usage: XOR dest , sr c
Modi f i es f l ags: CF OF PF SF ZF ( AF undef i ned)

Per f or ms a bi t wi se excl usi ve OR of t he oper ands and r et ur ns
t he r esul t i n t he dest i nat i on.

Cl ocks Si ze
Oper ands 808x 286 386 486 Byt es

r eg, r eg 3 2 2 1 2
mem, r eg 16+EA 7 6 3 2- 4 ( W88=24+EA)
r eg, mem 9+EA 7 7 2 2- 4 ( W88=13+EA)
r eg, i mmed 4 3 2 1 3- 4
mem, i mmed 17+EA 7 7 3 3- 6 ( W88=25+EA)
accum, i mmed 4 3 2 1 2- 3

You might also like