The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: ecube on April 25, 2007, 12:47:04 AM

Title: how can I use CPUID
Post by: ecube on April 25, 2007, 12:47:04 AM
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.
Title: Re: how can I use CPUID
Post by: PBrennick on April 25, 2007, 01:31:03 AM
E^cube,

db 0Fh, A2h

or

dd 0FA2h

Paul
Title: Re: how can I use CPUID
Post by: ecube on April 25, 2007, 01:36:01 AM
Ahh great, thanks a lot PBrennick!  :thumbu
Title: Re: how can I use CPUID
Post by: sinsi on April 25, 2007, 02:34:57 AM
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"
Title: Re: how can I use CPUID
Post by: Ratch on April 25, 2007, 06:02:05 AM
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

Title: Re: how can I use CPUID
Post by: Tedd on April 25, 2007, 11:00:30 AM
works fine here..

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

Title: Re: how can I use CPUID
Post by: sinsi on April 26, 2007, 04:43:52 AM
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