How I can read this instruction directly:
unsigned int eax, ebx, ecx, edx;
unsigned int leaf, subleaf;
unsigned int intbuf[12];`
char *buffer;
int i,j,k,base,start,stop,length;
float freq_GHz;
float frequency;
subleaf=0;
base = 0;
for (leaf=0x80000002; leaf<0x80000005; leaf++) {
__asm__ __volatile__ ("cpuid" : \
"=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (leaf), "c" (subleaf));
intbuf[base] = eax;
intbuf[base+1] = ebx;
intbuf[base+2] = ecx;
intbuf[base+3] = edx;
base += 4;
}
I've been trying to read it like this but its not working:
for (leaf = 0x80000002; leaf < 0x80000005; leaf++) {
int regs[4];
__cpuid(regs, leaf);
intbuf[base] = (*regs),eax;
intbuf[base + 1] = (*regs),ebx;
intbuf[base + 2] = (*regs),ecx;
intbuf[base + 3] = (*regs),edx;
base += 4;