_PROCESSOR DETECTION SCHEMES_
by Richard C. Leinecker
[LISTING ONE]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Detect the Processor Type -- by Richard C. Leinecker ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_PTEXT SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:_PTEXT, DS:_PTEXT
public _Processor
; This routine returns the processor type as an integer value.
; C Prototype
; int Processor( void );
; Returns: 0 == 8088, 1 == 8086, 2 == 80286, 3 == 80386, 4 == 80486
; Code assumes es, ax, bx, cx, and dx can be altered. If their contents
; must be preserved, then you'll have to push and pop them.
_Processor proc far
push bp ; Preserve bp
mov bp,sp ; bp = sp
push ds ; Preserve ds
push di ; and di
mov ax,cs ; Point ds
mov ds,ax ; to _PTEXT
call IsItAn8088 ; Returns 0 or 2
cmp al,2 ; 2 = 286 or better
jge AtLeast286 ; Go to 286 and above code
call IsItAn8086 ; Returns 0 or 1
jmp short ExitProcessor ; Jump to exit code
AtLeast286:
call IsItA286 ; See if it's a 286
cmp al,3 ; 4 and above for 386 and up
jl short ExitProcessor ; Jump to exit code
AtLeast386:
call IsItA386 ; See if it's a 386
ExitProcessor:
pop di ; Restore di,
pop ds ; ds,






