SlideShare a Scribd company logo
3
Most read
5
Most read
11
Most read
Chapter four
Addressing Modes
By GetnetT(MSc)
March, 2024
Addressing Modes
8086 Microprocessor
2
Addressing mode indicates a way of locating data or operands in a
register or a memory location. Every instruction of a program has to
operate on a data:
The different ways in which a source operand is denoted in an
instruction are known as addressing modes
The general addressing modes of 8086 microprocessor can be classified
as
1. Data Addressing Modes
2. Program-memory addressing Modes
3. Stack-memory addressing Modes
Addressing Modes
8086 Microprocessor
3
8086/8088 provide a seven Data Addressing Modes
Data addressing Modes
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
4. Register Indirect Addressing
5. Base–Plus–Index Addressing
6. Register Relative Addressing
7. Base Relative–Plus–Index
Addressing
1. Register Addressing  Transfers a copy of a byte or word from the
source register to the destination register
 Use of registers to hold the data to be
manipulated.
 Source and destination registers must have the
same size
 Memory is not accessed when this addressing
mode is executed
Example:
MOV CL, DH
The content of 8-bit register DH is moved to
another 8-bit register CL
(CL)  (DH)
Addressing Modes
8086 Microprocessor
4
Data addressing Modes
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
4. Register Indirect Addressing
5. Base–Plus–Index Addressing
6. Register Relative Addressing
7. Base Relative–Plus–Index
Addressing
2. Immediate Addressing
 Transfers the source, an immediate byte or
word of data, into the destination register or
memory location
 The source operand is a constant
 The operand comes immediately after the
opcode. For this reason, this addressing mode
executes quickly
 Immediate addressing mode can be used to
load information into any of the registers
except the segment registers and flag
registers.
Example:
MOV AX, 2550H; move 2550H into AX
The data must first be moved to a general-
purpose register and then to the segment register
MOV AX, 2550H
MOV DS, AX
MOV DS, 0123H ; illegal instruction!
Addressing Modes
8086 Microprocessor
5
Data addressing Modes
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
4. Register Indirect Addressing
5. Base–Plus–Index Addressing
6. Register Relative Addressing
7. Base Relative–Plus–Index
Addressing
3. Direct Addressing
 Moves a byte or word between a memory
location and a register.
 The data is in some memory location(s) and
the address of the data in memory comes
immediately after the instruction.
 This address is the offset address.
Example:
MOV AX, [2400] ; move contents of
DS:2400H into AX
 The physical address is calculated by
combining the contents of offset location
2400 with DS
 i.e. DS:2400
 If DS is given 1512H
 Physical address
= 15120+2400=17520H
Addressing Modes
8086 Microprocessor
6
Data addressing Modes
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
4. Register Indirect Addressing
5. Base–Plus–Index Addressing
6. Register Relative Addressing
7. Base Relative–Plus–Index
Addressing
4. Register-Indirect Addressing
 Transfers a byte or word between a register and a
memory location addressed by an index or base
register
 The address of the memory location where the
operand resides is held by a register
 The registers used for this purpose are SI, DI, and
BX, BP
 They must be combined with DS in order to
generate the 20-bit physical address
Example:
 MOV AX, [BX] ; moves into AX the
contents of the memory location pointed to
by DS:BX, 1000:1234
 The physical address is calculated as
1000x10+1234=11234H
Addressing Modes
8086 Microprocessor
7
Data addressing Modes
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
4. Register Indirect Addressing
5. Base–Plus–Index Addressing
6. Register Relative Addressing
7. Base Relative–Plus–Index
Addressing
5. Base–Plus–Index Addressing
 Transfers a byte or word between a register
and the memory location addressed by a
base register (BP or BX) plus an index
register (DI or SI).
 Combining based and indexed addressing
modes. One base register and one index
register are used
Example:
 MOV [BX+DI], CL ; move contents of CL
into DS:BX+DI
 Physical Address = DSx10 + BX+DI
 MOV [BP+SI], AL ; move contents of AL
into SS:BP+SI
 Physical Address = SSx10 + BP+SI
Addressing Modes
8086 Microprocessor
8
Data addressing Modes
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
4. Register Indirect Addressing
5. Base–Plus–Index Addressing
6. Register Relative Addressing
7. Base Relative–Plus–Index
Addressing
6. Register Relative Addressing
 Moves a byte or word between a register
and the memory location addressed by an
index or base register plus a displacement.
 The data in a segment of memory are
addressed by adding the displacement to
the contents of a base or an index register
(BP, BX, DI, or SI).
Example:
 MOV AX, [BX+4] ; move
contents of DS:BX+4 into AX
 Physical Address = DSx10 + BX+4
Addressing Modes
8086 Microprocessor
9
Data addressing Modes
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
4. Register Indirect Addressing
5. Base–Plus–Index Addressing
6. Register Relative Addressing
7. Base Relative–Plus–Index
Addressing
 The base relative-plus-index addressing
mode is similar to the base-plus-index
addressing mode, but adds a displacement
besides using a base register and an index
register to form the memory address.
 This type of addressing mode often
addresses a two-dimensional array of
memory data.
 The data in a segment of memory are
addressed by adding the displacement to
the contents of a base and an index register
(BP, BX, DI, or SI).
Example:
 MOV [BX+DI+1], AX ; move
contents of AX into DS:BX+DI+1
 Physical Address = DSx10 +
BX+DI+1H
Addressing Modes
8086 Microprocessor
10
: Program memory addressing modes
 The Program Memory Addressing mode is used in
branch instructions.
 These branch instructions are instructions which are
responsible for changing the regular flow of the instruction
execution and shifting the control to some other location.
 In 8086 microprocessor, these instructions are usually JMP
and CALL instructions
 The Program memory Addressing Mode contains
further three addressing modes within it.They are:
i. Direct Program memory Addressing
ii. Indirect Program memory Addressing
iii.Relative Program memoryAddressing
Addressing Modes
8086 Microprocessor
11
: Program memory addressing modes
2. Indirect program memory
addressing
3. Relative program memory
addressing
1.Direct program memory
addressing
 In this addressing mode, the offset address
where the control is to be shifted is defined
within the instruction.
 This mode is called direct addressing mode
because the required address is directly
present in the instruction rather than being
stored in some register
 E.g. JMP 4032H
 Here, the working of the above instruction
will be as follows:
 The current value of IP which holds the
address of next instruction to be executed
will be stored in the TOP OFTHE STACK.
Now, the IP will be replaced by the
mentioned value, i.e. IP <- 4032H
Addressing Modes
8086 Microprocessor
12
: Program memory addressing modes
1. Direct program memory
addressing
3. Relative program memory
addressing
2. Indirect program
memory addressing
 As the name suggests, in this addressing
mode, the offset address is not present
directly in the instruction.
 It is rather stored in any of the CPU registers
(Internal Register).
 So, the contents of the Instruction Pointer
(IP) will be replaced by the contents of that
register
 E.g. JMP BX
 Working: Suppose that the content of
the BX register is 0003H. So, the working of
the microprocessor for executing the above
instruction will be as follows:
• IP <- contents of BX i.e. IP <- 0003H
• And the required memory address is
calculated as: (Contents of CS) X 10H +
(contents of IP)
Addressing Modes
8086 Microprocessor
13
: Program memory addressing modes
1. Direct program memory
addressing
2. Indirect program memory
addressing
3. Relative program
memory addressing
 In this Addressing mode, the offset address is
equal to the content of the Instruction
Pointer (IP) plus the 8 or 16-bit
displacement.
 For the 8 bit displacement, SHORT is used
and for 16-bit displacement, LONG is used.
 This type of displacement will only be intra-
segment, i.e. within the segment.
 E.g. JMP SHORT OVER
 Here, SHORT is used to represent the 8-bit
displacement and OVER is the Label defined
for any particular memory location.
Addressing Modes
8086 Microprocessor
14
: stack memory addressing modes
 The stack plays an important role in all microprocessors. It
