DOS, pointers & flat addressing Question 
Author Message
 DOS, pointers & flat addressing Question

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.

1) Using pointers that are represented in SEG:OFS form, we are
   forever limited to linearly addressing only 1M byte, right?
   So what happens in Windows?  My co-worker keeps finding these
   ads that promise magic ways of letting our programs grow out
   this limit (PharLap, VMData, etc) but I keep thinking that
   without replacing the C Library (which has all the functions
   that are written to expect SEG:OFS pointers) you can't change
   the form of a pointer, so are limited to 1M.  Is Windows limited
   to 1M linear addressing? I know that handles will let you get
   access to more than 1M, but you lose the convenience of pointer
   addressing, right?

2) In Windows, where would it be best to try to put a linked list
   of about 2000 lines of text?  What would be a good approach that
   would let the 2000 number grow, only restricted by the amount
   of memory in the system?

If there is a more appropriate place to post these questions, let
me know! Thanks!

- Jay



Fri, 11 Aug 1995 08:05:29 GMT  
 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


Sat, 12 Aug 1995 19:14:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. C Question - pointer & address-operator

2. 32 Bit Flat Address to 16 Bit Segmented Address

3. info on changing dos display modes (MCGA) and making a pointer to an existing address

4. address & pointer

5. Pointers & incrementing array address

6. Address conversion to phys.address under DOS

7. Question on some segment address for DOS

8. question about NULL pointer and address 0x00000h

9. Newbie pointer/address question

10. Pointer/Address Question

11. D-Flat / D-Flat++

12. Pointers & matrices: Twist on the original question

 

 
Powered by phpBB® Forum Software