Processor Identification (Pre-CPUID)

Processor Identification (Pre-CPUID)

I am not sure if this is the right place to ask these questions. Please direct me to a different forum if there is one better suited.

First off, according to Volume 1 of the Intel 64 and IA-32 Architectures Software Developer's Manual, bits 12 through 15 of the FLAGS register are always set if the processor is a 8086/8088. For the 80286 in real-address mode, they are always cleared. What about the 80186? Like the 8086/8088? Like the 286? Somewhere in between?

I have searched the internet, but have failed to find the reference manuals for any of these older processors.

Also, I have seen an algorithm for testing the FLAGS register to determine the identity of the pre-CPUID processors. There seems to be a lot of excessive moving and modifying of values. If the 8086 and 8088always sets those four bits and the 80286 always has them cleared, what is the point of the algorithm toggling them off and on? If they are all set to begin with, is that not enough of an indicator that it is 8086/8088 and not a 286?

I apologize if such is a stupid question. I am new to this. It just seems that all the popping, pushing, modifying, and moving is a little excessive for detecting the 8086/8088. Or am I wrong?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The 80186/88 are most like the 8086/88 with added microcontroller like features.

Since the EFLAGS register is not directly accessable, it must be pushed onto the stack then poped into a general purpose register. Most detection algorithms do try to manipulate bits 15:12 of the EFLAGS to determine if the processor *might* be an 8086/88/186/188. But then algorithms check the stack write / decrement sequence to determine if the processor is truely a 8086 or perhaps a 80286 not in real mode. The stack pointer adjustment for a push & pop changed between the 8086 and 80286 - that is used as a second test to verify the processor is an 8086.

Leave a Comment

Please sign in to add a comment. Not a member? Join today