flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > CPUID

Author
Thread Post new topic Reply to topic
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 09 Jun 2007, 20:01
This app displays ALL CPUID info in HEX and ANSI that can be obtained using cpuid command.
It recursively retrieves CPUID data for processor.
For ditailed info on HEX values in registers refer to manuals (intel, amd etc.).
Anyone can use and modify it for more informative view with mention to my nickname.
Testing on different: very old/modern CPUs is appreciated.
___________
*Added procedure to substitute control symbols (CR/LF) that passed as strings to wsprintf with spaces.
*Updated again with right procedure of parsing ctrl symbols - CPUID instr returns only ASCII (ANSI?) strings and NO unicode.
*Replaced "modern" instructions: CMOVcc, MOVZX with their old equivalents for compatibility.
*Now more informative.
*both ANSI & UNICODE versions attached.
*updated messages when cpuid instruction is n/a.
*several additions according to cpuid specification updates.


Description: UNICODE version for up-to-date OSes.
Download
Filename: CPUID mem.zip
Filesize: 2.75 KB
Downloaded: 1285 Time(s)

Description: ANSI version of CPUID.exe for OSes that have poor UNICODE support (e.g. Win98).
Download
Filename: CPUID mem ANSI.zip
Filesize: 2.69 KB
Downloaded: 1156 Time(s)


_________________
Any offers?


Last edited by asmfan on 23 Sep 2009, 15:03; edited 16 times in total
Post 09 Jun 2007, 20:01
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 17 Jul 2007, 20:07
If this would run in DOS, I could test my old P1 (no MMX, no Windows, only DOS, heh). However, it's a Win32 GUI proggie, and apparently 11 others have downloaded it. I can only assume their silence means it works okay. Wink
Post 17 Jul 2007, 20:07
View user's profile Send private message Visit poster's website Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 19 Jul 2007, 17:15
New version and changes in 1st message.
______________________________________
10x rugxulo for cheering me up )
Yes, it is win32 exe, but it only uses 3 API funcs - ExitProcess, MessageBox and wsprintf. just replace then with dos ints and appropriate handlers (i mean processing strings - strcat etc.) and you'll get the equivalent cuz cpuid instruction works with whole 32bit (64 in Win64) register even in 16bit mode.
Post 19 Jul 2007, 17:15
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 20 Jul 2007, 02:18
Actually, you use CMOVZ in there, so it probably won't work on lower than a PII (or PPro or whatever).
Post 20 Jul 2007, 02:18
View user's profile Send private message Visit poster's website Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 20 Jul 2007, 10:48
i just got it the morning after i wrote the code this night )
just wrote branchless code as optimization says... not so difficult at all to fix it.
Post 20 Jul 2007, 10:48
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 20 Jul 2007, 11:21
rugxulo done. Updated 1st post.
Post 20 Jul 2007, 11:21
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 25 Jul 2007, 15:50
Works ok, but what does "No"-button do Very Happy I think OK and Cancel should be the buttons or only one button - OK - and then "X" in the corner to close it...

Smile just a note.
Post 25 Jul 2007, 15:50
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 25 Jul 2007, 16:47
Madis731 wrote:
Works ok

Thanks! OK here means step ahead on cpuid detection and CANCEL step to extended features flag or out if we are already in there.
[added]
New version here.

_________________
Any offers?
Post 25 Jul 2007, 16:47
View user's profile Send private message Reply with quote
ATV



Joined: 31 Aug 2004
Posts: 109
Location: Finland
ATV 27 Jul 2007, 07:05
asmfan, I tested it with Win98 with P166. It only show empty window with 2 buttons (yes/no). No window caption or any text inside window.
I replace 'win32wxp.inc' with 'win32a.inc' and then it works ok.
Post 27 Jul 2007, 07:05
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 27 Jul 2007, 08:19
ATV
thanks for testing. Attached ANSI version for legasy OSes.
/just changed the header )) to *axp.inc - thanks to macroses TCHAR/
Post 27 Jul 2007, 08:19
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 27 Jul 2007, 21:30
asmfan wrote:

> Also could somebody with p3 and less test it?

YES (see shots). Smile

> Updated again with right procedure of parsing ctrl symbols - CPUID instr returns only ASCII (ANSI?) strings and NO unicode.

GOOD. Smile

> Replaced "modern" instructions: CMOVcc, MOVZX with their old equivalents for compatibility.

GOOD. Smile Fully 80386 compatible now ?

> both ANSI & UNICODE versions attached

Seems you just fixed bug I was about to report. Laughing

Any benefit of UNICODE here at all ? Confused

Any way to provide just 1 version ? Idea

Issues:

- If CPUID inavailable, report " CPUID instruction NOT available, CPU is 80386 or 80486-old ", rather than silent exit.

- CANCEL button and "extended" CPUID - odd design ?


Description:
Filesize: 4.18 KB
Viewed: 31287 Time(s)

CPUID.PNG



_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 27 Jul 2007, 21:30
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 27 Jul 2007, 21:31
rugxulo wrote:

> If this would run in DOS

It does (see shots) Shocked
Post 27 Jul 2007, 21:31
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 28 Jul 2007, 08:10
NTOSKRNL_VXE wrote:

