Memory Segmentation in 8086 Microprocessor || Microprocessors and Microcontrollers

Memory Segmentation in 8086 Microprocessor || Microprocessors and Microcontrollers

Memory Segmentation in 8086 Microprocessor

Overview of the 8086 Microprocessor

  • The 8086 microprocessor is a 16-bit processor, meaning it operates on 16-bit data and has 16-bit registers.
  • In contrast, the earlier 8085 microprocessor had 8-bit registers.

Address Bus and Memory Capacity

  • The address bus in the 8086 uses 20 bits, allowing for a maximum physical memory capacity of 2^20, which equals 1 megabyte.
  • This memory can be segmented into 16 segments, each with a size of 64 kilobytes.

Memory Segmentation Explained

  • The main memory is divided into various parts called segments; specifically, it can be divided into up to 16 segments of 64 kilobytes each.
  • For illustration, only four segments are discussed:
  • Code Segment
  • Stack Segment
  • Data Segment
  • Extra Segment

Details on Memory Segments

  • Each segment is designed for specific purposes:
  • The Code Segment (CS) contains the currently executing program.
  • The Stack Segment (SS) stores subroutines or procedures.
  • The Data Segment (DS) and the Extra Segment (ES) are used for storing operands and data related to instructions.

Advantages of Segmentation Registers

  • There are four segmentation registers:
  • CS: Code Segment Register
  • SS: Stack Segment Register
  • DS: Data Segment Register
  • ES: Extra Segment Register

Functions of Each Register

  • CS holds the starting address of the code segment being executed by the CPU. For example, it may contain an address like 5A1H.
  • SS stores the starting address for stack operations, such as 5A2H, facilitating function calls and returns using LIFO principles.

Understanding Addressing in Memory

  • Addresses in this system require five hexadecimal digits since each digit represents four bits; thus, a total of twenty bits are needed to specify an address fully.

Memory Segmentation in 8086 Microprocessor

Overview of Registers and Their Functions

  • The data is held using registers, specifically the data segment register which stores the address of the data segment.
  • Offset resistance is introduced; an offset register contains a specific location within a corresponding segment (code, stack, data, or extra).
  • Each segment has a size of 64 kilobytes. The offset refers to a particular location within that segment.

Types of Pointer Registers

  • Three main pointer registers are identified:
  • IP (Instruction Pointer Register)
  • SP (Stack Pointer Register)
  • BP (Base Pointer Register)
  • These three can collectively be referred to as pointer registers. Additionally, SI (Source Index Register) and DI (Destination Index Register) are also categorized as index registers.

Functionality of Key Registers

  • The Instruction Pointer points to an offset within the code segment, indicating where execution should begin.
  • The Stack Pointer indicates an offset within the stack segment while the Base Pointer can point to offsets in either the data or extra segments.
  • Source Index points to an offset in the data segment and Destination Index points to an offset in the extra segment.

Calculating Physical Addresses

  • To calculate physical addresses, use the formula:
  • Physical Address = Segment Address × 10 + Offset
Video description

#8086 #memorysegmentation #mp 1. Compiler Design Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfC9pGMWuM6UWE3V4YZ9TZzM ------------------------------------------------------------------------------------ 2. Computer Organization and Architecture Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfDXDRzSLv1FfZ-SSA38SiC0 --------------------------------------------------------------------------------------- 3. Operating Systems Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfDrdQuJTHIPmKMpa7eYVaPm ---------------------------------------------------------------------------------------- 4. C Programming Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfBi_vnP7eo-QayXpzuMuOP6 -------------------------------------------------------------------------------------------------------------------------- 5. Java Programming Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfDlQklXu3Hrtru-bm2dJ9Df --------------------------------------------------------------------------------------------------------------------------------- 6. Data Structures Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfAhaLFnq4fQ5ASOqKd08-Us --------------------------------------------------------------------------------------------------------------------- 7. Web Technologies Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfCwJmQkWF9sBUFLAdonjOMB ---------------------------------------------------------------------------------------------------------------- 8. C++ Programming Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfCmm6ZT-R_33bxLY1fvcm_o -------------------------------------------------------------------------------------------------------------------------- 9. DAA ( Design and Analysis of Algorithms) Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfAG09GbFgMOLACfvbMplHsW ---------------------------------------------------------------------------------------------------------------------------- 10. Python Programming Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfAKSXjEzeQhXdqTflN7qRlo --------------------------------------------------------------------------------------------------------------------------- 11. DMS ( Discrete Mathematical Structures ) Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfBB-4hXp4XI84HOCWkaBD63 ---------------------------------------------------------------------------------------------------------------------------------- 12. C#.net Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfA8sKELgBkkUZxzGK1o5ll0 -------------------------------------------------------------------------------------------------------------------------------------- 13. OOP through Python Playlist: https://www.youtube.com/playlist?list=PLXj4XH7LcRfANIIqVzBRTh0XDgZxu-QO2 ----------------------------------------------------------------------------------------------------------------