Created
January 15, 2011 14:18
-
-
Save quantumelixir/780931 to your computer and use it in GitHub Desktop.
CPUID in GNU Assembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.section .data | |
output: | |
.ascii "The processor Vendor ID is: " | |
vendor_id: | |
.ascii "xxxxYYYYzzzz\n" | |
.section .bss | |
.section .text | |
.globl _start | |
_start: | |
nop | |
movl $0, %eax | |
cpuid | |
movl $vendor_id, %eax | |
movl %ebx, 0(%eax) | |
movl %edx, 4(%eax) | |
movl %ecx, 8(%eax) | |
movl $4, %eax | |
movl $1, %ebx | |
movl $output, %ecx | |
movl $28, %edx | |
int $0x80 | |
movl $4, %eax | |
movl $1, %ebx | |
movl $vendor_id, %ecx | |
movl $13, %edx | |
int $0x80 | |
movl $1, %eax | |
movl $0, %ebx | |
int $0x80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment