0% found this document useful (0 votes)
37 views7 pages

Microprocessor - 8086 Instruction Sets

The document discusses the various instruction sets supported by the 8086 microprocessor, including data transfer, arithmetic, bit manipulation, string, program execution transfer, processor control, iteration control, and interrupt instructions.

Uploaded by

Vasu Vasu
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)
37 views7 pages

Microprocessor - 8086 Instruction Sets

The document discusses the various instruction sets supported by the 8086 microprocessor, including data transfer, arithmetic, bit manipulation, string, program execution transfer, processor control, iteration control, and interrupt instructions.

Uploaded by

Vasu Vasu
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/ 7

Microprocessor - 8086 Instruction Sets

The 8086 microprocessor support s 8 t ypes of inst ruct ions −

Dat a Transfer Inst ruct ions


Arit hmet ic Inst ruct ions
Bit Manipulat ion Inst ruct ions

St ring Inst ruct ions


Program Execut ion Transfer Inst ruct ions (Branch & Loop Inst ruct ions)
Processor Cont rol Inst ruct ions

It erat ion Cont rol Inst ruct ions

Int errupt Inst ruct ions

Let us now discuss t hese inst ruct ion set s in det ail.

Data Transfer Instructions


These inst ruct ions are used t o t ransfer t he dat a from t he source operand t o t he dest inat ion
operand. Following are t he list of inst ruct ions under t his group −

Instruction to transfer a word

MOV − Used t o copy t he byt e or word from t he provided source t o t he provided


dest inat ion.
PPUSH − Used t o put a word at t he t op of t he st ack.
POP − Used t o get a word from t he t op of t he st ack t o t he provided locat ion.

PUSHA − Used t o put all t he regist ers int o t he st ack.


POPA − Used t o get words from t he st ack t o all regist ers.
XCHG − Used t o exchange t he dat a from t wo locat ions.

XLAT − Used t o t ranslat e a byt e in AL using a t able in t he memory.

Instructions for input and output port transfer


IN − Used t o read a byt e or word from t he provided port t o t he accumulat or.

OUT − Used t o send out a byt e or word from t he accumulat or t o t he provided port .

Instructions to transfer the address

LEA − Used t o load t he address of operand int o t he provided regist er.


LDS − Used t o load DS regist er and ot her provided regist er from t he memory

LES − Used t o load ES regist er and ot her provided regist er from t he memory.

Instructions to transfer flag registers

LAHF − Used t o load AH wit h t he low byt e of t he flag regist er.

SAHF − Used t o st ore AH regist er t o low byt e of t he flag regist er.


PUSHF − Used t o copy t he flag regist er at t he t op of t he st ack.

POPF − Used t o copy a word at t he t op of t he st ack t o t he flag regist er.

Arithmetic Instructions
These inst ruct ions are used t o perform arit hmet ic operat ions like addit ion, subt ract ion,
mult iplicat ion, division, et c.

Following is t he list of inst ruct ions under t his group −

Instructions to perform addition

ADD − Used t o add t he provided byt e t o byt e/word t o word.

ADC − Used t o add wit h carry.


INC − Used t o increment t he provided byt e/word by 1.

AAA − Used t o adjust ASCII aft er addit ion.

DAA − Used t o adjust t he decimal aft er t he addit ion/subt ract ion operat ion.

Instructions to perform subtraction

SUB − Used t o subt ract t he byt e from byt e/word from word.
SBB − Used t o perform subt ract ion wit h borrow.

DEC − Used t o decrement t he provided byt e/word by 1.

NPG − Used t o negat e each bit of t he provided byt e/word and add 1/2’s complement .
CMP − Used t o compare 2 provided byt e/word.

AAS − Used t o adjust ASCII codes aft er subt ract ion.

DAS − Used t o adjust decimal aft er subt ract ion.

Instruction to perform multiplication

MUL − Used t o mult iply unsigned byt e by byt e/word by word.


IMUL − Used t o mult iply signed byt e by byt e/word by word.

AAM − Used t o adjust ASCII codes aft er mult iplicat ion.

Instructions to perform division

DIV − Used t o divide t he unsigned word by byt e or unsigned double word by word.
IDIV − Used t o divide t he signed word by byt e or signed double word by word.

AAD − Used t o adjust ASCII codes aft er division.

CBW − Used t o fill t he upper byt e of t he word wit h t he copies of sign bit of t he lower
byt e.
CWD − Used t o fill t he upper word of t he double word wit h t he sign bit of t he lower word.

Bit Manipulation Instructions


These inst ruct ions are used t o perform operat ions where dat a bit s are involved, i.e. operat ions like
logical, shift , et c.

Following is t he list of inst ruct ions under t his group −

Instructions to perform logical operation

NOT − Used t o invert each bit of a byt e or word.


AND − Used for adding each bit in a byt e/word wit h t he corresponding bit in anot her
byt e/word.
OR − Used t o mult iply each bit in a byt e/word wit h t he corresponding bit in anot her
byt e/word.
XOR − Used t o perform Exclusive-OR operat ion over each bit in a byt e/word wit h t he
corresponding bit in anot her byt e/word.
TEST − Used t o add operands t o updat e flags, wit hout affect ing operands.

Instructions to perform shift operations

SHL/SAL − Used t o shift bit s of a byt e/word t owards left and put zero(S) in LSBs.
SHR − Used t o shift bit s of a byt e/word t owards t he right and put zero(S) in MSBs.

