Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!pepper!cmcmanis
From: cmcmanis%pepper@Sun.COM (Chuck McManis)
Newsgroups: comp.sys.amiga
Subject: Re: Piggyback CPU boards (also legal C expressions)
Message-ID: <36262@sun.uucp>
Date: 11 Dec 87 19:54:39 GMT
References: <2118@crash.cts.com> <36064@sun.uucp> <4284@garfield.UUCP>
Sender: news@sun.uucp
Reply-To: cmcmanis@sun.UUCP (Chuck McManis)
Distribution: na
Organization: Sun Microsystems, Mountain View
Lines: 37

>I've seen this mentioned a number of times, but no concrete examples of how
>it would be used or cases which would break with a 68020.

What happens is that most games are written in assembler for speed. The
68000 keeps its condition codes in the status register. When you want to
check some combination of the status bits the assy programmer moves the
status register into a data register and then uses the TEST instruction
to sample the bits of interest. On a 68000 this works fine, on an '010
or '020 it cause a supervisor trap. 

> Is moving the status register something that would only happen
> if you used assembler, or do any of the compilers generate it
> in certain cases? I certainly wouldn't want statements like "if
> (x == 0)" to start breaking :-) ! 

Yes, all of the high level languages I know of use the GetCC form to 
get the condition codes from the status register.

>                               ... I imagine someone skilled
> enough to program a game on the Amiga in assembly who didn't
> use GetCC() when appropriate simply had't run into it, tucked
> away as it is in the middle of the other Exec functions.

Wrong, strangely enough a lot of people who program games for the Amiga
seem to be stuck in a C64 mentality mode. You can recognize them by their
desire to go to the hardware first rather than see if the OS can provide
what they need. I realize that sometimes this is required and have no
qualms with it when people can say "Well I tried using function X and 
just couldn't get the speed I needed, so I went directly to the hardware."
But things like dropping data in to absolute memory locations, doing 
their own memory allocation schemes (which cannot be later made to specify
chip memory only) etc etc. They say, "I'm not using Intuition, so why 
should I use Exec?" 

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.