Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site moncol.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!hjuxa!petsd!moncol!john From: john@moncol.UUCP (John Ruschmeyer) Newsgroups: net.micro.pc Subject: Re: Identifying an iAPX series processo Message-ID: <193@moncol.UUCP> Date: Sun, 23-Mar-86 00:40:55 EST Article-I.D.: moncol.193 Posted: Sun Mar 23 00:40:55 1986 Date-Received: Tue, 25-Mar-86 03:47:41 EST References: <7901@watrose.UUCP> <53500027@trsvax> Reply-To: john@moncol.UUCP (John Ruschmeyer) Organization: Monmouth College, W. Long Branch, NJ Lines: 36 In article <53500027@trsvax> kevin@trsvax writes: > >> 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. Yes, but it requires writing self-modifying code. The trick is that the *6 and *8 processors have different pre-fetch queue sizes. For a difinitive answer on the subject- RUN, DO NOT WALK to the nearest newstand and pick up the April PC Tech Journal. There is a big article (including asm source) about doing exactly what you want. -- Name: John Ruschmeyer US Mail: Monmouth College, W. Long Branch, NJ 07764 Phone: (201) 571-3451 UUCP: ...!vax135!petsd!moncol!john ...!princeton!moncol!john ...!pesnta!moncol!john "I killed him... and he thanked me. Why did he have to be so nice about it?"