Feleke Instruction Set of 8086 Microprocessor
Feleke Instruction Set of 8086 Microprocessor
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.
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.
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.
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.
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.
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.
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.
---------------------------------------------
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.