home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1998 April / Freeware-CD.bin / cputst / amd_cpu / amd!.EXE / EXTIDSTR.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-19  |  1.9 KB  |  69 lines

  1. /*     $Archive: /General Utilities/CPUID/extidstr.cpp $
  2.     $Author : $
  3.     $Date   : $
  4.     $Header : $
  5.     $History: extidstr.cpp $
  6.  * 
  7.  * *****************  Version 5  *****************
  8.  * User: Tanb         Date: 7/18/96    Time: 4:58p
  9.  * Updated in $/General Utilities/CPUID
  10.  * Minor changed in display
  11.  */
  12.  
  13.  
  14. #include "DEFINES.H"
  15. #include <iomanip.h>
  16. #include <iostream.h>
  17. #include <conio.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20.  
  21. //ext_vendor_id_str() finds the largest extented function value
  22. // recognized by AMD processors.
  23.  
  24. void cpuid::ext_vendor_id_str()
  25. {
  26.   unsigned long reg_ebx,    //Register variables
  27.                      reg_ecx,
  28.                      reg_edx,
  29.                      largest_func;  //Largest function variable
  30.  
  31.  
  32.   asm {
  33.           mov    eax,0x80000000      //EAX = 8000_0000h
  34.           db     0x0F,0xA2           //CPUID opcode
  35.   }
  36.   largest_func = _EAX;             //The largest function value
  37.   reg_ebx = _EBX;
  38.   reg_edx = _EDX;
  39.   reg_ecx = _ECX;
  40.  
  41.   clrscr();
  42.   cout.setf(ios::uppercase);
  43.   cout << "\nFunction 8000_0000h (EAX = 80000000)" << endl;
  44.   cout << "====================================";
  45.   cout << "\n\n";
  46.  
  47.   cout << "      EAX == " <<setw(8)<< hex << largest_func<< endl;;
  48.   cout << "      EBX == " << setw(8) << hex << reg_ebx << endl;
  49.   cout << "      EDX == " << setw(8) << hex << reg_edx << endl;
  50.   cout << "      ECX == " << setw(8) << hex << reg_ecx << endl;
  51.   cout << "\n\n";
  52.   cout.unsetf(ios::uppercase);
  53.   cout << "     Largest Extended Function Input Value : " << largest_func;
  54.   if (largest_func == 0 ) {
  55.     cout << "\n\n";
  56.     cout << "     EBX, EDX, ECX : Undefined " << "\n\n";
  57.     cout << "                    Press any key for more." << endl;
  58.     cout <<"\n\n\n\n";
  59.     getch();
  60.   }
  61.   else {
  62.     cout << "\n\n";
  63.     cout << "     EBX, EDX, ECX : Reserved " << "\n\n";
  64.     cout << "                    Press any key for more." << endl;
  65.     cout <<"\n\n\n\n";
  66.     getch();
  67.   }
  68. }
  69.