[comp.sys.ibm.pc] arrays > 64k

LC.YRS@forsythe.stanford.edu (Richard Stanton) (11/21/89)

In article <1989Nov18.222704.16822@ccu.umanitoba.ca>,
rahardj@ccu.umanitoba.ca (Budi Rahardjo) writes:
>I am trying to write a program (in MSC) which loads a 100K data into memory,
>and save the starting address and ending address with a pointer or index.
>The problem is after reaching the end of 64 K the pointer wrap around
>the beginning of the same data blocks, so it writes over the first 36K.
>To make it simple, here is the problem I have :
>* How do I increment the pointer so that it can point beyond the 64 barier ?
>
As far as I can tell, the problem is that you are not using a huge
pointer to your array. Normal pointers only use a 16 bit address,
thus can access at most 64k before they go back to the beginning of
the segment. If you declare the pointer as e.g. (char huge *), it
will now have a 32 bit address, and should be able to address the
full 100k.

Richard Stanton