home *** CD-ROM | disk | FTP | other *** search
- /* $Archive: /General Utilities/CPUID/cpuid.cpp $
- $Author : $
- $Date : $
- $Header : $
- $History: cpuid.cpp $
- *
- * ***************** Version 6 *****************
- * User: Tanb Date: 7/18/96 Time: 4:53p
- * Updated in $/General Utilities/CPUID
- * Make the display look better
- */
-
-
- #pragma inline
- #include <fstream.h>
- #include <iomanip.h>
- #include <iostream.h>
- #include <stdlib.h>
- #include <string.h>
- #include <conio.h>
- #include <dos.h>
- #include "DEFINES.H"
-
- cpuid k86; //object of cpuid class
-
- int main(void)
- {
- int maxnum; //variable of the case statement
- int result = 0; //variable of the result
- int func = 3; //variable of the control loop
-
- result = k86.chkcpubit(); //check ID bit in EFLAGS
- if(result == -1) {
- clrscr();
- cout << "\n\n";
- cout << " CPUID instruction is not supported by this processor.";
- cout << "\n\n";
- exit(1);
- }
- else {
- result = k86.chkcpuid(); //check vendor id string
- if(result == 1) {
- clrscr();
- cout << "\n\n";
- cout << "AMD-k86 CPU supporting CPUID is in place.";
- cout << "\n\n";
- }
- else {
- clrscr();
- cout << "\n\n";
- cout << "CPU supporting CPUID is in place.";
- cout << "\n\n";
- }
- }
- //These are the standard functions
- k86.std_vendor_id_str();
- k86.std_cpu_signature();
-
- //These are the extended functions
- for (maxnum=0; maxnum<=func; maxnum++) {
- switch (maxnum) {
- case 0 : k86.ext_vendor_id_str(); //Vendor Identification String
- break;
- case 1 : k86.ext_cpu_signature(); //Processor Signature
- break;
- case 2 : k86.ext_cpu_name_str(); //Processor Name String
- break;
- case 3 : k86.ext_cpu_cache_info(); //Processor Cache Information
- break;
- }
- }
- return 0;
- }
-