The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: r_miele on January 07, 2005, 04:13:44 AM

Title: Another protected-mode segment question.
Post by: r_miele on January 07, 2005, 04:13:44 AM
Sorry for all the questions guys, I have no one else to ask.

I thought I had a good grasp of the concept of segments until I started protected-mode programming.  It seems that the more research I do on them the more confused I get. :lol

The flat memory model works similar to the tiny memory model in which the code, data, and stack reside in the same segment.  What if you want to create a program that needs to keep data in a seperate segment? 

In real-mode, is any data and code segment you make put in a different physical memory segment?

Thanks guys
Title: Re: Another protected-mode segment question.
Post by: tenkey on January 07, 2005, 11:54:21 PM
Physical memory has no segments. The segments are "windows" into physical memory. The descriptors tell the processor how big the window is, and where in physical memory it starts. That is why segments can overlap, creating more than one way to address the same physical memory location.