Professional Documents
Culture Documents
8086 has a powerful instruction set containing 117 basic instructions. The instruction set of 8086 can be divided into following groups:1. Data transfer instruction 2. Arithmetic group 3. Bit manipulation group 4. String instruction group 5. Program/control transfer group 6. Process control group
1. MOV reg. , reg.:This instruction will copy the contents of source register to the destination register. Example:-MOV AX, BX 2. MOV Reg., mem:This instruction copies the contents of specified memory locations to the Destination register. Example:- MOV CX,[DI] 3. MOV mem.,reg
4. MOV reg. , Data:This instruction will copy the immediate data to the destination register. Example:- MOV CL,02H 5. MOV Mem. , Data 6. MOV AX , Mem.:This instruction copies the contents of given memory locations to the accumulator. Example:- MOV AL,[SI]
7. MOV Mem., AX:This instruction copies the contents of accumulator to memory location specified in the instruction. Example:-MOV [SI],AL 8. MOV seg. Reg. ,reg-16:This instruction will copy the source register contents to the destination segment register Example:- MOV DS,AX 9. MOV seg. Reg. , Mem 16 Example:- MOV DS,[SI]
10. MOV reg.16,seg reg. 11. MOV mem.,seg reg. 12. PUSH source:PUSH can be used to save the data on the stack. Example:- PUSH AX 13. POP destination Example:- POP AX
14. XCHG destination , source:Exchange byte or word This instruction exchange the contents of a register with the contents of another register or the contents of a register with the contents of memory location. Example:-XCHG AX,DX XCHG [1234],BX
This instruction replaces a byte in AL register with a byte from a look up table in the memory. 16. IN accumulator , port address Example:- IN AL,0056H 17.OUT port address , accumulator Example:- OUT 3BH,AL
LDS,LEA,LES
Arithmetic Group
Arithmetic instruction:-
Subtraction instruction:-
CMP:-compare byte or word This instruction compares a byte/word from source with the byte/word from destination. The comparison is done by subtracting the source byte or word from the destination word/byte
Multiplication:Multiplication MUL IMUL AAM Multiply byte or word unsigned Multiply byte or word signed Integer multiply byte or word ASCII adjust for multiply AH=AL/10 AL=remainder
Division:Division DIV IDIV AAD CBW CWD Divide byte or word unsigned Divide byte or word signed ASCII adjust for division Convert byte to word Convert word to double-word AL=(AH*10)+AL AH=00
NOT
AND OR XOR TEST
NOT AX
AND AL,BL OR AL,BL XOR AL,BL TEST AL,75H
Shift operation:SHIFTS SHL SAR Shift logical left byte or word Shift arithmetic right byte or word
SHR
SAR
Rotate operation:ROTATES ROL ROR Rotate left byte or word Rotate right byte or word
RCL
RCR
Flag operations
STC CLC CMC STD CLD STI CLI NOP HLT Set the carry flag Clear the carry flag Complement carry flag Set direction flag Clear direction flag Set interrupt enable flag Clear interrupt enable flag No operation No operation External Synchronization Stop fetching and executing instruction
WAIT
ESC LOCK
Unconditional transfer:Instruction CALL RET Meaning Call procedure Return from procedure
JMP
Jump
Iteration control instruction:Instruction LOOP LOOPE/LOOPZ LOOPNE/LOOPNZ Meaning Loop Loop if equal/zero Loop if not equal /not zero
JA/JNBE
JAE/JNB JB/JNAE
JBE/JNA
JC JNC
JE/JZ
JG/JNLE JGE/JNL
Jump if equal/zero
Jump if greater/not less nor equal Jump if greater or equal/not less
JL/JNGE
JLE/JNG
Meaning Jump if not equal/not zero Jump if not overflow Jump if not parity/parity odd Jump if not sign Jump if overflow Jump if parity/parity even Jump if sign
Interrupts instruction
Instructions INT INTO IRET meaning Interrupt Interrupt if overflow Interrupt return
REPNE/REPNZ
MOVS MOVSB/MOVSW CMPS SCAS
LODS
STOS