
DOS, pointers & flat addressing Question
Quote:
>I am hoping to develop a better understanding of pointers in
>the ever expanding universe (Windows, OS2, etc.) so I hope someone
>can answer a few questions, or point me to the answers.
Followups are redirected to comp.os.ms-windows.programmer.misc.
Quote:
>1) Using pointers that are represented in SEG:OFS form, we are
> forever limited to linearly addressing only 1M byte, right?
No. In "real mode" the real address is (SEG<<4)+OFS; thus to all
intents and purposes you have a 20-bit address space, which is 1 MB.
(To be absolutely accurate, it's 0x00000 to 0xFFFF0+0x0FFFF, which is
about 1MB + 64 KB.)
But other ways of combining two 16-bit quantities give you a bigger
address space. In particular, the obvious (SEG<<16)+OFS gives you a
32-bit space, providing 4 GB. Windows programming wizards can give you
a better handle on the details than I.
Quote:
>If there is a more appropriate place to post these questions, let
>me know! Thanks!
See the "followup-to" line.
--
"'Overreacting' seems to be the new word for being upset when someone treats
you badly. As such, it is serving as the second round of ammunition for
bullies who find that their first round hits the target." --Miss Manners