Path: utzoo!utgpu!water!watmath!clyde!bellcore!tness7!tness1!sugar!peter
From: peter@sugar.UUCP (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Another question on the 80286- er, 68000 memory models
Summary: This is a job for Mr. Optimiser!
Message-ID: <2069@sugar.UUCP>
Date: 1 Jun 88 13:18:51 GMT
References: <8805182223.AA20918@cory.Berkeley.EDU> <2653@louie.udel.EDU> <2869@polya.STANFORD.EDU>
Organization: Sugar Land UNIX - Houston, TX
Lines: 63

In article ... rokicki@polya.STANFORD.EDU (Tomas G. Rokicki) writes:
> Let's get this all straight.  There are three independent things
> that affect the `model' on the Lattice and Manx compilers:

> 	* data addressing.  This can either be 32-bit absolute
> 	  or 16-bit relative.  *Pointers are 32-bits in either
> 	  case*.

This sounds more like a job for Mr. Optimiser than something the programmer
should have to deal with. You would have as many or as few base registers
as you needed to get quick access to the data, allocated and set up as needed
within the procedure, block, or even statement for which it's appropriate.

No need for a memory model, unless you're used to doing things the intel way.
The whole A4 business is an obvious copy of 8086 small data models.

Use it, but keep on your vendor's tail about doing it right.

> 	* code addressing (jsr's.)  These can either be 32-bit
> 	  absolute or 16-bit relative.  Again, you can mix
> 	  models.

And again, this is an optimisation that should be applied to all code. The
UNIX *assembler* on the PDP-11 did this: you just specified that you were
branching, and it'd generate either the short branch or the long branch
depending on how far away the destination was. Surely a compiler can do this
within a routine and for calls to static globals.

Again, no need for a memory model. Use it, but remember to let your vendor
know that they still need an optimiser.

> 	* int size.  Both Manx and Lattice allow 16 and 32-bit
> 	  ints.

This is the only case that I know of for which the concept of "models" is
appropriate. This is also the case that bites everyone. I would recommend
32-bit mode, for four reasons:

	1) It'll be more efficient when we're using 68020s.
	2) It makes it easier to port VAX-style code that assumes (sizeof int)
	   is the same as (sizeof char *).
	3) The Amiga libraries take 32-bit ints.
	4) Manx did a half-assed implementation of the X3J11 draft: no
	   function prototyping. When they wake up and put it in then the
	   whole thing will become a non-issue.

Point 1 is a bit of a fake. After all, they still don't align the stack
right for 32-bit memory.

> Someone please correct me where I'm wrong.

You're not wrong, just too willing to make allowances for 8086 mentality.

#ifdef HUMOR
The question is: how do you get on Manx' tail? Manxes don't have any tails :->.
And what sort of beast is a Lattice anyway?
#endif

What do the Modulans do?
-- 
-- Peter da Silva      `-_-'      ...!hoptoad!academ!uhnix1!sugar!peter
-- "Have you hugged your U wolf today?" ...!bellcore!tness1!sugar!peter
-- Disclaimer: These may be the official opinions of Hackercorp.