News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how can I use CPUID

Started by ecube, April 25, 2007, 12:47:04 AM

Previous topic - Next topic

ecube

How can I use cpuid in a normal 32bit exe (meaning no .model tiny)? I tried using it directly with .486,.586.,686 and it won't compile. i tried using db 0FA2h(cpuid in hex and db = emit in this case) but won't compile with that either says initalized magnitude 2 large.

PBrennick

E^cube,

db 0Fh, A2h

or

dd 0FA2h

Paul
The GeneSys Project is available from:
The Repository or My crappy website

ecube

Ahh great, thanks a lot PBrennick!  :thumbu

sinsi

Quote from: PBrennick on April 25, 2007, 01:31:03 AM
dd 0FA2h
Don't you mean " dw 0a20fh" ?
because " dd 0fa2h" becomes " db 0a2h,0fh,0,0"
Light travels faster than sound, that's why some people seem bright until you hear them.

Ratch

E^cube,

     What assembler are you using?  I can get CPUID to assemble with MASM directly with no sweat. My first two lines are:

.686
.model flat,stdcall


sinsi,

     I just love that picture of your dog.  Be careful no one dognaps it.  Ratch


Tedd

works fine here..

.586
.model flat, stdcall
option casemap:none
.code
start:
    cpuid
end start

No snowflake in an avalanche feels responsible.

sinsi

Quote from: Ratch on April 25, 2007, 06:02:05 AM
sinsi,

     I just love that picture of your dog.  Be careful no one dognaps it.  Ratch
Thanks Ratch. That's Sinsi - Purebred dobie, complete with tail. 1986-1998, last 2 years diabetic (2 injections a day). RIP
Light travels faster than sound, that's why some people seem bright until you hear them.