Vous êtes sur la page 1sur 59

5/6/2015

8086instructions

Touteslescommandesdu8086
Index:
AAA
AAD
AAM
AAS
ADC
ADD
AND
CALL
CBW
CLC
CLD
CLI
CMC
CMP

CMPSB
CMPSW
CWD
DAA
DAS
DEC
DIV
HLT
IDIV
IMUL
IN
INC
INT
INTO
IRET
JA

JAE
JB
JBE
JC
JCXZ
JE
JG
JGE
JL
JLE
JMP
JNA
JNAE
JNB

JNBE
JNC
JNE
JNG
JNGE
JNL
JNLE
JNO
JNP
JNS
JNZ
JO
JP
JPE

JPO
JS
JZ
LAHF
LDS
LEA
LES
LODSB
LODSW
LOOP
LOOPE
LOOPNE
LOOPNZ
LOOPZ

MOV
MOVSB
MOVSW
MUL
NEG
NOP
NOT
OR
OUT
POP
POPA
POPF
PUSH
PUSHA
PUSHF
RCL

RCR
REP
REPE
REPNE
REPNZ
REPZ
RET
RETF
ROL
ROR
SAHF
SAL
SAR
SBB

SCASB
SCASW
SHL
SHR
STC
STD
STI
STOSB
STOSW
SUB
TEST
XCHG
XLATB
XOR

Typesd'oprande:
REG:AX,BX,CX,DX,AH,AL,BL,BH,CH,CL,DH,DL,DI,SI,BP,SP.
SREG:DS,ES,SSetuniquementcommedeuximeoprande:CS.
mmoire:[BX],[BX+SI+7],variable,etc.(VoirAccsmmoire.)
valeurimmdiate:5,24,3Fh,10001101b,etc.

Notes:
Lorsquedeuxoprandessontncessairespouruneinstructionilssont
sparsparunevirgule.Parexemple:
REG,mmoire
Lorsquedeuxoprandessontncessaires,lesdeuxoprandesdoiventavoir
lammetaille(saufpourlesinstructionsdedcalageetderotation).Par
exemple:
AL,DL
DX,AX
m1DB?
file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

1/59

5/6/2015

8086instructions

AL,m1
m2DW?
AX,m2
Quelquesinstructionsadmettentplusieurscombinaisonsd'oprande.Par
exemple:
mmoire,immdiate
REG,immdiate
mmoire,REG
REG,SREG
Quelquesexemplescontiennentdesmacros,ainsiilestrecommand
d'utiliserlestouchesderaccourci[Maj]+[F8]pourfaireunpasdeplus
(lecodedelamacrodoits'excuteavecladuredupassurzrode
manireobtenirunevitessemaximale)sinon,l'mulateurferaunpas
pourchaqueinstructiond'unemacro.Voiciunexemplequiutiliselamacro
PRINTN:

#make_COM#
include'emu8086.inc'
ORG100h
MOVAL,1
MOVBL,2
PRINTN'Bonjourtoutlemonde!'macro.
MOVCL,3
PRINTN'Bienvenue!'macro.
RET

Cesrepressontutilisspourindiquerl'tatdesflags:
1Instructionquiplaceleflag1.
0Instructionquiplaceleflag0.
rLavaleurduflagdpenddursultatdel'instruction.
?Lavaleurduflagn'estpasdfinie(peuttre1ou0).

Quelquesinstructionsproduisentexactementlemmecodemachineet
decefait,ledsassembleurpeutavoirquelquesproblmespour
dcodervotrecoded'origine.C'estparticulirementimportantpourles
instructionsdesautsconditionnels(voir"Contrlededroulementdu
programme"dansledidacticielpourdesinformationssupplmentaires).
file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

2/59

5/6/2015

8086instructions

Instructionsparordrealphabtique:
Instruction

Oprandes

Description
AjustementASCIIaprsAddition.
CorrigelersultatdansALetAHaprs
additionlorsd'uneoprationenvaleurs
BCD.
Celafonctionneselonl'algorithmesuivant:
Sinibble(quartetoudemioctet)depoidsfaibledans
AL>9ouAF=1alors:
AL=AL+6
AH=AH+1
AF=1
CF=1

AAA

Pasd'oprande

sinon
AF=0
CF=0
danslesdeuxcas:
effacerlenibbledepoidsfortdansAL.
Exemple:
MOVAX,15AH=00,AL=0Fh
AAAAH=01,AL=05
RET
CZSO PA
r ? ? ? ? r

AjustementASCIIavantDivision.
PrparelesdeuxvaleursBCDpourla
division.
Algorithme:
AL=(AH*10)+AL
AH=0

AAD

Pasd'oprande

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

3/59

5/6/2015

8086instructions

Exemple:
MOVAX,0105hAH=01,AL=05
AADAH=00,AL=0Fh(15)
RET
CZSO PA
? r r ? r ?

AjustementASCIIaprsMultiplication.
Corrigelersultatdelamultiplicationdans
lesdeuxvaleursBCD.
Algorithme:
AH=AL/10
AL=reste
AAM

Pasd'oprande
Exemple:
MOVAL,15AL=0Fh
AAMAH=01,AL=05
RET
CZSO PA
? r r ? r ?

AjustementASCIIaprsSoustraction.
CorrigelersultatdansALetAHaprs
soustractionlorsd'uneoprationenvaleurs
BCD.
Algorithme:
Sinibble(quartetoudemioctet)depoidsfaibledans
AL>9ouAF=1alors:
AL=AL6
AH=AH1
AF=1
CF=1

AAS

Pasd'oprande

sinon
AF=0
CF=0
danslesdeuxcas:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

4/59

5/6/2015

8086instructions

effacerlenibbledepoidsfortdansAL.
Exemple:
MOVAX,02FFhAH=02,AL=0FFh
AASAH=01,AL=09
RET
CZSO PA
r ? ? ? ? r

Additionavecretenue.
Algorithme:
oprande1=oprande1+oprande2+CF
ADC

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

Exemple:
STCplaceCF1
MOVAL,5AL=5
ADCAL,1AL=7
RET
CZSO PA
r r r r r r

Addition.
Algorithme:

ADD

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

oprande1=oprande1+oprande2
Exemple:
MOVAL,5AL=5
ADDAL,3AL=2
RET
CZSO PA
r r r r r r

AND(ouET)logiqueentretouslesbitsdes
deuxoprandes.Lersultateststockdans
oprande1.

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

5/59

5/6/2015

8086instructions

Tabledevrit:

AND

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

1AND1=1
1AND0=0
0AND1=0
0AND0=0
Exemple:
MOVAL,'a'AL=01100001b
ANDAL,11011111bAL=01000001b('A')
RET
CZSO P
0 r r 0 r

Appeldeprocdure,l'adressederetour
dans(IP)estplacesurlapile.L'adressede
4octetspeuts'criresouslaformesuivante
:1234h:5678h,lapremirevaleurestle
segmentetladeuximeestl'offset(c'estun
appellong,CSestgalementplacsurla
pile).
Exemple:

