home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!usc!cs.utexas.edu!torn!news.ccs.queensu.ca!slip202.telnet1.QueensU.CA!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: Once more about big structures in BP7.
- Message-ID: <dmurdoch.287.726607429@mast.queensu.ca>
- Lines: 37
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <Sorokin.52.726598021@ps1.iaee.tuwien.ac.at>
- Date: Sat, 9 Jan 1993 19:23:50 GMT
-
- In article <Sorokin.52.726598021@ps1.iaee.tuwien.ac.at> Sorokin@ps1.iaee.tuwien.ac.at (Sorokin Zhenya) writes:
-
- >1. Is the space for global variables now bigger than 64k in protected mode?
- >2. What is the upper limit for stack size?
-
- No and 64K. The protected mode memory model is quite a bit like the real
- mode one.
-
- >3. Can I allocate a place for the structure, that is bigger than 64k on the
- >heap? If not, why (i.e. what procedure is used to allocate memory on the
- >heap? The conventional one from DOS takes only WORD as parameter, but maybe
- >DPMI has another call)?
-
- Yes, you can. In fact, you can in DOS too - INT 21 function 48h takes a word
- as a parameter, but it specifies the number of 16 byte paragraphs. Under TP
- it'll usually fail because TP has grabbed all memory for itself, but if you
- ask for a small heap or shrink it using SetMemTop, you can allocate
- a block of any size. It's also not hard to work with the real mode heap
- manager and do your own allocations of bigger than 64K.
-
- 5. If 4. is "yes", than can I address, say, MyDoubleArr[100000] (vorbidden
- >in 8086 mode, but principally not in protected)?
- >6. Can I write "type MyDoubleArr = array [1..100000] of double"?
-
- No to both. It's still running in 80286 16 bit mode. Segments are limited
- to 64K, and there's very little support for crossing segment boundaries.
- (There is a tiny bit of support, and it works in real mode too. You add
- SelectorInc to the segment part of an address to move forward 64K in your
- structure.)
-
- By the way, your big allocation could be made to work in either real or 16
- bit protected mode, provided you had 800K free. Borland has chosen not to
- put huge object support into TP. Other real mode languages have it. The
- 8086/80286 architecture makes it more difficult than on a 32 bit machine,
- but certainly not impossible.
-
- Duncan Murdoch
-