Sie sind auf Seite 1von 13

REAL MODE MEMORY ADDRESSING

CHAPTER 4
MEMORY ADDRESSING

• The 80286 and above operate in either the real or protected

mode. Only the 8086 and 8088 operate exclusively in the

real mode.

• Note that the first 1 M byte of memory is called either the real

memory or conventional memory system.


Memory Organization

o 8086/8088µP, via its 20-bit address bus, can address 2(20) = 1,048,576 bytes or (1
Mbyte) of memory locations.

o Thus the memory space of 8086µP is 1,048,576 bytes or 524,288 words. The
memory map of 8086µP as shown, where the whole memory space starting from
00000H to FFFFFH.

o The 8086µP operate in the Real mode memory addressing. Real mode operation
allows the microprocessor to address only the first 1 Mbyte of memory.

o Even though the 8086 has a 1 Mbyte address space, not all this memory is active
at one time.

o Actually, the 1 Mbytes of memory are partitioned into 64 Kbyte (65,536) segments.
The 8086µP allows four memory segments. The figure shows these memory
segments.

(figure)
Physical Address

Segment Address x 10H +offset Address

How this formula came? Lets see


Physical Address Generation

Logical address, segment address and physical address are explained as follows:

o The logical address, also known as the effective address or offset address is
contained in the registers IP(instruction pointer), BP(base pointer), SP(stack
pointer), BX(16bit base register), SI(source index) or DI(destination index).

o The 16-bit content of one of the four segment registers (CS, DS, ES, SS) is
known as the base segment address.

o Offset and base segment address are combined to form a 20-bit physical
address (also called real address) that is used to access the memory.

o The 20-bit physical address is generated by combining the offset (residing in


BX, BP, IP, SP, SI or DI) and the content of one of the segment registers CS,
DS, ES or SS.
TABLE 1: SEGMENT REGISTERS AND THEIR OFFSETS

SEGMENT OFFSET SPECIAL PURPOSE


REGISTERS REGISTERS

CS(code segment) IP Instruction Address

SS (stack segment) SP or BP Stack Address

DS(data segment) BX,DI,SI,an 8bit number Data Address


Or 16bit number

ES,DS(extra DI for string instruction String Destination


segment, data (e.g “S” is written with mov Address
segment) instruction like MOVS)
The process of combination is as follows:

o The content of the segment register is internally appended with


0H (0000B) on its right most end to form a 20-bit memory
address—this 20-bit address points to the start of the segment.

o The offset is then added to the appended segment register to


get the physical address.
Go back
Physical Address = Segment Register : Offset
(Effective Address)

= (Segment Register)x10H + Offset (Effective


Address)
BLOCK DIAGRAM OF PHYSICAL ADDRESS CALCULATION
Exercise for calculating Physical Addresses

1.MOV AX,[BP]

BP is a offset of stack segment (TABLE 1)

so the SS will append by zero, and added to offset so,

physical address: SS x 10H +BP

similarly same techniques goes for rest of the instruction below,

2.ADD DX [DI]

DI is a offset of Data segment

physical address: DS x 10H +DI (TABLE 1)


3.SUB DI,[08H]

08H is a 8bit number

0000 1000 (TABLE 1)

OFFSET OF 8BIT OR 16 BIT NUMBER IS DATA SEGMENT

physical address: DS x 10H +08H


Offset 16 bit (0000 0100 0000 0101)

4.MOV [0405H],AX

physical address: DS x 10H +0405H

Das könnte Ihnen auch gefallen