Information Technology Reference
In-Depth Information
A.2.2 Memory segmentation
The 80386, 80486 and Pentium processors run in one of two modes, either virtual or real.
When using the virtual mode they act as a pseudo-8086 16-bit processor, known as the pro-
tected mode. In the real mode they can use the full capabilities of their address and data bus.
The mode and their addressing capabilities depend on the software and thus all DOS-based
programs use the virtual mode.
The 8086 has a 20-bit address bus so that when the PC is running 8086-compatible code
it can only address up to 1 MB of memory. It also has a segmented memory architecture and
can only directly address 64 kB of data at a time. A chunk of memory is known as a segment
and hence the phrase 'segmented memory architecture'.
Memory addresses are normally defined by their hexadecimal address. A 4-bit address
bus can address 16 locations from 0000b to 1111b . This can be represented in hexadecimal
as 0h to Fh . An 8-bit bus can address up to 256 locations from 00h to FFh .
Two important addressing capabilities for the PC relate to a 16- and a 20-bit address bus.
A 16-bit address bus addresses up to 64 kB of memory from 0000h to FFFFh and a 20-bit
address bus addresses a total of 1 MB from 00000h to FFFFFh . The 80386/80486/Pentium
processors have a 32-bit address bus and can address from 00000000h to FFFFFFFFh .
A memory location is identified with a segment and an offset address and the standard
notation is segment:offset . A segment address is a 4-digit hexadecimal address
which points to the start of a 64 kB chunk of data. The offset is also a 4-digit hexadecimal
address which defines the address offset from the segment base pointer. This is illustrated in
Figure A.3.
address location
segment:offset
64 kB of
data
segment
offset
Figure A.3 Memory addressing
The segment:offset address is defined as the logical address, the actual physical
address is calculated by shifting the segment address; 4 bits to the left and adding the offset.
The example given next shows that the actual address of 2F84:0532 is 2FD72h:
0010 1111 1000 0100 0000
Segment ( 2F84 ):
0000 0101 0011 0010
Offset ( 0532 ):
Actual address:
0010 1111 1101 0111 0010
 
Search WWH ::




Custom Search