SlideShare une entreprise Scribd logo
1  sur  5
Télécharger pour lire hors ligne
8086 INSTRUCTION FORMATS
Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore
1
Byte 3 Byte 4
UNIT 2. Instruction Format:
The 8086 instruction sizes vary from one to six bytes. Depending on the type of coding, an
instruction may have more than one Hexcode, (not unique as in 8085)
The OP code field occupies 6-bits.It defines the operation to be carried out by the instruction.
Register Direct bit (D) occupies one bit. It defines whether the register operand in byte 2 is the
source or destination operand.
D=1 Specifies that the register operand is the destination operand.
D=0 indicates that the register is a source operand.
Data size bit (W) defines whether the operation to be performed is an 8 bit or 16 bit data
W=0 indicates 8 bit operation
W=1 indicates 16 bit operation
7 2 1 0 7 6 5 4 3 2 1 0
Opcode D W MOD REG R/M
Low Disp/
DATA
High Disp/
DATA
The second byte of the instruction usually identifies whether one of the operands is in memory or
whether both are registers.
This byte contains 3 fields. These are the mode (MOD) field, the register (REG) field and the
Register/Memory (R/M) field.
MOD
(2 bits)
Interpretation
00 Memory mode with no displacement follows except for 16 bit displacement when R/M=110
01 Memory mode with 8 bit displacement
10 Memory mode with 16 bit displacement
11 Register mode (no displacement)
Register field occupies 3 bits. It defines the register for the first operand which is specified as
source or destination by the D bit.
Register Codes:
Byte 1 Byte 2 OR
Register Operand/Register to use EA
Calculation
Register Operand/Extension of opcode
Register mode/Memory mode with
displacement length
Word/byte operation
Direction is to register/from register
Operation code
DIRECT
ADDRESS LOW
BYTE
DIRECT
ADDRESS HIGH
BYTE
8086 INSTRUCTION FORMATS
Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore
2
REG W=0 W=1
000 AL AX
001 CL CX
010 DL DX
011 BL BX
100 AH SP
101 CH BP
110 DH SI
111 BH DI
The R/M field occupies 3 bits. The R/M field along with the MOD field defines the
second operand as shown below.
MOD 11
R/M W=0 W=1
000 AL AX
001 CL CX
010 DL DX
011 BL BX
100 AH SP
101 CH BP
110 DH SI
111 BH DI
Effective Address Calculation
R/M MOD=00 MOD 01 MOD 10
000 (BX) + (SI) (BX)+(SI)+D8 (BX)+(SI)+D16
001 (BX)+(DI) (BX)+(DI)+D8 (BX)+(DI)+D16
010 (BP)+(SI) (BP)+(SI)+D8 (BP)+(SI)+D16
011 (BP)+(DI) (BP)+(DI)+D8 (BP)+(DI)+D10
100 (SI) (SI) + D8 (SI) + D16
101 (DI) (DI) + D8 (DI) + D16
110 Direct address (BP) + D8 (BP) + D16
111 (BX) (BX) + D8 (BX) + D16
In the above, encoding of the R/M field depends on how the mode field is set. If MOD=11
(register to register mode), this R/M identifies the second register operand.
MOD selects memory mode, then R/M indicates how the effective address of the memory
operand is to be calculated. Bytes 3 through 6 of an instruction are optional fields that
MOD / R/M Memory Mode (EA Calculation) Register Mode
00 01 10 W=0 W=1
000 (BX)+(SI) (BX)+(SI)+d8 (BX)+(SI)+d16 AL AX
001 (BX) + (DI) (BX)+(DI)+d8 (BX)+(DI)+d16 CL CX
010 (BP)+(SI) (BP)+(SI)+d8 (BP)+(SI)+d16 DL DX
011 (BP)+(DI) (BP)+(DI)+d8 (BP)+(DI)+d16 BL BX
100 (SI) (SI) + d8 (SI) + d16 AH SP
101 (DI) (DI) + d8 (DI) + d16 CH BP
110 d16 (BP) + d8 (BP) + d16 DH SI
111 (BX) (BX) + d8 (BX) + d16 BH DI
8086 INSTRUCTION FORMATS
Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore
3
normally contain the displacement value of a memory operand and / or the actual value
of an immediate constant operand.
Obtain the opcodes for the following instructions.
Example 1 : Code for MOV CH, BL
This instruction transfers 8 bit content of BL into CH
The 6 bit Opcode for this instruction is 1000102 D bit indicates whether the register
specified by the REG field of byte 2 is a source or destination operand.
D=0 indicates BL is a source operand.
W=0 byte operation
In byte 2, since the second operand is a register MOD field is 112.
The R/M field = 101 (CH)
Register (REG) field = 011 (BL)
Hence the machine code for MOV CH, BL is
10001000 11 011 101
Byte 1 Byte2
= 88DDH
Example 2: Code for SUB BX, (DI)
This instruction subtracts the 16 bit content of memory location addressed by DI and DS from Bx.
The 6 bit Opcode for SUB is 0010102.
D=1 so that REG field of byte 2 is the destination operand. W=1 indicates 16 bit operation.
MOD = 00
REG = 011
R/M = 101
The machine code is 0010 1011 0001 1101
2 B 1 D
Example 3 :Code for MOV 1234 (BP), DX
Here we have specify DX using REG field, the D bit must be 0, indicating the DX is the
source register. The REG field must be 010 to indicate DX register. The W bit must be 1 to
indicate it is a word operation. 1234 [BP] is specified using MOD value of 10 and R/M
value of 110 and a displacement of 1234H. The 4 byte code for this instruction would be
89 96 34 12H.
Opcode D W MOD REG R/M LB displacement HB displacement
100010 0 1 10 010 110 34H 12H
Example 4 :Code for MOV DS : 2345 [BP], DX
Here we have to specify DX using REG field. The D bit must be 0, indicating that Dx is the
source register. The REG field must be 010 to indicate DX register. The w bit must be 1 to
indicate it is a word operation. 2345 [BP] is specified with MOD=10 and R/M = 110 and
displacement = 2345 H.
Whenever BP is used to generate the Effective Address (EA), the default segment would
be SS. In this example, we want the segment register to be DS, we have to provide the
8086 INSTRUCTION FORMATS
Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore
4
segment override prefix byte (SOP byte) to start with. The SOP byte is 001 xx 110, where
SR value is provided as per table shown below.
xx Segment register
00 ES
01 CS
10 SS
11 DS
To specify DS register, the SOP byte would be 001 11 110 = 3E H. Thus the 5 byte code for this
instruction would be 3E 89 96 45 23 H.
SOP Opcode D W MOD REG R/M LB disp. HD disp.
3EH 1000 10 0 1 10 010 110 45 23
Suppose we want to code MOV SS : 2345 (BP), DX. This generates only a 4 byte code, without
SOP byte, as SS is already the default segment register in this case.
Example 5:
Give the instruction template and generate code for the instruction ADD 0FABE [BX],
[DI], DX (code for ADD instruction is 000000)
ADD 0FABE [BX] [DI], DX
Here we have to specify DX using REG field. The bit D is 0, indicating that DX is the
source register. The REG field must be 010 to indicate DX register. The w must be 1 to
indicate it is a word operation. FABE (BX + DI) is specified using MOD value of 10 and
R/M value of 001 (from the summary table). The 4 byte code for this instruction would be
Opcode D W MOD REG R/M 16 bit disp.
000000 0 1 10 010 001 BEH FAH
=01 91 BE FAH
Example 6 :
Give the instruction template and generate the code for the instruction MOV AX, [BX]
(Code for MOV instruction is 100010)
AX destination register with D=1 and code for AX is 000 [BX] is specified using 00 Mode
and R/M value 111. It is a word operation
Opcode D W Mod REG R/M
100010 1 1 00 000 111
=8B 07H
INPUT/OUTPUT INSTRUCTIONS:
IN acc, port : In transfers a byte or a word from input port to the AL register or the AX
register respectively. The port number my be specified either with an immediate byte
constant, allowing access to ports numbered 0 through 255 or with a number previously
placed in the DX register allowing variable access (by changing the value in DX) to ports
numbered from 0 through 65,535.
In Operands Example
acc, immB IN AL, 0E2H (OR) IN AX, PORT
acc, DX IN AX, DX (OR) IN AL, DX
8086 INSTRUCTION FORMATS
Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore
5
OUT port, acc : Out transfers a byte or a word from the AL register or the AX register
respectively to an output port. The port numbers may be specified either with an
immediate byte or with a number previously placed in the register DX allowing variable
access.
No flags are affected.
In Operands Example
Imm 8, acc OUT 32, AX (OR) OUT PORT, AL
DX, acc OUT DX, AL (OR) OUT DX, AX
I/O mode (direct) :
Port number is an 8 bit immediate operand.
Example : OUT 05 H, AL
Outputs [AL] to 8 bit port 05 H
I/O mode (indirect):
The port number is taken from DX.
Example 1 : INAL, DX
If [DX] = 5040
8 bit content by port 5040 is moved into AL.
Example 2 : IN AX, DX
Inputs 8 bit content of ports 5040 and 5041 into AL and AH respectively.