holds data temporarily and stores the return addresses used by
procedures.
 The stack memory is an LIFO (last-in, first-out) memory,
which describes the way that data are stored and removed
from the stack.
 Data are placed onto the stack with a PUSH instruction and
removed with a POP instruction.
 The CALL instruction also uses the stack to hold the return
address for procedures and a RET (return) instruction to
remove the return address from the stack
Addressing Modes
8086 Microprocessor
15
: stack memory addressing modes
 The stack memory is maintained by two registers: the stack
pointer (SP or ESP) and the stack segment register (SS).
 Whenever a word of data is pushed onto the stack the high-
order 8 bits are placed in the location addressed by SP – 1.The
low-order 8 bits are placed in the location addressed by SP – 2.
 The SP is then decremented by 2 so that the next word of data
is stored in the next available stack memory location
 Whenever data are popped from the stack the low-order 8 bits
are removed from the location addressed by SP.
 The high-order 8 bits are removed from the location addressed
by SP + 1.
 The SP register is then incremented by 2
Addressing Modes
16
: stack memory addressing modes
 Note that PUSH and POP store or retrieve words of data—never bytes
—in the 8086 through the 80286 microprocessors
 The 80386 and above allow words or double words to be transferred to
and from the stack. Data may be pushed onto the stack from any 16-bit
register or segment register; in the 80386 and above, from any 32-bit
extended register.
 Data may be popped off the stack into any register or any segment
register except CS
 The reason that data may not be popped from the stack into CS is that
this only changes part of the address of the next instruction.
 In the Pentium 4 or Core2 operated in 64-bit mode, the 64-bit registers
can be pushed or popped from the stack, but they are 8 bytes in length
 registers can be pushed or popped from the stack, but they are 8 bytes in
length.
 The PUSHA and POPA instructions either push or pop all of the
registers, except segment registers, onto the stack.These instructions are
not available on the early 8086/8088 processors.
17
POPF Removes a word from the stack and places it into the flag register
POPFD Removes a doubleword from the stack and places it into the EFLAG register
PUSHF Copies the flag register to the stack
PUSHFD Copies the EFLAG register to the stack
PUSH AX Copies the AX register to the stack
POP BX Removes a word from the stack and places it into the BX register
PUSH DS Copies the DS register to the stack
PUSH 1234H Copies a word-sized 1234H to the stack
POP CS This instruction is illegal
PUSH WORD PTR[BX] Copies the word contents of the data segment memory location addressed by BX onto
the stack
PUSHA Copies AX, CX, DX, BX, SP, BP, DI, and SI to the stack
POPA Removes the word contents for the following registers from the stack: SI, DI, BP
, SP, BX, DX, CX,
and AX
PUSHAD Copies EAX, ECX, EDX, EBX, ESP, EBP, EDI, and ESI to the stack
POPAD Removes the doubleword contents for the following registers from the stack: ESI, EDI, EBP
, ESP
, EBX, EDX, ECX, and EAX
POP EAX Removes a doubleword from the stack and places it into the EAX register
POP RAX Removes a quadword from the stack and places it into the RAC register (64-bit mode)
PUSH EDI Copies EDI to the stack
PUSH RSI Copies RSI into the stack (64-bit mode)
PUSH QWORD PTR[RDX] Copies the quadword contents of the memory location addressed
18

More Related Content

PPTX
4-ADDRESSING_MODES_E logic circuits.pptx
PPTX
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
PPTX
02 Addressing Modes.pptx
PDF
Unit 2 (Complete) - Programming of 8086.pdf
PPTX
Chapter 1 archietecture of 8086
PPTX
8086 microprocessor pptx JNTUH ece 3rd year
PPT
ADDRESSING MODES in 8086 MICROPROCESSOR.ppt
PPTX
address5ng modes.pptx IS A GOOD MATERIAL
4-ADDRESSING_MODES_E logic circuits.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
02 Addressing Modes.pptx
Unit 2 (Complete) - Programming of 8086.pdf
Chapter 1 archietecture of 8086
8086 microprocessor pptx JNTUH ece 3rd year
ADDRESSING MODES in 8086 MICROPROCESSOR.ppt
address5ng modes.pptx IS A GOOD MATERIAL

