home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!news2me.EBay.Sun.COM!west.West.Sun.COM!cronkite.Central.Sun.COM!texsun!exucom.exu.ericsson.se!pc254101.exu.ericsson.se!exuptr
- From: exuptr@exu.ericsson.se (Patrick Taylor)
- Newsgroups: comp.lang.pascal
- Subject: Re: Turbo Pascal mem[a: b] question
- Message-ID: <exuptr.258.722564133@exu.ericsson.se>
- Date: 24 Nov 92 00:15:33 GMT
- References: <zlsiida.414@fs1.mcc.ac.uk> <1992Nov16.050457.26839@qiclab.scn.rain.com>
- Sender: news@exu.ericsson.se
- Organization: Ericsson Network Systems, Inc.
- Lines: 50
- Nntp-Posting-Host: pc254101.exu.ericsson.se
- X-Disclaimer: This article was posted by a user at Ericsson.
- Any opinions expressed are strictly those of the
- user and not necessarily those of Ericsson.
-
- In article <1992Nov16.050457.26839@qiclab.scn.rain.com> leonard@qiclab.scn.rain.com (Leonard Erickson) writes:
- >From: leonard@qiclab.scn.rain.com (Leonard Erickson)
- >Subject: Re: Turbo Pascal mem[a:b] question
- >Date: 16 Nov 92 05:04:57 GMT
-
- >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.
- >>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?
-
- >Sure. A is the segment, B is the offset. These are *absolute* addresses,
- >not relative to anything.
-
- >You can specify *any* address. If it's not present in the machine what
- >happens is probably hardware/BIOS dependent.
-
- One thing's for sure, if A or B are larger than WORDS, they are truncated.
-
- >mem[a:b] := x is a *very* low level instruction. It's compiled as a
- >direct write to RAM. probably a LOAD X,[a:b] (if I remember the assembler
- >mnemonics correctly).
-
- Close enough. I think it is more like
-
- MOV AX,[x]
- MOV DX,[a]
- MOV ES,DX
- MOV DX,[b]
- MOV [ES:DX],AX
-
- using TASM syntax, of course.
-
- Bottom line is, probably *no checking at all* is done on the address and if
- you address something that is not there, there is *no telling* what your
- machine might do.
-
- ----------------------------------------------------------------------------
- PEROT IN '96!
-
- - Patrick Taylor, Ericsson Network Systems
- exuptr@exu.ericsson.se "Don't let the .se fool you"
- exuptr@ZGNews.Lonestar.Org <SLOW!>
-