8086 memory organization
DESCRIPTION
physical memory 8086 Memory OrganizationTRANSCRIPT
8086 Memory Organization
Segmented MemoryTwo types of memory organization are used:
Linear addressing where the entire memory is available to the processor at all the times ( Motorola 68000 family).
Segmented addressing where the memory space is divided into several segments and the processor is limited to access program instructions and data in specific segments.
8086 Memory OrganizationEach memory location 8086 is a byte while the 8086 is a 16-bits microprocessor?
Many of the 8086 ‘s operation codes are single bytes.I/O devices like printers, terminals and modems are designed to transfer ASCII encoded data.
The 8086 has a 20-bits address bus, allowing to access a memory of 220 = 1 M locations.
Data Bus
1048575 10485745
0
2
67
5
3
1
4
0 0 0 0Segment register
Address Bus
Segment Registers
Within the 1MB of memory space, the 8086 defines four 64 K memory blocks:
The code segment, stack segment, data segment, extra segment.
Each of these blocks of memory is used differently by the processor.
The code segment holds the program instruction codes.The data segment holds the data of the program.The extra segment is an extra data segment (often used for shared data).The stack segment is used to store interrupt and subroutine return addresses.
There are four segment registers CS, DS, ES and SS and each of them defines the starting address of the corresponding segment.
Each segment register is 16 bits wide while the address bus is 20 bits wide. The BIU takes care of this by appending four 0s to the low order bits of the segment register.
Example
Assuming the four segment register contain the values shown in the above figure, calculate the beginning and ending addresses of the four segments.
At any time only ………… of memory can be accessed by the processor.
CS
C2E00he
4F980he
4A000h
E0000he
Stack Segment
Extra Segment
Data Segment
Code Segment
E000h
DS
C2E0h
SS
4F98h
ES
4A00h
Offset
0 0 0 0Segment register
Adder
PhysicalAddress
Logical and Physical Addresses
Addresses within a segment can be ranged from address 0 to address FFFFh. This correspond to the 64K length of the segment. An address within a segment is called an offset or logical address. For example, logical address 20h in the code segment shown above actually correspond to the real address E0000h+ 20h= E0020h. this real address is called the physical address.
Physical address is the 20 bits address that being output bus the BIU on the address bus.
Types of memory Reference
Default Segment Alternate Segment Offset (Logical Address)
Instruction fetch CS None IPStack operation SS None SPGeneral data DS CS, ES, SS Effective addressString source DS CS, ES, SS SIString destination ES None DIBX used as pointer DS CS, ES, SS Effective addressBP used as pointer SS CS, ES, SS Effective address