News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

flat memory model

Started by ookami, January 22, 2011, 04:27:07 PM

Previous topic - Next topic

ookami

Hi,

I just want to check if I am right about that :

Even in the flat memory model, there is at least three segments : the stack, the code segment and the data segment.

Please tell me if i am right.

Thanks

BogdanOntanu

Quote from: ookami on January 22, 2011, 04:27:07 PM
Hi,

I just want to check if I am right about that :

Even in the flat memory model, there is at least three segments : the stack, the code segment and the data segment.

Please tell me if i am right.

Thanks

They are not considered as segments anymore. There are considered selectors. Selectors offset into the GDT system table. The CPU looks up the GDT table in order to determine the segment's characteristics.

For Win32 flat memory model the CS,DS and SS selectors refer to "segments" with base = 0x0000_0000 and limit 0xFFFF_FFFF or in other words all of the 4Gbytes address space is available. Protection is enforced by paging and not by segments / selectors.

However there is on exception to this: Windows does use the FS: selector for some process/thread internal structures. As a consequence this selector refers to an segment with a base not equal to zero and an limit much smaller than 4Giga bytes
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro