Path: utzoo!attcan!uunet!snorkelwacker!spdcc!esegue!johnl From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.os.msdos.programmer Subject: Re: Detecting an 80486 Message-ID: <1990Aug14.025550.17669@esegue.segue.boston.ma.us> Date: 14 Aug 90 02:55:50 GMT References: <26a858b9@ralf> <3817@altos86.Altos.COM> Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine) Organization: Segue Software, Cambridge MA Lines: 22 In article <3817@altos86.Altos.COM> rcollins@altos86.UUCP (Robert Collins) writes: >In some article, it was written: >+} In my Infoplus program, the 286/386/486 are detected by trapping the >+}invalid opcode interrupt, and then trying instructions. >[but there are lots of places where this doesn't work very well, either >because someone else gets the trap, or because some putatively unused opcodes >do secret things.] The Intel 486 Programmer's manual has sample code to tell the difference among the 8086, 286, 386, and 486 without any trapping at all. There are lots of differences other than new instructions. For example, on a PUSH SP, the 8086 pushes the decremented SP but newer processors push the original value. When you push the flags register with PUSHF, the 8086 always sets bits 12-15 to one, the 286 always sets them to zero, and the 386 and 486 store some actual flags there. The 486 uses flag bit 18, which the 386 didn't. Intel provides sample code that is straightforward and doesn't depend on catching traps. Looks good to me. -- John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 864 9650 johnl@esegue.segue.boston.ma.us, {ima|spdcc|world}!esegue!johnl Marlon Brando and Doris Day were born on the same day.