SAR − Used t o shift bit s of a byt e/word t owards t he right and copy t he old MSB int o t he
new MSB.

Instructions to perform rotate operations

ROL − Used t o rot at e bit s of byt e/word t owards t he left , i.e. MSB t o LSB and t o Carry
Flag [CF].
ROR − Used t o rot at e bit s of byt e/word t owards t he right , i.e. LSB t o MSB and t o Carry
Flag [CF].
RCR − Used t o rot at e bit s of byt e/word t owards t he right , i.e. LSB t o CF and CF t o MSB.
RCL − Used t o rot at e bit s of byt e/word t owards t he left , i.e. MSB t o CF and CF t o LSB.

String Instructions
St ring is a group of byt es/words and t heir memory is always allocat ed in a sequent ial order.

Following is t he list of inst ruct ions under t his group −

REP − Used t o repeat t he given inst ruct ion t ill CX ≠ 0.

REPE/REPZ − Used t o repeat t he given inst ruct ion unt il CX = 0 or zero flag ZF = 1.
REPNE/REPNZ − Used t o repeat t he given inst ruct ion unt il CX = 0 or zero flag ZF = 1.
MOVS/MOVSB/MOVSW − Used t o move t he byt e/word from one st ring t o anot her.

COMS/COMPSB/COMPSW − Used t o compare t wo st ring byt es/words.


INS/INSB/INSW − Used as an input st ring/byt e/word from t he I/O port t o t he provided
memory locat ion.
OUTS/OUTSB/OUTSW − Used as an out put st ring/byt e/word from t he provided memory
locat ion t o t he I/O port .

SCAS/SCASB/SCASW − Used t o scan a st ring and compare it s byt e wit h a byt e in AL or


st ring word wit h a word in AX.

LODS/LODSB/LODSW − Used t o st ore t he st ring byt e int o AL or st ring word int o AX.

Program Execution Transfer Instructions (Branch and Loop


Instructions)
These inst ruct ions are used t o t ransfer/branch t he inst ruct ions during an execut ion. It includes
t he following inst ruct ions −

Inst ruct ions t o t ransfer t he inst ruct ion during an execut ion wit hout any condit ion −

CALL − Used t o call a procedure and save t heir ret urn address t o t he st ack.
RET − Used t o ret urn from t he procedure t o t he main program.

JMP − Used t o jump t o t he provided address t o proceed t o t he next inst ruct ion.

Inst ruct ions t o t ransfer t he inst ruct ion during an execut ion wit h some condit ions −

JA/JNBE − Used t o jump if above/not below/equal inst ruct ion sat isfies.

JAE/JNB − Used t o jump if above/not below inst ruct ion sat isfies.
JBE/JNA − Used t o jump if below/equal/ not above inst ruct ion sat isfies.
JC − Used t o jump if carry flag CF = 1

JE/JZ − Used t o jump if equal/zero flag ZF = 1


JG/JNLE − Used t o jump if great er/not less t han/equal inst ruct ion sat isfies.
JGE/JNL − Used t o jump if great er t han/equal/not less t han inst ruct ion sat isfies.

JL/JNGE − Used t o jump if less t han/not great er t han/equal inst ruct ion sat isfies.
JLE/JNG − Used t o jump if less t han/equal/if not great er t han inst ruct ion sat isfies.
JNC − Used t o jump if no carry flag (CF = 0)

JNE/JNZ − Used t o jump if not equal/zero flag ZF = 0


JNO − Used t o jump if no overflow flag OF = 0
JNP/JPO − Used t o jump if not parit y/parit y odd PF = 0

JNS − Used t o jump if not sign SF = 0


JO − Used t o jump if overflow flag OF = 1
JP/JPE − Used t o jump if parit y/parit y even PF = 1

JS − Used t o jump if sign flag SF = 1

Processor Control Instructions


These inst ruct ions are used t o cont rol t he processor act ion by set t ing/reset t ing t he flag values.

Following are t he inst ruct ions under t his group −

STC − Used t o set carry flag CF t o 1


CLC − Used t o clear/reset carry flag CF t o 0
CMC − Used t o put complement at t he st at e of carry flag CF.

STD − Used t o set t he direct ion flag DF t o 1


CLD − Used t o clear/reset t he direct ion flag DF t o 0
STI − Used t o set t he int errupt enable flag t o 1, i.e., enable INTR input .

CLI − Used t o clear t he int errupt enable flag t o 0, i.e., disable INTR input .

Iteration Control Instructions


These inst ruct ions are used t o execut e t he given inst ruct ions for number of t imes. Following is
t he list of inst ruct ions under t his group −

LOOP − Used t o loop a group of inst ruct ions unt il t he condit ion sat isfies, i.e., CX = 0

LOOPE/LOOPZ − Used t o loop a group of inst ruct ions t ill it sat isfies ZF = 1 & CX = 0
LOOPNE/LOOPNZ − Used t o loop a group of inst ruct ions t ill it sat isfies ZF = 0 & CX = 0

JCXZ − Used t o jump t o t he provided address if CX = 0

Interrupt Instructions
These inst ruct ions are used t o call t he int errupt during program execut ion.
INT − Used t o int errupt t he program during execut ion and calling service specified.
INTO − Used t o int errupt t he program during execut ion if OF = 1

IRET − Used t o ret urn from int errupt service t o t he main program

You might also like