home *** CD-ROM | disk | FTP | other *** search
- title Set ERRORLEVEL To Reflect Ultravision Status
-
- ;******************************************************************
- ;* *
- ;* An idiot program by Tom Slone, CIS# 76137,215. April 1990. *
- ;* Written to MASM 5.1. *
- ;; *
- ;; (modified by Mark Horvatich, 4/24/90, to allow assembly *
- ;; with other types/versions of assemblers) *
- ;* *
- ;* ERRORLEVEL (return code) will be set as follows: *
- ;* *
- ;* 0 = UV is not resident. *
- ;* 1 = UV is resident, but is presently inactive. *
- ;* other = UV is resident and is active; ERRORLEVEL is *
- ;* equal to the UV text mode (in decimal) per table *
- ;* C-2 on page 94 of the UV 2.0 Reference Manual. *
- ;* *
- ;* *
- ;******************************************************************
-
- VideoInt equ 010h ;BIOS video interrupt
- DosFuncInt equ 021h ;DOS function request interrupt
- UvSystemCtl equ 0CCh ;UV system control function
- UvScreenCtl equ 0CDh ;UV screen control function
- UvGetStatus equ 000h ;get UV status subfunction
- UvGetTextMode equ 004h ;get UV text mode subfunction
- UvResFlag equ 0ABCDh ;UV resident indicator
- ConZero equ 000h ;constant hex zero
- ConOne equ 001h ;constant hex one
- ExitFunc equ 04Ch ;DOS exit function
-
-
- uvcheck segment ;begin code segment
- assume cs:uvcheck,ds:uvcheck ;tell assembler about registers
-
- org 100h ;begin at 100h for .COM format
-
- start:
- mov cx,ConZero ;init cx to a known value
- mov ah,UvSystemCtl ;UV system control function
- mov al,UvGetStatus ;UV get status
- int VideoInt ;perform video interrupt
- cmp cx,UvResFlag ;is UV resident?
- je uv_resident ; jump if yes
- mov al,ConZero ;set ERRORLVL to UV not resident
- jmp short exit ;finished
-
- uv_resident:
- cmp al,ConZero ;is al=00 (UV active)?
- je uv_active ; jump if yes
- mov al,ConOne ;set ERRORLVL to UV not active
- jmp short exit ;finished
-
- uv_active:
- mov ah,UvScreenCtl ;UV screen control function
- mov al,UvGetTextMode ;UV get text mode
- int VideoInt ;perform video interrupt
- jmp short exit ;finished - text mode is in al
-
- exit: ;exit with ERRORLVL in al
- mov ah,ExitFunc ;DOS exit function
- int DosFuncInt ;perform DOS interrupt
-
- uvcheck ends ;end of code segment
- end start ;end of source program