Fully 80386 compatible now ?

Not sure - cannot find such an ancient CPU )
NTOSKRNL_VXE wrote:

Any benefit of UNICODE here at all ? Confused
Any way to provide just 1 version ? Idea

Since UNICODE support is native to modern Win OS - i support it. No benefit at all - only double memory consumption.
Oh, found one bft - native languages of nonenglish speaking people )
(just joking)
NTOSKRNL_VXE wrote:

- If CPUID inavailable, report...rather than silent exit.

Done - but alas cannot really test (not using Olly) )) the same reason.
NTOSKRNL_VXE wrote:

- CANCEL button and "extended" CPUID - odd design ?

Nope, "cancel" it's just shortcut to ext feat, since just pushing "ok" can be boring ) (e.g. i have to push "ok" 13 decimal times before i get ext. features, and only 1 "cancel").
/another reason - don't want to mess with nicer GUI developement Wink /

_________________
Any offers?
Post 28 Jul 2007, 08:10
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 28 Jul 2007, 08:16
NTOSKRNL_VXE wrote:

> If this would run in DOS
It does (see shots) Shocked

Post DOS version here if you don't mind. And let people with 386/486 try it )
btw intel manual says that only late 486 cpu support cpuid instruction.
Post 28 Jul 2007, 08:16
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 28 Jul 2007, 23:40
Theres a cpuid program for DexOS, done 2-3 years a go


Description:
Filesize: 22.39 KB
Viewed: 31247 Time(s)

cpuid.png


Post 28 Jul 2007, 23:40
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 29 Jul 2007, 10:48
> Theres a cpuid program for DexOS

YES. The CPUID program is very good ... the top 28 lines of the shot a bit less Neutral

> > Fully 80386 compatible now ?

> Not sure - cannot find such an ancient CPU

Checked with BIEW - seems to be, except the CPUID instruction ...

> Post DOS version here if you don't mind.

I have none ... ran yours on HX Shocked

But here there is a DOS CPUID: http://rayer.ic.cz/programm/programe.htm

asmfan wrote:

> intel manual says that only late 486 cpu support cpuid instruction.

I wrote:

> CPUID instruction NOT available, CPU is 80386 or 80486-old Wink
Post 29 Jul 2007, 10:48
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 31 Jul 2007, 03:04
I mentioned somewhere on these forums that DOSBox 0.70 supported CPUID (emulates a 486 DX2) yet I found out (through Rayer's program) that it doesn't let the ID flag be set, so it doesn't correctly let you know that it supports it (even though it does). I should probably report that to them.

As far as testing on old computers, I've got a P166 (no MMX), which does support CPUID, and a 486 Sx/25, which doesn't. I'll go test and report what happens. (But DOSBox 0.70 + HXRT.ZIP + HXGUI.ZIP + "CPUID ANSI.RAR", at least, correctly whines and lets you exit.)


Description: DOSBox 0.70
Filesize: 2.31 KB
Viewed: 31204 Time(s)

asmfan-CPUID_ANSI-DOSBox-0.70.png




Last edited by rugxulo on 31 Jul 2007, 04:19; edited 1 time in total
Post 31 Jul 2007, 03:04
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 31 Jul 2007, 04:18
my 486 Sx/25 wrote:

Code:
D:\ME\AF-CPUID.EXE

af-cpuid exe       2,048              Jul,28,2007   12:56:50pm   A...
    

[ MS-DOS ] Sun 07-01-2007>dpmild32 af-cpuid.exe

DPMI loader version 3.3.0
Copyright (C) 1993-2007 Japheth

video mode 800x600x16 with LFB not supported

[ MS-DOS ] Sun 07-01-2007>whatvesa
VESA 1.2 Copyright 1988-1991 TRIDENT MICROSYSTEMS INC.


In other words, HXGUI doesn't work without VESA 2.0. (And my attempts to install UNIVBE 6.7 on the 486 didn't work, probably because of no FPU.)

However, the P166 (no MMX) worked okay (although I did have to use UNIVBE there, normally is only VESA 1.2 ATI Mach64).

dpmild32 af-cpuid.exe (had to rename it b/c spaces in filenames are weird)

BTW, Ctrl+Break didn't work for me in HXGUI, had to use APPS button (aka, right-click menu button?) on Win95 keyboard to bring up menu to allow screenshots (because Snarf didn't work). Oh, and HXGUIHLP.INI needed "save=0" to not mess up the palette upon exit (weird).


Description: P166_A.PNG (looks odd, heh, oh well)
Filesize: 28.68 KB
Viewed: 31194 Time(s)

p166_a.PNG


Description: P166_B.PNG
Filesize: 28.41 KB
Viewed: 31194 Time(s)

p166_b.PNG


Post 31 Jul 2007, 04:18
View user's profile Send private message Visit poster's website Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 22 Dec 2008, 12:08
*added new features detection support for modern processors

Testing on Core 2 8000 & 9000 series & i7 for input eax=0Bh and eax=0Dh parameters appreciated.
Post 22 Dec 2008, 12:08
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 23 Sep 2009, 08:46
several additions according to cpuid specification updates apllied to prev. post (iterative 0xD leaf).
Post 23 Sep 2009, 08:46
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.