home *** CD-ROM | disk | FTP | other *** search
- /* $Archive: /General Utilities/CPUID/chkcpuid.cpp $
- $Author : $
- $Date : $
- $Header : $
- $History: chkcpuid.cpp $
- *
- * ***************** Version 2 *****************
- * User: Tanb Date: 7/18/96 Time: 4:47p
- * Updated in $/General Utilities/CPUID
- * Make the display look better.
- */
-
-
- #include "DEFINES.H"
- #include <iomanip.h>
- #include <iostream.h>
- #include <conio.h>
- #include <stdlib.h>
- #include <string.h>
-
- //chkdpuid identifies the processor name string.
-
- int cpuid::chkcpuid()
- {
- char idstr[13]; //vendor string variable
-
-
- asm {
- mov eax,0x0 //EAX = 0
- db 0x0F,0xA2 //CPUID opcode
- }
- //store the 12 character ASCII string
- idstr[0] = _BL;
- idstr[1] = _BH;
- asm {
- ror ebx,0x10
- }
- idstr[2] = _BL;
- idstr[3] = _BH;
- idstr[4] = _DL;
- idstr[5] = _DH;
- asm {
- ror edx,0x10
- }
- idstr[6] = _DL;
- idstr[7] = _DH;
- idstr[8] = _CL;
- idstr[9] = _CH;
- asm {
- ror ecx,0x10
- }
- idstr[10] = _CL;
- idstr[11] = _CH;
- idstr[12] = '\0';
-
- if ( strcmp(idstr, "AuthenticAMD") != 0 )
- return (0);
- else
- return (1);
- }
-