Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!ginosko!uunet!mcsun!ukc!tcdcs!wsl!john From: john@wsl.UUCP (John Allen on wsl) Newsgroups: comp.lang.c Subject: Re: Large arrays in MSDOS Message-ID: <273@wsl.UUCP> Date: 27 Oct 89 20:13:13 GMT References: <4010005@hpcvca.CV.HP.COM> Reply-To: john@wsl.ie (John Allen on wsl) Organization: Workhorse Systems, Dublin, Ireland Lines: 41 Summary: Expires: Sender: Followup-To: In article <4010005@hpcvca.CV.HP.COM> scott@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."