home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_07 / 1n07075a < prev    next >
Text File  |  1990-11-07  |  967b  |  37 lines

  1.  
  2. ;Include this in your AUTOEXEC,BAT file to enable TSR loading options.
  3. ;If the ALT key is held down as this executes it will prompt for a
  4. ;single digit, then set the error level equal to that digit.
  5. ;You may then use IF ERRORLEVEL and IF NOT ERRORLEVEL to load
  6. ;certain TSRs and not others for special situations.
  7. ;Writen in TASM by David Nye in 1990 and released to the public domain.
  8.  
  9. IDEAL
  10. MODEL TINY
  11. CODESEG                                            
  12. ORG lOOh
  13.  
  14.                                                           
  15. Start:
  16.   mov ax, cs
  17.   mov ds, ax
  18.   mov ah, 2                 ;If ALT key is down,
  19.   int 16h
  20.   and al, 8
  21.   jz Exit
  22.   mov dx, OFFSET message    ;Prompt for keypress
  23.   mov ah, 9
  24.   int 21h
  25.   mov ah, 1                 ;Get a digit
  26.   int 21h
  27.   sub al, '0'
  28. Exit:
  29.   mov ah, 4Ch               ;Exit with error code = digit
  30.   int 21h
  31.  
  32. message:
  33.   db 'Enter digit for alternate AUTOEXEC.BAT functions: $'
  34.  
  35. END Start
  36.  
  37.