Determining CPU speed 1 
Author Message
 Determining CPU speed 1

Subj: Re: Determining CPU type, speed...

I tried to send this by e-mail but someone called UUOUT EXPORT DAEMON
bounced it saying something about an 'Invalid Local User' so I'm
reposting it to ALL


SZ> I would like to have a BASIC program that would determine the
  > CPU type, (MCA or other), type or processor and its speed


CG> I wouldn't know how to do this in native BASIC code but I do have
  > some assembly code (callable from QuickBASIC) which identifies CPU
  > and co-pro types. It was posted recently in alt.msdos.programmer
  > but I can post it again here if you like?


RY> I would like to see a copy of that code.  I think I missed the
  > alt.msdos.programmer posting...

Here y'are...

--- cut here ---------------------------------------------------------------
; HARDWARE.ASM  a collection of functions which return information about
;               the equipment available to the computer in which the
;               calling program is running.
;
;   Author:     Christy Gemmell
;   For:        Assembly-Language Toolbox
;   Version:    5.58
;   Date:       6/2/1995
;
;   Compatible with QuickBASIC 4.5, BASIC 7.1 PDS and VisualBASIC DOS.
;   Assembled using MicroSoft Macro Assembler, MASM version 6.11a
;
               .model   medium

                public  Cpu
                public  MathsChip

               .code

                .386P

;   Translation table of return values for different microprocessors.
;
CTable          dw      0, 88, 86, 188, 186, 20, 30, 286, -386
                dw      386,-486, 486, 586, 686, 786, 886

;   Translation table of return values for different co-processors.
;
MTable          dw      0, 87, 287, 387, 487

;   Storage for co-processor status and control words.
;
CtrlWrd         label   word
Masks           db      ?
Control         db      ?

;   This function returns a value which indicates the type of micro-
;   processor installed in the host computer system.
;
;   The value returned in AX indicates the microprocessor installed, i.e.
;
;      20 = NEC   V20        30 = NEC   V30          88 = Intel 8088
;      86 = Intel 8086      186 = Intel 80186       188 = Intel 80188
;     286 = Intel 80286     386 = Intel 80386DX    -386 = Intel 80386SX
;     486 = Intel 80486DX  -486 = Intel 80486SX     586 = Intel Pentium
;
Cpu             proc    far
                push    ds                      ; Save Data segment
                push    cs                      ; Align code and
                pop     ds                      ;    Data segments
                call    CpuType
                xor     bx,bx
                mov     bl,al
                shl     bl,1                    ; Multiply by two
                mov     ax,CTable[bx]           ; Extract translation code
                pop     ds                      ; Clean up the stack
                ret
Cpu             endp

;   Test if a floating-point maths co-processor is installed.
;
;   Output: AX = 487    Intel 80487
;                387    Intel 80387
;                287    Intel 80287
;                 87    Intel 8087
;                  0    Unknown co-processor (or none)
;
MathsChip       proc    far
                push    ds                      ; Save Data segment
                push    cs                      ; Align code and
                pop     ds                      ;    Data segments
                call    CpuType
                xor     bx,bx
                mov     bl,ah
                shl     bl,1                    ; Multiply by two
                mov     ax,MTable[bx]           ; Extract translation code
                pop     ds                      ; Clean up the stack
                ret
MathsChip       endp

;   This procedure tests if the processor has an 8 or 16-bit data bus,
;   distinguishing the 8088/80188/V20 from the 8086/80186/V30. The two
;   series differ in that the 8-bit processors will replenish the
;   instruction queue after each byte is read, whereas 16-bit processors
;   wait until two bytes have been read before topping up the queue.
;   Also the 8086 queue is six bytes long while the 8088 series queue has
;   only four bytes.
;
BusWidth        proc    near
                push    es
                push    di
(Continued to next message)
---
 * 1st 2.00o #323 *



Sat, 29 Nov 1997 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Determining CPU speed 4

2. Determining CPU speed 3

3. Determining CPU speed 2

4. Determine cpu speed

5. Using VB to determine CPU speed

6. Determining CPU Speed?

7. Determining CPU type, speed...

8. determining CPU class & speed

9. Using VB to determine speed of CPU?

10. Code for CPU speed

11. Detecting CPU Speed

12. CPU Clock Speed w/ API?

 

 
Powered by phpBB® Forum Software