Path: utzoo!yunexus!geac!daveb From: daveb@geac.UUCP (David Collier-Brown) Newsgroups: comp.arch Subject: Re: Intel memory model (really segmented memory) Message-ID: <2771@geac.UUCP> Date: 24 May 88 12:01:34 GMT Article-I.D.: geac.2771 Posted: Tue May 24 08:01:34 1988 References: <1806@obiwan.mips.COM> <2904@omepd> <353@cf-cm.UUCP> <524@xios.XIOS.UUCP> <1623@vaxb.calgary.UUCP> Reply-To: daveb@geac.UUCP (David Collier-Brown) Organization: The Geac 'Bun Department. Lines: 52 | In article <524@xios.XIOS.UUCP>, greg@xios.XIOS.UUCP (Greg Franks) writes: | The biggest win when segmenting is implemented properly, is that it | allows you to put individual items into separate segments and then use | the hardware protection mechanisms to catch illegal references. Bounds | checking can be done in parallel to program execution because explicit | 'check' instructions need not be included in the program... In article <1623@vaxb.calgary.UUCP> radford@calgary.UUCP (Radford Neal) writes: | I don't think one necessarily gets this advantage, at least not from | segments as I understand the term. ... | I presume that you are proposing allocating the arrays a and b | to different segments, and protecting all but the first ten | words of each. This may work with i==15, but how about i==12345678? | The address of a[i] is likely to be computed as &a[0] + i. If | the segment number for a is the high-order part of &a[0], then | adding i can change this to the segment number for b, and it's | possible that the segment offset will also end up being valid. The example (elided) would produce "correct" errors on the large segmented Honeywells, since the address is really (segment.$a[0]+i) (pardon my lisp), and an overflow of the second part does not show up in the first part. The behavior you describe does occur on the Intel (huge memory model), which is why people who've used segmented machines get so annoyed at it. User-@!%$#&$*#$@!!!! visible segment registers! As to the second example: | | var a: array [1..10,1..10] of integer; | i, j: integer; | | begin | i := 1; j := 11; | ... | a[i,j] := 0; | end; | The only machine I know which gets that one right is the ICL, which has "array descriptors" (there may be others: I just don't know about them). On the third hand, neither Honeywell nor ICL typically **use** their segment registers/descriptors to trap either of these array funnys. --dave ((:-<) c-b -- David Collier-Brown. {mnetor yunexus utgpu}!geac!daveb Geac Computers Ltd., | "His Majesty made you a major 350 Steelcase Road, | because he believed you would Markham, Ontario. | know when not to obey his orders"