Similar to Chapter 4 addressing mode in microprocessor.pptx (20)

PPTX
Lecture 11
PPTX
addressing-modes-of-8086-mr-binu-joy-2 (2).pptx
PDF
8086 instruction set (with simulator)
PPTX
pptx_20221115_180411_0000.pptx
DOCX
Notes 8086 instruction format
PPTX
All-addressing-modes of the 80386 /microprocessor.pptx
PPT
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
PPTX
instruction format and addressing modes
PPTX
Addressing modes of 8086 - Binu Joy
PDF
lect 03- MIT Addressing Modes.pdf
PPTX
addressing-modes-of-8086-mr-binu-joy-2.pptx
PPTX
31. 8086 addressing modes
PDF
Microprocessor module 4.pdfbabssbabanjxnsb
PPTX
Adressing modes of 8086
PPTX
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
PDF
BISWAJIT ADHIKARI_28101623024_PC EE 602.pdf
PPT
8086 add mod
PPTX
Lecture 10
PPTX
Addressing Modes Of 8086
PDF
Addressing modes of 80386
Lecture 11
addressing-modes-of-8086-mr-binu-joy-2 (2).pptx
8086 instruction set (with simulator)
pptx_20221115_180411_0000.pptx
Notes 8086 instruction format
All-addressing-modes of the 80386 /microprocessor.pptx
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
instruction format and addressing modes
Addressing modes of 8086 - Binu Joy
lect 03- MIT Addressing Modes.pdf
addressing-modes-of-8086-mr-binu-joy-2.pptx
31. 8086 addressing modes
Microprocessor module 4.pdfbabssbabanjxnsb
Adressing modes of 8086
micro chapter 3jjgffffyeyhhuyerfftfgggffgjj
BISWAJIT ADHIKARI_28101623024_PC EE 602.pdf
8086 add mod
Lecture 10
Addressing Modes Of 8086
Addressing modes of 80386
Ad

More from Getnet Tigabie Askale -(GM) (20)

