LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   cpuid (https://www.linuxquestions.org/questions/programming-9/cpuid-543611/)

strycnine 04-05-2007 01:21 PM

cpuid
 
Code:

.section .data
output:
        .ascii "The procesor Type is 'xxxxxxxxxxxx' \n"
.section .text
.globl _start
_start:
        nop
        movl $1, %eax
        cpuid
        movl $output, %edi
        movl %ebx, 27(%edi)
        movl %edx, 31(%edi)
        movl %ecx, 35(%edi)
        movl $4, %eax
        movl $1, %ebx
        movl $output, %ecx
        movl $42, %edx
        int $0x80
        movl $1, %eax
        movl $0, %ebx
        int $0x80

I took this program form a book, and it must print me 'Procesor Type, family, model, and stepping information'.
but when I run it :
$./cpuid
$The procesor Type ÿûƒxxxx'
where is the problem?
thx

nilleso 04-05-2007 03:24 PM

I don't know what kind of program that is but you've asked it to actually print 'xxxxxxxxxxxx'... perhaps the 'xxxxxxxxxxxx' was supposed to be something else.

btw, this command will likely give you what you're looking for:
cat /proc/cpuinfo

but if your just practising programming, keep at it and good luck.
cheers:)

strycnine 04-07-2007 03:14 AM

In the place of the x's must be the stuff I want.
Yout try the program yourself just put 0 in eax.
I tooked the program from the book Professional assembly language.
Where can I find about the AMD Processor?

nilleso 04-08-2007 05:44 PM

try chipgeek


All times are GMT -5. The time now is 04:15 AM.