Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!seismo!gatech!akgua!akguc!mtunh!mtung!ijk From: ijk@mtung.UUCP (Ihor Kinal) Newsgroups: net.micro.pc Subject: Re: Re: Identifying an iAPX series processo Message-ID: <685@mtung.UUCP> Date: Wed, 26-Mar-86 08:21:41 EST Article-I.D.: mtung.685 Posted: Wed Mar 26 08:21:41 1986 Date-Received: Mon, 21-Apr-86 01:16:11 EST References: <7901@watrose.UUCP> <53500027@trsvax> Organization: AT&T ISL Holmdel NJ USA Lines: 34 > > > Question: is it possible to identify in software the type of processor > > a program is running on (assuming MS-DOS here...)? I would like to > > know whether it's an 8088, 8086, 80188, 80186 or an 80286. If it > > is possible, how do I do it? > > Yes, it is possible, at least to distinguish between {8086|8088}, > {80186|80188}, and 80286 flavors of processors. The 8086 (and the 8088, > I guess) don't mask shift counts, so if you shift a 2 in AX by a number > of places greater than 16 (?or 32, maybe -- 32 works for sure) you'll > get a zero. On the 186 and 286 you'll get a non-zero value. To > distinguish between the 186 and the 286, do a PUSH SP, pop it into > another register and compare it. The 186 pushes the SP value *after* > it's been decremented, the 286 pushes the SP value *before* it's > decremented. > > I don't know if you can tell if you're on a *8 or *6 version processor, > though. > > Good luck! > Kevin Dack > ..ctvax!trsvax!kevin The latest issue of the PC TECH Journal (April 86) discusses these issues (including differentiating from the NEC 20/30, and includes a test program. Their way off differentiating an 8/6 is to make use of the fact that they have different length instruction buffers. Ihor Kinal ihnp4!mtung!ijk P.S. One discrepancy: the article claims that in a 286, it's no longer legal to say MOV CS, AX; nor can one say POP CS. Using DEBUG, I tried both; the MOV CS,AX seemed ok, the POP CS totally hung the machine. If both were true, then how could a program reset the CS register????