The Wayback Machine - https://web.archive.org/web/20240917190814/https://www.geeksforgeeks.org/memory-segmentation-8086-microprocessor/
Open In App

Memory Segmentation in 8086 Microprocessor

Last Updated : 18 Oct, 2019
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Prerequisite – Segmentation
Segmentation is the process in which the main memory of the computer is logically divided into different segments and each segment has its own base address. It is basically used to enhance the speed of execution of the computer system, so that the processor is able to fetch and execute the data from the memory easily and fast.

Need for Segmentation –
The Bus Interface Unit (BIU) contains four 16 bit special purpose registers (mentioned below) called as Segment Registers.

  • Code segment register (CS): is used for addressing memory location in the code segment of the memory, where the executable program is stored.
  • Data segment register (DS): points to the data segment of the memory where the data is stored.
  • Extra Segment Register (ES): also refers to a segment in the memory which is another data segment in the memory.
  • Stack Segment Register (SS): is used for addressing stack segment of the memory. The stack segment is that segment of memory which is used to store stack data.

The number of address lines in 8086 is 20, 8086 BIU will send 20bit address, so as to access one of the 1MB memory locations. The four segment registers actually contain the upper 16 bits of the starting addresses of the four memory segments of 64 KB each with which the 8086 is working at that instant of time. A segment is a logical unit of memory that may be up to 64 kilobytes long. Each segment is made up of contiguous memory locations. It is an independent, separately addressable unit. Starting address will always be changing. It will not be fixed.

Note that the 8086 does not work the whole 1MB memory at any given time. However, it works only with four 64KB segments within the whole 1MB memory.

Below is the one way of positioning four 64 kilobyte segments within the 1M byte memory space of an 8086.

Types Of Segmentation –

  1. Overlapping Segment – A segment starts at a particular address and its maximum size can go up to 64kilobytes. But if another segment starts along with this 64kilobytes location of the first segment, then the two are said to be Overlapping Segment.
  2. Non-Overlapped Segment – A segment starts at a particular address and its maximum size can go up to 64kilobytes. But if another segment starts before this 64kilobytes location of the first segment, then the two segments are said to be Non-Overlapped Segment.

Rules of Segmentation Segmentation process follows some rules as follows:

  • The starting address of a segment should be such that it can be evenly divided by 16.
  • Minimum size of a segment can be 16 bytes and the maximum can be 64 kB.
  • Advantages of the Segmentation The main advantages of segmentation are as follows:

    • It provides a powerful memory management mechanism.
    • Data related or stack related operations can be performed in different segments.
    • Code related operation can be done in separate code segments.
    • It allows to processes to easily share data.
    • It allows to extend the address ability of the processor, i.e. segmentation allows the use of 16 bit registers to give an addressing capability of 1 Megabytes. Without segmentation, it would require 20 bit registers.
    • It is possible to enhance the memory size of code data or stack segments beyond 64 KB by allotting more than one segment for each area.


Similar Reads

