[comp.sys.mac.misc] 68000 specific program?

rs54@cunixf.cc.columbia.edu (Richard Sucgang) (05/19/91)

I am unsure about this but:
Is it possible to write a program so coded that it
will specifically run only with a 68000 chip, and not t
on any of the later generation chips?  I suppose
Motorola has built in early generation emulators, but
I am unsure.

-rich
Richard Sucgang : Dept. of Anatomy and Cell Biology
Columbia University (sucgang@cuhhca.hhmi.columbia.edu; 
de slime god         rs54@cunixf.cc.columbia.edu)

sjhg9320@uxa.cso.uiuc.edu (Maximum Slackness ) (05/19/91)

rs54@cunixf.cc.columbia.edu (Richard Sucgang) writes:

>I am unsure about this but:
>Is it possible to write a program so coded that it
>will specifically run only with a 68000 chip, and not t
>on any of the later generation chips?

The instruction sets for the MC68XXX series are pretty much entirely
forward compatible, but you can always tell which chip you're using
by checking the Status Registers or, if you're running under the Mac OS,
by making a quick call to SysEnvirons (Pre-System 7) or Gestalt. 
Once you've checked which chips are there, just exit to shell if you've
returned a result you don't want.

Any chance you're doing this to support an emulator? 
--
______________________________________________________________________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

es1@cunixb.cc.columbia.edu (Ethan Solomita) (05/19/91)

In article <1991May18.190505.21579@ux1.cso.uiuc.edu> sjhg9320@uxa.cso.uiuc.edu (Maximum Slackness ) writes:
>rs54@cunixf.cc.columbia.edu (Richard Sucgang) writes:
>
>>I am unsure about this but:
>>Is it possible to write a program so coded that it
>>will specifically run only with a 68000 chip, and not t
>>on any of the later generation chips?
>
>The instruction sets for the MC68XXX series are pretty much entirely
>forward compatible, but you can always tell which chip you're using
>by checking the Status Registers or, if you're running under the Mac OS,
>by making a quick call to SysEnvirons (Pre-System 7) or Gestalt. 
>Once you've checked which chips are there, just exit to shell if you've
>returned a result you don't want.
>
>Any chance you're doing this to support an emulator? 
>--
>______________________________________________________________________________
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	I can't quite fathom WHY he would want to do this, but
all the emulators I know of support 030s just fine.
	-- Ethan

The constitution isn't perfect, but
it's better than what we have now.

blm@6sceng.UUCP (Brian Matthews) (05/20/91)

In article <1991May18.180250.20204@cunixf.cc.columbia.edu> rs54@cunixf.cc.columbia.edu (Richard Sucgang) writes:
|I am unsure about this but:
|Is it possible to write a program so coded that it
|will specifically run only with a 68000 chip, and not t
|on any of the later generation chips?

	data
values:	byte	0, 1
	text
	moveq	&1, %d0
	lea	values - 1, %a0
	long	0x10300200		; mov.b 0(%a0,%d0.w*2),%d0

At this point, d0 contains 1 on a 68020 or higher, and 0 on a 68010
or lower.  I'll leave it up to the reader to figure out why this works
(look at how the scale factor is encoded on 020s).

If you're doing this on a Mac, you can use SysEnvirons to find out
what kind of processor you're running on.
-- 
Brian L. Matthews	blm@6sceng.UUCP

rs54@cunixf.cc.columbia.edu (Richard Sucgang) (05/20/91)

To those of you who wonder about the question on the 68000 specific
instructions...it isn't because *I* want to write the program...I 
someone explained to me that an old game of his won't run on the newer
machines, giving a message that it requires the old 68000 chip.

Sort of didn't make sense...I suspected the ROMs or System...

-rich
Richard Sucgang : Dept. of Anatomy and Cell Biology
Columbia University (sucgang@cuhhca.hhmi.columbia.edu; 
de slime god         rs54@cunixf.cc.columbia.edu)

sjhg9320@uxa.cso.uiuc.edu (Idiot Savant ) (05/20/91)

rs54@cunixf.cc.columbia.edu (Richard Sucgang) writes:

>To those of you who wonder about the question on the 68000 specific
>instructions...it isn't because *I* want to write the program...I 
>someone explained to me that an old game of his won't run on the newer
>machines, giving a message that it requires the old 68000 chip.

>Sort of didn't make sense...I suspected the ROMs or System...

Usually its the Sound Manager Stuff or an absolute requirement for
specific memory addresses being free that seems to hang up all the games
I loved on the SE and had to dump when I upgraded to a IIci.
(Reach for the Stars, The Ancient Art of War, Dark Castle...)
--
______________________________________________________________________________
Internet: scott@scotty.life.uiuc.edu                         AppleLink: ISware 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~