]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/SELECT/SSTUB.ASM
3 TITLE SELECT Stub
;AN000;
4 SUBTTL SELSTUB
.ASM
;AN000;
8 INCLUDE SYSMSG
.INC ;AN000;
9 MSG_UTILNAME
<SELECT
> ;AN000;
11 CODE SEGMENT PARA
PUBLIC 'CODE' ;AN000;
12 ASSUME
CS:code ;AN000;
13 ASSUME
DS:code ;AN000;
14 ASSUME
ES:NOTHING
;AN000;
15 ASSUME
SS:NOTHING
;AN000;
21 prognm
DB "SELECT.EXE",0 ;AN000; EXEC this program
23 execparm
DW 0 ;AN000; environment string
24 DW 80H
;AN000; command string offset
25 comseg
DW (?
) ;AN000; command string segment
26 DW 5
CH ;AN000; use the FCB's from this program
28 DW 6
CH ;AN000; use the FCB's from this program
31 enter equ
13 ;AN000;ENTER key
32 escape equ
27 ;AN000;ESC key
35 stck
DB 255 DUP(0) ;AN000;stack
39 MOV SP,OFFSET stck_beg
;AN000;setup local stack
42 MOV AX,10 ;AN000;insert SELECT diskette in drive A:
43 CALL DISPLAY_MSG
;AN000;
46 XOR AH,AH ;AN000;get ENTER key
48 CMP AL,ESCAPE
;AN000;if ESC, then exit
50 CMP AL,ENTER ;AN000;if ENTER
51 JE INPOK
;AN000; then continue
52 MOV AX,11 ;AN000;else, sound BELL
53 CALL DISPLAY_MSG
;AN000;
54 JMP AGN
;AN000;try again
56 CALL CHECK_DISKETTE
;AN000;ensure INSTALL diskette in drive
57 JNC DSKTOK
;AN000;if so, continue
58 CALL CLEAR_SCREEN
;AN032;SEH
59 MOV AX,11 ;AN000;else, sound BELL
60 CALL DISPLAY_MSG
;AN000;
61 MOV AX,10 ;AN032;SEH flash msg on screen to insert SELECT diskette
62 CALL DISPLAY_MSG
;AN032; if user has not inserted it
63 JMP AGN
;AN000;try again
65 CALL CLEAR_SCREEN
;AN000;
67 ; Issue SETBLOCK to free memory
69 PUSH CS ;AN000; restore ES pointing to this segment
71 LEA AX,endofcode
;AN000; get the address of the program end
72 MOV BL,16 ;AN000; get the paragraph size
73 DIV BL ;AN000; get the number of paragraphs
74 INC AL ;AN000; round up to next paragraph
75 SUB AH,AH ;AN000; clear high remainder
76 MOV BX,AX ;AN000; set up call
77 MOV AH,4
AH ;AN000; setblock function code
78 INT 21H
;AN000; issue function to free memory
80 ; EXEC the main program
82 MOV AX,CS ;AN000; get our segment
84 MOV comseg
,AX ;AN000; put in parameter blocks
87 MOV DX,OFFSET prognm
;AN000; get a pointer to the program name
88 MOV BX,OFFSET execparm
;AN000; get a pointer to the program parms
89 MOV AX,4
BH*256 ;AN000; get function code - load & execute
90 INT 21H
;AN000; exec SELECT
96 endofcode
DB ?
;AN000;
98 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
99 ; Message Retriever code inserted at this point....
100 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
101 MSG_SERVICES
<MSGDATA
> ;AN000;
102 MSG_SERVICES
<NOVERCHECKmsg
, DISPLAYmsg
, LOADmsg
>;AN000;
103 MSG_SERVICES
<SELECT
.CLA
,SELECT
.CLB
>;AN000;
104 MSG_SERVICES
<SELECT
.CL1
,SELECT
.CL2
>;AN000;
106 ;****************************************************************************
108 ; DISPLAY_MSG: Call the message retriever to display a message.
111 ; AX = message number
114 ; If CY = 1, there was an error displaying the message.
115 ; If CY = 0, there were no errors.
119 ;****************************************************************************
120 DISPLAY_MSG PROC
NEAR ;AN000;
121 MOV BX, -1 ;AN000; HANDLE -1 ==> USE ONLY DOS FUNCTION 1-12
122 MOV SI, 0 ;AN000; SUBSTITUTION LIST
123 MOV CX, 0 ;AN000; SUBSTITUTION COUNT
124 MOV DL, 00 ;AN000; DOS INT21H FUNCTION FOR INPUT 0==> NO INPUT
125 MOV DI, 0 ;AN000; INPUT BUFFER IF DL = 0AH
126 MOV DH, -1 ;AN000; MESSAGE CALL -1==> UTILITY MESSAGE
127 CALL SYSDISPMSG
;AN000;
129 DISPLAY_MSG ENDP
;AN000;
131 ;****************************************************************************
133 ; LOAD_MSG: Load the message
141 ;****************************************************************************
142 LOAD_MSG PROC
NEAR ;AN000;
143 CALL SYSLOADMSG
;AN000;
145 LOAD_MSG ENDP
;AN000;
147 ;****************************************************************************
149 ; CLEAR_SCREEN: Clear the screen and move cursor to top of display
157 ;****************************************************************************
158 CLEAR_SCREEN PROC
NEAR ;AN000;
160 MOV CX,0000H ;AN000;0,0 upper left of scroll
161 MOV DX,184FH
;AC032;SEH 24,79 lower right of screen
162 MOV BH,07H ;AN000;normal attribute
163 MOV AX,600H
;AN000;scroll screen
166 MOV DX,0000H ;AN000;move cursor to 0,0
167 XOR BH,BH ;AN000;display page
168 MOV AH,2 ;AN000;move cursor
173 CLEAR_SCREEN ENDP
;AN000;
175 ;****************************************************************************
177 ; CHECK_DISKETTE: Check for INSTALL diskette in drive A:
183 ; CY = 0 correct diskette in drive
184 ; CY = 1 incorrect diskette in drive
186 ;****************************************************************************
187 CHECK_DISKETTE PROC
NEAR ;AN000;
191 MOV DX,OFFSET dta
;AN000;set new dta
194 MOV DX,OFFSET prognm
;AN000;search for this file
195 XOR CX,CX ;AN000;search attribute
196 MOV AH,4EH
;AN000;find first matching file
200 CHECK_DISKETTE ENDP
;AN000;
202 DTA
DB ?
;AN000;start of dummy DTA for find first