Microprocessor - 8086 Instruction Sets
Microprocessor - 8086 Instruction Sets
Let us now discuss t hese inst ruct ion set s in det ail.
OUT − Used t o send out a byt e or word from t he accumulat or t o t he provided port .
LES − Used t o load ES regist er and ot her provided regist er from t he memory.
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.
DAA − Used t o adjust t he decimal aft er t he addit ion/subt ract ion operat ion.
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.
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.
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.
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.
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.
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.
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.
LODS/LODSB/LODSW − Used t o st ore t he st ring byt e int o AL or st ring word int o AX.
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
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)
CLI − Used t o clear t he int errupt enable flag t o 0, i.e., disable INTR input .
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
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