0% found this document useful (0 votes)
58 views12 pages

Instruction Format in 8086 Microprocessor

The document discusses the different instruction formats used in the 8086 microprocessor. It describes the general instruction format and fields like opcode, direction, word size, MOD, R/M and REG. It then explains the six general instruction formats used - one byte, register to register, register to/from memory with and without displacement, immediate operand to register, and immediate operand to memory with displacement.

Uploaded by

rbardak
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)
58 views12 pages

Instruction Format in 8086 Microprocessor

The document discusses the different instruction formats used in the 8086 microprocessor. It describes the general instruction format and fields like opcode, direction, word size, MOD, R/M and REG. It then explains the six general instruction formats used - one byte, register to register, register to/from memory with and without displacement, immediate operand to register, and immediate operand to memory with displacement.

Uploaded by

rbardak
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/ 12

Instruction Format in 8086 Microprocessor

For every instruction that is executed in the 8086 microprocessor,


an instruction format is available that is the binary representation of
that instruction.
This instruction format can be coded from 1 to 6 bytes depending upon
the addressing modes used for instructions.
The general Instruction format that most of the instructions of
the 8086 microprocessor follow is:

PRPCEM,CSE,Prof. S.A.Gulhane
The first field is called as operation code field or op-code field, which
indicates the type of operation to be performed by the CPU
•The instruction format also contains other fields known as operand
fields
•The CPU executes the instruction using the information which reside in
these fields
.
•Opcode stands for Operation Code. Every Instruction has a unique 6-bit
opcode. For example, the opcode for MOV is 100010.
•D stands for direction
If D=0, then the direction is from the register
If D=1, then the direction is to the register
•W stands for word
If W=0, then only a byte is being transferred, i.e. 8 bits
If W=1, them a whole word is being transferred, i.e. 16 bits

PRPCEM,CSE,Prof. S.A.Gulhane
•The MOD and R/M together is calculated based upon the addressing mode and
register being used in it. This is calculated as follows:
R/M 00 01 10 11
(Memory Mode (Memory mode (Memory Mode (Register Mode)
with no with 8 bit with 16 bit
displacement) displacement) displacement)

000 [BX] + [SI] [BX] + [SI] + d8 [BX] + [SI] + AL AX


d16
001 [BX] + [DI] [BX] + [DI] + d8 [BX] + [DI] + CL CX
d16
010 [BP] + [SI] [BP] + [SI] + d8 [BP] + [SI] + DL DX
d16
011 [BP] + [DI] [BP] + [DI] + d8 [BP] + [DI] + BL BX
d16
100 [SI] [SI] + d8 [SI] + d16 AH SP
101 [DI] [DI] + d8 [DI] + d16 CH BP
110 d16 (direct) [BP] + d8 [BP] + d16 DH SI
111
PRPCEM,CSE,Prof. S.A.Gulhane
[BX] [BX] + d8 [BX] + d16 BH DI
•REG stands for register selected. It is a 3-bit code which is calculated as follows:

REG Code Register Selected


000 AL AX
001 CL CX
010 DL DX
011 BL BX
100 AH SP
101 CH BP
PRPCEM,CSE,Prof. S.A.Gulhane
110 DH SI
111 BH DI
There are six general formats of instructions in 8086 instruction set

1 One Byte Instruction:


•This format is only one byte long and may have the implied data or
register operands.
•The least significant 3-bits of the opcode are used for specifying the
register operand, if any.
•Otherwise, all the 8 bits form an opcode and the operands are implied
– Eg: CLC, clear carry (11111000)

PRPCEM,CSE,Prof. S.A.Gulhane
2 Register to Register:
•This format is 2 bytes long
•The first byte of the code specifies the operation code
and width of the operand specified by ‘w’ bit.
•The second byte of the code shows the register
operands and R/M field, as shown below.

•The register represented by the REG field is one of the


operands.
•The R/M field specifies another register or memory location
PRPCEM,CSE,Prof. S.A.Gulhane
3 Register to/from memory with no
displacement:
•This format is also 2 bytes long and similar to the
Register to Register format except for the MOD field as
shown.

•TheMOD field shows the mode of addressing. The MOD,


R/M, REG and the ‘W’ fields are decided in Table

PRPCEM,CSE,Prof. S.A.Gulhane
4 Register to/from Memory with Displacement:
•This type of instruction format contains 1 or 2 additional
bytes for displacement along with 2 byte format of the
register to/from memory without displacement.
The format is as shown below.

PRPCEM,CSE,Prof. S.A.Gulhane
5 Immediate Operand to Register:
•In this format, the first byte as well as the 3-bits from the second
byte which are used for REG field in case of register to register
format are used for opcode.
•It also contains one or two bytes of immediate data. The
complete instruction format is as shown below

PRPCEM,CSE,Prof. S.A.Gulhane
6 Immediate Operand to Memory with 16-bit
displacement:
•This type of instruction format requires 5 or 6 bytes for
coding.
•The first 2 bytes contain the information regarding OPCODE,
MOD and R/M fields.
The remaining 4 bytes contain 2 bytes of displacement and 2
bytes of data as shown.

PRPCEM,CSE,Prof. S.A.Gulhane
PRPCEM,CSE,Prof. S.A.Gulhane
Examples

MOV BL,AL (88C3H)


Opcode for MOV = 100010
D = 0 (AL source operand)
W bit = 0 (8-bits)

Therefore byte 1 is 10001000=8816H


• MOD = 11 (register mode)
• REG = 000 (code for AL)
• R/M = 011 (destination is BL)

Therefore Byte 2 is 11000011=C316H


PRPCEM,CSE,Prof. S.A.Gulhane

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy