Skip to content

Instantly share code, notes, and snippets.

@quantumelixir
Created January 15, 2011 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantumelixir/780931 to your computer and use it in GitHub Desktop.
Save quantumelixir/780931 to your computer and use it in GitHub Desktop.
CPUID in GNU Assembly
.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