Software Archive
Read-only legacy content
17061 Discussions

Processor Identification (Pre-CPUID)

terax
Beginner
442 Views
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?
0 Kudos
1 Reply
Frank_W_Intel
Employee
442 Views

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.
0 Kudos
Reply