Flag register of 8086 microprocessor
Prerequisite – Flag register in 8085 microprocessor The Flag register is a Special Introduction : The flag register is a 16-bit register in the Intel 8086 microprocessor that contains information about the state of the processor after executing an instruction. It is sometimes referred to as the status register because it contains various status fla
6 min read
Arithmetic instructions in 8086 microprocessor
Arithmetic Instructions are the instructions which perform basic arithmetic operations such as addition, subtraction and a few more. Unlike in 8085 microprocessor, in 8086 microprocessor the destination operand need not be the accumulator. Following is the table showing the list of arithmetic instructions: OPCODE OPERAND EXPLANATION EXAMPLE ADD D,
2 min read
Logical instructions in 8086 microprocessor
Introduction : Logical instructions in the 8086 microprocessor are instructions that perform logical operations on data stored in registers or memory locations. These instructions can manipulate bits within a byte, set or clear individual bits, or perform Boolean operations such as AND, OR, XOR, and NOT. Some of the commonly used logical instructio
5 min read
Data transfer instructions in 8086 microprocessor
Introduction : Data transfer instructions in the 8086 microprocessor are used to move data between memory locations, registers, and input/output (I/O) devices. These instructions are essential for manipulating data within a program, as well as for communicating with external devices. Data transfer instructions are a fundamental part of programming
4 min read
Reset Accumulator (8085 & 8086 microprocessor)
1. Problem - Write the 8085 instructions which reset the accumulator. Solution - There are 4 instructions to reset the accumulator in 8085. These instructions are: S.No.MNEMONICSCOMMENT1MVI A, 00A <- 002ANI 00A AND 003XRA AA XOR A4SUB AA <- A - A Explanation - MVI A, 00: instruction copies 00 to A.ANI 00: instruction performs bit by bit AND o
4 min read
Process control instructions in 8086 microprocessor
Process control instructions are the instructions which control the processor's action by setting(1) or resetting(0) the values of flag registers. Following is the table showing the list of process control instructions: OPCODEOPERANDEXPLANATIONEXAMPLESTCnonesets carry flag to 1STCCLCnoneresets carry flag to 0CLCCMCnonecompliments the carry flagCMCS
1 min read
Differences between 8085 and 8086 microprocessor
8085 Microprocessor 8085 Microprocessor is a predecessor of version 8086 Microprocessor, designed by Intel in 1976 with the help of NMOS technology. It includes a data bus of 8 bits, and 16 bits of the address bus, having a +5V voltage supply, and operates at 3.2 MHz single segment CLK. It has an internal clock generator and functions on a clock cy
4 min read
Addressing modes in 8086 microprocessor
Prerequisite - Addressing modes, Addressing modes in 8085 microprocessor The way of specifying data to be operated by an instruction is known as addressing modes. This specifies that the given data is an immediate data or an address. It also specifies whether the given operand is register or register pair. Types of addressing modes: Register mode -
2 min read
Program execution transfer instructions in 8086 microprocessor
Prerequisite - Branching instructions in 8085 microprocessor Program execution transfer instructions are similar to branching instructions and refer to the act of switching execution to a different instruction sequence as a result of executing a branch instruction. The two types of program execution transfer instructions are: Unconditional Conditio
3 min read
Interrupts in 8086 microprocessor
An interrupt is a condition that halts the microprocessor temporarily to work on a different task and then returns to its previous task. An interrupt is an event or signal that requests the CPU's attention. This halt allows peripheral devices to access the microprocessor. Whenever an interrupt occurs, the processor completes the current instruction
3 min read
Bus Cycles of 8086 Microprocessor
The bus cycle is also named as machine cycle. Bus cycle of 8086 is used to access memory, peripheral devices (Input/Output devices), and Interrupt controller. Bus cycle corresponds to a sequence of events that starts with an address being output on system address bus followed by a write or read data transfer. During these operations, a series of co
2 min read
Auxiliary Carry Flag in 8086 Microprocessor
Auxiliary Carry Flag (AF) is one of the six status flags in the 8086 microprocessor. This flag is used in BCD (Binary-coded Decimal) operations.The status of this flag is updated for every arithmetic or logical operation performed by ALU.This flag is set to one if there is a CARRY from the lower nibble or BORROW for the lower nibble in binary repre
1 min read
Minimum mode configuration of 8086 microprocessor (Min mode)
Overview : The 8086 microprocessor operates in minimum mode when MN/MX' = 1.In minimum mode,8086 is the only processor in the system which provides all the control signals which are needed for memory operations and I/O interfacing.Here the circuit is simple but it does not support multiprocessing.The other components which are transceivers, latches
5 min read
Difference Between Minimum Mode and Maximum Mode in 8086 Microprocessor
Introduction : In the 8086 microprocessor, there are two modes of operation: minimum mode and maximum mode. Minimum mode is used when the 8086 microprocessor is operating as a standalone processor without any external coprocessors or support chips. In this mode, the 8086 uses a single 8-bit bus for both data and instructions, and a single 20-bit ad
3 min read
String manipulation instructions in 8086 microprocessor
In this Article, We will be going through the String Manipulation Instruction, We will start our Article with the Introduction of the String Manipulation Instruction in the 8086, Then We will go through the different String Manipulation Instructions with some Examples, and At last, we will conclude our Article with Some FAQs. What are String Manipu
5 min read
Immediate Addressing Mode in 8086 Microprocessor
Immediate addressing mode in 8086 microprocessor contains the instruction where the first operand may be a register or memory location and the second operand is an immediate value that represents the operand. In this article, we will explore the immediate addressing mode in detail along with the examples of immediate addressing mode. Also, we will
4 min read
Types of Registers in 8086 Microprocessor
A microprocessor is a register-based clock-driven digital device that is used for data processing. It is a multipurpose device that is capable of producing outputs when provided binary data as input. In computers, the microprocessor is like the brain, handling tasks and calculations. Inside the microprocessor are tiny storage units called registers
7 min read
Maximum mode configuration of 8086 microprocessor (Max mode)
The 8086 microprocessor is an 8-bit/16-bit microprocessor designed by Intel in the late 1970s. It is the first member of the x86 family of microprocessors, which includes many popular CPUs used in personal computers. The architecture of the 8086 microprocessor is based on a complex instruction set computer (CISC) architecture, which means that it s
4 min read
General purpose registers in 8086 microprocessor
It is one of the most important chips ever created due to its part in the development of x86-based architecture. One significant aspect of this microprocessor is that it contains general registers. Efficiency and speed of computations in the processor are influenced by these registers since they determine arithmetic operations execution and data ma
6 min read
Pin diagram of 8086 microprocessor
The 8086 chip, presented by Intel in 1978, is a critical part in the development of processing innovation. Its pin outline is a basic part of figuring out its design and usefulness. The pin chart gives a visual portrayal of the chip's outer associations and their individual capabilities, including power supply, ground, information, address, and con
8 min read
Memory Banking in Microprocessor
The 8086 processor provides a 16-bit data bus. So It is capable of transferring 16 bits in one cycle but each memory location is only of a byte(8 bits), therefore we need two cycles to access 16 bits(8 bit each) from two different memory locations. The solution to this problem is Memory Banking. Through Memory banking, our goal is to access two con
3 min read
Difference between Memory Mapped IO and IO Mapped IO with reference to 8085 microprocessor
Introduction : In a microprocessor system, there are two methods of interfacing input/output (I/O) devices: memory-mapped I/O and I/O mapped I/O. In memory-mapped I/O, input/output devices are mapped to the memory address space of the microprocessor. This means that the I/O devices are treated like memory locations and can be accessed using the sam
4 min read
Difference between Random Access Memory (RAM) and Content Addressable Memory (CAM)
Random Access Memory (RAM) is used to read and write. It is the part of primary memory and used in order to store running applications (programs) and program's data for performing operation. It is mainly of two types: Dynamic RAM (or DRAM) and Static RAM (or SRAM). RAM is made up of small memory cells that are arranged in a grid pattern. Each cell
4 min read
Difference between Virtual memory and Cache memory
Cache Memory: Cache memory increases the accessing speed of CPU. It is not a technique but a memory unit i.e a storage device. In cache memory, recently used data is copied. Whenever the program is ready to be executed, it is fetched from main memory and then copied to the cache memory. But, if its copy is already present in the cache memory then t
2 min read
Difference between Uniform Memory Access (UMA) and Non-uniform Memory Access (NUMA)
Multiprocessors can be categorized into three shared-memory model which are: Uniform Memory Access (UMA)Non-uniform Memory Access (NUMA)Cache-only Memory Access (COMA) Uniform Memory Access (UMA): In UMA, where Single memory controller is used. Uniform Memory Access is slower than non-uniform Memory Access. In Uniform Memory Access, bandwidth is re
4 min read
Difference between Byte Addressable Memory and Word Addressable Memory
Memory is a storage component in the Computer used to store application programs. The Memory Chip is divided into equal parts called as "CELLS" . Each Cell is uniquely identified by a binary number called as "ADDRESS" . For example, the Memory Chip configuration is represented as '64 K x 8' as shown in the figure below. The following information ca
3 min read
Random Access Memory (RAM) and Read Only Memory (ROM)
Memory is a fundamental component of computing systems, essential for performing various tasks efficiently. It plays a crucial role in how computers operate, influencing speed, performance, and data management. In the realm of computer memory, two primary types stand out: Random Access Memory (RAM) and Read-Only Memory (ROM). Understanding the diff
8 min read
8086 program to sort an integer array in ascending order
Problem - Write a program in 8086 microprocessor to sort numbers in ascending order in an array of n numbers, where size “n” is stored at memory address 2000 : 500 and the numbers are stored from memory address 2000 : 501. Example - Example explanation: Pass-1: F9 F2 39 05 F2 F9 39 05 F2 39 F9 05 F2 39 05 F9 (1 number got fix) Pass-2: F2 39 05 F9 3
3 min read
8086 program to divide a 16 bit number by an 8 bit number
Problem - Write an assembly language program in 8086 microprocessor to divide a 16 bit number by an 8 bit number. Example - Algorithm - Assign value 500 in SI and 600 in DI Move the contents of [SI] in BL and increment SI by 1 Move the contents of [SI] and [SI + 1] in AX Use DIV instruction to divide AX by BL Move the contents of AX in [DI]. Halt t
2 min read
8086 program to subtract two 16-bit numbers with or without borrow
Problem - Write a program to subtract two 16-bit numbers where starting address is 2000 and the numbers are at 3000 and 3002 memory address and store result into 3004 and 3006 memory address. Example - Algorithm - Load 0000H into CX register (for borrow) Load the data into AX(accumulator) from memory 3000 Load the data into BX register from memory
2 min read