diff options
Diffstat (limited to 'v4.0/src/SELECT/SSTUB.ASM')
| -rw-r--r-- | v4.0/src/SELECT/SSTUB.ASM | 209 |
1 files changed, 209 insertions, 0 deletions
diff --git a/v4.0/src/SELECT/SSTUB.ASM b/v4.0/src/SELECT/SSTUB.ASM new file mode 100644 index 0000000..b62fdbc --- /dev/null +++ b/v4.0/src/SELECT/SSTUB.ASM | |||
| @@ -0,0 +1,209 @@ | |||
| 1 | |||
| 2 | |||
| 3 | TITLE SELECT Stub ;AN000; | ||
| 4 | SUBTTL SELSTUB.ASM ;AN000; | ||
| 5 | |||
| 6 | PAGE 60,132 ;AN000; | ||
| 7 | |||
| 8 | INCLUDE SYSMSG.INC ;AN000; | ||
| 9 | MSG_UTILNAME <SELECT> ;AN000; | ||
| 10 | |||
| 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; | ||
| 16 | |||
| 17 | ORG 100H ;AN000; | ||
| 18 | MAIN PROC FAR ;AN000; | ||
| 19 | BEGIN: JMP A0 ;AN000; | ||
| 20 | |||
| 21 | prognm DB "SELECT.EXE",0 ;AN000; EXEC this program | ||
| 22 | |||
| 23 | execparm DW 0 ;AN000; environment string | ||
| 24 | DW 80H ;AN000; command string offset | ||
| 25 | comseg DW (?) ;AN000; command string segment | ||
| 26 | DW 5CH ;AN000; use the FCB's from this program | ||
| 27 | seg1 DW (?) ;AN000; . | ||
| 28 | DW 6CH ;AN000; use the FCB's from this program | ||
| 29 | seg2 DW (?) ;AN000; . | ||
| 30 | |||
| 31 | enter equ 13 ;AN000;ENTER key | ||
| 32 | escape equ 27 ;AN000;ESC key | ||
| 33 | |||
| 34 | EVEN ;AN000; | ||
| 35 | stck DB 255 DUP(0) ;AN000;stack | ||
| 36 | stck_beg DB 0 ;AN000; | ||
| 37 | |||
| 38 | A0: ;AN000; | ||
| 39 | MOV SP,OFFSET stck_beg ;AN000;setup local stack | ||
| 40 | |||
| 41 | CALL LOAD_MSG ;AN000; | ||
| 42 | MOV AX,10 ;AN000;insert SELECT diskette in drive A: | ||
| 43 | CALL DISPLAY_MSG ;AN000; | ||
| 44 | |||
| 45 | AGN: ;AN000; | ||
| 46 | XOR AH,AH ;AN000;get ENTER key | ||
| 47 | INT 16H ;AN000; | ||
| 48 | CMP AL,ESCAPE ;AN000;if ESC, then exit | ||
| 49 | JE EXIT ;AN000; | ||
| 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 | ||
| 55 | INPOK: ;AN000; | ||
| 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 | ||
| 64 | DSKTOK: ;AN000; | ||
| 65 | CALL CLEAR_SCREEN ;AN000; | ||
| 66 | |||
| 67 | ; Issue SETBLOCK to free memory | ||
| 68 | |||
| 69 | PUSH CS ;AN000; restore ES pointing to this segment | ||
| 70 | POP ES ;AN000; . | ||
| 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,4AH ;AN000; setblock function code | ||
| 78 | INT 21H ;AN000; issue function to free memory | ||
| 79 | |||
| 80 | ; EXEC the main program | ||
| 81 | |||
| 82 | MOV AX,CS ;AN000; get our segment | ||
| 83 | MOV DS,AX ;AN000; | ||
| 84 | MOV comseg,AX ;AN000; put in parameter blocks | ||
| 85 | MOV seg1,AX ;AN000; . | ||
| 86 | MOV seg2,AX ;AN000; . | ||
| 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,4BH*256 ;AN000; get function code - load & execute | ||
| 90 | INT 21H ;AN000; exec SELECT | ||
| 91 | EXIT: ;AN000; | ||
| 92 | MOV AX,4C00H ;AN000; | ||
| 93 | INT 21H ;AN000; | ||
| 94 | RET ;AN000; | ||
| 95 | |||
| 96 | endofcode DB ? ;AN000; | ||
| 97 | |||
| 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; | ||
| 105 | |||
| 106 | ;**************************************************************************** | ||
| 107 | ; | ||
| 108 | ; DISPLAY_MSG: Call the message retriever to display a message. | ||
| 109 | ; | ||
| 110 | ; INPUT: | ||
| 111 | ; AX = message number | ||
| 112 | ; | ||
| 113 | ; OUTPUT: | ||
| 114 | ; If CY = 1, there was an error displaying the message. | ||
| 115 | ; If CY = 0, there were no errors. | ||
| 116 | ; | ||
| 117 | ; OPERATION: | ||
| 118 | ; | ||
| 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; | ||
| 128 | RET ;AN000; | ||
| 129 | DISPLAY_MSG ENDP ;AN000; | ||
| 130 | |||
| 131 | ;**************************************************************************** | ||
| 132 | ; | ||
| 133 | ; LOAD_MSG: Load the message | ||
| 134 | ; | ||
| 135 | ; INPUT: | ||
| 136 | ; None | ||
| 137 | ; | ||
| 138 | ; OUTPUT: | ||
| 139 | ; None | ||
| 140 | ; | ||
| 141 | ;**************************************************************************** | ||
| 142 | LOAD_MSG PROC NEAR ;AN000; | ||
| 143 | CALL SYSLOADMSG ;AN000; | ||
| 144 | RET ;AN000; | ||
| 145 | LOAD_MSG ENDP ;AN000; | ||
| 146 | |||
| 147 | ;**************************************************************************** | ||
| 148 | ; | ||
| 149 | ; CLEAR_SCREEN: Clear the screen and move cursor to top of display | ||
| 150 | ; | ||
| 151 | ; INPUT: | ||
| 152 | ; None | ||
| 153 | ; | ||
| 154 | ; OUTPUT: | ||
| 155 | ; None | ||
| 156 | ; | ||
| 157 | ;**************************************************************************** | ||
| 158 | CLEAR_SCREEN PROC NEAR ;AN000; | ||
| 159 | |||
| 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 | ||
| 164 | INT 10H ;AN000; | ||
| 165 | |||
| 166 | MOV DX,0000H ;AN000;move cursor to 0,0 | ||
| 167 | XOR BH,BH ;AN000;display page | ||
| 168 | MOV AH,2 ;AN000;move cursor | ||
| 169 | INT 10H ;AN000; | ||
| 170 | |||
| 171 | RET ;AN000; | ||
| 172 | |||
| 173 | CLEAR_SCREEN ENDP ;AN000; | ||
| 174 | |||
| 175 | ;**************************************************************************** | ||
| 176 | ; | ||
| 177 | ; CHECK_DISKETTE: Check for INSTALL diskette in drive A: | ||
| 178 | ; | ||
| 179 | ; INPUT: | ||
| 180 | ; None | ||
| 181 | ; | ||
| 182 | ; OUTPUT: | ||
| 183 | ; CY = 0 correct diskette in drive | ||
| 184 | ; CY = 1 incorrect diskette in drive | ||
| 185 | ; | ||
| 186 | ;**************************************************************************** | ||
| 187 | CHECK_DISKETTE PROC NEAR ;AN000; | ||
| 188 | PUSH DS ;AN000; | ||
| 189 | PUSH CS ;AN000; | ||
| 190 | POP DS ;AN000; | ||
| 191 | MOV DX,OFFSET dta ;AN000;set new dta | ||
| 192 | MOV AH,1AH ;AN000; | ||
| 193 | INT 21H ;AN000; | ||
| 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 | ||
| 197 | INT 21H ;AN000; | ||
| 198 | POP DS ;AN000; | ||
| 199 | RET ;AN000; | ||
| 200 | CHECK_DISKETTE ENDP ;AN000; | ||
| 201 | |||
| 202 | DTA DB ? ;AN000;start of dummy DTA for find first | ||
| 203 | |||
| 204 | include msgdcl.inc | ||
| 205 | |||
| 206 | MAIN ENDP ;AN000; | ||
| 207 | CODE ENDS ;AN000; | ||
| 208 | END BEGIN ;AN000; | ||
| 209 | |||