BISWAJIT ADHIKARI_28101623024_PC EE 602.pdf

BiswajitAdhikari6 10 views 13 slides Feb 26, 2025
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

SDSFVS


Slide Content

Gargi Memorial Institute of Technology

1
Title of the Topic

8086 Instruction Set
Name of the Student: BISWAJIT ADHIKARI
RollNumber:28101623024
Registration Number:232810120222
Present Semester:

6
th

Department of Electrical Engineering

Course Name: Microprocessor & Microcontroller
Course Code: (PC - EE - 602)

2





8086 Instruction Set

The 8086 instruction Set finds an important part in today’s modern computing, providing strong support for software
development. It has ability to work with older system and offering wide variety of instructions, making it useful for
programmers. As technology changes, the concepts introduced by 8086 mains constant, showing its significance in the world
of computing.

Table of Content
 8086 Instruction Set
 Classification of Instructions set
 Addressing Modes
 Key Instructions in the 8086 Instruction Set
 Assembly Language Programming with the 8086
 8086 Instruction Set Extensions
 FAQs on 8086 Instruction Set


What is 8086 Instruction Set?
The 8086 instruction set is a group of commands that the Intel 8086 microprocessor uses to perform tasks. It
includes a variety of instructions that allow developers to create software for many different

2

tasks, from simple math to more complex processing. Understanding this instruction set is essential for anyone
looking to work with the 8086 microprocessor and its applications.

Classification of Instructions Set

Data Movement Instructions


Instructions
MOV Transfer data from source to destination.
XCHG Swap the contents of two registers or a register and a memory location.
PUSH Push data onto the stack.
POP Pop the data from the stack.
LEA Load Effective Address (loads the address of a memory operand into
a register).



Arithmetic Instructions:-

2

Instructions Definition/Meaning
ADD, SUB, ADC, SBB Sum, difference, sum with carry, difference with borrow.
INC, DEC: Increment, decrement.
MUL, IMUL, DIV, IDIV: Multiplication and division (unsigned and signed).

Logic Instructions:-

Instructions Definition/Meaning
AND, OR, XOR, NOT Bitwise logical operations.
TEST Bitwise AND operation modifies flags while operands remain
unchanged.
SHL, SHR, SAL, SAR Shift left, shift right (logical and arithmetic).
ROL, ROR, RCL, RCR Left rotate, right rotate (with carry).

2

Control Transfer Instructions:-


Instructions Definition/Meaning
JMP Absolute jump to a specified address.
JC, JNC, JZ, JNZ, JS,
JNS, JO, JNO


Conditional branching on the flags.
CAL Call a subroutine.
RET Return from subroutine.
INT Software interrupt.
IRET Interrupt return.

String Instructions:-


Instructions Definition/Meaning
MOVSB, MOVSW Transfer byte or word from source to destination (used in string manipulation).
CMPSB, CMPSW: Compare byte or word string operands.

2
SCASB, SCASW Scan byte or word string operands.
LODSB, LODSW Get a byte or word from memory into the accumulator.

Input/Output Instructions:-

Instructions Definition/Meaning
IN Input from port.
OUT Output to port.

Flag Control Instructions:-

Instructions Definition/Meaning
CLC, STC, CMC Set, clear, complement flags
on CY
CLD, STD


Set direction flag.
CLI, STI Clr int flag.
HLT: Halt processor execution.

2

Other Instructions:-

Instructions Definition/Meaning
NOP No operation.
WAIT Await external event.
ESC Jump to external coprocessor.

Process Control Instructions;-

 Process Control Instructions are used to control the order execution in a program and in
processes. They comprise of instruction for branching, looping, and calling functions or
subroutines.
 In other words, the instruction set changes the sequence of instruction executing, therefore, it
allows to change the program flow. Include commands for conditional jump, unconditional
jump, subroutine calls among others.

2

Instruction Definition/Meaning
Branching
Instructions
Branching Instruction that transfers the flow of execution onto certain conditions
or unconditional transfers to the part of the program.
Looping Instructions Instruction that can be used to repeatedly execute a block of code either
conditionally or unconditionally.
Subroutine
Instructions
Subroutine Instructions are used to call and return from subroutine to enhance
code modularity and reusability.
Unconditional Jumps Unconditional Jumps Included in the program flow are the instructions that
unconditionally jump to a predetermined location without taking any condition in
to account.
Conditional Jumps Conditional Jumps Conditionals that moves the control flow to a specific address
depending on the truth value of a condition.
Subroutine Calls


Jump Commands Instructions that are responsible for transferring control to a
subroutine, enabling task execution, while promoting code modularity and
reusability.

Addressing Modes;-

The addressing modes of computer architecture are the various ways in which operand(s) of an instruction are
specified. These modes define how the processor finds the data it needs to execute a command. The Intel 8086
microprocessor has support for many addressing modes, each granting flexibility in addressing memory and registers
at the same time.
Below are the main addressing modes supported by the 8086
Immediate Addressing
 In case of immediate addressing, the operand is a constant value or immediate data that is
part of the instruction itself.

2

 Example: MOV AX, 1234h - copies value 1234h into AX.

