home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10357 < prev    next >
Encoding:
Internet Message Format  |  1992-11-04  |  3.0 KB

  1. Xref: sparky comp.os.msdos.programmer:10357 comp.msdos.programmer:84 comp.os.ms-windows.programmer.tools:1337
  2. Path: sparky!uunet!ogicse!sequent!muncher.sequent.com!furballs
  3. From: furballs@sequent.com (Paul Penrod)
  4. Newsgroups: comp.os.msdos.programmer,comp.msdos.programmer,comp.os.ms-windows.programmer.tools
  5. Subject: Re: BC++ far* default in medium model
  6. Message-ID: <1992Nov5.084656.10427@sequent.com>
  7. Date: 5 Nov 92 08:46:56 GMT
  8. Article-I.D.: sequent.1992Nov5.084656.10427
  9. References: <1992Nov4.090359.21666@hellgate.utah.edu> <1992Nov5.031544.5264@sequent.com> <1992Nov5.053551.20533@emr1.emr.ca>
  10. Sender: usenet@sequent.com (usenet )
  11. Organization: Sequent Computer Systems Inc.
  12. Lines: 48
  13. Nntp-Posting-Host: crg8.sequent.com
  14.  
  15. In article <1992Nov5.053551.20533@emr1.emr.ca> jagrant@emr1.emr.ca (John Grant) writes:
  16. >In article <1992Nov5.031544.5264@sequent.com> furballs@sequent.com (Paul Penrod) writes:
  17. >[stuff deleted]
  18. >
  19. >>Almost right, but you forgot something.
  20. >>
  21. >>In your data declarations, if you do not specifically specify the
  22. >>keyword far, then the declaration is left in the default data
  23. >>segment, which can be a problem if you have more than 64k of global
  24. >>data. Granted, DS is referenced by a far pointer, but you are still
  25. >>limited to 64k per data segment, eventhough you can reference upto
  26. >>1 megabyte of data and 1 meg of code. This is because the far
  27. >>pointers in the LARGE model are not normalized 32 bit, but
  28. >>segment:offset 20 bit pointers. 
  29. >>
  30. >I am writing my first app, and I am using large model (BC++ 3.1). I haven't
  31. >used either 'far' or 'FAR' so far.  I have just let pointers default to far as
  32. >provided by the large model.  Ok, presumably I will eventually hit the
  33. >64k limit for data in my app sooner or later.  What do I do then?
  34. >Are you saying I can get more than 64k data storage by explicitly using the
  35. >'far' declaration?  Does that give me 'another' 64k data segment?
  36. >
  37. By explicitly declaring a variable, array, pointer, structure, etc.
  38. to be far the compiler forces it into another data segment, thus
  39. you can achieve more than 64k of TOTAL global storage by this
  40. method. If you want to have arrays or structures that explicity
  41. store > 64k of data in one instance then you have to use the HUGE
  42. model, which, under the Borland Compiler, makes use of 32 nit
  43. normalized pointers. By normalized, they mean a linear 32 bit
  44. address that refers to only one place in memory. Under the segment
  45. offset method, several variations of the segment:offset address can
  46. point to the exact physical location in memory.
  47.  
  48. If you have the Borland C++ 3.0 or 3.1 compiler, look on page 344
  49. to 346 of the Programmer's Guide and it does give a good, albeit
  50. cursory explaination of pointers and how those versions of the
  51. compiler handle them and the advantages, plus drawbacks to each.
  52.  
  53. Good Luck...
  54.  
  55. ...Paul
  56.  
  57.  
  58. -- 
  59. --------------------------------------------------------------------
  60.             Bureaucracy: noun, plural - Bureaucracies.
  61.          The process of turning energy into solid waste.
  62. ---------------------------------------------------------------------
  63.