CALL

nomdelaprocdure
label
adressede4octets

#make_COM#
ORG100hpourunfichierCOM.
CALLp1
ADDAX,1
RETretourausystmed'exploitation.
p1PROCdclarationdelaprocdure.
MOVAX,1234h
RETretourl'appel.
p1ENDP
CZSO PA
inchangs

Conversiond'octetenmot(word).
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

6/59

5/6/2015

8086instructions

Silebitdepoidsfort(bitdesigne)dansAL=1alors:
AH=255(0FFh)
sinon
AH=0
CBW

Pasd'oprande
Exemple:
MOVAX,0AH=0,AL=0
MOVAL,5AX=000FBh(251)
CBWAX=0FFFBh(5)
RET
CZSO PA
inchangs

Misezroduflagderetenue.
Algorithme:

CLC

Pasd'oprande

CF=0
C
0

Misezroduflagdedirection.Les
registresSIetDIserontincrmentspar
lesinstructionspourchanessuivantes:
CMPSB,CMPSW,LODSB,LODSW,MOVSB,
MOVSW,STOSB,STOSW.

CLD

Pasd'oprande

Algorithme:
DF=0
D
0

Misezroduflagd'interruption.Dsactive
desinterruptionsmatrielles.
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

7/59

5/6/2015

CLI

8086instructions

Pasd'oprande

IF=0
I
0

Complmenteleflagderetenue.Inversela
valeurduflagCF.
Algorithme:

CMC

Pasd'oprande

siCF=1alorsCF=0
siCF=0alorsCF=1

C
r

Comparedeuxoprandes.
Algorithme:
oprande1oprande2

CMP

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

Lersultatn'estpasstock,lesflags(OF,SF,ZF,AF,
PF,CF)sontpositionnsselonlersultat.
Exemple:
MOVAL,5
MOVBL,5
CMPAL,BLAL=5,ZF=1(galit!)
RET
CZSO PA
r r r r r r

Comparelesoctetsde:ES:[DI]etDS:[SI].
Algorithme:
DS:[SI]ES:[DI]
Positionnelesflags:
OF,SF,ZF,AF,PF,CF
selonlersultat.
siDF=0alors

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

8/59

5/6/2015

CMPSB

8086instructions

SI=SI+1
DI=DI+1

Pasd'oprande

sinon
SI=SI1
DI=DI1
Exemple:
Voircmpsb.asmdansledossier"
Samples".
CZSO PA
r r r r r r

Comparelesmots:ES:[DI]etDS:[SI].
Algorithme:

CMPSW

DS:[SI]ES:[DI]
Positionnelesflags:
OF,SF,ZF,AF,PF,CF
selonlersultat.
siDF=0alors
SI=SI+2
DI=DI+2
sinon
SI=SI2
DI=DI2

Pasd'oprande

Exemple:
Voircmpsw.asmdansledossier
"Samples".
CZSO PA
r r r r r r

Conversiondemotendoublemot.
Algorithme:
silebitdepoidsfortdansAX=1alors:
DX=65535(0FFFFh)
sinon
DX=0
CWD

Pasd'oprande

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

9/59

5/6/2015

8086instructions

Exemple:
MOVDX,0DX=0
MOVAX,0AX=0
MOVAX,5DXAX=00000h:0FFFBh
CWDDXAX=0FFFFh:0FFFBh
RET
CZSO PA
inchangs

AjustementdcimalaprsAddition.
Corrigelersultatdel'additiondesdeux
valeursBCDcompactes.
Algorithme:
siledemioctetdepoidsfaibledansAL>9ouAF=1
alors:
AL=AL+6
AF=1
siAL>9FhouCF=1alors:
DAA

Pasd'oprande

AL=AL+60h
CF=1
Exemple:
MOVAL,0FhAL=0Fh(15)
DAAAL=15h
RET
CZSO PA
r r r r r r

AjustementdcimalaprsSoustraction.
Corrigelersultatdelasoustractiondes
deuxvaleursBCDcompactes.
Algorithme:
siledemioctetdepoidsfaibledansAL>9ouAF=1
alors:
AL=AL6
AF=1

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

10/59

5/6/2015

8086instructions

siAL>9FhouCF=1alors:
DAS

Pasd'oprande

AL=AL60h
CF=1
Exemple:
MOVAL,0FFhAL=0FFh(1)
DASAL=99h,CF=1
RET
CZSO PA
r r r r r r

Dcrment.
Algorithme:
oprande=oprande1

DEC

REG
mmoire

Exemple:
MOVAL,255AL=0FFh(255or1)
DECALAL=0FEh(254or2)
RET
ZSO PA
r r r r r
CFinchang!
Divisionnonsigne.
Algorithme:
lorsquel'oprandeestunoctet:
AL=AX/oprande
AH=reste(coefficient)

DIV

REG
mmoire

lorsquel'oprandeestunmot:
AX=(DXAX)/oprande
DX=reste(coefficient)
Exemple:
MOVAX,203AX=00CBh
MOVBL,4
DIVBLAL=50(32h),AH=3
RET

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

11/59

5/6/2015

8086instructions

CZSO PA
? ? ? ? ? ?

Suspendl'excutionetplacele8086dans
l'tatHALT.
Exemple:
HLT

Pasd'oprande

MOVAX,5
HLT
CZSO PA
inchangs

Divisionsigne.
Algorithme:
lorsquel'oprandeestunoctet:
AL=AX/oprande
AH=reste(coefficient)

IDIV

lorsquel'oprandeestunmot:
AX=(DXAX)/oprande
DX=reste(coefficient)

REG
mmoire

Exemple:
MOVAX,203AX=0FF35h
MOVBL,4
IDIVBLAL=50(0CEh),AH=3(0FDh)
RET
CZSO PA
? ? ? ? ? ?

Multiplicationsigne.
Algorithme:
orsquel'oprandeestunoctet:
AX=AL*oprande.
lorsquel'oprandeestunmot:
(DXAX)=AX*oprande.
file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

12/59

5/6/2015

IMUL

