home *** CD-ROM | disk | FTP | other *** search
- TEXT SEGMENT PARA PUBLIC 'CODE'
-
- ASSUME CS:TEXT,DS:NOTHING,ES:NOTHING,SS:NOTHING
-
- TERM_VECTOR DD ?
-
- ENTRY_PROC PROC FAR
-
- ;save pointer to termination vector in PSP
-
- MOV WORD PTR CS:TERM_VECTOR+0,0000h ;save offset of Warm Boot vector
- MOV WORD PTR CS:TERM_VECTOR+2,DS ;save segment address of PSP
-
- ;***** Place main task here *****
-
- ;determine which MS-DOS version is active, take jump if 2.0 or later
-
- MOV AH,30h ;load Get MS-DOS Version Number function code
- INT 21h ;call MS-DOS to get version number
- OR AL,AL ;see if pre-2.0 MS-DOS
- JNZ TERM_0200 ;jump if 2.0 or later
-
- ;terminate under pre-2.0 MS-DOS
-
- JMP CS:TERM_VECTOR ;jump to Warm Boot vector in PSP
-
- ;terminate under MS-DOS 2.0 or later
-
- TERM_0200:
- MOV AX,4C00h ;load MS-DOS termination function code
- ;and return code
- INT 21h ;call MS-DOS to terminate
-
- ENTRY_PROC ENDP
-
- TEXT ENDS
-
- END ENTRY_PROC ;define entry point
-