1

Intel guide says "The logical address consists of a 16-bit selector and 32-bit offset". Now if using a small program in C:

printf("The address of a=%x", &a);

The output is: 0xbffa8343

The above address is 32 bit so how can it be broken into selector (16-bit) and offset(32-bit)?

Albert
  • 385
  • 1
  • 4
  • 17

1 Answers1

2

The 32-bit address in this case is the 32-bit offset from the guide. The "16-bit selector" is generally left out of C code and is, in fact, often left implicit in assembly code. (In many modern operating systems, segmentation is not even used except for internal access to thread-local storage. For the most part, a default segment is set up that points to the full 4GB of virtual memory.)

You might find it useful to search the web for good introductions to segment registers and how segmentation is used today.

reuben
  • 3,360
  • 23
  • 28
  • Thanks, I also got info at: http://stackoverflow.com/questions/3029064/segmentation-in-linux-segmentation-paging-are-redundant – Albert Feb 20 '12 at 08:50