Thanks for everyone's help! I finally got it to work after alot of reading. Here is a very inefficient but working version:
Code:
#include <iostream>
#include <stdio.h>
int main()
{
char* ptr1 = new char[4];
char* ptr2 = new char[4];
char* ptr3 = new char[4];
asm("movl %0, %%esi; movl $0, %%eax; CPUID; movl %%ebx, (%%esi);"
:
:"m"(ptr1)
:"memory","%eax","%ebx","%esi");
asm("movl %0, %%esi; movl $0, %%eax; CPUID; movl %%edx, (%%esi);"
:
:"m"(ptr2)
:"memory","%eax","%edx","%esi");
asm("movl %0, %%esi; movl $0, %%eax; CPUID; movl %%ecx, (%%esi);"
:
:"m"(ptr3)
:"memory","%eax","%ecx","%esi");
for(int i = 0; i < 4; i++)
{
printf("%c",ptr1[i]);
}
for(int i = 0; i < 4; i++)
{
printf("%c",ptr2[i]);
}
for(int i = 0; i < 4; i++)
{
printf("%c",ptr3[i]);
}
delete ptr1;
delete ptr2;
delete ptr3;
return 1;
}
This will print the 12 character name of the processor to the screen using AT&T syntax as used in the Code:Blocks compiler which I believe is of type GCC