Instruction Format in 8086 Microprocessor
Instruction Format in 8086 Microprocessor
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)
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.
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