home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!ukma!gatech!destroyer!caen!batcomputer!cornell!rochester!cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!spdcc!merk!fcshome!fredex
- From: fredex@fcshome.UUCP (fred smith)
- Newsgroups: comp.os.msdos.programmer
- Subject: Re: fread-inf >= 64K in Borland C++
- Message-ID: <921109150@fcshome.UUCP>
- Date: 10 Nov 92 19:33:57 GMT
- References: <1992Nov9.095508@sees.bangor.ac.uk>
- Organization: What?!? Absolutely none!
- Lines: 22
- X-Newsreader: Tin 1.1 PL5
-
- Bill Denton (AD) (bill@sees.bangor.ac.uk) wrote:
- : When I try to fread 64K or more in Borland C the PC locks up. This occurs with
- : all memory models and with version 2.0 and 3.0. Is this serious bug fixed in
- : version 3.1 ? How do I fix it, without the obvious, but unsatisifactory, solution of reading the data in chunks smaller the 64K ?
- :
- This is NOT A BUG (unless you're generating 32-bit 386 or 486 code, that is!).
-
- On MS-DOS systems the processor is run in real mode in which mode all
- int's are 16-bit quantities. The biggest number you can store in an int
- is (2**32)-1, or 65535, or 64k-1. Therefore the biggest chunk of data that
- can be moved in an i/o operation is 64k, since all the low-level functions
- use an int to tell 'em how many bytes to move.
-
- It's a FEATURE (of sorts).
-
- : Bill Denton
- : bill@sees.bangor.ac.uk
- : School of Electronic Engineering and Computer Science
- : University of Wales, Bangor
- : UK
- :
- :
-