home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
DESQVIEW
/
DESQTEST.ZIP
/
DESQTEST.ASM
next >
Wrap
Assembly Source File
|
1988-04-22
|
4KB
|
96 lines
PAGE 66,132
NAME DESQTEST
TITLE DESQTEST - Test for presence of DESQview
COMMENT *
File : DESQTEST.ASM - Test for presence of DESQview environment
:
Environment : PC compatible assembler
:
Related Files : DVTEST.BAT - demonstration for use of DESQTEST
in .ARC : DESQTEST.COM - assembled executable program file
:
Revision Log : 13:00 4/22/88
This source code has been adapted from the public domain file
DVINT.ASM, downloadable as DVINT.ARC from the Quarterdeck Bulletin
Board, (213) 396-3904. DESQview is a registered trademark of
Quarterdeck Office Systems. This version has been adapted and
re-released into the public domain as DESQTEST.ARC by:
Marc Rubin, Multi-Phase Research
1216 West University Drive, Suite H
Tempe, AZ 85281
Description:
------------
This program tests for the presence of the DESQview operating
environment, and reports the result via the MD-DOS termination status
code: 0 indicates that DESQview is NOT present. Any other exit
status indicates that the program IS running under DESQview, and the
exit code corresponds to the DESQview major version number.
The DOS termination status may be read inside a .BATch file and
then reported to the user and/or used to conditionally execute programs
as demonstrated in DVTEST.BAT. For more information, see the section
on Batch File Commands in the DOS Reference manual.
Alternatively, the termination code may be read directly by a program
using the DOS Interrupt 21 function 04DH, 'Get Termination Code'. For
more information on interfacing with DESQview, see Appendix J in the
DESQview version 2 documentation.
Assembly and Linkage:
---------------------
To generate an executable .COM file from this source file using
standard PC assembler utilities, use the following sequence:
MASM DESQTEST;
LINK DESQTEST;
(ignore the "Warning: no STACK segment" error)
DEL DESQTEST.OBJ
EXE2BIN DESQTEST.EXE DESQTEST.COM
DEL DESQTEST.EXE
(END OF DOCUMENTATION SECTION, PROGRAM FOLLOWS)
*
DESQTEST_SEG SEGMENT 'CODE'
ASSUME CS:DESQTEST_SEG
;
GET_VERSION PROC
PUSH BX ; SAVE REGS WE'LL USE
PUSH CX ; JUST IN CASE THIS CODE IS
PUSH DX ; USED AS A CALLABLE SUBROUTINE
MOV AX,2B01H ; DV 'Get Version' request
MOV CX,'DE' ; WORKS BY SUPPLYING A SPECIAL
MOV DX,'SQ' ; INVALID DATE TO DOS 'SET DATE'
INT 21H ; FUNCTION CALL
CMP AL,0FFH ; Are we in DV?
JE NO_DV ; Jump if not
MOV AX,BX ; We are; save DV Major version number
MOV AL, AH ; and pass to DOS as TERMINATION CODE
JMP SHORT DVGV_EXIT ; SKIP 'NO DESQVIEW' LOGIC
NO_DV: SUB AX,AX ; Clear AX (zero indicates no DESQview)
;
DVGV_EXIT:
POP DX ; RESTORE REGS
POP CX ; SO THAT THIS CODE COULD BE
POP BX ; USED IN A CALLABLE SUBROUTINE
; RET ; UNCOMMENT THIS FOR SUBROUTINE USE
MOV AH, 04CH ; DOS 'TERMINATE PROGRAM' FUNCTION
INT 21H ; EXIT PROGRAM WITH TERMINATION CODE
GET_VERSION ENDP
;
;
DESQTEST_SEG ENDS
;
END GET_VERSION