8086instructions

REG
mmoire

Exemple:
MOVAL,2
MOVBL,4
IMULBLAX=8
RET
CZSO PA
r ? ? r ? ?
CF=OF=0lorsdesajustementsdursultatdans
l'oprandeparIMUL.

IN

AL,im.octet
AL,DX
AX,im.octet
AX,DX

TransfreladonneluesurleportdansAL
ouAX.
Lesecondoprandeestlenumrodeport.
Ilestpossibled'accdern'importequel
portcomprisentre0et255.Lenumrode
portseplacedansleregistreDX.
Exemple:
INAX,4obtenirlestatutdesfeuxdecirculation.
INAL,7obtenirlestatutdumoteurpaspas.
CZSO PA
inchangs

Incrment.
Algorithme:
oprande=oprande+1

INC

REG
mmoire

Exemple:
MOVAL,4
INCALAL=5
RET
ZSO PA
r r r r r
CFinchang!
Appeld'uneprocdured'interruption.
Numrod'interruptionparunoctet
immdiatcomprisentre0et255.
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

13/59

5/6/2015

INT

8086instructions

Sauvegardesurlapile:
registresdeflag
CS
IP
IF=0
Appeldelaprocdured'interruption

octetimmdiat

Exemple:
MOVAH,0Ehtltype.
MOVAL,'A'
INT10hinterruptionduBIOS.
RET
CZSO PA I
inchangs

Appeld'uneprocdured'interruption.
Interruption4sileflagdedbordementest
1.
Algorithme:
siOF=1alorsINT4
INTO

Pasd'oprande

