Page 1 of 1

Tutorial on CPU detection

Posted: Fri Aug 30, 2002 5:08 pm
by beyondsociety
Does anybody know of any tutorials on how to detect the type of processor for pentium and AMD type processors.

Also does anybody know how to detect the version and maker of the cpu.

Either links or examples in assembly would help.

Thanks in advance!

Re:Tutorial on CPU detection

Posted: Fri Aug 30, 2002 9:54 pm
by Warmaster199
I was just looking at the Intel 486 documentation today :)

You can use the CPUID instruction for 486DX and better processors. do:
mov eax, 0x00000000
cpuid
...and then ebx, edx, and edx(I forget the order) will give you the string "GenuineIntel". With the first reg holding "uneG", the next holding "Ieni" and so on... For AMD processors, the 12-character string is "AuthenticAMD", decoded the same way...

if you do:
mov eax, 0x00000001
cpuid
...then eax is filled with tons of stuff:
bits 0-3 give the CPU's stepping number(revision?)
bits 4-7 give the CPU's Model in it's family...
bits 8-11 give the CPU's family number, 4 = 486, 5 = Pentium/K6, 6 = Pentium II, III, IV, Celery, Athlon, Duron...(use model # to find the exact chip...
bits 12 and 13 are processor type.
bits 14-31 are reserved (On the i486, not sure about other CPUs...)

I hope this was EXACTLY what you were looking for! 8)

Re:Tutorial on CPU detection

Posted: Sat Aug 31, 2002 12:31 pm
by gedeon
You can find here
- more details
- ASM source code
- c source
for cpu detection
ftp://download.intel.com/design/Xeon/applnots/24161821.pdf
very good documentation on CPUID

Re:Tutorial on CPU detection

Posted: Sun Sep 01, 2002 6:39 am
by gedeon
Check this for AMD CPU
It's the same idea.
http://www.amd.com/us-en/assets/content ... /20734.pdf