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