Large arrays in MSDOS

John Allen on wsl john at wsl.UUCP
Sat Oct 28 06:13:13 AEST 1989


In article <4010005 at hpcvca.CV.HP.COM> scott at hpcvca.CV.HP.COM (Scott Linn) writes:
>
>Hello,
>
>I've been having a problem trying to use an array greater than 64k on
>an msdos machine.  What I have is the following:
>
>char foo;
>char FAR *bigbuf;
>.
>.
>.
>bigbug=farmalloc(125000L);
>
>Then, I try to use bigbuf as a linear array:

Try changing you code to something like his:

char ch;
char HUGE *buf;

.
.
.
.
buf = farmalloc(125000L);

buf[some_num] = ch;

................
The HUGE keyword causes pointer arithmetic to become effectively linear.
i.e. Both the segment and offset are modified when subscripting and doing
pointer calculations.

NOTE:- HUGE pointer manipulation is not particularly fast on iApx86 hardware.



-- 

				   "Don't quote me on any issue whatsoever."



More information about the Comp.lang.c mailing list