c - What does .byte mean in this asm line? -


i revisiting code wrote while ago math on large numbers. when wrote code, lab had few x86s split between 32 , 64 bits. work on ultrasparcs, , vaguely remember pulling line of code intel manual sure code being used on 64-bit cpu.

unsigned long x[4]; x[0] = 0; x[1] = 0; x[2] = 0; x[3] = 0; asm volatile(".byte 15;.byte 162" : "=a"(x[0]),"=b"(x[1]),"=c"(x[3]),"=d"(x[2]) : "0"(0) ); 

if x[0] 0, , program started chugging away.

can explain me line of code does?

the bytes .byte 15 , .byte 162 represent cpuid instruction.
when executes results in eax, ebx, ecx, , edx.

these results stored in array elements:

x[0] <- eax x[1] <- ebx x[2] <- edx x[3] <- ecx 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -