dear
I need cpu model like 8088, 8086, 80286,...Pentium of the running system through the c/c++ program in dos platform
thanks a lot
anil
Need cpu model/type
RE:Need cpu model/type
//input:
MOV AH, 0xC9
MOV AL, 0x10
INT 15 ( or 0x15, don't know)
//output:
CF clear if success
CH:
03h 80386DX or clone
04h 80486
05h Pentium
23h 80386SX or clone
33h Intel i376
43h 80386SL or clone
A3h IBM 386SLC
A4h IBM 486SLC
found it on Ralf Brown's, hope it works and helps.
Cheers,
Adrian
MOV AH, 0xC9
MOV AL, 0x10
INT 15 ( or 0x15, don't know)
//output:
CF clear if success
CH:
03h 80386DX or clone
04h 80486
05h Pentium
23h 80386SX or clone
33h Intel i376
43h 80386SL or clone
A3h IBM 386SLC
A4h IBM 486SLC
found it on Ralf Brown's, hope it works and helps.
Cheers,
Adrian
RE:Need cpu model/type
it rarely works;
if output AH = 0x80, 0x86 then function unsupported.
well, you'd have to be quite good at assembler to use this solution: download cputyp13.zip http://www.simtel.iif.hu/pub/pd/50095.html and extract the function from the source.
Cheers,
Adrian
if output AH = 0x80, 0x86 then function unsupported.
well, you'd have to be quite good at assembler to use this solution: download cputyp13.zip http://www.simtel.iif.hu/pub/pd/50095.html and extract the function from the source.
Cheers,
Adrian
RE:Need cpu model/type
I have tried the asm code in my c program as follows
#include<dos.h>
#include<stdio.h>
#include<conio.h>
void main()
{
union REGS ourregs;
ourregs.h.ah=0xC9;
ourregs.h.al=0x10;
int86(0x15,&ourregs,&ourregs); //calling function with int 15h
if(!ourregs.x.cflag) // checking for cf clear or not
printf("%x",ourregs.h.ch);
else
printf("error");
getch();
}
but it won't work showing the error and i have also tried the content of ah and it is showing answer as 86h. and gone to the url as mr. Adek336 had specified. got the asm file but am not deep in the ASM. the exe provided in the zip file is showing the answer but it is the exe of asm and a need to write the code with in the c program
anil
#include<dos.h>
#include<stdio.h>
#include<conio.h>
void main()
{
union REGS ourregs;
ourregs.h.ah=0xC9;
ourregs.h.al=0x10;
int86(0x15,&ourregs,&ourregs); //calling function with int 15h
if(!ourregs.x.cflag) // checking for cf clear or not
printf("%x",ourregs.h.ch);
else
printf("error");
getch();
}
but it won't work showing the error and i have also tried the content of ah and it is showing answer as 86h. and gone to the url as mr. Adek336 had specified. got the asm file but am not deep in the ASM. the exe provided in the zip file is showing the answer but it is the exe of asm and a need to write the code with in the c program
anil
RE:Need cpu model/type
yea, it seems like bios functions are useless in cpu detection.
If you want to test if it is a 386 you may use this:
byte check386()
byte x;
{
x = 1;
$ PUSHF
$ XOR AH, AH
$ PUSH AX
$ POPF
$ PUSHF
$ POP AX
if (AH & 0xf0 == 0xf0) x = 0;
$ MOV AH, 0x70
$ PUSH AX
$ POPF
$ PUSHF
$ POP AX
if (AH & 0x70 <> 0x70) x = 0;
$ POPF
AL = x;
}
Cheers,
Adrian
If you want to test if it is a 386 you may use this:
byte check386()
byte x;
{
x = 1;
$ PUSHF
$ XOR AH, AH
$ PUSH AX
$ POPF
$ PUSHF
$ POP AX
if (AH & 0xf0 == 0xf0) x = 0;
$ MOV AH, 0x70
$ PUSH AX
$ POPF
$ PUSHF
$ POP AX
if (AH & 0x70 <> 0x70) x = 0;
$ POPF
AL = x;
}
Cheers,
Adrian
RE:Need cpu model/type
Hai Adek336
sorry yar, i didn't understand the code you have written. any way i will try it in my c++ program. the main problem is i am not deep in the asm coding.
with luv,
anil
sorry yar, i didn't understand the code you have written. any way i will try it in my c++ program. the main problem is i am not deep in the asm coding.
with luv,
anil