Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ulowell!apollo!oj From: oj@apollo.COM (Ellis Oliver Jones) Newsgroups: comp.sys.apollo Subject: Re: Please include architecture define in cpp Summary: _ISP__M68K Message-ID: <3f6a319b.d5b2@apollo.COM> Date: 2 Nov 88 00:36:00 GMT References: <17414@shemp.CS.UCLA.EDU> Reply-To: oj@canyon.UUCP (Ellis Oliver Jones) Organization: Apollo Computer, Chelmsford, MA Lines: 43 In article <17414@shemp.CS.UCLA.EDU> casey@COGNET.UCLA.EDU (Casey Leedom) writes: >I need to put some byte order ifdef's in my code based on CPU >architecture type. >The Apollo SR10 cpp doesn't define the architecture >type being compiled on. Yes it does! There are two symbols: _ISP__M68K (underscore I S P underscore underscore M 6 8 K ) _ISP__A88K (underscore I S P underscore underscore A 8 8 K ) In an Apollo SR10 C compiler, both are defined, and one has a nonzero value. _ISP__M68K means Motorola 68K cpus. _ISP__A88K means Apollo PRISM cpus (DN10000) For compatibility with SR9.7, I use cpp stuff like the following: #ifdef _ISP__A88K /* do whatever for SR10 (regardless of CPU type) */ #if _ISP__A88K /* do whatever for PRISM CPUS */ #endif #if _ISP__M68K /* do whatever for Motorola 68K CPUS */ #endif #else /* do whatever for pre-SR10 */ #endif The following symbols are also defined: #define apollo 1 #define aegis 1 #define unix 1 #define m68000 1 #define timezone _bky_timezone The PRISM is in fact big-endian, and data-compatible with the Motorola cpus. To stop idle speculation about the meaning of A88K, the "A" means Apollo, the "88" refers to the year of the first release of a cpu of the type, and I have no idea what the "K" means. /Ollie Jones (speaking for myself, not necessarily for Apollo Computer, Inc.)