home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6673 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  2.2 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!usc!rpi!batcomputer!munnari.oz.au!uniwa!uniwa!usenet
  2. From: j.laidman@cowan.edu.au (Jeremy Laidman)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: Turbo Pascal mem[a:b] question
  5. Date: 18 Nov 92 06:05:31 GMT
  6. Organization: The University of Western Australia
  7. Lines: 34
  8. Distribution: world
  9. Message-ID: <jeremy.722066731@scorpion.ac.cowan.edu.au>
  10. References: <zlsiida.414@fs1.mcc.ac.uk>
  11. Reply-To: j.laidman@cowan.edu.au (Jeremy Laidman)
  12. NNTP-Posting-Host: scorpion.ac.cowan.edu.au
  13.  
  14. zlsiida@fs1.mcc.ac.uk (dave budd) writes:
  15.  
  16. >One of our users claims he can increase a in mem[a:b]:=value; until it MUST 
  17. >be off the end of his machine.  This is the kind of user who always forgets 
  18. >to bring a disk with the program on it.  I've had a brief scan of the manual 
  19. >and it's not clear to me just exactly which bits of memory get addressed - 
  20. >eg I don't believe they'd let you write into a program segment.
  21.  
  22. Yes, you can write into a program segment.
  23.  
  24. >Are all the addresses relative to the start of the data segment (or 
  25. >something along those lines)?
  26. >If the address is off the end of the machine or just bigger than the largest 
  27. >allowable, does it get truncated in some way?
  28. >Anybody want to give me a nice simple explanation of how mem[a:b] works?
  29.  
  30. The segment*16+offset ( a*16+b ) that results is limited to FFFFFh.  It is
  31. easy to go beyond that, eg:
  32.         [$FFFF:0]    ->  FFFF0
  33.         [$FFFF:$F]   ->  FFFFF
  34.         [$FFFF:$10]  -> 100000
  35. The address bus in an 8086 is 20 bits wide, so the largest number that can be
  36. put on the address bus is FFFFFh.  If you put something bigger, the high bit
  37. will be ignored, and so 100000 will address location 00000.
  38.  
  39. To access memory above this 20 bit limit (1meg) the A20 address line has to be
  40. fiddled with, which is what the HIMEM.SYS driver does on 80286s and above.
  41.  
  42. ---------------------------------------------------------------------
  43. Jeremy Laidman, Computer Support Officer
  44. Department of Computer Science                 Phone: (61 9) 370 6648
  45. Edith Cowan University                         Fax:   (61 9) 370 2910
  46. Perth, Western Australia                       j.laidman@cowan.edu.au
  47. ---------------------------------------------------------------------
  48.