Skip to content

Margus Roo –

If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time

  • Cloudbreak Autoscale fix
  • Endast

CPUID

Posted on February 18, 2010 - February 18, 2010 by margusja

Lihtne assembleris kirjutatud programm mis kuvab masina CPU tootja.
Programm on kompileeritud hetkel 2.6.27.5-117.fc10.i686 jaoks.
cpuid

Source


#cpuid.s Sample program to extract the processor Vendor ID.section .dataoutput:
.ascii "The processor Vendor ID is 'xxxxxxxxxxxx'\n".section .text.globl _start
_start:movl $0, %eax
cpuid

movl $output, %edi
movl %ebx, 28(%edi)
movl %edx, 32(%edi)
movl %ecx, 36(%edi)

# Display
movl $4, %eax # sys_write
movl $1, %ebx # file descriptor to write. 1 is stdout
movl $output, %ecx # start of the display string
movl $42, %edx # lenght of the display string
int $0x80

# Exit
movl $1, %eax # sys_exit
movl $0, %ebx # exit status
int $0x80

Posted in Assembler

Post navigation

skype-sucks-over-irc
Talv maal

Leave a Reply

You must be logged in to post a comment.

The Master

Categories

  • Apache
  • Apple
  • Assembler
  • Audi
  • BigData
  • BMW
  • C
  • Elektroonika
  • Fun
  • Hadoop
  • help
  • Infotehnoloogia koolis
  • IOT
  • IT
  • IT eetilised
  • Java
  • Langevarjundus
  • Lapsed
  • lastekodu
  • Linux
  • M-401
  • Mac
  • Machine Learning
  • Matemaatika
  • Math
  • MSP430
  • Muusika
  • neo4j
  • openCL
  • Õpetaja identiteet ja tegevusvõimekus
  • oracle
  • PHP
  • PostgreSql
  • ProM
  • R
  • Turvalisus
  • Varia
  • Windows
Proudly powered by WordPress | Theme: micro, developed by DevriX.