[comp.sys.amiga.tech] 020 and 32 bit memory

shf@well.UUCP (Stuart H. Ferguson) (06/21/88)

Is there any reason why a program that works on an Amiga with an '020 
would not work on an Amiga with an '020 *and* 32-bit memory?

I've gotten some vague reports from beta-testers along these lines and 
I'd like to know if there are any differences as far as software should 
be concerned.  My understanding was that this type of change to the 
hardware is completely transparent to the programmer.  Thanx in advance.
-- 
		Stuart Ferguson		(shf@well.UUCP)
		Action by HAVOC		(shf@Solar.Stanford.EDU)

dillon@CORY.BERKELEY.EDU (Matt Dillon) (06/22/88)

>Is there any reason why a program that works on an Amiga with an '020 
>would not work on an Amiga with an '020 *and* 32-bit memory?
>
>I've gotten some vague reports from beta-testers along these lines and 
>I'd like to know if there are any differences as far as software should 
>be concerned.  My understanding was that this type of change to the 
>hardware is completely transparent to the programmer.  Thanx in advance.
>-- 
>		Stuart Ferguson		(shf@well.UUCP)
>		Action by HAVOC		(shf@Solar.Stanford.EDU)

	I would expect a couple of programs to assume that their
memory address is <=80000000 (i.e. they can use bit 31), and even some that
assume the high byte of the pointer can be used for other purposes.

	This all goes to pot when you switch to a 68020.

	Of course, the fault is the original programmer's, since it was
clearly stated by C-A that pointers should be assumed to be a full 32 bits.

	The only assumption I make with pointers is that stuff returned
by AllocMem() is 8-byte aligned (the lower three bits are 0).  Actually,
I expect this might change (though I doubt it) so at best I assume it is
long word aligned (lower 2 bits are 0).

						-Matt

thad@cup.portal.com (06/22/88)

Yes, there is a good reason why a program will work on an '020 Amiga, then
fail on a system with an '020 and 32-bit-wide memory (look to True Basic
as one example of such failure).  The reason:

some crap software is using the high byte of a 32-bit pointer for some
purpose OTHER than as part of the address (e.g. someone is sticking DATA
into bits 31:24).

On an Amiga withOUT the 32-bit-wide memory, the crap in bits 31:24 is
simply not seen (or, at least, is ignored) by a memory address decoder.

An Amiga WITH 32-bit-wide memory has that memory in the address space ABOVE
the reach of 2^24, and the extra junk WILL be decoded to a non-existent
address.

Rephrased: on a system with 32-bit-wide memory, EVERY bit in an address
pointer is considered to be part of an address; on a "standard" Amiga, only
the information in bits 23:0 are considered part of an address.

thad@cup.portal.com (06/22/88)

BTW, in case anyone's offended by my use of `crap' (tough!), you can
assuage your sensibilities by considering `crap' to be an acronym:

     Completely
     Random
     Address
     Pointer

One (of many) "hobbies" of mine is deriving or conjuring acronyms; something
to do while shaving, driving, waiting for my 11-months-late developer
paperwork (Lauren?), etc., and I thought you might enjoy this one I developed
when I (finally!) purchased a telephone answering machine (which I call
"Communication by PROXY"): PROXY:

     Personal
     Remotely
     Operated
    eXtension of
     Yourself


Quickly discovered that one does NOT want to use the Translator/Narrator
to produce the answering message (unless one is trying to "put off" bill
collectors, the IRS, etc. :-)

Sheesh; my ol' Votrax SC-01 chip (with Votrax software) sounds better than
the Amiga.  Perhaps someone should license that stuff and port it to the
Amiga?

rokicki@polya.Stanford.EDU (Tomas G. Rokicki) (06/23/88)

Here's another thing that could break a 68020 machine that I just
realized.  If you *ever* do something like:

char *copystr(s) char *s ; { return(strcpy(mymalloc(strlen(s)),s)) ; }

(not as though I'm advocating that style of programming) but where
mymalloc grabs a chunk of memory, from a previously allocated chunk
or from the system, (and presumably checks for NULL), this could
well work on a 68000 system for a long time.  You'll overwrite the
next byte with a 0, but if that next byte is a pointer, you'll never
notice on a '000, but an '020 will break.

I've been bitten with malloc(strlen), so be careful!  Sometimes it's
a lot more subtle, if you add constants or something because you did
a strcat() and are off by one or something . . .

-tom

-- 
    /-- Tomas Rokicki         ///  Box 2081  Stanford, CA  94309
   / o  Radical Eye Software ///  (TAMU EE '85)   (415) 326-5312
\ /  |  . . . or I       \\\///Join CCFFAALW---Concerned Citzens
 V   |  won't get dressed \XX/Fighting For An Acronym-Less World