0% found this document useful (0 votes)
13 views5 pages

Feleke Instruction Set of 8086 Microprocessor

The 8086 microprocessor instruction set includes various instructions for data transfer, arithmetic, logical operations, shifting, branching, string manipulation, and processor control. Key instructions include MOV, ADD, AND, SHL, JMP, and STI, which facilitate efficient programming across multiple operations. This comprehensive set allows for effective control of data movement, mathematical computations, and execution flow.
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)
13 views5 pages

Feleke Instruction Set of 8086 Microprocessor

The 8086 microprocessor instruction set includes various instructions for data transfer, arithmetic, logical operations, shifting, branching, string manipulation, and processor control. Key instructions include MOV, ADD, AND, SHL, JMP, and STI, which facilitate efficient programming across multiple operations. This comprehensive set allows for effective control of data movement, mathematical computations, and execution flow.
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/ 5

Instruction Set of 8086 Microprocessor (Detailed)

The 8086 instruction set consists of a variety of instructions that perform arithmetic, logical,
data transfer, control transfer, and string operations. Below is a step-by-step and detailed
breakdown of these instructions.

---------------------------------------------
1. Data Transfer Instructions
---------------------------------------------
These instructions transfer data between registers, memory, and I/O ports.

- MOV: Copies data from source to destination (register/memory)


- PUSH: Stores data on the stack
- POP: Retrieves data from the stack
- XCHG: Swaps the values of two operands
- IN: Transfers data from an I/O port to the accumulator
- OUT: Transfers data from the accumulator to an I/O port
- LEA: Loads the effective address of a memory operand into a register
- LDS: Loads DS and another register from memory
- LES: Loads ES and another register from memory

Example:
MOV AX, 1234H ; Move 1234H to AX
MOV BX, AX ; Copy AX value to BX
PUSH AX ; Push AX onto stack
POP CX ; Pop stack value into CX

---------------------------------------------
2. Arithmetic Instructions
---------------------------------------------
These instructions perform mathematical operations.

- ADD: Adds two operands (destination = destination + source)


- SUB: Subtracts two operands (destination = destination - source)
- INC: Increments operand by 1
- DEC: Decrements operand by 1
- MUL: Multiplies AL/AX with operand (unsigned multiplication)
- IMUL: Multiplies AL/AX with operand (signed multiplication)
- DIV: Divides operand (unsigned division)
- IDIV: Divides operand (signed division)
- ADC: Adds with carry (destination = destination + source + carry flag)
- SBB: Subtracts with borrow (destination = destination - source - carry flag)
- NEG: Negates the operand (two's complement)

Example:
MOV AL, 05H
ADD AL, 03H ; AL = AL + 3 (AL = 08H)
SUB AL, 02H ; AL = AL - 2 (AL = 06H)
INC AL ; AL = AL + 1 (AL = 07H)

---------------------------------------------
3. Logical Instructions
---------------------------------------------
These instructions perform bitwise logical operations.

- AND: Performs bitwise AND (used for masking operations)


- OR: Performs bitwise OR (used for setting bits)
- XOR: Performs bitwise XOR (used for toggling bits)
- NOT: Complements the bits (inverts all bits)
- TEST: Performs AND operation but does not store the result

Example:
MOV AL, 0F0H ; AL = 11110000B
AND AL, 0FH ; AL = AL AND 00001111B -> AL = 00000000B
OR AL, 0FH ; AL = AL OR 00001111B -> AL = 00001111B
XOR AL, 0FH ; AL = AL XOR 00001111B -> AL = 00000000B
---------------------------------------------
4. Shift and Rotate Instructions
---------------------------------------------
These instructions shift or rotate bits in registers.

- SHL/SAL: Shift left (each shift doubles the number)


- SHR: Shift right (each shift divides by 2)
- ROL: Rotate left without carry
- ROR: Rotate right without carry
- RCL: Rotate left through carry flag
- RCR: Rotate right through carry flag

Example:
MOV AL, 11001100B
SHL AL, 1 ; Shift left -> AL = 10011000
ROR AL, 1 ; Rotate right -> AL = 01001100

---------------------------------------------
5. Branch and Control Instructions
---------------------------------------------
These instructions control the execution flow.

- JMP: Unconditional jump to a given address


- CALL: Calls a subroutine
- RET: Returns from a subroutine
- JC: Jump if carry flag is set
- JNC: Jump if carry flag is not set
- JZ: Jump if zero flag is set
- JNZ: Jump if zero flag is not set
- LOOP: Loops until CX = 0

Example:
MOV CX, 05H
LOOP_LABEL:
DEC CX ; Decrement CX
JNZ LOOP_LABEL ; Jump back if CX != 0

---------------------------------------------
6. String Instructions
---------------------------------------------
These instructions operate on sequences of bytes or words.

- MOVS: Moves a string from source to destination


- CMPS: Compares two strings
- SCAS: Scans a string for a given value
- LODS: Loads a string into AL/AX
- STOS: Stores AL/AX into a string

Example:
MOV SI, OFFSET SOURCE ; Source address
MOV DI, OFFSET DEST ; Destination address
MOV CX, LENGTH ; Set loop count
REP MOVSB ; Move CX bytes from SI to DI

---------------------------------------------
7. Processor Control Instructions
---------------------------------------------
These instructions control the execution of the processor.

- STI: Set Interrupt Flag (enable interrupts)


- CLI: Clear Interrupt Flag (disable interrupts)
- HLT: Halt the processor
- NOP: No operation (delay)
- WAIT: Wait for an external signal
Example:
CLI ; Disable interrupts
NOP ; Do nothing
STI ; Enable interrupts
HLT ; Halt the processor

---------------------------------------------
Summary of 8086 Instructions:
---------------------------------------------
- **Data Transfer**: MOV, PUSH, POP, XCHG, IN, OUT, LEA, LDS, LES
- **Arithmetic**: ADD, SUB, MUL, DIV, INC, DEC, ADC, SBB, NEG
- **Logical**: AND, OR, XOR, NOT, TEST
- **Shift/Rotate**: SHL, SHR, ROL, ROR, RCL, RCR
- **Branching**: JMP, CALL, RET, LOOP, JZ, JNZ, JC, JNC
- **String Operations**: MOVS, CMPS, SCAS, LODS, STOS
- **Processor Control**: STI, CLI, HLT, NOP, WAIT

The 8086 instruction set provides powerful features for efficient programming,
covering all essential operations from data movement to logical, arithmetic,
and control flow handling.

You might also like