home *** CD-ROM | disk | FTP | other *** search
- page 55,132
- name compaq
- title 'COMPAQ - check if Compaq machine'
-
- ;
- ; COMPAQ utility to test whether host machine is
- ; one of the Compaq family of personal computers.
- ;
- ; Returns ERRORLEVEL <>0 if a Compaq, =0 if not.
- ;
- ; Copyright (c) 1984 Ray Duncan
- ;
- ; To assemble, link, and convert this program into
- ; a COM file, follow these steps:
- ;
- ; C>MASM COMPAQ;
- ; C>LINK COMPAQ;
- ; C>EXE2BIN COMPAQ.EXE COMPAQ.COM
- ; C>DEL COMPAQ.EXE
- ;
- ; Ignore the message "Warning: no stack segment" from the Linker.
- ;
-
- cseg segment para public 'CODE'
-
- org 100h
-
- assume cs:cseg,ds:cseg,es:cseg,ss:cseg
-
- compaq proc near
-
- mov ax,0f000h ;search ROM BIOS for
- mov es,ax ;COMPAQ copyright notice
- mov di,0a000h
- mov cx,05fffh
- compaq1: mov al,'C' ;look for initial C
- repnz scasb
- jnz compaq2 ;ROM exhausted, COMPAQ not found
- push di ;save current ROM pointer
- push cx
- push si
- mov cx,6 ;found C, try & match 'COMPAQ'
- mov si,offset compaq_name
- dec di
- repz cmpsb
- pop si ;restore ROM pointer
- pop cx
- pop di
- jnz compaq1 ;jump, strings didn't match
- mov al,1 ;return T for Compaq=True
- jmp compaq3
- compaq2: mov al,0 ;return F for Compaq=False
- compaq3: mov ah,04ch
- int 21h
- compaq endp
-
- compaq_name db 'COMPAQ'
-
- cseg ends
-
- end compaq
-
-