Direct Addressing:-

 In direct addressing, the operand's address is directly specified in the instruction itself.
 Example: MOV AX, [1234h] - displaces register AX with the data stored at the memory
location 1234h.
Indirect Addressing:-

 In indirect addressing, the address of the operand is stored in a register or memory location,
and the data is at that address.
 Example: MOV AX, [BX] - copies the data pointed to by a 16-bit signed offset relative to a
16-bit register with data type of pointer into a 16-bit register with data type of integer.

Indexed Addressing:-

 In indexed addressing, the operand's address is obtained by computing the offset together
with a base address stored in a register.
 Example: MOV AX, [BX+SI] - Moves the data located at the address formed by adding the
contents of BX and SI registers into register AX.

Based Addressing;-

 Like indexed addressing, but the base address is added to the offset in the instruction.
 Example: MOV AX, [1234h+SI] – loads register AX with data from the address that is 1234h
added with SI.

2

Based Indexed Addressing:-

 Combines based and listed addressing modes, in which an offset is introduced to a base deal
with stored in a sign in, and an index sign in is used to in addition regulate the address.
 Example: MOV AX, [BX DI 10h] - movements the facts positioned on the cope with shaped
through adding the contents of BX, DI, and an instantaneous offset of 10h into sign up AX.

Key Instructions in the 8086 Instruction Set

The Intel 8086 microprocessor has a wealthy coaching set architecture (ISA) with loads of commands
catering to different responsibilities.
Here are some key instructions in the 8086 instruction set along side information on their capability and
utilization:
MOV (Move):-

 Syntax: MOV destination, supply
 Description: The MOV preparation transfers statistics from a supply operand to a destination
operand. The source and destination operands may be registers, memory places, or
instantaneous values.
 Example: MOV AX, BX - Moves the contents of sign in BX into sign up AX.

ADD (Addition):-
 Syntax: ADD destination, source
 Description: The ADD instruction takes a value from the source operand and adds it to the
destination operand. The result of this addition is then stored in the destination operand.

2
 Example: ADD AX, BX - Adds the contents of register BX to register AX and stores the result
in sign up AX.
SUB (Subtraction):-

 Syntax: SUB destination, source
 Description: The SUB instruction subtracts the value of the source operand from the
destination operand. The result of this subtraction is then stored in the destination operand.
 Example: SUB AX, BX - Subtracts the contents of register BX from register AX and stores the
result in sign up AX.
INC (Increment):-

 Syntax: INC operand
 Description: The INC instruction increments the value of the operand by using one.
 Example: INC AX - Increments the fee of register AX via one.
DEC (Decrement):-

 Syntax: DEC operand
 Description: The DEC coaching decrements the fee of the operand by using one.
 Example: DEC AX - Decrements the value of register AX via one.
CMP (Compare):-

 Syntax: CMP operand1, operand2
 Description: The CMP training plays a subtraction among operand1 and operand2, but it does
now not save the result. It only updates the flags sign up primarily based on the result of the
comparison.
 Example: CMP AX, BX - Compares the content.

2


PUSH:-

 PUSH stores the value from a register or memory location in the top of a stack. It is used to
pass parameters to subroutines or store the registers’ values.
 The code implicates a transition of the AX register data to the stack. Following the stacking,
the stack pointer is decremented to point to the new top of the stack.
POP:_

 POP instruction carries out the operation of storing the topmost value of the stack into a
register, a memory location or a stack. In this case, it serves for bringing the last values
already applied to the stack.
 This instruction is used to pop the highest value from the stack and load it into the AX
register. Upon completion, the value that was formerly pushed onto the stack is transferred
into AX, while the stack pointer (SP) is increased to point to the new top of the stack
POPA:-
 Instruction POPA knocks values out of stack frame in a defined order and puts them into
general-purpose registers. It isn't the counterpart of the PUSHA command.
 This indicates deserving values from stack to registers (DI, SI, BP upward to AX) using the
stack system. Next, EAX, ECX, and EDX registers are holding the original value that has been
saved onto the stack in the opposite order.
PUSHA:-

 The PUSHA instruction of the pushes the values of general-purpose registers to the stack in
that order. Saving temporary register values before the subroutine changes and restoring
them later is also a part of it.

2
 This instruction loads values into the stack from AX and upwards, including CX, DX, and
ending with DI. Following every register write, the corresponding value is pushed on the
stack and the stack pointer (SP) is decremented.

Assembly Language Programming with the 8086
 8086 Architecture Familiarization: Study the architecture of the 8086 CPU which includes its
registers, memory organization, instruction set, and addressing modes.
 Development Environment Setup: Get assembler (NASM, MASM) installed and configured
and emulator or hardware (DOSBox, Bosch) in place and make assembly language programs
of your own to write, compile, and test.
 Writing Programs Using Mnemonics: Write assembly language programs in the 8086
computer using instructions, data representation, control structures, and interrupt handling.
 Debugging and Testing: Debug programs using methods such as single stepping, register
and memory content inspection, and utilize debuggers or emulators to assure proper
functioning.
 Optimization and Documentation: Optimize performance and efficiency of programs by
minimizing instruction count and memory access while maximizing using registers. Document
programs in details using comments and variable descriptions for clarity and maintenance.
Tags