flat assembler
Message board for the users of flat assembler.

Index > DOS > CPU Typ auslesen mit Assembler

Author
Thread Post new topic Reply to topic
bmmueller



Joined: 06 Mar 2025
Posts: 12
bmmueller 17 Mar 2025, 18:57
Hallo Ich möchte unter MS-DOS den CPU Type mit assembler oder C++ 3.1 auslesen. Der ANsatz war mit INT 15h AH=C0h aber scheint irgend wie nicht zu funkjtionieren. Gibt es da noch andere Möglichkeiten oder INT's ?
Post 17 Mar 2025, 18:57
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1708
Location: Toronto, Canada
AsmGuru62 17 Mar 2025, 20:40
Post 17 Mar 2025, 20:40
View user's profile Send private message Send e-mail Reply with quote
bmmueller



Joined: 06 Mar 2025
Posts: 12
bmmueller 19 Mar 2025, 07:52
Es muss unter real Modus und DOS 16 Bit funktionieren, da es alte Laptops sind mit MS-DOS 5.0 bis Novell Dos 7.
Post 19 Mar 2025, 07:52
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1708
Location: Toronto, Canada
AsmGuru62 19 Mar 2025, 11:53
Code:
;
; MS-DOS COM executable file
;
org 100h
;
; Check the CPU type
;
cpuid
;
; In 16-bit debugger look into registers filled by CPUID
;
    

I was not able to try this in debugger, because my computer cannot run 16-bit code.
I have old Turbo Debugger 3.1 in my archives from Windows 95 days, but it does not run.
Post 19 Mar 2025, 11:53
View user's profile Send private message Send e-mail Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 47
Location: Socket on motherboard
Core i7 19 Mar 2025, 12:32
bmmueller wrote:
Es muss unter real Modus und DOS 16 Bit funktionieren

Since 1985 all processors are 32-bit (i80386).
Where can you find a 16-bit processor now?

Check this code, it may work on all your systems:

Code:
org 100h
jmp start

cpuName  db    64 dup('$')

start:  mov    di,cpuName
        mov    cx,3
        mov    eax,0x80000002

@@:     push   ax cx 
        cpuid 
        stosd 
        xchg   eax,ebx 
        stosd
        xchg   eax,ecx 
        stosd
        xchg   eax,edx 
        stosd
        pop    cx ax 
        inc    ax 
        loop   @b 

        mov    ah,9 
        mov    dx,cpuName 
        int    21h 

        xor    ax,ax 
        int    16h 
        ret        
Post 19 Mar 2025, 12:32
View user's profile Send private message Reply with quote
Mat-Quasar



Joined: 02 Mar 2025
Posts: 82
Mat-Quasar 19 Mar 2025, 12:49
But CPUID is not available on some 32-bit processors.

Please see my attached screenshot of Intel SDM on how to detect early CPUs.


Description: Different technique other than CPUID in older processors
Filesize: 169.8 KB
Viewed: 579 Time(s)

cpuid_ia32.png


Description:
Filesize: 17.14 KB
Viewed: 579 Time(s)

na_cpuid.png


Post 19 Mar 2025, 12:49
View user's profile Send private message Reply with quote
bmmueller



Joined: 06 Mar 2025
Posts: 12
bmmueller 19 Mar 2025, 17:24
Ok
Danke schon mal
Also CPUID scheint nicht unterstützt zu werden bei meinen Maschinen, aber ich werde mal mit den Flags herumprobieren.
Post 19 Mar 2025, 17:24
View user's profile Send private message Reply with quote
bmmueller



Joined: 06 Mar 2025
Posts: 12
bmmueller 22 Apr 2025, 08:23
Danke an Alle ,hab alles im Griff
Post 22 Apr 2025, 08:23
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.