What does the following C code do? void id(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx) { *eax = info; asm volatile( "mov %%ebx, %%edi;" "cpuid;" "mov %%ebx, %%esi;" "mov %%edi, %%ebx;" :"+a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx) : :"edi"); }
that look like things I see in assembly language
Yeah C often supports inline assembly
esi and edi are used often for memeory to memory transfer
I have 0% knowledge of assembly, so I don't know how that code ended up there :(
from what I can see , you are just moving data around the register
what's the cpuid statement do?
figure out information about processor , I suppose
typical output
almost meaningless to me though :(
everything makes sense now
Join our real-time social learning platform and learn together with your friends!