Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!cbmvax!daveh
From: daveh@cbmvax.UUCP (Dave Haynie)
Newsgroups: comp.sys.amiga
Subject: "WhatCPU" am I using?
Message-ID: <2880@cbmvax.UUCP>
Date: Mon, 30-Nov-87 17:54:23 EST
Article-I.D.: cbmvax.2880
Posted: Mon Nov 30 17:54:23 1987
Date-Received: Wed, 2-Dec-87 01:12:55 EST
Organization: Commodore Technology, West Chester, PA
Lines: 128

Here's a quick one I mentioned in a previous article.  It checks the OS's
CPU flags to see what you're running in your system, and prints that to
the standard output.  I used this in my Startup-Sequence to make sure the
68020 board was really in control during development.

					-Dave Haynie

------------------You'd best be cuttin' here------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	WhatCPU.c
#	WhatCPU.uue
# This archive created: Mon Nov 30 17:44:58 1987
export PATH; PATH=/bin:$PATH
if test -f 'WhatCPU.c'
then
	echo shar: will not over-write existing file "'WhatCPU.c'"
else
cat << \SHAR_EOF > 'WhatCPU.c'
/*
      WhatCPU.c : Prints the CPU information to the standard output.

				-Dave Haynie 
*/

#include 
#include 

/* This is all there is */

main(argc,argv)
int argc;
char *argv[];
{
   struct ExecBase *eb, **peb;

   peb = (struct ExecBase **)(4L);
   eb = *peb;

   printf("System Configuration : ");
   if (eb->AttnFlags & AFF_68020)
      printf("68020 ");
   else if (eb->AttnFlags & AFF_68010)
      printf("68010 ");
   else
      printf("68000 ");
   if (eb->AttnFlags & AFF_68881)
      printf("68881 "); 
   printf("\n");
}
SHAR_EOF
fi # end of overwriting check
if test -f 'WhatCPU.uue'
then
	echo shar: will not over-write existing file "'WhatCPU.uue'"
else
cat << \SHAR_EOF > 'WhatCPU.uue'
begin 644 WhatCPU
M   #\P         '          8   !Q    ;@   "8    .    %     @ 
M   /   #Z0   '$CSP   !PCP    "0CR    "A"N0   " L>0    0CS@  
M  23R4ZN_MHH0$JL *QG  "H80 !;"!L *S1R-'((&@ $-'(T
M# $ (&_T4H(FRF *$AA3@ P! "!O!!3!8/)"&F#<0AI"FR "3-\,!$AY    
M+"\ 3KD    <(\     03KD    L(\     4(\     83KD     <  N>0  
M !Q.=6$  ,9A  "P(\     @0J0   "!.KOZ&(!].=4CG 08N/  #@   $3J[_E$S?
M8(!P9&"P0>P 7$ZN_H!![ !<3J[^C$YU0KD    (0_D   &L(#P    >3J[]
MV"/     "&>V3G4      ^P    :     0   ;H   &J   !I    6H   %>
M   !4    4(   $B   !'    18   #V    Y    -0   #&    P    +0 
M  "F    <@   &P   !4    3@   "     4    #@    @    "     @  
M  (   $T    S     (    &    K@   +H        #\     )E>&ET,@  
M     4     "<&%R;45X:70   ":     G=A:71M&ET       !/     )O<&5N1$]3     :(    "-B0W-3(       "6    
M G-T87)T=7            (U)#0    /P
M     E9E0       "P    "7V5R
M7-"87-E    !     )$3U-.86UE     :P    #
M87)G=D)U9F9E<@      K     )?0  
M "9.N0    !8CR!N__PP* $H"   !&<.2'D    M3KD     6(](>0   #1.
MN0    !8CTY>3G4   /L    !@    ,   "(    >@   %X   !.    ,   
M !0    &    !0   (X   "     9    %0    V    &@        /R   #
MZ@    Y3>7-T96T@0V]N9FEG=7)A=&EO;B Z(  V.# R,"  -C@P,3 @ #8X
M,# P(  V.#@X,2  "@       _(   /I    %$CG #HH;P 4(&\ &")O !Q%
M^@ Z3^__="9/+'D    $3J[]]G#_2AM7R/_\1H!G$B\ 2&\ !$A43KD     
M3^\ #$_O (Q,WUP 3G46P$YU   #[     $    &    .@        /P    
M G-C7W!U=       3     -S='5F9D-H87(       !,     G!S7V5M<'1Y
M    0@    )?7V1O<')N=          "<'-?0    A,[P . !!.KO_03-] #$YU   O#BQY    "$ZN_\HL7TYU+PXL>0  
M  A.KO_$+%].=0   ^P    #     0   #     @    !@        /P    
M E]/=71P=70     +     )?26YP=70      !P    "7U=R:71E        
(         _( 
 
end
SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
Dave Haynie     Commodore-Amiga    Usenet: {ihnp4|uunet|rutgers}!cbmvax!daveh
   "The B2000 Guy"              PLINK : D-DAVE H             BIX   : hazy
		"I can't relax, 'cause I'm a Boinger!"