home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 7987 < prev    next >
Encoding:
Text File  |  1993-01-09  |  2.3 KB  |  49 lines

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