page 60,132 name need title SNIFF Version 6.7 .286p ; need an smsw to check virtual state ; ideally need 32 bit registers too. ; code runs on more primitive machines. ; E Q U A T E S DEBUGGING equ 1 ;1 if debugging 0 if not ; inserts some register dumps comment | ================= sniff.com Copyright: (c) 1991-2017 Roedy Green, Canadian Mind Products Greg Chicares (BIX: gchicares) wrote Weird.Com upon which SNIF is based. This program is copyrighted, but the executables be freely distributed for non-military use only. You may cannibalize from the source for your own programs. SNIFF.COM simply reports on conditions. Many people contributed directly or indirectly. Many more helped by testing. The beta testers from BIX include: aGurski aRog Blaszczak bQuerry bStrauss dSparks Fred.Robinson gChicares hGessau instantel JeBarr lFirrantello Ligo M.Love macbeth Mike123 mReay pRoub rlis sSchneider terjeM tron wlMoore MFG, tenThumbs SNIFF DESQ LAN RAM DOS Please report bugs and problems to: Roedy Green Canadian Mind Products #101 - 2536 Wark Street Victoria, BC Canada V8T 4G8 tel:(250) 361-9093 mailto:roedyg@mindprod.com http://mindprod.com | %include versionhistory.asm ;============================================================== ; R E G I S T E R C O N V E N T I O N S comment | Subroutines may trash any registers they please except CS: DS: ES: SS: and of course the outputs. Often BP or other registers are specially preserved. |; end of comment ; .XALL turns on macro expansion .SALL turns it off ; .XLIST turns off listing .LIST turns it on ;============================================================== %include equates.asm defaultSuffix equ Bang OR Plus OR Minus ;; for sniff, everything is ok. ;; we won't even test this anyway. %include macros.asm %include segments.asm %include variables.asm ;============================================================== %include macros.asm ; M E S S A G E S String segment CopyrightMsg label byte db '°±²Û SNIFF 6.7 Û²±°' cr cr db 'Freeware to determine which hardware and software is present.' cr db 'Copyright: (c) 1991-2017 Roedy Green, Canadian Mind Products' cr db '#101 - 2536 Wark Street, Victoria, BC Canada V8T 4G8',13,10 db 'tel:(250) 361-9093 mailto:roedyg@mindprod.com http://mindprod.com',13,10 db 'May be freely distributed and used for any purpose except military.' cr db 'email: roedyg@mindprod.com' eos SyntaxErrMsg label byte cr db '°±²Û Error in Command line Û²±°' db 07d eos SyntaxMsg label byte db 'Try something like this:' cr db 'SNIFF DESQview DOS CPU C: TIME' cr cr db 'DESQview means is DESQview is running?' cr db 'DOS means what version of DOS is running?' cr db 'CPU means what kind of CPU do you have?' cr db 'C: means how much space is left on drive C:?' cr db 'TIME what time is it?' cr db 'There are many other tests supported. See NEED.TXT or NEED.ASM.' eos string ends ;============================================================== START proc far ; P R O C E D U R E S Main proc near call SayCr ; just in case DOS left us on a partial line ; start a fresh one. call CountrySeps ; get country dependent chars to use as ; comma and decimal point mov Success,-1 ; Mark that we are succesful so far in this group mov PreviousSuccess,0 ; mark that no previous group of OR tests ; succeeded. call Parse ; calls tests as it parses each parm mov al,Success ; We succeed if current OR group or ; previous OR group succeeded. or al,PreviousSuccess jnz AllOk OhOh: call SayCr saystr 'Sniff failed' call SayCr ; Failed at least one test mov ax, 4c01h ; ERRORLEVEL = 1 int 21h ; Die AllOk: ; no need for a SNIFF successful message call SayCr mov ax, 4c00h ; ERRORLEVEL = 0 int 21h ; normal exit to dos, all tests passed abort: ; If user blows it, we still treat him well! ; Must as if he had said NEED HELP say CopyRightMsg ; CopyRight banner say SyntaxErrMsg say SyntaxMsg mov ax, 4c04h ; ERRORLEVEL = 4 int 21h ; Die, with serious errorlevel Main endp ;============================================================== Handle1Parm proc near ; SNIFF version ignores Version, Capacity and suffixes ; Parses one command on the line, and does all work associated with it. ; On Entry si points to counted string to look for, CX is its length ; not counting the count byte that Findcommand temporarily inserts ; leading / has already be pruned off by Filter call Trisect ; break into 3 pieces C:400K+ ; C 400K + ; Command Capacity Suffix ; ComAddr:ComLen points to C ; CapAddr:CapLen points to 400K ; Sufaddr:SufLen points to + ; for /MSDOS3.1+ ; MSDOS 3.1 + ; ComAddr:ComLen points to MSDOS3.1 ; CapAddr:CapLen is null ; SufAddr:SufLen points to + ; AlpAddr:AlpLen points to MSDOS ; VerAddr:VerLen points to 3.1 ; First try for a matching capacity word ; even if user has not supplied a capacity e.g. /RAM mov al,CapacityStyle or TimeStyle ; SNIFF treats the same mov si,ComAddr mov cx,ComLen call FindCommand ; find command in list ; return with pointer to MCT in BP jnc FoundCommand ; Next try for a matching version word ; even if version left off e.g. /DOS mov al,VersionStyle mov si,AlpAddr mov cx,AlpLen call FindCommand ; find command in list ; return with pointer to MCT in BP jnc FoundCommand ; Next try for a matching implied word e.g. /A20 mov al,ImpliedStyle mov si,ComAddr ; Search for implied first to catch false mov cx,ComLen ; version types e.g. /A20 which are really implied call FindCommand ; find command in list ; return with pointer to MCT in BP jnc FoundCommand NoSuchCommand: jmp Abort ; could not find a matching command FoundCommand: mov TheBase,BP ; found match, either at comaddr or alpaddr ; For SNIFF ; Don't bother to Parse the suffix. We will not use it. ; Don't bother to calculate WantLevel, we will not need it. call DoTheTest ; Test for the feature with one of the Testxxxx ; routines saystr ' ' ; same length as fail msg call DisplayTheTest ; display the result with one of the Displayxxx call SayCr ; routines ret Handle1Parm endp ;============================================ TestANDOperator proc near ; This is not really a test, but a logical operator to separate tests: ; E.g. NEED 80387 80386 AND 80486 ; We implement it to look like a test routine. ; It does nothing really, since tests are separated by an IMPLIED AND. mov ax,1 ; dummy as if present ret TestAndOperator endp ;============================================ if DEBUGGING TestDebugExist proc near ; Force tests to turn on debugging dumps. data segment Debug dw 0 ; do we want debugging dumps to show? ; initially no. If DEBUG command, then yes. data ends mov Debug,-1 ; turn on slow testing mov ax,1 ; dummy as if present ret TestDEBUGExist endp endif ;============================================ %include common.asm %include thetests.asm %include wrapup.asm