Exemple:
5127=132(n'estpasentre128et127)
lersultatdeSUB(124)estfaux,
doncOFestplac1:
MOVAL,5
SUBAL,127AL=7Ch(124)
INTOerreurdeprocdure.
RET

Retourd'interruption.
Algorithme:

IRET

Pasd'oprande

Restauredepuislapile:
IP
CS
registresdeflag
CZSO PA
restaurs

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

14/59

5/6/2015

8086instructions

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest
suprieuraudeuximeoprande(identique
l'instructionCMP).Nonsign.
Algorithme:
si(CF=0)et(ZF=0)alorssaut
Exemple:

JA

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,250
CMPAL,5
JAlabel1
PRINT'ALn'estpassuprieur5'
JMPexit
label1:
PRINT'ALestsuprieur5'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest
suprieurougalaudeuximeoprande
(identiquel'instructionCMP).Nonsign.
Algorithme:
siCF=0alorssaut
Exemple:

JAE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,5
CMPAL,5
JAElabel1
PRINT'ALn'estpassuprieurougal5'
JMPexit
label1:
PRINT'ALestsuprieurougal5'

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

15/59

5/6/2015

8086instructions

exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest
infrieuraudeuximeoprande(identique
l'instructionCMP).Nonsign.
Algorithme:
siCF=1alorssaut
Exemple:

JB

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,1
CMPAL,5
JBlabel1
PRINT'ALn'estpasinfrieur5'
JMPexit
label1:
PRINT'ALestinfrieur5'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest
infrieurougalaudeuximeoprande
(identiquel'instructionCMP).Nonsign.
Algorithme:
siCF=1ouZF=1alorssaut
Exemple:

JBE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,5

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

16/59

5/6/2015

8086instructions

CMPAL,5
JBElabel1
PRINT'ALn'estpasinfrieurougal5'
JMPexit
label1:
PRINT'ALestinfrieurougal5'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsileflagderetenue(carry)est
1.
Algorithme:
siCF=1alorssaut
Exemple:

JC

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,255
ADDAL,1
JClabel1
PRINT'pasderetenue.'
JMPexit
label1:
PRINT'ilyaretenue.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
SautcourtsileregistreCXvaut0.
Algorithme:
siCX=0alorssaut
Exemple:
include'emu8086.inc'

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

17/59

5/6/2015

JCXZ

8086instructions

label

#make_COM#
ORG100h
MOVCX,0
JCXZlabel1
PRINT'CXnevautpas0.'
JMPexit
label1:
PRINT'CXvautzro.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestgal
audeuximeoprande(identique
l'instructionCMP).SignetNonsign.
Algorithme:
siZF=1alorssaut
Exemple:

JE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,5
CMPAL,5
JElabel1
PRINT'ALn'estpasgal5.'
JMPexit
label1:
PRINT'ALestgal5.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest
suprieuraudeuximeoprande(identique
l'instructionCMP).Sign.
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

18/59

5/6/2015

8086instructions

si(ZF=0)et(SF=OF)alorssaut
Exemple:
JG

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,5
CMPAL,5
JGlabel1
PRINT'ALn'estpassuprieur5.'
JMPexit
label1:
PRINT'ALestsuprieur5.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest
suprieurougalaudeuximeoprande
(identiquel'instructionCMP).Sign.
Algorithme:
siSF=OFalorssaut
Exemple:

JGE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,5
JGElabel1
PRINT'AL<5'
JMPexit
label1:
PRINT'AL>=5'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

19/59

5/6/2015

8086instructions

infrieuraudeuximeoprande(identique
l'instructionCMP).Sign.
Algorithme:
siSF<>OFalorssaut
Exemple:
JL

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,5
JLlabel1
PRINT'AL>=5.'
JMPexit
label1:
PRINT'AL<5.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeest
infrieurougalaudeuximeoprande
(identiquel'instructionCMP).Sign.
Algorithme:
siSF<>OFouZF=1alorssaut
Exemple:

JLE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,5
JLElabel1
PRINT'AL>5.'
JMPexit
label1:
PRINT'AL<=5.'
exit:
RET
CZSO PA

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

20/59

5/6/2015

8086instructions

inchangs

Sautinconditionnel.Transfrelecontrle
uneautrepartieduprogramme.L'adresse
sur4octetss'critsouslaformesuivante:
1234h:5678h,lapremirevaleurestla
valeurdesegmentetladeuximeestla
valeurd'offset.
Algorithme:
sautdanstouslescas
JMP

label
adressesur4octets

Exemple:
include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,5
JMPlabel1sautaudessusde2lignes!
PRINT'Pasdesaut!'
MOVAL,0
label1:
PRINT'Arrivici!'
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
suprieuraudeuximeoprande(identique
l'instructionCMP).Nonsign.
Algorithme:
siCF=1ouZF=1alorssaut
Exemple:

JNA

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,5
JNAlabel1
PRINT'ALestsuprieur5.'

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

21/59

5/6/2015

8086instructions

JMPexit
label1:
PRINT'ALestnonsuprieur5.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
suprieurounongalaudeuxime
oprande(identiquel'instructionCMP).
Nonsign.
Algorithme:
siCF=1alorssaut
Exemple:
JNAE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,5
JNAElabel1
PRINT'AL>=5.'
JMPexit
label1:
PRINT'AL<5.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
infrieuraudeuximeoprande(identique
l'instructionCMP).Nonsign.
Algorithme:
siCF=0alorssaut
Exemple:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

22/59

5/6/2015

JNB

8086instructions

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,7
CMPAL,5
JNBlabel1
PRINT'AL<5.'
JMPexit
label1:
PRINT'AL>=5.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
infrieuretnongalaudeuximeoprande
(identiquel'instructionCMP).Nonsign.
Algorithme:
si(CF=0)et(ZF=0)alorssaut
Exemple:

JNBE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,7
CMPAL,5
JNBElabel1
PRINT'AL<=5.'
JMPexit
label1:
PRINT'AL>5.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsileflagderetenue(carry)est
0.
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

23/59

5/6/2015

8086instructions

siCF=0alorssaut
Exemple:

JNC

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
ADDAL,3
JNClabel1
PRINT'ilyaretenue.'
JMPexit
label1:
PRINT'pasderetenue.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
galaudeuximeoprande(identique
l'instructionCMP).Signetnonsign.
Algorithme:
siZF=0alorssaut
Exemple:

JNE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,3
JNElabel1
PRINT'AL=3.'
JMPexit
label1:
PRINT'Al<>3.'
exit:
RET
CZSO PA
inchangs

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

24/59

5/6/2015

8086instructions

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
suprieuraudeuximeoprande(identique
l'instructionCMP).Sign.
Algorithme:
si(ZF=1)et(SF<>OF)alorssaut
Exemple:
JNG

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,3
JNGlabel1
PRINT'AL>3.'
JMPexit
label1:
PRINT'Al<=3.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
suprieuretnongalaudeuxime
oprande(identiquel'instructionCMP).
Sign.
Algorithme:
siSF<>OFalorssaut
Exemple:

JNGE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,3
JNGElabel1
PRINT'AL>=3.'
JMPexit
label1:
PRINT'Al<3.'
exit:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

25/59

5/6/2015

8086instructions

RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
infrieuraudeuximeoprande(identique
l'instructionCMP).Sign.
Algorithme:
siSF=OFalorssaut
Exemple:

JNL

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,3
JNLlabel1
PRINT'AL<3.'
JMPexit
label1:
PRINT'Al>=3.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsilepremieroprandeestnon
infrieuretnongalaudeuximeoprande
(identiquel'instructionCMP).Sign.
Algorithme:
si(SF=OF)et(ZF=0)alorssaut
Exemple:

JNLE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,2
CMPAL,3

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

26/59

5/6/2015

8086instructions

JNLElabel1
PRINT'AL<=3.'
JMPexit
label1:
PRINT'Al>3.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsipasdedbordement.
Algorithme:
siOF=0alorssaut
Exemple:
52=7(setrouveentre128et127)
lersultatdel'instructionSUBestcorrect,
doncOF=0:
JNO

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,5
SUBAL,2AL=0F9h(7)
JNOlabel1
PRINT'Dbordement!'
JMPexit
label1:
PRINT'Pasdedbordement.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsipasdeparit(impaire).Seulle
rsultatdes8bitsdepoidsfaibleestvrifi.
Ceflagestpositionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

27/59

5/6/2015

8086instructions

siPF=0alorssaut
Exemple:
JNP

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,00000111bAL=7
ORAL,0positionnejustelesflags.
JNPlabel1
PRINT'Paritpaire.'
JMPexit
label1:
PRINT'Paritimpaire.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsinonsign(positif).Ceflagest
positionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:
siSF=0alorssaut
Exemple:

JNS

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,00000111bAL=7
ORAL,0positionnejustelesflags.
JNSlabel1
PRINT'Sign.'
JMPexit
label1:
PRINT'Nonsign.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsinonzro(pasgal).Ceflag

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

28/59

5/6/2015

8086instructions

estpositionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:
siZF=0alorssaut
Exemple:

JNZ

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,00000111bAL=7
ORAL,0positionnejustelesflags.
JNZlabel1
PRINT'Zro.'
JMPexit
label1:
PRINT'Nonzro.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsidbordement.
Algorithme:
siOF=1alorssaut
Exemple:
5127=132(nesetrouvepasentre128et127)
lersultatdel'instructionSUBestfaux(124),
doncOF=1:

JO

label

include'emu8086.inc'
#make_COM#
org100h
MOVAL,5
SUBAL,127AL=7Ch(124)
JOlabel1
PRINT'Pasdedbordement.'
JMPexit
label1:
PRINT'Dbordement!'
exit:
RET

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

29/59

5/6/2015

8086instructions

CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsiparit(paire).Seullersultat
des8bitsdepoidsfaibleestvrifi.Ceflag
estpositionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:
siPF=1alorssaut
Exemple:
JP

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,00000101bAL=5
ORAL,0positionnejustelesflags.
JPlabel1
PRINT'Paritimpaire.'
JMPexit
label1:
PRINT'Paritpaire.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsiparit(paire).Seullersultat
des8bitsdepoidsfaibleestvrifi.Ceflag
estpositionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:
siPF=1alorssaut
Exemple:

JPE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,00000101bAL=5
ORAL,0positionnejustelesflags.

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

30/59

5/6/2015

8086instructions

JPElabel1
PRINT'Paritimpaire.'
JMPexit
label1:
PRINT'Paritpaire.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsiparit(impaire).Seulle
rsultatdes8bitsdepoidsfaibleestvrifi.
Ceflagestpositionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:
siPF=0alorssaut
Exemple:
JPO

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,00000111bAL=7
ORAL,0positionnejustelesflags.
JPOlabel1
PRINT'Paritpaire.'
JMPexit
label1:
PRINT'Paritimpaire.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsisign(ngatif).Ceflagest
positionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:
siSF=1alorssaut

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

31/59

5/6/2015

8086instructions

Exemple:

JS

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,10000000bAL=128
ORAL,0positionnejustelesflags.
JSlabel1
PRINT'Nonsign.'
JMPexit
label1:
PRINT'Sign.'
exit:
RET
CZSO PA
inchangs

Sautsilaconditionestralise.
Sautcourtsizro(gal).Ceflagest
positionnparlesinstructions
CMP,SUB,ADD,TEST,AND,OR,XOR.
Algorithme:
siZF=1alorssaut
Exemple:

JZ

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVAL,5
CMPAL,5
JZlabel1
PRINT'ALn'estpasgal5.'
JMPexit
label1:
PRINT'ALestgal5.'
exit:
RET
CZSO PA
inchangs

ChargeAHavecles8bitsdepoidsfaibledu
registredeflags.
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

32/59

5/6/2015

8086instructions

AH=registredeflags
LAHF

Pasd'oprande

BitsdeAH:76543210
[SF][ZF][0][AF][0][PF][1][CF]
lesbits1,3,5sontrservs.
CZSO PA
inchangs

Chargeunpointeurlong(doublemot)
partirdelammoiredansunregistre16
bitsetdansDS.
Algorithme:
REG=premiermot
DS=deuximemot
Exemple:

LDS

REG,mmoire

#make_COM#
ORG100h
LDSAX,m
RET
mDW1234h
DW5678h
END
AXcontient1234h,DScontient5678h.
CZSO PA
inchangs

Chargeuneadresseeffective
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

33/59

5/6/2015

8086instructions

REG=adressedemmoire(offset)
Gnralement,cetteinstructionest
remplacesipossibleparMOVlorsde
l'assemblage.
Exemple:
#make_COM#
ORG100h
LEA

REG,mmoire

LEAAX,m
RET
mDW1234h
END
AXcontient:0104h.
L'instructionLEAutilise3octets,RETutilise
1octetpourleretour,nousdbutons
100h,doncl'adressede'm'est104h.
CZSO PA
inchangs

Chargeunpointeurlong(doublemot)
partirdelammoiredansunregistre16
bitsetdansES.
Algorithme:
REG=premiermot
ES=deuximemot
Exemple:
#make_COM#
ORG100h

LES

REG,mmoire

LESAX,m
RET
mDW1234h

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

34/59

5/6/2015

8086instructions

DW5678h
END
AXcontient1234h,EScontient5678h.
CZSO PA
inchangs

ChargeunoctetdepuisDS:[SI]dansALet
misejourdeSI.
Algorithme:
AL=DS:[SI]
siDF=0alors
SI=SI+1
sinon
SI=SI1
Exemple:

LODSB

Pasd'oprande

#make_COM#
ORG100h
LEASI,a1
MOVCX,5
MOVAH,0Eh
m:LODSB
INT10h
LOOPm
RET
a1DB'H','e','l','l','o'
CZSO PA
inchangs

ChargeunmotdepuisDS:[SI]dansAXet
misejourdeSI.
Algorithme:
AX=DS:[SI]
siDF=0alors

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

35/59

5/6/2015

8086instructions

SI=SI+2
sinon
SI=SI2
Exemple:
LODSW

Pasd'oprande

#make_COM#
ORG100h
LEASI,a1
MOVCX,5
REPLODSWlafin,ilyaura555hdansAX.
RET
a1dw111h,222h,333h,444h,555h
CZSO PA
inchangs

DcrmenteCX,boucleenrevenantau
labeltantqueCXn'estpaszro.
Algorithme:
CX=CX1
siCX<>0alors
saut
sinon
pasdesaut,continue

LOOP

label

Exemple:
include'emu8086.inc'
#make_COM#
ORG100h
MOVCX,5
label1:
PRINTN'boucle!'
LOOPlabel1
RET
CZSO PA
inchangs

DcrmenteCX,boucleenrevenantau
labelsiCXnonzroetgal(ZF=1).

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

36/59

5/6/2015

8086instructions

Algorithme:
CX=CX1
si(CX<>0)et(ZF=1)alors
saut
sinon
pasdesaut,continue
Exemple:

LOOPE

label

Bouclejusqu'cequelersultatdansALsoit1
ou5fois.Lersultatserasuprieur255lors
delatroisimeboucle(100+100+100)et
sortiradelaboucle.
include'emu8086.inc'
#make_COM#
ORG100h
MOVAX,0
MOVCX,5
label1:
PUTC'*'
ADDAX,100
CMPAH,0
LOOPElabel1
RET
CZSO PA
inchangs

DcrmenteCX,boucleenrevenantau
labelsiCXnonzroetnongal(ZF=0).
Algorithme:
CX=CX1
si(CX<>0)et(ZF=0)alors
saut
sinon
pasdesaut,continue
Exemple:
Bouclejusqu'ceque'7'soittrouv
ouque5bouclessoienteffectues.

LOOPNE

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVSI,0

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

37/59

5/6/2015

8086instructions

MOVCX,5
label1:
PUTC'*'
MOVAL,v1[SI]
INCSIoctetsuivant:(SI=SI+1).
CMPAL,7
LOOPNElabel1
RET
v1db9,8,7,6,5
CZSO PA
inchangs

DcrmenteCX,boucleenrevenantau
labelsiCXnonzroetnongal(ZF=0).
Algorithme:
CX=CX1
si(CX<>0)et(ZF=0)alors
saut
sinon
pasdesaut,continue
Exemple:
Bouclejusqu'ceque'7'soittrouv
ouque5bouclessoienteffectues.
LOOPNZ

label

include'emu8086.inc'
#make_COM#
ORG100h
MOVSI,0
MOVCX,5
label1:
PUTC'*'
MOVAL,v1[SI]
INCSIoctetsuivant:(SI=SI+1).
CMPAL,7
LOOPNZlabel1
RET
v1db9,8,7,6,5
CZSO PA
inchangs

DcrmenteCX,boucleenrevenantau
labelsiCXnonzroetZF=1.

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

38/59

5/6/2015

8086instructions

Algorithme:
CX=CX1
si(CX<>0)et(ZF=1)alors
saut
sinon
pasdesaut,continue
Exemple:

LOOPZ

label

Bouclejusqu'cequelersultatdansALsoit1
ou5fois.Lersultatserasuprieur255lors
delatroisimeboucle(100+100+100)et
sortiradelaboucle.
include'emu8086.inc'
#make_COM#
ORG100h
MOVAX,0
MOVCX,5
label1:
PUTC'*'
ADDAX,100
CMPAH,0
LOOPZlabel1
RET
CZSO PA
inchangs

Copiel'oprande2dansl'oprande1.
L'instructionMOVnepeutpas:

MOV

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate
SREG,mmoire

UtiliserlesvaleursdesregistresCSet
IP.
Copierlavaleurd'unregistrede
segmentdansunautreregistrede
segment(ilfautd'abordcopierla
valeurd'unsegmentderegistredans
unregistregnraletensuite,copier
dansunautreregistredesegment).
Copierunevaleurimmdiatedansun
registredesegment(ilfautd'abord,
passerparunregistregnral).
Algorithme:
oprande1=oprande2

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

39/59

5/6/2015

8086instructions

mmoire,SREG
REG,SREG
SREG,REG

Exemple:
#make_COM#
ORG100h
MOVAX,0B800hAX=B800h(mmoireVGA).
MOVDS,AXcopielavaleurdeAXdansDS.
MOVCL,'A'CL=41h(codeASCII).
MOVCH,01011111bCL=attributcouleur.
MOVBX,15EhBX=positiond'affichage.
MOV[BX],CXw.[0B800h:015Eh]=CX.
RETretourausystmed'exploitation.
CZSO PA
inchangs

Copiel'octetdeDS:[SI]dansES:[DI].Met
jourSIetDI.
Algorithme:
ES:[DI]=DS:[SI]
siDF=0alors
SI=SI+1
DI=DI+1
sinon
SI=SI1
DI=DI1
Exemple:
MOVSB

Pasd'oprande

#make_COM#
ORG100h
LEASI,a1
LEADI,a2
MOVCX,5
REPMOVSB
RET
a1DB1,2,3,4,5
a2DB5DUP(0)
CZSO PA
inchangs

CopielemotdeDS:[SI]dansES:[DI].Met

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

40/59

5/6/2015

8086instructions

jourSIetDI.
Algorithme:
ES:[DI]=DS:[SI]
siDF=0alors
SI=SI+2
DI=DI+2
sinon
SI=SI2
DI=DI2
MOVSW

Pasd'oprande

Exemple:
#make_COM#
ORG100h
LEASI,a1
LEADI,a2
MOVCX,5
REPMOVSW
RET
a1DW1,2,3,4,5
a2DW5DUP(0)
CZSO PA
inchangs

Multiplicationnonsigne.
Algorithme:
lorsquel'oprandeestunoctet:
AX=AL*oprande.

MUL

REG
mmoire

lorsquel'oprandeestunmot:
(DXAX)=AX*oprande.
Exemple:
MOVAL,200AL=0C8h
MOVBL,4
MULBLAX=0320h(800)
RET
CZSO PA
r ? ? r ? ?

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

41/59

5/6/2015

8086instructions

CF=OF=0silasectionhautedursultatestzro.
Ngation.Transformelavaleurd'un
oprandeenvaleurngative(parson
complmentdeux).
Algorithme:
Inversetouslesbitsdel'oprande
Additionne1l'oprandeinvers
NEG

REG
mmoire

Exemple:
MOVAL,5AL=05h
NEGALAL=0FBh(5)
NEGALAL=05h(5)
RET
CZSO PA
r r r r r r

Aucuneopration.
Algorithme:
Rien
Exemple:

NOP

Pasd'oprande

rien,3fois:
NOP
NOP
NOP
RET
CZSO PA
inchangs

Inversechaquebitdel'oprande.
Algorithme:
sibitest1remplacepar0.
sibitest0remplacepar1.

NOT

REG

Exemple:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

42/59

5/6/2015

8086instructions

mmory

MOVAL,00011011b
NOTALAL=11100100b
RET
CZSO PA
inchangs

EffectueunOR(OU)logiqueentretousles
bitsdesdeuxoprandes.Lersultatest
stockdanslepremieroprande.
Tabledevrit:

OR

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

1OR(OU)1=1
1OR(OU)0=1
0OR(OU)1=1
0OR(OU)0=0
Exemple:
MOVAL,'A'AL=01000001b
ORAL,00100000bAL=01100001b('a')
RET
CZSO PA
0 r r 0 r ?

PlacelavaleurdeALouAXsurleport.
Lepremieroprandecontientlenumrode
port.Pouraccderunportdontlenumro
estsuprieur255,ilfaututiliserle
registreDX.

OUT

im.octet,AL
im.octet,AX
DX,AL
DX,AX

Exemple:
MOVAX,0FFFhAllumertousles
OUT4,AXfeuxdecirculation.
MOVAL,100bAlimenterletroisime
OUT7,ALlectroaimantdumoteurpaspas.
CZSO PA
inchangs

Dpileunevaleur16bits.

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

43/59

5/6/2015

8086instructions

Algorithme:

POP

REG
SREG
mmoire

oprande=SS:[SP](sommetdelapile)
SP=SP+2
Exemple:
MOVAX,1234h
PUSHAX
POPDXDX=1234h
RET
CZSO PA
inchangs

DpiletouslesregistresgnrauxDI,SI,
BP,SP,BX,DX,CX,AX.
LavaleurdeSPestignore,elleestdpile
maispasplacedansleregistreSP.
Note:cetteinstructionfonctionne
uniquementaveclesCPU80186ou
suprieurs!
Algorithme:

POPA

Pasd'oprande

POPDI
POPSI
POPBP
POPxx(lavaleurdeSPestignore)
POPBX
POPDX
POPCX
POPAX
CZSO PA
inchangs

Dpileleregistreflags.
Algorithme:

POPF

Pasd'oprande

flags=SS:[SP](sommetdelapile)
SP=SP+2

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

44/59

5/6/2015

8086instructions

CZSO PA
dpils

Empileunevaleur16bits.
Note:EMPILERunevaleurimmdiate,
fonctionneuniquementaveclesCPU80186
ousuprieurs!
Algorithme:

PUSH

REG
SREG
mmoire
immdiate

SP=SP2
SS:[SP](sommetdelapile)=oprande
Exemple:
MOVAX,1234h
PUSHAX
POPDXDX=1234h
RET
CZSO PA
inchangs

EmpiletouslesregistresgnrauxDI,SI,
BP,SP,BX,DX,CX,AX.
Lavaleurd'origineduregistreSP(avant
PUSHA)estutilise.
Note:cetteinstructionfonctionne
uniquementaveclesCPU80186ou
suprieurs!
Algorithme:

PUSHA

Pasd'oprande

PUSHAX
PUSHCX
PUSHDX
PUSHBX
PUSHSP
PUSHBP
PUSHSI
PUSHDI
CZSO PA

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

45/59

5/6/2015

8086instructions

inchangs

Empileleregistreflags.
Algorithme:
PUSHF

Pasd'oprande

SP=SP2
SS:[SP](sommetdelapile)=flags
CZSO PA
inchangs

Larotationeffectueundcalagede
l'oprande1gauchedetouslesbitsy
comprisleflagderetenue.Lenombrede
rotationsestcontenudansl'oprande2.
Silavaleurimmdiateestsuprieure1,
l'assembleurgnreplusieursRCLxx,une
instructionlafois,carle8086alecode
machineuniquementpourcetteinstruction
(lemmeprincipeestutilispourtoutesles
autresinstructionsderotations/dcalages).
Algorithme:

mmoire,immdiate
REG,immdiate
RCL
mmoire,CL
REG,CL

Dcaletouslesbitsverslagauche,lebitqui
dbordeestplacdansCFetlebitprcdentde
CFestplaclapositiondroitelaissevidepar
ledcalage.
Exemple:
STCplacelaretenue(CF=1).
MOVAL,1ChAL=00011100b
RCLAL,1AL=00111001b,CF=0.
RET
CO
r r
OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
Larotationeffectueundcalagede
l'oprande1gauchedetouslesbitsy

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

46/59

5/6/2015

8086instructions

comprisleflagderetenue.Lenombrede
rotationsestcontenudansl'oprande2.
Algorithme:
Dcaletouslesbitsversladroite,lebitqui
dbordeestplacdansCFetlebitprcdentde
CFestplaclapositiongauchelaissevidepar
ledcalage.

mmoire,immdiate
REG,immdiate
RCR

mmoire,CL
REG,CL

Exemple:
STCplacelaretenue(CF=1).
MOVAL,1ChAL=00011100b
RCRAL,1AL=10001110b,CF=0.
RET
CO
r r
OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
RptelesinstructionsMOVSB,MOVSW,
LODSB,LODSW,STOSB,STOSW,lenombre
defoiscontenudansCX.
Algorithme:
contrle_cx:
siCX<>0alors

REP

excutel'instructionchanesuivante
CX=CX1
retournecontrle_cx

instructionchane

sinon
sortducycleREP
Z
r

RptelesinstructionsCMPSB,CMPSW,
SCASB,SCASW,tantqueZF=1(galitdu
rsultat),lenombredefoismaximum
contenudansCX.
file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

47/59

5/6/2015

8086instructions

Algorithme:
contrle_cx:
siCX<>0alors

REPE

excutel'instructionchanesuivante
CX=CX1
siZF=1alors:
retournecontrle_cx
sinon
sortducycleREPE

instructionchane

sinon
sortducycleREPE
Exemple:
voircmpsb.asmdansledossier"Samples".
Z
r

RptelesinstructionsCMPSB,CMPSW,
SCASB,SCASW,tantqueZF=0(NON
galitdursultat),lenombredefois
maximumcontenudansCX.
Algorithme:
contrle_cx:
siCX<>0alors
REPNE

excutel'instructionchanesuivante
CX=CX1
siZF=0alors:
retournecontrle_cx
sinon
sortducycleREPNE

instructionchane

sinon
sortducycleREPNE
Z
r

RptelesinstructionsCMPSB,CMPSW,
file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

48/59

5/6/2015

8086instructions

SCASB,SCASWtantqueZF=0(rsultat
NONzro),lenombredefoismaximum
contenudansCX.
Algorithme:
contrle_cx:
siCX<>0alors
REPNZ

excutel'instructionchanesuivante
CX=CX1
siZF=0alors:
retournecontrle_cx
sinon
sortducycleREPNZ

instructionchane

sinon
sortducycleREPNZ
Z
r

RptelesinstructionsCMPSB,CMPSW,
SCASB,SCASWtantqueZF=1(rsultat
zro),lenombredefoismaximumcontenu
dansCX.
Algorithme:
contrle_cx:
siCX<>0alors
REPZ

excutel'instructionchanesuivante
CX=CX1
siZF=1alors:
retournecontrle_cx
sinon
sortducycleREPZ

instructionchane

sinon
sortducycleREPZ
Z
r

Retourdesousprogramme(court).
file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

49/59

5/6/2015

8086instructions

Algorithme:
Dpile:
IP
siunoprandeimmdiatestprsent:
SP=SP+oprande
Exemple:
#make_COM#
ORG100hpourunfichierexcutableCOM.
RET

Pasd'oprande
mmeimmdiat

CALLp1
ADDAX,1
RETretourausystmed'exploitation.
p1PROCdclarationdelaprocdure.
MOVAX,1234h
RETretourl'appelant.
p1ENDP
CZSO PA
inchangs

Retourdesousprogramme(long).
Algorithme:

RETF

Dpile:
IP
CS
siunoprandeimmdiatestprsent:
SP=SP+operand

Pasd'oprande
mmeimmdiat

CZSO PA
inchangs

Larotationeffectueundcalagede
l'oprande1gauche.Lenombrede
rotationsestcontenudansl'oprande2.
Algorithme:

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

50/59

5/6/2015

8086instructions

mmoire,immdiate
REG,immdiate
ROL
mmoire,CL
REG,CL

Dcaletouslesbitsverslagauche,lebitqui
dbordeestplacdansCFetlebitprcdentde
CFestplaclapositiondroitelaissevidepar
ledcalage.
Exemple:
MOVAL,1ChAL=00011100b
ROLAL,1AL=00111000b,CF=0.
RET
CO
r r
OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
Larotationeffectueundcalagede
l'oprande1droite.Lenombrede
rotationsestcontenudansl'oprande2.
Algorithme:

mmoire,immdiate
REG,immdiate
ROR
mmoire,CL
REG,CL

Dcaletouslesbitsversladroite,lebitqui
dbordeestplacdansCFetlebitprcdentde
CFestplaclapositiongauchelaissevidepar
ledcalage.
Exemple:
MOVAL,1ChAL=00011100b
RORAL,1AL=00001110b,CF=0.
RET
CO
r r
OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
Placedansleregistredeflagsles8bitsde
poidsfaibledelavaleurdeAH.
Algorithme:
AH=registredeflags

SAHF

Pasd'oprande

BitsdeAH:76543210
[SF][ZF][0][AF][0][PF][1][CF]
lesbits1,3,5sontrservs.

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

51/59

5/6/2015

8086instructions

CZSO PA
r r r r r r

Effectueundcalagearithmtiquede
l'oprande1gauche.Lenombrede
dcalagesestcontenudansl'oprande2.
Algorithme:
Dcaletouslesbitsverslagauche,lebitqui
dbordeestplacdansCF.
Lebit0droiteestmis0.

mmoire,immdiate
REG,immdiate
SAL
mmoire,CL
REG,CL

Exemple:
MOVAL,0E0hAL=11100000b
SALAL,1AL=11000000b,CF=1.
RET
CO
r r
OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
Effectueundcalagearithmtiquede
l'oprande1droite.Lenombrede
dcalagesestcontenudansl'oprande2.
Algorithme:
Dcaletouslesbitsversladroite,lebitqui
dbordeestplacdansCF.
Lebitdesignegauche,gardelammevaleur
qu'avantledcalage.

mmoire,immdiate
REG,immdiate

Exemple:

mmoire,CL
REG,CL

MOVAL,0E0hAL=11100000b
SARAL,1AL=11110000b,CF=0.

SAR

MOVBL,4ChBL=01001100b
SARBL,1BL=00100110b,CF=0.
RET
CO
r r
file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

52/59

5/6/2015

8086instructions

OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
Soustractionavecretenue.
Algorithme:
oprande1=oprande1oprande2CF

SBB

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

Exemple:
STC
MOVAL,5
SBBAL,3AL=531=1
RET
CZSO PA
r r r r r r

Comparelesoctets:ALavecES:[DI].
Algorithme:

SCASB

ES:[DI]AL
placelesflagssuivantlersultat:
OF,SF,ZF,AF,PF,CF
siDF=0alors
DI=DI+1
sinon
DI=DI1

Pasd'oprande

CZSO PA
r r r r r r

Comparelesoctets:AXavecES:[DI].
Algorithme:

SCASW

Pasd'oprande

ES:[DI]AX
placelesflagssuivantlersultat:
OF,SF,ZF,AF,PF,CF
siDF=0alors
DI=DI+2
sinon
DI=DI2

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

53/59

5/6/2015

8086instructions

CZSO PA
r r r r r r

Effectueundcalagedel'oprande1
gauche.Lenombrededcalagesest
contenudansl'oprande2.
Algorithme:
Dcaletouslesbitsverslagauche,lebitqui
dbordeestplacdansCF.
Lebit0droiteestmis0.

mmoire,immdiate
REG,immdiate
SHL
mmoire,CL
REG,CL

Exemple:
MOVAL,11100000b
SHLAL,1AL=11000000b,CF=1.
RET
CO
r r
OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
Effectueundcalagedel'oprande1
droite.Lenombrededcalagesestcontenu
dansl'oprande2.
Algorithme:
Dcaletouslesbitsversladroite,lebitqui
dbordeestplacdansCF.
Lebit0gaucheestmis0.

mmoire,immdiate
REG,immdiate
SHR
mmoire,CL
REG,CL

Exemple:
MOVAL,00000111b
SHRAL,1AL=00000011b,CF=1.
RET
CO
r r
OF=0sic'estlepremieroprande,ilconservelesigne
d'origine.
Mise1duflagderetenue.

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

54/59

5/6/2015

8086instructions

Algorithme:
STC

Pasd'oprande

CF=1
C
1

Mise1duflagdedirection.SIetDIseront
dcrmentsparlesinstructionschanes
suivantes:CMPSB,CMPSW,LODSB,
LODSW,MOVSB,MOVSW,STOSB,STOSW.

STD

Pasd'oprande

Algorithme:
DF=1
D
1

Mise1duflagd'interruption.Dsactive
desinterruptionsmatrielles.
Algorithme:

STI

Pasd'oprande

IF=1
I
1

Copiel'octetcontenudansALdansES:[DI].
MetjourSI.
Algorithme:
ES:[DI]=AL
siDF=0alors
DI=DI+1
sinon
DI=DI1
Exemple:

STOSB

Pasd'oprande

#make_COM#
ORG100h

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

55/59

5/6/2015

8086instructions

LEADI,a1
MOVAL,12h
MOVCX,5
REPSTOSB
RET
a1DB5dup(0)
CZSO PA
inchangs

Copiel'octetcontenudansAXdansES:[DI].
MetjourSI.
Algorithme:
ES:[DI]=AX
siDF=0alors
DI=DI+2
sinon
DI=DI2
Exemple:
STOSW

Pasd'oprande

#make_COM#
ORG100h
LEADI,a1
MOVAX,1234h
MOVCX,5
REPSTOSW
RET
a1DW5dup(0)
CZSO PA
inchangs

Soustraction.
Algorithme:
oprande1=oprande1oprande2

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

56/59

5/6/2015

SUB

8086instructions

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

Exemple:
MOVAL,5
SUBAL,1AL=4
RET
CZSO PA
r r r r r r

AND(ET)logiqueentretouslesbitsdes
deuxoprandespositionneuniquementles
flags.Lesflagssuivantssontaffects:ZF,
SF,PF.Lersultatn'estpasutilis.
Tabledevrit:

TEST

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

1AND(ET)1=1
1AND(ET)0=0
0AND(ET)1=0
0AND(ET)0=0
Exemple:
MOVAL,00000101b
TESTAL,1ZF=0.
TESTAL,10bZF=1.
RET
CZSO P
0 r r 0 r

Echangelesvaleursdesdeuxoprandes.
Algorithme:
oprande1<>oprande2

XCHG

REG,mmoire
mmoire,REG
REG,REG

Exemple:
MOVAL,5
MOVAH,2
XCHGAL,AHAL=2,AH=5
XCHGAL,AHAL=5,AH=2
RET
CZSO PA

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

57/59

5/6/2015

8086instructions

inchangs

Conversiond'octetdepuisunetable.
Copielavaleurdel'octetmmoiredeDS:
[BX+ALnonsign]dansleregistreAL.
Algorithme:
AL=DS:[BX+ALnonsign]
Exemple:
XLATB

Pasd'oprande

#make_COM#
ORG100h
LEABX,dat
MOVAL,2
XLATBAL=33h
RET
datDB11h,22h,33h,44h,55h
CZSO PA
inchangs

XORlogique(OUexclusif)entretouslesbits
desdeuxoprandes.Lersultateststock
danslepremieroprande.
Tabledevrit:

XOR

REG,mmoire
mmoire,REG
REG,REG
mmoire,immdiate
REG,immdiate

1XOR(OUexclusif)1=0
1XOR(OUexclusif)0=1
0XOR(OUexclusif)1=1
0XOR(OUexclusif)0=0
Exemple:
MOVAL,00000111b
XORAL,00000010bAL=00000101b
RET
CZSO PA
0 r r 0 r ?

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

58/59

5/6/2015

8086instructions

Copyright2002emu8086,Inc.
Tousdroitsrservs.
http://www.emu8086.com

file:///C:/Users/Simmed/AppData/Local/Temp/Rar$EXa0.398/Informatique%20industrielle/8086_instruction_set.html#JNC

59/59

Vous aimerez peut-être aussi