Contenu connexe

Tendances (20)

Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
flag register of 8086
flag register of 8086flag register of 8086
flag register of 8086
 
Micro program example
Micro program exampleMicro program example
Micro program example
 
Register Organization of 80386
Register Organization of 80386Register Organization of 80386
Register Organization of 80386
 
8086 pin details
8086 pin details8086 pin details
8086 pin details
 
T-states in microprocessor 8085
T-states in microprocessor 8085T-states in microprocessor 8085
T-states in microprocessor 8085
 
Instruction format
Instruction formatInstruction format
Instruction format
 
ADDRESSING MODES
ADDRESSING MODESADDRESSING MODES
ADDRESSING MODES
 
8086
80868086
8086
 
Intel 8259 - Programmable Interrupt Controller
Intel 8259 - Programmable Interrupt Controller  Intel 8259 - Programmable Interrupt Controller
Intel 8259 - Programmable Interrupt Controller
 
DMA and DMA controller
DMA and DMA controllerDMA and DMA controller
DMA and DMA controller
 
4.programmable dma controller 8257
4.programmable dma controller 82574.programmable dma controller 8257
4.programmable dma controller 8257
 
8086 pin diagram description
8086 pin diagram description8086 pin diagram description
8086 pin diagram description
 
Segment registers
Segment registersSegment registers
Segment registers
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
8255 PPI
8255 PPI8255 PPI
8255 PPI
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 

En vedette

Embedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontrollerEmbedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontrollerGaurav Verma
 
instruction set of 8086
instruction set of 8086instruction set of 8086
instruction set of 8086muneer.k
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorAshita Agrawal
 
8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORGurudev joshi
 
8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijay8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijayVijay Kumar
 
8086 instruction set with types
8086 instruction set with types8086 instruction set with types
8086 instruction set with typesRavinder Rautela
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller NotesDr.YNM
 

En vedette (9)

Embedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontrollerEmbedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontroller
 
instruction set of 8086
instruction set of 8086instruction set of 8086
instruction set of 8086
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSOR
 
8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijay8254 Programmable Interval Timer by vijay
8254 Programmable Interval Timer by vijay
 
8086 instruction set with types
8086 instruction set with types8086 instruction set with types
8086 instruction set with types
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
 

Similaire à Instruction formats-in-8086

microcomputer architecture-Instruction formats
microcomputer architecture-Instruction formatsmicrocomputer architecture-Instruction formats
microcomputer architecture-Instruction formatslavanya marichamy
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086sravanithonta79
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary janicetiong
 
15CS44 MP & MC Module 2
15CS44 MP & MC Module  215CS44 MP & MC Module  2
15CS44 MP & MC Module 2RLJIT
 
16-bit microprocessors
16-bit microprocessors16-bit microprocessors
16-bit microprocessorsZahra Sadeghi
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSSwapnil Mishra
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Shubham Singh
 
address5ng modes.pptx IS A GOOD MATERIAL
address5ng  modes.pptx IS A GOOD MATERIALaddress5ng  modes.pptx IS A GOOD MATERIAL
address5ng modes.pptx IS A GOOD MATERIALDrkoteswararaoseelam
 
8086 Register organization and Architecture details
8086 Register organization and Architecture details8086 Register organization and Architecture details
8086 Register organization and Architecture detailsMahendraMunirathnam1
 
Notes 8086 instruction format
Notes 8086 instruction formatNotes 8086 instruction format
Notes 8086 instruction formatHarshitParkar6677
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Siraj Ahmed
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptManju Badiger
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instnsRam Babu
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer KitAmit Kumer Podder
 
