home *** CD-ROM | disk | FTP | other *** search
- /* $Archive: /General Utilities/CPUID/extidstr.cpp $
- $Author : $
- $Date : $
- $Header : $
- $History: extidstr.cpp $
- *
- * ***************** Version 5 *****************
- * User: Tanb Date: 7/18/96 Time: 4:58p
- * Updated in $/General Utilities/CPUID
- * Minor changed in display
- */
-
-
- #include "DEFINES.H"
- #include <iomanip.h>
- #include <iostream.h>
- #include <conio.h>
- #include <stdlib.h>
- #include <string.h>
-
- //ext_vendor_id_str() finds the largest extented function value
- // recognized by AMD processors.
-
- void cpuid::ext_vendor_id_str()
- {
- unsigned long reg_ebx, //Register variables
- reg_ecx,
- reg_edx,
- largest_func; //Largest function variable
-
-
- asm {
- mov eax,0x80000000 //EAX = 8000_0000h
- db 0x0F,0xA2 //CPUID opcode
- }
- largest_func = _EAX; //The largest function value
- reg_ebx = _EBX;
- reg_edx = _EDX;
- reg_ecx = _ECX;
-
- clrscr();
- cout.setf(ios::uppercase);
- cout << "\nFunction 8000_0000h (EAX = 80000000)" << endl;
- cout << "====================================";
- cout << "\n\n";
-
- cout << " EAX == " <<setw(8)<< hex << largest_func<< endl;;
- cout << " EBX == " << setw(8) << hex << reg_ebx << endl;
- cout << " EDX == " << setw(8) << hex << reg_edx << endl;
- cout << " ECX == " << setw(8) << hex << reg_ecx << endl;
- cout << "\n\n";
- cout.unsetf(ios::uppercase);
- cout << " Largest Extended Function Input Value : " << largest_func;
- if (largest_func == 0 ) {
- cout << "\n\n";
- cout << " EBX, EDX, ECX : Undefined " << "\n\n";
- cout << " Press any key for more." << endl;
- cout <<"\n\n\n\n";
- getch();
- }
- else {
- cout << "\n\n";
- cout << " EBX, EDX, ECX : Reserved " << "\n\n";
- cout << " Press any key for more." << endl;
- cout <<"\n\n\n\n";
- getch();
- }
- }
-