Subj : NASM segment registers- a To : Jasen Betts From : Robin Sheppard Date : Tue Oct 30 2001 12:18 pm JB> You, can't always do it like that, CS and DS can reference the same JB> memory but have different values if the descriptors they point to point JB> to the same memory. of course if CS == DS then they'll be pointing to JB> the same descriptor. JB> but I doubt that DJGPP uses an environment that complex. You don't like DJGPP, do you? Anyways, they have to be different descriptors, simply because one must be code, and the other data. Data segments aren't executable, and code segments aren't writable. Loading a data selector into CS would cause some sort of exception immediately, as it tried to execute the next instruction- or maybe the exception would be caught on loading CS with an invalid value. Loading DS would probably be okay until you tried to write data to it, but I'm not sure- maybe the CPU verifies that it is indeed a valid data selector. I don't know much about protected mode, but I'm pretty sure on these aspects. .... Christian Science programming: "Let God debug it!" --- EzyBlueWave V1.48g0 01fd0192 * Origin: Milky Way, Langley, BC [604] 532-4367 (1:153/307) .