15CS44 MP &MC Module 3
15CS44 MP &MC Module 315CS44 MP &MC Module 3
15CS44 MP &MC Module 3RLJIT
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :PJathin Kanumuri
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
 

Similaire à Instruction formats-in-8086 (20)

microcomputer architecture-Instruction formats
microcomputer architecture-Instruction formatsmicrocomputer architecture-Instruction formats
microcomputer architecture-Instruction formats
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
Assembly code
Assembly codeAssembly code
Assembly code
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary
 
15CS44 MP & MC Module 2
15CS44 MP & MC Module  215CS44 MP & MC Module  2
15CS44 MP & MC Module 2
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
16-bit microprocessors
16-bit microprocessors16-bit microprocessors
16-bit microprocessors
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
 
address5ng modes.pptx IS A GOOD MATERIAL
address5ng  modes.pptx IS A GOOD MATERIALaddress5ng  modes.pptx IS A GOOD MATERIAL
address5ng modes.pptx IS A GOOD MATERIAL
 
8086 Register organization and Architecture details
8086 Register organization and Architecture details8086 Register organization and Architecture details
8086 Register organization and Architecture details
 
Notes 8086 instruction format
Notes 8086 instruction formatNotes 8086 instruction format
Notes 8086 instruction format
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instns
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
 
15CS44 MP &MC Module 3
15CS44 MP &MC Module 315CS44 MP &MC Module 3
15CS44 MP &MC Module 3
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 

Plus de MNM Jain Engineering College

Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationMNM Jain Engineering College
 
It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2MNM Jain Engineering College
 

Plus de MNM Jain Engineering College (17)

IT8602 MOBILE COMMUNICATION.docx
IT8602 MOBILE COMMUNICATION.docxIT8602 MOBILE COMMUNICATION.docx
IT8602 MOBILE COMMUNICATION.docx
 
IT8602 Syllabus.pdf
IT8602 Syllabus.pdfIT8602 Syllabus.pdf
IT8602 Syllabus.pdf
 
Mg8591 syllabus
Mg8591 syllabusMg8591 syllabus
Mg8591 syllabus
 
Ccse ii model_qp
Ccse ii model_qpCcse ii model_qp
Ccse ii model_qp
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Task assignment approach
Task assignment approachTask assignment approach
Task assignment approach
 
Process Management-Process Migration
Process Management-Process MigrationProcess Management-Process Migration
Process Management-Process Migration
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
Peer to Peer services and File systems
Peer to Peer services and File systemsPeer to Peer services and File systems
Peer to Peer services and File systems
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Engineering Ethics
Engineering EthicsEngineering Ethics
Engineering Ethics
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 
It6312 dbms lab-ex2
It6312 dbms lab-ex2It6312 dbms lab-ex2
It6312 dbms lab-ex2
 
Expected questions in Artificial Intelligence
Expected questions in Artificial IntelligenceExpected questions in Artificial Intelligence
Expected questions in Artificial Intelligence
 
Qp mobile & pervasive 2015
Qp mobile & pervasive 2015Qp mobile & pervasive 2015
Qp mobile & pervasive 2015
 
It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2
 

Dernier

Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...ranjana rawat
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...motiram463
 
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikLow Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gapedkojalkojal131
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRdollysharma2066
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...anilsa9823
 
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样qaffana
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Pooja Nehwal
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...Call Girls in Nagpur High Profile
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...Pooja Nehwal
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 

Dernier (20)

Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikLow Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
 
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai GapedCall Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
Call Girls Dubai Slut Wife O525547819 Call Girls Dubai Gaped
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
 
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
Lucknow 💋 Call Girls Adil Nagar | ₹,9500 Pay Cash 8923113531 Free Home Delive...
 
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
哪里办理美国宾夕法尼亚州立大学毕业证(本硕)psu成绩单原版一模一样
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
 
@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls
@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls
@Delhi ! CAll GIRLS IN Defence Colony 🦋 9999965857 🤩 Dwarka Call Girls
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 

Instruction formats-in-8086

  • 1. 8086 INSTRUCTION FORMATS Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore 1 Byte 3 Byte 4 UNIT 2. Instruction Format: The 8086 instruction sizes vary from one to six bytes. Depending on the type of coding, an instruction may have more than one Hexcode, (not unique as in 8085) The OP code field occupies 6-bits.It defines the operation to be carried out by the instruction. Register Direct bit (D) occupies one bit. It defines whether the register operand in byte 2 is the source or destination operand. D=1 Specifies that the register operand is the destination operand. D=0 indicates that the register is a source operand. Data size bit (W) defines whether the operation to be performed is an 8 bit or 16 bit data W=0 indicates 8 bit operation W=1 indicates 16 bit operation 7 2 1 0 7 6 5 4 3 2 1 0 Opcode D W MOD REG R/M Low Disp/ DATA High Disp/ DATA The second byte of the instruction usually identifies whether one of the operands is in memory or whether both are registers. This byte contains 3 fields. These are the mode (MOD) field, the register (REG) field and the Register/Memory (R/M) field. MOD (2 bits) Interpretation 00 Memory mode with no displacement follows except for 16 bit displacement when R/M=110 01 Memory mode with 8 bit displacement 10 Memory mode with 16 bit displacement 11 Register mode (no displacement) Register field occupies 3 bits. It defines the register for the first operand which is specified as source or destination by the D bit. Register Codes: Byte 1 Byte 2 OR Register Operand/Register to use EA Calculation Register Operand/Extension of opcode Register mode/Memory mode with displacement length Word/byte operation Direction is to register/from register Operation code DIRECT ADDRESS LOW BYTE DIRECT ADDRESS HIGH BYTE
  • 2. 8086 INSTRUCTION FORMATS Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore 2 REG W=0 W=1 000 AL AX 001 CL CX 010 DL DX 011 BL BX 100 AH SP 101 CH BP 110 DH SI 111 BH DI The R/M field occupies 3 bits. The R/M field along with the MOD field defines the second operand as shown below. MOD 11 R/M W=0 W=1 000 AL AX 001 CL CX 010 DL DX 011 BL BX 100 AH SP 101 CH BP 110 DH SI 111 BH DI Effective Address Calculation R/M MOD=00 MOD 01 MOD 10 000 (BX) + (SI) (BX)+(SI)+D8 (BX)+(SI)+D16 001 (BX)+(DI) (BX)+(DI)+D8 (BX)+(DI)+D16 010 (BP)+(SI) (BP)+(SI)+D8 (BP)+(SI)+D16 011 (BP)+(DI) (BP)+(DI)+D8 (BP)+(DI)+D10 100 (SI) (SI) + D8 (SI) + D16 101 (DI) (DI) + D8 (DI) + D16 110 Direct address (BP) + D8 (BP) + D16 111 (BX) (BX) + D8 (BX) + D16 In the above, encoding of the R/M field depends on how the mode field is set. If MOD=11 (register to register mode), this R/M identifies the second register operand. MOD selects memory mode, then R/M indicates how the effective address of the memory operand is to be calculated. Bytes 3 through 6 of an instruction are optional fields that MOD / R/M Memory Mode (EA Calculation) Register Mode 00 01 10 W=0 W=1 000 (BX)+(SI) (BX)+(SI)+d8 (BX)+(SI)+d16 AL AX 001 (BX) + (DI) (BX)+(DI)+d8 (BX)+(DI)+d16 CL CX 010 (BP)+(SI) (BP)+(SI)+d8 (BP)+(SI)+d16 DL DX 011 (BP)+(DI) (BP)+(DI)+d8 (BP)+(DI)+d16 BL BX 100 (SI) (SI) + d8 (SI) + d16 AH SP 101 (DI) (DI) + d8 (DI) + d16 CH BP 110 d16 (BP) + d8 (BP) + d16 DH SI 111 (BX) (BX) + d8 (BX) + d16 BH DI
  • 3. 8086 INSTRUCTION FORMATS Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore 3 normally contain the displacement value of a memory operand and / or the actual value of an immediate constant operand. Obtain the opcodes for the following instructions. Example 1 : Code for MOV CH, BL This instruction transfers 8 bit content of BL into CH The 6 bit Opcode for this instruction is 1000102 D bit indicates whether the register specified by the REG field of byte 2 is a source or destination operand. D=0 indicates BL is a source operand. W=0 byte operation In byte 2, since the second operand is a register MOD field is 112. The R/M field = 101 (CH) Register (REG) field = 011 (BL) Hence the machine code for MOV CH, BL is 10001000 11 011 101 Byte 1 Byte2 = 88DDH Example 2: Code for SUB BX, (DI) This instruction subtracts the 16 bit content of memory location addressed by DI and DS from Bx. The 6 bit Opcode for SUB is 0010102. D=1 so that REG field of byte 2 is the destination operand. W=1 indicates 16 bit operation. MOD = 00 REG = 011 R/M = 101 The machine code is 0010 1011 0001 1101 2 B 1 D Example 3 :Code for MOV 1234 (BP), DX Here we have specify DX using REG field, the D bit must be 0, indicating the DX is the source register. The REG field must be 010 to indicate DX register. The W bit must be 1 to indicate it is a word operation. 1234 [BP] is specified using MOD value of 10 and R/M value of 110 and a displacement of 1234H. The 4 byte code for this instruction would be 89 96 34 12H. Opcode D W MOD REG R/M LB displacement HB displacement 100010 0 1 10 010 110 34H 12H Example 4 :Code for MOV DS : 2345 [BP], DX Here we have to specify DX using REG field. The D bit must be 0, indicating that Dx is the source register. The REG field must be 010 to indicate DX register. The w bit must be 1 to indicate it is a word operation. 2345 [BP] is specified with MOD=10 and R/M = 110 and displacement = 2345 H. Whenever BP is used to generate the Effective Address (EA), the default segment would be SS. In this example, we want the segment register to be DS, we have to provide the
  • 4. 8086 INSTRUCTION FORMATS Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore 4 segment override prefix byte (SOP byte) to start with. The SOP byte is 001 xx 110, where SR value is provided as per table shown below. xx Segment register 00 ES 01 CS 10 SS 11 DS To specify DS register, the SOP byte would be 001 11 110 = 3E H. Thus the 5 byte code for this instruction would be 3E 89 96 45 23 H. SOP Opcode D W MOD REG R/M LB disp. HD disp. 3EH 1000 10 0 1 10 010 110 45 23 Suppose we want to code MOV SS : 2345 (BP), DX. This generates only a 4 byte code, without SOP byte, as SS is already the default segment register in this case. Example 5: Give the instruction template and generate code for the instruction ADD 0FABE [BX], [DI], DX (code for ADD instruction is 000000) ADD 0FABE [BX] [DI], DX Here we have to specify DX using REG field. The bit D is 0, indicating that DX is the source register. The REG field must be 010 to indicate DX register. The w must be 1 to indicate it is a word operation. FABE (BX + DI) is specified using MOD value of 10 and R/M value of 001 (from the summary table). The 4 byte code for this instruction would be Opcode D W MOD REG R/M 16 bit disp. 000000 0 1 10 010 001 BEH FAH =01 91 BE FAH Example 6 : Give the instruction template and generate the code for the instruction MOV AX, [BX] (Code for MOV instruction is 100010) AX destination register with D=1 and code for AX is 000 [BX] is specified using 00 Mode and R/M value 111. It is a word operation Opcode D W Mod REG R/M 100010 1 1 00 000 111 =8B 07H INPUT/OUTPUT INSTRUCTIONS: IN acc, port : In transfers a byte or a word from input port to the AL register or the AX register respectively. The port number my be specified either with an immediate byte constant, allowing access to ports numbered 0 through 255 or with a number previously placed in the DX register allowing variable access (by changing the value in DX) to ports numbered from 0 through 65,535. In Operands Example acc, immB IN AL, 0E2H (OR) IN AX, PORT acc, DX IN AX, DX (OR) IN AL, DX
  • 5. 8086 INSTRUCTION FORMATS Compiled by: L. Krishnananda, Assistant Professor, REVA ITM, Bangalore 5 OUT port, acc : Out transfers a byte or a word from the AL register or the AX register respectively to an output port. The port numbers may be specified either with an immediate byte or with a number previously placed in the register DX allowing variable access. No flags are affected. In Operands Example Imm 8, acc OUT 32, AX (OR) OUT PORT, AL DX, acc OUT DX, AL (OR) OUT DX, AX I/O mode (direct) : Port number is an 8 bit immediate operand. Example : OUT 05 H, AL Outputs [AL] to 8 bit port 05 H I/O mode (indirect): The port number is taken from DX. Example 1 : INAL, DX If [DX] = 5040 8 bit content by port 5040 is moved into AL. Example 2 : IN AX, DX Inputs 8 bit content of ports 5040 and 5041 into AL and AH respectively.