PDF
Chapter 4 Frequency Domain Image Processing.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Chapter 1 Introduction to Computer Vision and Image Processing .pdf
PPTX
Fundamentals of Database management system Lab Manual.pptx
PDF
Chapter 5 and 6 instructions and program control instructions.pdf
PPTX
Chapter 2 and 3 8086,8088 architecture and HW specification.pptx
PDF
Chapter 7 Interrupts in microprocessor and assembly language.pdf
PDF
chapter 1-part 1 introduction o microprocessor.pdf
PPT
Chapter 1-part 2 introduction to microprocessor.ppt
PPTX
CH2 Mobile Computing in wireless communication.pptx
PPTX
CH4 Wireless Local Area Networks in wireless communication.pptx
PPTX
CH3 Wireless Network Principle in wireless Communication.pptx
PPTX
CH1 Introduction to wireless communication and Mobile Computing.pptx
PPTX
CH5 Cellular Networks in wireless communication.pptx
PPTX
CH6 Mobile Network Layer in wireless communication.pptx
PDF
Chapter 4 FD and normalization edited.pdf
PDF
Chapter 3 Database Modeling short slide.pdf
PDF
Chapter 5 record storage and primary file organization.pdf
PDF
chapter 6 Relational Algebra and calculus.pdf
Chapter 4 Frequency Domain Image Processing.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Chapter 2 Digital Image Fundamentals.pdf
Chapter 1 Introduction to Computer Vision and Image Processing .pdf
Fundamentals of Database management system Lab Manual.pptx
Chapter 5 and 6 instructions and program control instructions.pdf
Chapter 2 and 3 8086,8088 architecture and HW specification.pptx
Chapter 7 Interrupts in microprocessor and assembly language.pdf
chapter 1-part 1 introduction o microprocessor.pdf
Chapter 1-part 2 introduction to microprocessor.ppt
CH2 Mobile Computing in wireless communication.pptx
CH4 Wireless Local Area Networks in wireless communication.pptx
CH3 Wireless Network Principle in wireless Communication.pptx
CH1 Introduction to wireless communication and Mobile Computing.pptx
CH5 Cellular Networks in wireless communication.pptx
CH6 Mobile Network Layer in wireless communication.pptx
Chapter 4 FD and normalization edited.pdf
Chapter 3 Database Modeling short slide.pdf
Chapter 5 record storage and primary file organization.pdf
chapter 6 Relational Algebra and calculus.pdf
Ad

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Getting Started with Data Integration: FME Form 101
PDF
Approach and Philosophy of On baking technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
NewMind AI Weekly Chronicles - August'25-Week II
Getting Started with Data Integration: FME Form 101
Approach and Philosophy of On baking technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Diabetes mellitus diagnosis method based random forest with bat algorithm
Building Integrated photovoltaic BIPV_UPV.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Programs and apps: productivity, graphics, security and other tools
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
SOPHOS-XG Firewall Administrator PPT.pptx
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Chapter 4 addressing mode in microprocessor.pptx

  • 1. Chapter four Addressing Modes By GetnetT(MSc) March, 2024
  • 2. Addressing Modes 8086 Microprocessor 2 Addressing mode indicates a way of locating data or operands in a register or a memory location. Every instruction of a program has to operate on a data: The different ways in which a source operand is denoted in an instruction are known as addressing modes The general addressing modes of 8086 microprocessor can be classified as 1. Data Addressing Modes 2. Program-memory addressing Modes 3. Stack-memory addressing Modes
  • 3. Addressing Modes 8086 Microprocessor 3 8086/8088 provide a seven Data Addressing Modes Data addressing Modes 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Base–Plus–Index Addressing 6. Register Relative Addressing 7. Base Relative–Plus–Index Addressing 1. Register Addressing  Transfers a copy of a byte or word from the source register to the destination register  Use of registers to hold the data to be manipulated.  Source and destination registers must have the same size  Memory is not accessed when this addressing mode is executed Example: MOV CL, DH The content of 8-bit register DH is moved to another 8-bit register CL (CL)  (DH)
  • 4. Addressing Modes 8086 Microprocessor 4 Data addressing Modes 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Base–Plus–Index Addressing 6. Register Relative Addressing 7. Base Relative–Plus–Index Addressing 2. Immediate Addressing  Transfers the source, an immediate byte or word of data, into the destination register or memory location  The source operand is a constant  The operand comes immediately after the opcode. For this reason, this addressing mode executes quickly  Immediate addressing mode can be used to load information into any of the registers except the segment registers and flag registers. Example: MOV AX, 2550H; move 2550H into AX The data must first be moved to a general- purpose register and then to the segment register MOV AX, 2550H MOV DS, AX MOV DS, 0123H ; illegal instruction!
  • 5. Addressing Modes 8086 Microprocessor 5 Data addressing Modes 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Base–Plus–Index Addressing 6. Register Relative Addressing 7. Base Relative–Plus–Index Addressing 3. Direct Addressing  Moves a byte or word between a memory location and a register.  The data is in some memory location(s) and the address of the data in memory comes immediately after the instruction.  This address is the offset address. Example: MOV AX, [2400] ; move contents of DS:2400H into AX  The physical address is calculated by combining the contents of offset location 2400 with DS  i.e. DS:2400  If DS is given 1512H  Physical address = 15120+2400=17520H
  • 6. Addressing Modes 8086 Microprocessor 6 Data addressing Modes 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Base–Plus–Index Addressing 6. Register Relative Addressing 7. Base Relative–Plus–Index Addressing 4. Register-Indirect Addressing  Transfers a byte or word between a register and a memory location addressed by an index or base register  The address of the memory location where the operand resides is held by a register  The registers used for this purpose are SI, DI, and BX, BP  They must be combined with DS in order to generate the 20-bit physical address Example:  MOV AX, [BX] ; moves into AX the contents of the memory location pointed to by DS:BX, 1000:1234  The physical address is calculated as 1000x10+1234=11234H
  • 7. Addressing Modes 8086 Microprocessor 7 Data addressing Modes 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Base–Plus–Index Addressing 6. Register Relative Addressing 7. Base Relative–Plus–Index Addressing 5. Base–Plus–Index Addressing  Transfers a byte or word between a register and the memory location addressed by a base register (BP or BX) plus an index register (DI or SI).  Combining based and indexed addressing modes. One base register and one index register are used Example:  MOV [BX+DI], CL ; move contents of CL into DS:BX+DI  Physical Address = DSx10 + BX+DI  MOV [BP+SI], AL ; move contents of AL into SS:BP+SI  Physical Address = SSx10 + BP+SI
  • 8. Addressing Modes 8086 Microprocessor 8 Data addressing Modes 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Base–Plus–Index Addressing 6. Register Relative Addressing 7. Base Relative–Plus–Index Addressing 6. Register Relative Addressing  Moves a byte or word between a register and the memory location addressed by an index or base register plus a displacement.  The data in a segment of memory are addressed by adding the displacement to the contents of a base or an index register (BP, BX, DI, or SI). Example:  MOV AX, [BX+4] ; move contents of DS:BX+4 into AX  Physical Address = DSx10 + BX+4
  • 9. Addressing Modes 8086 Microprocessor 9 Data addressing Modes 1. Register Addressing 2. Immediate Addressing 3. Direct Addressing 4. Register Indirect Addressing 5. Base–Plus–Index Addressing 6. Register Relative Addressing 7. Base Relative–Plus–Index Addressing  The base relative-plus-index addressing mode is similar to the base-plus-index addressing mode, but adds a displacement besides using a base register and an index register to form the memory address.  This type of addressing mode often addresses a two-dimensional array of memory data.  The data in a segment of memory are addressed by adding the displacement to the contents of a base and an index register (BP, BX, DI, or SI). Example:  MOV [BX+DI+1], AX ; move contents of AX into DS:BX+DI+1  Physical Address = DSx10 + BX+DI+1H
  • 10. Addressing Modes 8086 Microprocessor 10 : Program memory addressing modes  The Program Memory Addressing mode is used in branch instructions.  These branch instructions are instructions which are responsible for changing the regular flow of the instruction execution and shifting the control to some other location.  In 8086 microprocessor, these instructions are usually JMP and CALL instructions  The Program memory Addressing Mode contains further three addressing modes within it.They are: i. Direct Program memory Addressing ii. Indirect Program memory Addressing iii.Relative Program memoryAddressing
  • 11. Addressing Modes 8086 Microprocessor 11 : Program memory addressing modes 2. Indirect program memory addressing 3. Relative program memory addressing 1.Direct program memory addressing  In this addressing mode, the offset address where the control is to be shifted is defined within the instruction.  This mode is called direct addressing mode because the required address is directly present in the instruction rather than being stored in some register  E.g. JMP 4032H  Here, the working of the above instruction will be as follows:  The current value of IP which holds the address of next instruction to be executed will be stored in the TOP OFTHE STACK. Now, the IP will be replaced by the mentioned value, i.e. IP <- 4032H
  • 12. Addressing Modes 8086 Microprocessor 12 : Program memory addressing modes 1. Direct program memory addressing 3. Relative program memory addressing 2. Indirect program memory addressing  As the name suggests, in this addressing mode, the offset address is not present directly in the instruction.  It is rather stored in any of the CPU registers (Internal Register).  So, the contents of the Instruction Pointer (IP) will be replaced by the contents of that register  E.g. JMP BX  Working: Suppose that the content of the BX register is 0003H. So, the working of the microprocessor for executing the above instruction will be as follows: • IP <- contents of BX i.e. IP <- 0003H • And the required memory address is calculated as: (Contents of CS) X 10H + (contents of IP)
  • 13. Addressing Modes 8086 Microprocessor 13 : Program memory addressing modes 1. Direct program memory addressing 2. Indirect program memory addressing 3. Relative program memory addressing  In this Addressing mode, the offset address is equal to the content of the Instruction Pointer (IP) plus the 8 or 16-bit displacement.  For the 8 bit displacement, SHORT is used and for 16-bit displacement, LONG is used.  This type of displacement will only be intra- segment, i.e. within the segment.  E.g. JMP SHORT OVER  Here, SHORT is used to represent the 8-bit displacement and OVER is the Label defined for any particular memory location.
  • 14. Addressing Modes 8086 Microprocessor 14 : stack memory addressing modes  The stack plays an important role in all microprocessors. It holds data temporarily and stores the return addresses used by procedures.  The stack memory is an LIFO (last-in, first-out) memory, which describes the way that data are stored and removed from the stack.  Data are placed onto the stack with a PUSH instruction and removed with a POP instruction.  The CALL instruction also uses the stack to hold the return address for procedures and a RET (return) instruction to remove the return address from the stack
  • 15. Addressing Modes 8086 Microprocessor 15 : stack memory addressing modes  The stack memory is maintained by two registers: the stack pointer (SP or ESP) and the stack segment register (SS).  Whenever a word of data is pushed onto the stack the high- order 8 bits are placed in the location addressed by SP – 1.The low-order 8 bits are placed in the location addressed by SP – 2.  The SP is then decremented by 2 so that the next word of data is stored in the next available stack memory location  Whenever data are popped from the stack the low-order 8 bits are removed from the location addressed by SP.  The high-order 8 bits are removed from the location addressed by SP + 1.  The SP register is then incremented by 2
  • 16. Addressing Modes 16 : stack memory addressing modes  Note that PUSH and POP store or retrieve words of data—never bytes —in the 8086 through the 80286 microprocessors  The 80386 and above allow words or double words to be transferred to and from the stack. Data may be pushed onto the stack from any 16-bit register or segment register; in the 80386 and above, from any 32-bit extended register.  Data may be popped off the stack into any register or any segment register except CS  The reason that data may not be popped from the stack into CS is that this only changes part of the address of the next instruction.  In the Pentium 4 or Core2 operated in 64-bit mode, the 64-bit registers can be pushed or popped from the stack, but they are 8 bytes in length  registers can be pushed or popped from the stack, but they are 8 bytes in length.  The PUSHA and POPA instructions either push or pop all of the registers, except segment registers, onto the stack.These instructions are not available on the early 8086/8088 processors.
  • 17. 17 POPF Removes a word from the stack and places it into the flag register POPFD Removes a doubleword from the stack and places it into the EFLAG register PUSHF Copies the flag register to the stack PUSHFD Copies the EFLAG register to the stack PUSH AX Copies the AX register to the stack POP BX Removes a word from the stack and places it into the BX register PUSH DS Copies the DS register to the stack PUSH 1234H Copies a word-sized 1234H to the stack POP CS This instruction is illegal PUSH WORD PTR[BX] Copies the word contents of the data segment memory location addressed by BX onto the stack PUSHA Copies AX, CX, DX, BX, SP, BP, DI, and SI to the stack POPA Removes the word contents for the following registers from the stack: SI, DI, BP , SP, BX, DX, CX, and AX PUSHAD Copies EAX, ECX, EDX, EBX, ESP, EBP, EDI, and ESI to the stack POPAD Removes the doubleword contents for the following registers from the stack: ESI, EDI, EBP , ESP , EBX, EDX, ECX, and EAX POP EAX Removes a doubleword from the stack and places it into the EAX register POP RAX Removes a quadword from the stack and places it into the RAC register (64-bit mode) PUSH EDI Copies EDI to the stack PUSH RSI Copies RSI into the stack (64-bit mode) PUSH QWORD PTR[RDX] Copies the quadword contents of the memory location addressed
  • 18. 18