Page 1 of 1

I need an NASM compatable cpuID prog ;D

Posted: Wed Nov 12, 2003 9:41 am
by KieranFoot
Please could someone supply me with a peice of code that identifies the cpu type and displayes a message accordingley???

I have one allready but its written in 32bit asm, and i need 16bit, it was also made for MASM (Boooo)...
>:( MICROSOFT >:( (Boooooo) ;D ;D ;D

Re:I need an NASM compatable cpuID prog ;D

Posted: Wed Nov 12, 2003 10:10 am
by Pype.Clicker
cat /proc/cpuinfo ?

Re:I need an NASM compatable cpuID prog ;D

Posted: Wed Nov 12, 2003 1:23 pm
by Curufir
I have one allready but its written in 32bit asm, and i need 16bit, it was also made for MASM
This is hardly the most challenging conversion in the world.

Re:I need an NASM compatable cpuID prog ;D

Posted: Wed Nov 12, 2003 3:56 pm
by Pype.Clicker
keep in mind that even in real mode, you can use 32 bits registers like eax provided that you're running on a 386+ (oh, but you certainly assume you are as CPUID comes on Pentium processors and a few selected 486 :) )

Re:I need an NASM compatable cpuID prog ;D

Posted: Thu Nov 13, 2003 10:26 am
by Schol-R-LEA
I don't think KieranFoot was necessarily meaning to use the CPUID instruction; I gather he wants a program that determines the processor by checking for support (or lack thereof) of CPU specific features, primarily to check that the CPU is a 386 or later. Such checking code was a lot more common years ago, when a considerable number of 286s were still in use; most OS developers these days don't even consider the possibility of someone trying to use their system on anything older than a Pentium, which given that computer sales more or less doubled with each new processor generation between 1986 and 1999, that isn't so unreasonable.

The Jeff Weeks bootsector example in OSRC includes NASM code for checking that the system is 32-bit ready, but it does not do a full CPU detection. Also, Curufir points out, converting MASM code to assemble under NASM is fairly straightforward.

Re:I need an NASM compatable cpuID prog ;D

Posted: Fri Nov 14, 2003 6:46 am
by KieranFoot
cheers