Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!jade!ig!uwmcsd1!leah!itsgw!batcomputer!cornell!uw-beaver!tektronix!tekig!phils From: phils@tekig.TEK.COM (Phil Staub) Newsgroups: comp.sys.amiga Subject: Re: Piggyback CPU boards (also legal C expressions) Message-ID: <638@tekig.TEK.COM> Date: 12 Dec 87 09:54:00 GMT References: <8712111630.AA17999@cory.Berkeley.EDU> Sender: news@tekig.TEK.COM Reply-To: phils@tekig.UUCP (Phil Staub) Organization: Tektronix, Inc., Beaverton, OR. Lines: 33 In article <8712111630.AA17999@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes: > I know of no compilers which use MOVE SR, it is strickly a >hand-programmed opcode. The SR contains the condition codes, supervisor state, >trace mode, and interrupt mask. The only reason anybody uses MOVE SR,x is >to check the trace mode, supervisor state, or interrupt mask. The condition >codes can be read/written with MOVE CCR. Motorola decided MOVE SR should >become privilaged (user programs should not know about supervisor flags) under >the 68010 and 68020. > > I see it in copyprotection a lot, but not much else. > > -Matt Check the edge of the page describing the MOVE CCR,instruction in the 68000 Programmers Reference Manual, and you'll see a little black bar indicating that a MOVE with a source operand of CCR is a 68010/68012 only instruction. This is the real problem. 68000 programs often use MOVE SR, to read the condition codes, since the MOVE CCR, instruction does not exist. 68010 programs *should* use MOVE CCR, to achieve the same purpose (i.e., if *all* they're interested in is the condition codes). There is no single solution which works on both processors, hence the GetCC() function. AmigaDOS determines which processor is installed on bootup and ensures that the right instruction (MOVE CCR, or MOVE SR,) gets executed as a result of branching to the GetCC vector in the jump table for the Exec library. Phil -- ------------------------------------------------------------------------------ Phil Staub "I do NOT approve. I merely said I UNDERSTAND." tektronix!tekigm2!phils - Spock phils@tekigm2.TEK.COM