Contents of the CPU.DOC file
CPU Toolkit Library
Written by Lindsay Vagg
Copyright (C) 1993, Lindsay Vagg
Trading as Vaggabond Software.
10/522 Mowbray Rd.
Lane Cove, 2066, NSW, Sydney,
(612) 975-1466 (Voice)
(612) 452-3493 (Fax)
CPU Library is a basic library of C runtime routines that
allow easy anaylasis of the Processor chip in your PC
The CPU Library routines are written mainly in C with some portions
in Assembly language. The routines make use of C library functions
when possible and are compatible with TURBO C, TURBO C++, and
BORLAND C++, although i would like to think that they will also
work with Microsoft C, Microsoft QuickC. However, i'm not a big
enough fan to worry about testing that theory.
CPU Library supports the five major memory models, all of which
are supplied here.
TURBO C is a registered trademark of Borland International Inc.
TURBO C++ is a registered trademark of Borland International Inc.
BORLAND C++ is a registered trademark of Borland International Inc.
Microsoft is a registered trademark, and QuickC is a trademark of
the Microsoft Corporation.
None is required or even expected...or even wanted.
As you can probably tell, i've experienced Public Domain, Shareware
and Free Ware responses before.
The registered version includes:
All five popular memory models.
CPU.H header file.
Sample C source (and EXE file) of the use of the Library.
Sample batch file for compilation.
The Un-registered version includes:
The same as above.
This is a list of all the functions in the CPU librarys. Each
is described in detail on the following pages. (The functions
are listed in alphabetical order by function name.)
char *cpuspeed(unsigned int round,unsigned int cputype);
Function:Test the processor to determine its type.
Remarks:Activates a number of assembler procedures to attempt
to determine the processor type and any details of a
Works with the following CPUs:-
Return:CPU returns a value from 0 to 9.
Table:0 = Undetermined
1 = 8086/8088
2 = 8086/8088 with Coprocessor
3 = 80286
4 = 80286 with Coprocessor
5 = i386tm
6 = i386tm with 387 Coprocessor
7 = i386tm with 87/287 Coprocessor
8 = i486tm (SX)
9 = i486tm (DX) or i487tm (SX) with Coprocessor
Function:Test the processor speed in real MHz.
Syntax:char *cpuspeed(unsigned int round,unsigned int cputype);
Remarks:This function relys on the CPU() function to determine
firstly, detect the correct processor type to
accurately test the processors real MHz speed,
irrespective of its possible Turbo switch setting.
CPUTYPE, MUST be an accurate result from the CPU()
If ROUND is set to 1, the result will be rounded to
a whole figure, otherwise the result will contain a
decimal point with decimal place precision.
Return:CPUSPEED returns a string containing the speed
in ASCII form.
Function:Test to see if the processor is operating in
Remarks:Makes some tests to determine if the processor
is operating in a Protected Mode.
Return:ISPROT returns a value from 0 to 2.
Table:0 = Not in Protected mode
1 = Protected mode
2 = Protected mode via MS-Windows Enhanced mode
Function:Check if MS-Windows is currently active or not.
Remarks:Tests the PC for some unique signatures and/or
interrupt responses to determine if MS-Windows
is active or if the program is running on just
plain old DOS.
Return:ISWIN returns a value from 0 to 6.
Table:0 = DOS
1 = Windows/386 2.x is running
2 = Windows 3.x is running in Enhanced mode
3 = Windows 4.x is running in Enhanced mode
4 = Windows/386 2.x is running
5 = Windows 3.0 is running in Real mode
or Windows 3.1+ is running in Standard mode
6 = Windows 3.0 is running in Standard mode