diff options
Diffstat (limited to 'v4.0/src/INC/SHELLRD.INC')
| -rw-r--r-- | v4.0/src/INC/SHELLRD.INC | 5111 |
1 files changed, 5111 insertions, 0 deletions
diff --git a/v4.0/src/INC/SHELLRD.INC b/v4.0/src/INC/SHELLRD.INC new file mode 100644 index 0000000..7d35d11 --- /dev/null +++ b/v4.0/src/INC/SHELLRD.INC | |||
| @@ -0,0 +1,5111 @@ | |||
| 1 | ; | ||
| 2 | PAGE | ||
| 3 | ;-----------------------------------------------------------------------------+ | ||
| 4 | ; : | ||
| 5 | ; Name: SHELLRD.INC : | ||
| 6 | ; : | ||
| 7 | ; Description: Include file for SHELLRD.ASM : | ||
| 8 | ; : | ||
| 9 | ; Revised: 04-21-88 : | ||
| 10 | ; : | ||
| 11 | ;-----------------------------------------------------------------------------+ | ||
| 12 | ; | ||
| 13 | PAGE | ||
| 14 | ;-----------------------------------------------------------------------------+ | ||
| 15 | ; : | ||
| 16 | ; Name: INIT_GTEXT : | ||
| 17 | ; : | ||
| 18 | ; Description: Initialize the PCGRAPH parameter block with the PCB : | ||
| 19 | ; contained in AX. : | ||
| 20 | ; : | ||
| 21 | ; Entry: AX = Panel ID to initialize into PCGRAPH parameter : | ||
| 22 | ; block. : | ||
| 23 | ; : | ||
| 24 | ; Exit: ES:DI = Address of initialized PCGRAPH parameter : | ||
| 25 | ; block. : | ||
| 26 | ; : | ||
| 27 | ; Entry point: INIT_GTEXT : | ||
| 28 | ; : | ||
| 29 | ; Notes: None. : | ||
| 30 | ; : | ||
| 31 | ; Internal references: None. : | ||
| 32 | ; : | ||
| 33 | ; External references: None. : | ||
| 34 | ; : | ||
| 35 | ;-----------------------------------------------------------------------------+ | ||
| 36 | ; | ||
| 37 | INIT_GTEXT PROC NEAR | ||
| 38 | ; | ||
| 39 | CALL FAR PTR GET_PCB ;return panel address at ES:DI | ||
| 40 | ; | ||
| 41 | PUSH ES:[DI]+PCB_FLAGSEG ;flag string segment | ||
| 42 | PUSH ES:[DI]+PCB_FLAGOFF ;flag string offset | ||
| 43 | PUSH ES:[DI]+PCB_EXPANDSEG ;segment of text string | ||
| 44 | PUSH ES:[DI]+PCB_EXPANDOFF ;offset of text string | ||
| 45 | PUSH ES:[DI]+PCB_WIDTH ;width of panel | ||
| 46 | PUSH ES:[DI]+PCB_LROW ;lower right corner | ||
| 47 | PUSH ES:[DI]+PCB_UCOL ;column location of panel | ||
| 48 | PUSH ES:[DI]+PCB_UROW ;row location of panel | ||
| 49 | PUSH ES:[DI]+PCB_CCBID ;Index number of log color | ||
| 50 | MOV AL,ES:[DI]+PCB_OPT4 | ||
| 51 | ; | ||
| 52 | LEA DI,GEN_DATA ;point graphics window structure | ||
| 53 | ; to data area | ||
| 54 | MOV [DI]+G_DRAWT_F,AL ;set flags | ||
| 55 | POP AX ;get color index | ||
| 56 | POP BX ;get upper row | ||
| 57 | MOV [DI]+G_DRAWTROWO,BX ;window row origin (top left) | ||
| 58 | POP [DI]+G_DRAWTCOLO ;window column origin | ||
| 59 | POP CX ;get lower row and calculate | ||
| 60 | SUB CX,BX ; number of lines in text panel | ||
| 61 | INC CX | ||
| 62 | MOV [DI]+G_DRAWTLINES,CX | ||
| 63 | POP [DI]+G_DRAWTLEN ;width of panel text | ||
| 64 | ; | ||
| 65 | POP WORD PTR [DI].G_DRAWTSTRING | ||
| 66 | ;panel text string address | ||
| 67 | POP WORD PTR [DI+2].G_DRAWTSTRING | ||
| 68 | POP WORD PTR [DI].G_DRAWTFLAGS | ||
| 69 | ;panel text flag string address | ||
| 70 | POP WORD PTR [DI+2].G_DRAWTFLAGS | ||
| 71 | ; | ||
| 72 | DEC [DI]+G_DRAWTROWO ;window row origin (top left) | ||
| 73 | DEC [DI]+G_DRAWTCOLO ;window column origin | ||
| 74 | ; | ||
| 75 | MOV BX,G_DRAWT_WA+G_DRAWT_WC+G_DRAWT_UA | ||
| 76 | CMP [DI]+G_DRAWT_F,0 ;check if source flags option used | ||
| 77 | JE IGT10 | ||
| 78 | ; | ||
| 79 | CMP WORD PTR [DI].G_DRAWTFLAGS,0 | ||
| 80 | JNE IGT10 | ||
| 81 | ; | ||
| 82 | OR BX,G_DRAWT_UF ;set option to use source flags | ||
| 83 | ; option | ||
| 84 | ; | ||
| 85 | IGT10: MOV [DI]+G_DRAWTOPT,BX ;option word | ||
| 86 | MOV [DI]+G_DRAWTSKIP,0 ;num bytes in source to next line | ||
| 87 | ; | ||
| 88 | PUSH ES ;save pointer to panel data | ||
| 89 | PUSH DI | ||
| 90 | CALL FAR PTR GET_COLOR ;get color attribute | ||
| 91 | MOV AL,ES:[DI]+CCB_A1 ;get normal panel color | ||
| 92 | POP DI ;point back to panel data | ||
| 93 | POP ES | ||
| 94 | MOV [DI]+G_DRAWT_A,AL ;window attribute | ||
| 95 | MOV [DI]+G_DRAWTOUT,AL ;outline color attribute | ||
| 96 | ; | ||
| 97 | MOV AX,DATA ;point to segment containing | ||
| 98 | MOV ES,AX ; general data area | ||
| 99 | ; | ||
| 100 | RET | ||
| 101 | INIT_GTEXT ENDP | ||
| 102 | ; | ||
| 103 | PAGE | ||
| 104 | ;-----------------------------------------------------------------------------+ | ||
| 105 | ; : | ||
| 106 | ; Name: PROCESS_SCROLL : | ||
| 107 | ; : | ||
| 108 | ; Description: Highlight mouse fields in the specified range as : | ||
| 109 | ; the up and down arrows are used. The range of mouse : | ||
| 110 | ; fields to highlight are specified in AX and BX with : | ||
| 111 | ; intervening fields in consecutive order. The help : | ||
| 112 | ; ID for each selection is calculated from the values : | ||
| 113 | ; set to COM_HCBIDL and COM_HCBIDH. It is important : | ||
| 114 | ; that the help equates are in sequential order. : | ||
| 115 | ; : | ||
| 116 | ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ : | ||
| 117 | ; COM_HCBIDL ÄÄ 1. First element to highlight ÄÄÄÄ AX : | ||
| 118 | ; ³ 2. : : ³ : | ||
| 119 | ; ³ 3. : : ³ : | ||
| 120 | ; COM_HCBIDH ÄÄ 4. Last element to highlight ÄÄÄÄ BX : | ||
| 121 | ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : | ||
| 122 | ; : | ||
| 123 | ; : | ||
| 124 | ; Entry: AX = First element to highlight : | ||
| 125 | ; BX = Last element to highlight : | ||
| 126 | ; : | ||
| 127 | ; COM_HCBIDL = First element help ID : | ||
| 128 | ; COM_HCBIDH = Last element help ID : | ||
| 129 | ; COM_HCBID = Set to desired help ID for all selections: | ||
| 130 | ; and set COM_HCBIDL and COM_HCBIDH to 0. : | ||
| 131 | ; : | ||
| 132 | ; COM_SCROPT = Set scroll option for multiple : | ||
| 133 | ; selections. COM_HCBID and COM_CURPUPF : | ||
| 134 | ; must be initialized before entry. : | ||
| 135 | ; : | ||
| 136 | ; Exit: COM_MOK 0= Mouse input : | ||
| 137 | ; 1= Keyboard input : | ||
| 138 | ; COM_KEY = Keystroke (keyboard or mouse value) : | ||
| 139 | ; COM_ROW = Row of mouse pointer (text coordinates) : | ||
| 140 | ; COM_COL = Column of mouse pointer (text coord) : | ||
| 141 | ; COM_POSITION = Line number of scroll bar element : | ||
| 142 | ; COM_CURRF = Current mouse field ID : | ||
| 143 | ; COM_DELTA = Scroll bar delta from current top : | ||
| 144 | ; element displayed in panel : | ||
| 145 | ; COM_HCBID = Current help equate : | ||
| 146 | ; : | ||
| 147 | ; : | ||
| 148 | ; Notes: None. : | ||
| 149 | ; : | ||
| 150 | ; Entry point: PROCESS_SCROLL : | ||
| 151 | ; : | ||
| 152 | ; Internal references: PCTRACK_CALL : | ||
| 153 | ; PCINPUT_CALL : | ||
| 154 | ; : | ||
| 155 | ; External references: None. : | ||
| 156 | ; : | ||
| 157 | ;-----------------------------------------------------------------------------+ | ||
| 158 | ; | ||
| 159 | PROCESS_SCROLL PROC FAR | ||
| 160 | ; | ||
| 161 | PUSH AX ;save registers | ||
| 162 | PUSH BX | ||
| 163 | PUSH CX | ||
| 164 | PUSH DX | ||
| 165 | PUSH DI | ||
| 166 | PUSH ES | ||
| 167 | PUSH SI | ||
| 168 | PUSH DS | ||
| 169 | ; | ||
| 170 | ; initialize first highlighted field | ||
| 171 | ; | ||
| 172 | MOV COM_HLPTEMP,0 ;set to unique scroll help | ||
| 173 | ; | ||
| 174 | CMP COM_HCBIDL,0 ;check if unique scroll item | ||
| 175 | JNE SI04 ; help option active | ||
| 176 | ; | ||
| 177 | CMP COM_HCBIDH,0 | ||
| 178 | JNE SI04 | ||
| 179 | ; | ||
| 180 | PUSH COM_HCBID ;set help ID | ||
| 181 | POP COM_HLPTEMP | ||
| 182 | ; | ||
| 183 | SI04: MOV COM_FLDT,2 ;scroll field type | ||
| 184 | ; | ||
| 185 | MOV CX,BX ;calulate number of entries | ||
| 186 | SUB CX,AX ; in list | ||
| 187 | XOR CH,CH ;clear to zero | ||
| 188 | ADD CL,'1' ;adjust for string value | ||
| 189 | MOV COM_CNT,CX ;save value | ||
| 190 | ; | ||
| 191 | CMP COM_SCROPT,1 ;when using this option make | ||
| 192 | JNE SI05 ; sure starting help ID initializd | ||
| 193 | ; to COM_HCBID and the current | ||
| 194 | ; field to highlight COM_CURPUPF | ||
| 195 | ; | ||
| 196 | MOV DX,AX ;get first field | ||
| 197 | MOV AX,COM_CURPUPF ;make new mouse field the current | ||
| 198 | MOV COM_LASTF,AX ; field | ||
| 199 | JMP SI07 | ||
| 200 | ; | ||
| 201 | SI05: MOV CX,COM_HCBIDL ;initialize starting help ID | ||
| 202 | MOV COM_HCBID,CX | ||
| 203 | ; | ||
| 204 | MOV COM_CURPUPF,AX ;make new mouse field the current | ||
| 205 | MOV COM_LASTF,AX ; field | ||
| 206 | MOV DX,AX ;get first field | ||
| 207 | ; | ||
| 208 | SI07: MOV CX,BX ;get last field | ||
| 209 | CALL FAR PTR LOC_MOUSEF ;get actual mouse field number | ||
| 210 | CALL FAR PTR MOUSE_OFF | ||
| 211 | CALL FAR PTR MOUSE_HIGH ;highlight mouse field | ||
| 212 | CALL FAR PTR MOUSE_ON | ||
| 213 | ; | ||
| 214 | ; Poll for keyboard or mouse input | ||
| 215 | ; | ||
| 216 | SI10: CMP COM_HLPTEMP,0 ;check if single help ID selection | ||
| 217 | JE SI11 ; active | ||
| 218 | ; | ||
| 219 | MOV AX,COM_HLPTEMP ;set single help ID for all scroll | ||
| 220 | MOV COM_HCBID,AX ; selections | ||
| 221 | ; | ||
| 222 | SI11: MOV AX,0 ;turn monocasing off | ||
| 223 | CALL FAR PTR PROCESS_KEY ;get keystroke | ||
| 224 | |||
| 225 | MOV BX,COM_KEY ;get keystroke | ||
| 226 | ; | ||
| 227 | ; Exit if mouse action | ||
| 228 | ; | ||
| 229 | SI12: CMP COM_MOK,1 ;check if keyboard input | ||
| 230 | JE SI15 | ||
| 231 | ; | ||
| 232 | CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed | ||
| 233 | JNE SI13 | ||
| 234 | ; | ||
| 235 | CMP COM_SCROPT,1 ;is this the multiple select opt? | ||
| 236 | JE SI13 ;yes, jump out of procedure | ||
| 237 | ; | ||
| 238 | MOV AX,COM_CURPUPF ;get current highlighted field | ||
| 239 | CALL FAR PTR GET_MOUSEF ;get mouse structure | ||
| 240 | ; | ||
| 241 | MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field | ||
| 242 | MOV COM_KEY,AX | ||
| 243 | MOV COM_MOK,0 ;set for keystroke input | ||
| 244 | ; | ||
| 245 | SI13: JMP SIEXIT ;mouse action exit | ||
| 246 | ; | ||
| 247 | ; Process down arrow key | ||
| 248 | ; | ||
| 249 | SI15: CMP BX,ES:[DI]+KY_DARROW ;check if up arrow pressed | ||
| 250 | JNE SI30 | ||
| 251 | ; | ||
| 252 | CMP COM_CURPUPF,CX ;check if below last field | ||
| 253 | JAE SI20 | ||
| 254 | ; | ||
| 255 | INC COM_HCBID ;point to next help equate | ||
| 256 | INC COM_CURPUPF ;no, point to next field | ||
| 257 | JMP SI45 ;now change highlight | ||
| 258 | ; | ||
| 259 | SI20: PUSH COM_HCBIDL ;initialize help to first field | ||
| 260 | POP COM_HCBID | ||
| 261 | MOV COM_CURPUPF,DX ;yes, point to first field | ||
| 262 | JMP SI45 ;now change highlight | ||
| 263 | ; | ||
| 264 | ; process up arrow key | ||
| 265 | ; | ||
| 266 | SI30: CMP BX,ES:[DI]+KY_UARROW ;check if up arrow pressed | ||
| 267 | JNE SI50 | ||
| 268 | ; | ||
| 269 | CMP COM_CURPUPF,DX ;check if above first field | ||
| 270 | JBE SI40 | ||
| 271 | ; | ||
| 272 | DEC COM_HCBID ;point to next help equate | ||
| 273 | DEC COM_CURPUPF ;no, point to previous field | ||
| 274 | JMP SI45 | ||
| 275 | ; | ||
| 276 | SI40: PUSH COM_HCBIDH ;initialize help to last field | ||
| 277 | POP COM_HCBID | ||
| 278 | MOV COM_CURPUPF,CX ;yes, point to last field | ||
| 279 | ; | ||
| 280 | ; Remove last field highlight and display new highlight | ||
| 281 | ; | ||
| 282 | SI45: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off | ||
| 283 | ; | ||
| 284 | MOV AX,COM_LASTF ;unhighlight last mouse field | ||
| 285 | CALL FAR PTR LOC_MOUSEF ;get actual field number | ||
| 286 | CALL FAR PTR MOUSE_UNHIGH | ||
| 287 | ; | ||
| 288 | MOV AX,COM_CURPUPF ;highlight current mouse field | ||
| 289 | CALL FAR PTR LOC_MOUSEF ;get actual field number | ||
| 290 | CALL FAR PTR MOUSE_HIGH | ||
| 291 | ; | ||
| 292 | CALL FAR PTR MOUSE_ON ;turn mouse pointer on | ||
| 293 | ; | ||
| 294 | MOV AX,COM_CURPUPF ;set last field as current | ||
| 295 | MOV COM_LASTF,AX | ||
| 296 | JMP SI10 ;poll for next keystroke | ||
| 297 | ; | ||
| 298 | ; Process Enter key | ||
| 299 | ; | ||
| 300 | SI50: CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed | ||
| 301 | JNE SI60 | ||
| 302 | ; | ||
| 303 | CMP COM_SCROPT,1 ;is this the multiple select opt? | ||
| 304 | JE SIEXIT ;yes, jump out of procedure | ||
| 305 | ; | ||
| 306 | MOV AX,COM_CURPUPF ;get current highlighted field | ||
| 307 | CALL FAR PTR GET_MOUSEF ;get mouse structure | ||
| 308 | ; | ||
| 309 | MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field | ||
| 310 | MOV COM_KEY,AX | ||
| 311 | MOV COM_MOK,0 ;set for keystroke input | ||
| 312 | JMP SIEXIT ;exit process_scroll | ||
| 313 | ; | ||
| 314 | ; if escape key, exit | ||
| 315 | ; | ||
| 316 | SI60: CMP BX,ES:[DI]+KY_CANCEL ;check if Escape pressed | ||
| 317 | JNE SI70 | ||
| 318 | ; | ||
| 319 | JMP SIEXIT | ||
| 320 | ; | ||
| 321 | ; if not multiple select, exit on number | ||
| 322 | ; | ||
| 323 | SI70: CMP COM_SCROPT,1 ;is this the multiple select opt? | ||
| 324 | JE SI90 ;yes, jump to check space bar | ||
| 325 | ; | ||
| 326 | CMP BX,'1' ;compare to a one | ||
| 327 | JB SI80 | ||
| 328 | ; | ||
| 329 | CMP BX,COM_CNT ;compare to number of entries | ||
| 330 | JBE SIEXIT | ||
| 331 | ; | ||
| 332 | SI80: JMP SI100 ;poll for next keystroke | ||
| 333 | ; | ||
| 334 | ; multiple select, exit on spacebar | ||
| 335 | ; | ||
| 336 | SI90: CMP BX,ES:[DI]+KY_SELECT ;was this the space bar? | ||
| 337 | JE SIEXIT ;yes, exit routine | ||
| 338 | ; | ||
| 339 | SI100: CALL FAR PTR PCMBEEP_CALL ;beep on unknown keystroke P*3940 | ||
| 340 | JMP SI10 ;poll for next keystroke | ||
| 341 | ; | ||
| 342 | ; Unhighlight field before exit | ||
| 343 | ; | ||
| 344 | SIEXIT: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off | ||
| 345 | MOV AX,COM_CURPUPF ;get last field | ||
| 346 | ; | ||
| 347 | CALL FAR PTR LOC_MOUSEF | ||
| 348 | CALL FAR PTR MOUSE_UNHIGH ;unhighlight field before exit | ||
| 349 | CALL FAR PTR MOUSE_ON ;turn mouse point on | ||
| 350 | ; | ||
| 351 | MOV COM_FLDT,0 ;no field type | ||
| 352 | ; | ||
| 353 | POP DS ;restore registers | ||
| 354 | POP SI | ||
| 355 | POP ES | ||
| 356 | POP DI | ||
| 357 | POP DX | ||
| 358 | POP CX | ||
| 359 | POP BX | ||
| 360 | POP AX | ||
| 361 | ; | ||
| 362 | RET | ||
| 363 | PROCESS_SCROLL ENDP | ||
| 364 | ; | ||
| 365 | PAGE | ||
| 366 | ;-----------------------------------------------------------------------------+ | ||
| 367 | ; : | ||
| 368 | ; Name: PROCESS_INPUT : | ||
| 369 | ; : | ||
| 370 | ; Description: Display input field contents relative to location of : | ||
| 371 | ; associated panel and optionally process keystroke : | ||
| 372 | ; before returning. : | ||
| 373 | ; : | ||
| 374 | ; Entry: COM_ICBID = Input field ID to process. : | ||
| 375 | ; COM_HCBID = Help ID assigned to input field. : | ||
| 376 | ; COM_INOPT 0= Display data entry : | ||
| 377 | ; 1= Do not display data entry (Password) : | ||
| 378 | ; : | ||
| 379 | ; Exit: ES:DI = Address of input field data : | ||
| 380 | ; CX = Length of data : | ||
| 381 | ; AX = Return key : | ||
| 382 | ; : | ||
| 383 | ; COM_MOK 0= Mouse input : | ||
| 384 | ; 1= Keyboard input : | ||
| 385 | ; COM_KEY = Keystroke (keyboard or mouse value) : | ||
| 386 | ; COM_ROW = Row of mouse pointer (text coordinates) : | ||
| 387 | ; COM_COL = Column of mouse pointer (text coord) : | ||
| 388 | ; COM_CURRF = Current mouse field ID : | ||
| 389 | ; COM_DELTA = Scroll bar delta from current top : | ||
| 390 | ; element displayed in panel : | ||
| 391 | ; : | ||
| 392 | ; : | ||
| 393 | ; Entry point: PROCESS_INPUT : | ||
| 394 | ; : | ||
| 395 | ; Notes: None. : | ||
| 396 | ; : | ||
| 397 | ; Internal references: GET_ICB = Get specified input control block. : | ||
| 398 | ; : | ||
| 399 | ; PCINPUT_CALL = Call to external CAS routine. : | ||
| 400 | ; : | ||
| 401 | ; External references: None. : | ||
| 402 | ; : | ||
| 403 | ;-----------------------------------------------------------------------------+ | ||
| 404 | ; | ||
| 405 | PROCESS_INPUT PROC FAR | ||
| 406 | ; | ||
| 407 | PUSH BX | ||
| 408 | PUSH DX | ||
| 409 | ; | ||
| 410 | ; initialize | ||
| 411 | ; | ||
| 412 | MOV COM_FLDT,1 ;input field | ||
| 413 | ; | ||
| 414 | MOV IN_CURNOR,0607H ;non-mono cursor size | ||
| 415 | ; | ||
| 416 | CMP GV_VIDMODE,7 ;check if mono mode | ||
| 417 | JNE PH03 | ||
| 418 | ; | ||
| 419 | MOV IN_CURNOR,0C0DH ;mono cursor size | ||
| 420 | ; | ||
| 421 | ; remove mouse pointer | ||
| 422 | ; | ||
| 423 | PH03: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off | ||
| 424 | ; | ||
| 425 | ; locate specified input control block | ||
| 426 | ; | ||
| 427 | MOV AX,COM_ICBID ;get PCINPUT field | ||
| 428 | MOV IN_ICBID,AX | ||
| 429 | CALL FAR PTR GET_ICB ;ES:DI points to ICB | ||
| 430 | ; | ||
| 431 | ; initialize, display and exit field | ||
| 432 | ; | ||
| 433 | AND ES:[DI]+ICB_OPT1,NOT ICB_PSW | ||
| 434 | ;deactivate password option | ||
| 435 | CMP COM_INOPT,0 ;check if password option is on | ||
| 436 | JE PH04 | ||
| 437 | ; | ||
| 438 | OR ES:[DI]+ICB_OPT1,ICB_PSW ;activate password option | ||
| 439 | ; | ||
| 440 | PH04: AND ES:[DI]+ICB_STATUS,NOT ICB_DONE | ||
| 441 | AND ES:[DI]+ICB_STATUS,NOT ICB_SINS | ||
| 442 | ; | ||
| 443 | MOV ES:[DI]+ICB_CURCHAR,1 | ||
| 444 | ; | ||
| 445 | PH05: OR ES:[DI]+ICB_OPT4,ICB_INIT | ||
| 446 | AND ES:[DI]+ICB_OPT3,NOT ICB_KEY | ||
| 447 | CALL FAR PTR PCINPUT_CALL ;initialize field | ||
| 448 | AND ES:[DI]+ICB_OPT4,NOT ICB_INIT | ||
| 449 | OR ES:[DI]+ICB_OPT3,ICB_KEY | ||
| 450 | ;remove initialization option | ||
| 451 | ; | ||
| 452 | ; Process field | ||
| 453 | ; | ||
| 454 | PH06: XOR AX,AX | ||
| 455 | OR ES:[DI]+ICB_OPT3,ICB_KEY | ||
| 456 | AND ES:[DI]+ICB_OPT4,NOT ICB_INIT | ||
| 457 | TEST ES:[DI]+ICB_OPT2,ICB_UPC ;check if monocasing option active | ||
| 458 | JE PH07 | ||
| 459 | ; | ||
| 460 | MOV AX,0000000000000001B ;set monocasing option on | ||
| 461 | ; | ||
| 462 | PH07: TEST IN_OPT,IN_UTRAN ;check if translation option actv | ||
| 463 | JE PH10 | ||
| 464 | ; | ||
| 465 | MOV AX,0000000000000010B ;set translation option on | ||
| 466 | ; | ||
| 467 | ; display mouse pointer | ||
| 468 | ; | ||
| 469 | PH10: CALL FAR PTR MOUSE_ON ;turn mouse pointer on | ||
| 470 | ; | ||
| 471 | ; Poll keyboard and mouse | ||
| 472 | ; | ||
| 473 | CALL FAR PTR PROCESS_KEY | ||
| 474 | MOV AX,COM_KEY ;get keystroke | ||
| 475 | ; | ||
| 476 | CMP COM_MOK, 0 ;mouse field? | ||
| 477 | JNE PH12 ;no, continue | ||
| 478 | CMP COM_RSTFLD, 0 ;restrict mouse field? | ||
| 479 | JE PH12 ;no, continue | ||
| 480 | CMP AH, 0 ;extended char? | ||
| 481 | JE PH12 ;no, continue | ||
| 482 | CMP AL,0 ;unrestricted extended char? | ||
| 483 | JE PH12 ;yes, continue | ||
| 484 | CMP AL, COM_RSTFLD ;mouse field in current set? | ||
| 485 | JNE PH11 ;no, return new field index | ||
| 486 | XOR AL, AL ;clear ID byte | ||
| 487 | comment | | ||
| 488 | cmp ah, rtarrow ; | ||
| 489 | jne ph1005 ; | ||
| 490 | mov es,in_icbseg ; | ||
| 491 | mov di,in_icboff ; | ||
| 492 | inc es:[di]+icb_hrstart ; | ||
| 493 | INC ES:[DI]+ICB_CURCHAR ; | ||
| 494 | AND ES:[DI]+ICB_OPT3,NOT ICB_KEY | ||
| 495 | OR ES:[DI]+ICB_OPT4,ICB_INIT | ||
| 496 | jmp ph12 ; | ||
| 497 | ph1005: cmp ah, lfarrow ; | ||
| 498 | jne ph12 ; | ||
| 499 | mov es,in_icbseg ; | ||
| 500 | mov di,in_icboff ; | ||
| 501 | dec es:[di]+icb_hrstart ; | ||
| 502 | DEC ES:[DI]+ICB_CURCHAR ; | ||
| 503 | AND ES:[DI]+ICB_OPT3,NOT ICB_KEY | ||
| 504 | OR ES:[DI]+ICB_OPT4,ICB_INIT | ||
| 505 | | | ||
| 506 | JMP PH12 ;continue | ||
| 507 | PH11: XOR AH, AH ;clear keystroke byte | ||
| 508 | ; | ||
| 509 | PH12: MOV COM_KEY, AX ;update keystroke | ||
| 510 | CALL FAR PTR MOUSE_OFF ; | ||
| 511 | ; | ||
| 512 | ; Pass keystroke to input field for processing | ||
| 513 | ; | ||
| 514 | PH50: MOV ES,IN_ICBSEG ;point to current ICB | ||
| 515 | MOV DI,IN_ICBOFF | ||
| 516 | MOV ES:[DI]+ICB_KS,AX ;set keystroke to ICB | ||
| 517 | ; | ||
| 518 | CALL FAR PTR PCINPUT_CALL ;process input field | ||
| 519 | ; | ||
| 520 | MOV ES,IN_ICBSEG ;point to current ICB | ||
| 521 | MOV DI,IN_ICBOFF | ||
| 522 | ; | ||
| 523 | MOV AX,ES:[DI]+ICB_KS ;return keystroke | ||
| 524 | ; | ||
| 525 | TEST ES:[DI]+ICB_STATUS,ICB_DONE | ||
| 526 | jne ph51 | ||
| 527 | jmp PH06 ;check for exit condition | ||
| 528 | ; | ||
| 529 | ph51: CALL FAR PTR MOUSE_ON ;turn mouse pointer on | ||
| 530 | CALL FAR PTR CURSOROFF ;turn hardware cursor off | ||
| 531 | MOV COM_FLDT,0 ;no field type | ||
| 532 | MOV COM_INOPT,0 ;no password option | ||
| 533 | ; | ||
| 534 | MOV DX,ES:[DI]+ICB_OPT4 ;get option word 4 | ||
| 535 | ; | ||
| 536 | PUSH ES:[DI]+ICB_ENDBYTE ;return length of data | ||
| 537 | PUSH ES:[DI]+ICB_FIELDOFF ;return offset of data | ||
| 538 | PUSH ES:[DI]+ICB_FIELDSEG ;return segment of data | ||
| 539 | ; | ||
| 540 | POP ES | ||
| 541 | POP DI | ||
| 542 | POP CX | ||
| 543 | ; | ||
| 544 | TEST DX,ICB_TRUN ;field is DOS pathname? | ||
| 545 | JZ PH60 ;no, continue | ||
| 546 | ; | ||
| 547 | MOV SI,DI ;save string offset | ||
| 548 | ADD DI,CX ;get end of string offset | ||
| 549 | MOV BYTE PTR ES:[DI],0 ;null-terminate pathname | ||
| 550 | MOV DI,SI ;restore string offset | ||
| 551 | ; | ||
| 552 | CALL TRUNC_NAME ;truncate DOS names & extensions | ||
| 553 | PUSH ES ;MJK005 | ||
| 554 | PUSH DI ;MJK005 | ||
| 555 | MOV ES,IN_ICBSEG ;point to current ICB ;MJK005 | ||
| 556 | MOV DI,IN_ICBOFF ;MJK005 | ||
| 557 | MOV ES:[DI]+ICB_ENDBYTE,CX ;return length of data ;MJK005 | ||
| 558 | POP DI ;MJK005 | ||
| 559 | POP ES ;MJK005 | ||
| 560 | ; | ||
| 561 | PH60: POP DX | ||
| 562 | POP BX | ||
| 563 | ; | ||
| 564 | RET | ||
| 565 | PROCESS_INPUT ENDP | ||
| 566 | ; | ||
| 567 | PAGE | ||
| 568 | ;-----------------------------------------------------------------------------+ | ||
| 569 | ; : | ||
| 570 | ; Name: PROCESS_KEY : | ||
| 571 | ; : | ||
| 572 | ; Description: Poll keyboard then mouse return only if action : | ||
| 573 | ; occurs. : | ||
| 574 | ; : | ||
| 575 | ; Entry: AX 0000000000000001 = Monocasing : | ||
| 576 | ; 0000000000000010 = Translation table : | ||
| 577 | ; : | ||
| 578 | ; COM_HLPOPT = set to 10 to deactivate help : | ||
| 579 | ; COM_HCBID = Help ID assigned to input field. : | ||
| 580 | ; : | ||
| 581 | ; Exit: COM_MOK 0= Mouse input : | ||
| 582 | ; 1= Keyboard input : | ||
| 583 | ; COM_KEY = Keystroke (keyboard or mouse value) : | ||
| 584 | ; COM_ROW = Row of mouse pointer (text coordinates) : | ||
| 585 | ; COM_COL = Column of mouse pointer (text coord) : | ||
| 586 | ; COM_CURRF = Current mouse field ID : | ||
| 587 | ; COM_DELTA = Scroll bar delta from current top : | ||
| 588 | ; element displayed in panel : | ||
| 589 | ; : | ||
| 590 | ; COM_FLDT 0= no field used to determine if : | ||
| 591 | ; 1= input field cursor should be displayed : | ||
| 592 | ; 2= scroll field : | ||
| 593 | ; : | ||
| 594 | ; Entry point: PROCESS_KEY : | ||
| 595 | ; : | ||
| 596 | ; Notes: None. : | ||
| 597 | ; : | ||
| 598 | ; Internal references: PCTRACK_CALL = Call to external CAS routine. : | ||
| 599 | ; PCINPUT_CALL = Call to external CAS routine. : | ||
| 600 | ; : | ||
| 601 | ; External references: None. : | ||
| 602 | ; : | ||
| 603 | ;-----------------------------------------------------------------------------+ | ||
| 604 | ; | ||
| 605 | PROCESS_KEY PROC FAR | ||
| 606 | ; | ||
| 607 | PUSH AX ;save registers | ||
| 608 | PUSH BX | ||
| 609 | PUSH CX | ||
| 610 | PUSH DX | ||
| 611 | ; | ||
| 612 | MOV INC_KS,0 ;initialize to no keystroke | ||
| 613 | MOV INC_OPT,0 | ||
| 614 | ; | ||
| 615 | TEST AX,0000000000000001B ;check if monocasing | ||
| 616 | JE PK05 | ||
| 617 | ; | ||
| 618 | OR INC_OPT,INC_AMONO ;initialize to monocasing | ||
| 619 | CMP IN_MONOSEG,0 ;monocasing table gotten? P5197 | ||
| 620 | JNE PK02 ;yes, don't get again P5197 | ||
| 621 | CALL GET_MONO_DOS ;get DOS monocasing table P5197 | ||
| 622 | PK02: ; P5197 | ||
| 623 | MOV BX,IN_MONOOFF ;get from PCINPUT control block | ||
| 624 | MOV INC_MONOOFF,BX ;set in PCINCHA control block | ||
| 625 | MOV BX,IN_MONOSEG ;get from PCINPUT control block | ||
| 626 | MOV INC_MONOSEG,BX ;set in PCINCHA control block | ||
| 627 | ; | ||
| 628 | PK05: TEST AX,0000000000000010B ;check if translation table | ||
| 629 | JE PK10 | ||
| 630 | ; | ||
| 631 | OR INC_OPT,INC_UTRAN ;initialize for translation table | ||
| 632 | ; | ||
| 633 | ; Poll keyboard for input | ||
| 634 | ; | ||
| 635 | PK10: MOV KS_CHAR,0 ;clear out P*4663 | ||
| 636 | TEST COM_PROCFLAG,COM_KPLOCK ;keyboard locked? P*4457 | ||
| 637 | JZ PK17 ;no, get keystroke P*4457 | ||
| 638 | IN AL,64H ;get keyboard lock bit P*4457 | ||
| 639 | TEST AL,10H ;is keyboard locked? P*4457 | ||
| 640 | JNZ PK15 ;OK, keyboard not locked P*4457 | ||
| 641 | JMP PK40 ;check time/date P*4457 | ||
| 642 | PK15: | ||
| 643 | CALL INIT_MOUSE ;initialize mouse P*4457 | ||
| 644 | CALL MOUSE_ON ;turn on mouse P*4457 | ||
| 645 | PK17: ; P*4457 | ||
| 646 | |||
| 647 | |||
| 648 | MOV AH,1 ;keystroke status MJK013 | ||
| 649 | TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732 | ||
| 650 | JZ PK17_05 ;no, get normal keystroke P*4732 | ||
| 651 | MOV AH,11H ;get extended keystroke P*4732 | ||
| 652 | PK17_05: ; P*4732 | ||
| 653 | INT 16H ;is there any keystrokes? MJK013 | ||
| 654 | JZ PK17_10 ;don't save keystroke P*4663 | ||
| 655 | MOV KS_CHAR,AX ;save the keystroke MJK013 | ||
| 656 | PK17_10: ; P*4663 | ||
| 657 | ; | ||
| 658 | CALL PCINCHA_CALL ;call CAS routine | ||
| 659 | ; | ||
| 660 | CMP INC_KS,0 ;check if keystroke returned | ||
| 661 | JE PK20 ;yes, pass to input field | ||
| 662 | ; | ||
| 663 | CMP INC_KS, 0003H ;ctrl/c or ctrl/break? P*4663 | ||
| 664 | JNE PK18 ;no, continue P*4663 | ||
| 665 | MOV AX, KS_CHAR ;get status keystroke P*4663 | ||
| 666 | CMP AL, 03H ;same ASCII character? P*4663 | ||
| 667 | JE PK19 ;yes, must be ctrl/c P*4663 | ||
| 668 | MOV INC_KS, 0 ;ignore ctrl/break P*4663 | ||
| 669 | JMP PK40 ;continue P*4663 | ||
| 670 | PK18: ; p*4663 | ||
| 671 | |||
| 672 | CMP INC_KS, 6800H ;keystroke is alt-f1? | ||
| 673 | |||
| 674 | JNE PK19 ;no, continue | ||
| 675 | MOV INC_KS, 8500H ;translate to f11 | ||
| 676 | ; | ||
| 677 | PK19: CALL CHK_OVERRUN ;check for overrun keystrokes | ||
| 678 | ; | ||
| 679 | MOV COM_MOK,1 ;set to indicate keyboard | ||
| 680 | XOR AX,AX ;clear to zero | ||
| 681 | MOV COM_ROW,AX ; pointer row | ||
| 682 | MOV COM_COL,AX ; pointer column | ||
| 683 | MOV COM_DELTA,AX ; scroll bar delta | ||
| 684 | MOV AX,INC_KS ;set keystroke from keyboard | ||
| 685 | MOV COM_KEY,AX | ||
| 686 | ; | ||
| 687 | MOV AX,COM_CURRF ;sav field ID before help process | ||
| 688 | MOV COM_HELPF,AX | ||
| 689 | ; | ||
| 690 | JMP PK30 | ||
| 691 | ; | ||
| 692 | ; Poll mouse for action | ||
| 693 | ; | ||
| 694 | PK20: TEST COM_STATE,COM_MOUS ;check if mouse configured | ||
| 695 | JNE PK22 ; do call if no | ||
| 696 | JMP PK40 ; skip call if yes | ||
| 697 | ; | ||
| 698 | PK22: LEA DI,GEN_DATA ;check mouse for button press | ||
| 699 | MOV [DI]+M_FUNC,M_GET | ||
| 700 | CALL FAR PTR PCTRACK_CALL | ||
| 701 | ; | ||
| 702 | XOR CH,CH ;clear to zero | ||
| 703 | XOR DH,DH ;clear to zero | ||
| 704 | MOV CL,[DI]+M_GETBUT ;get button pressed | ||
| 705 | MOV DL,[DI]+M_GETFIELD ;get field of current pointer | ||
| 706 | ; | ||
| 707 | CMP CL, 2 ;process keystroke | ||
| 708 | JNE PK24X | ||
| 709 | ; | ||
| 710 | TEST COM_STATE2,COM_ENHA | ||
| 711 | JZ PK24X | ||
| 712 | ; | ||
| 713 | MOV COM_BUT2,1 | ||
| 714 | MOV CL, 1 | ||
| 715 | JMP PK24 | ||
| 716 | ; | ||
| 717 | PK24X: MOV COM_BUT2,0 | ||
| 718 | CMP CL,1 ;mouse configuration | ||
| 719 | JE PK24 ; 0= no button pressed | ||
| 720 | ; | ||
| 721 | CMP CL,4 ; 1= button 1 pressed | ||
| 722 | JE PK24 ; 2= button 2 pressed | ||
| 723 | ; 3= button 3 pressed | ||
| 724 | ; 4= double click button 1 | ||
| 725 | JMP PK40 | ||
| 726 | ; | ||
| 727 | PK24: OR DL,DL ;check if pointer in active field | ||
| 728 | JNZ PK26 ; when button pressed, if not | ||
| 729 | JMP PK40 ; poll again | ||
| 730 | ; | ||
| 731 | PK26: CMP GE_MODEL,MODEL_AT ;check if AT | ||
| 732 | JNE PK29 | ||
| 733 | ; | ||
| 734 | CMP GE_SUBMODEL,SUBMD_AT ;make sure AT | ||
| 735 | JE PK28 | ||
| 736 | ; | ||
| 737 | CMP GE_SUBMODEL,SUBMD_AS ;make sure AT/skyrocket | ||
| 738 | JNE PK29 | ||
| 739 | ; | ||
| 740 | PK28: CALL KEYLOCK ;check if keyboard on AT is | ||
| 741 | JNZ PK29 | ||
| 742 | ; | ||
| 743 | JMP PK40 ; locked, poll again | ||
| 744 | ; | ||
| 745 | PK29: MOV COM_MOK,0 ;set to indicate mouse | ||
| 746 | MOV AX,COM_CURRF ;sav field ID before help process | ||
| 747 | MOV COM_HELPF,AX | ||
| 748 | MOV COM_CURRF,DX ;set current field number | ||
| 749 | MOV AX,[DI]+M_GETROW ;get mouse pointer row where | ||
| 750 | MOV COM_ROW,AX ; button was pressed | ||
| 751 | MOV AX,[DI]+M_GETCOL ;get mouse pointer column where | ||
| 752 | MOV COM_COL,AX ; button was pressed | ||
| 753 | MOV AX,[DI]+M_GETFKEY ;get keystroke assigned to field | ||
| 754 | MOV COM_KEY,AX | ||
| 755 | ; | ||
| 756 | MOV AX,[DI]+M_GETDELTA ;scroll delta (if in sb field) | ||
| 757 | MOV COM_DELTA,AX | ||
| 758 | XOR CX,CX | ||
| 759 | MOV AX,[DI]+M_GETSPOS ;text row/col position in bar | ||
| 760 | MOV COM_POSITION,AX | ||
| 761 | ; | ||
| 762 | ; Check for help option before exit | ||
| 763 | ; | ||
| 764 | PK30: CMP COM_HLPOPT,10 ;check if help deactivated | ||
| 765 | JE PKEXIT ;exit | ||
| 766 | ; | ||
| 767 | MOV AX,STR_TOTAL ;get keystroke structure | ||
| 768 | CALL FAR PTR GET_STRING ;structure at ES:DI | ||
| 769 | ; | ||
| 770 | MOV AX,COM_KEY ;get keystroke | ||
| 771 | CMP AX,ES:[DI]+KY_CHELP | ||
| 772 | JNE PKEXIT | ||
| 773 | ; | ||
| 774 | CALL FAR PTR CURSOROFF ;turn hardware cursor off | ||
| 775 | PUSH COM_HELPF ;save field ID before help process | ||
| 776 | CALL MANAGE_HELP ;process all types of help | ||
| 777 | POP COM_CURRF ;reset original field ID before hl | ||
| 778 | ; | ||
| 779 | CMP COM_FLDT,1 ;redisplay cursor if input field | ||
| 780 | JNE PK40 | ||
| 781 | ; | ||
| 782 | CALL FAR PTR CURSORON ;turn hardware cursor on | ||
| 783 | ; | ||
| 784 | ; Check if date and time should be updated. | ||
| 785 | ; | ||
| 786 | PK40: CALL DISP_DATETIME ;update date/time | ||
| 787 | JMP PK10 | ||
| 788 | ; | ||
| 789 | ; Exit | ||
| 790 | ; | ||
| 791 | PKEXIT: PUSH ES | ||
| 792 | PUSH DI | ||
| 793 | MOV AX, 40H | ||
| 794 | MOV ES, AX | ||
| 795 | MOV BX, 17H | ||
| 796 | MOV AL, ES:[BX] | ||
| 797 | XOR AH, AH | ||
| 798 | MOV COM_SHIFT, AX | ||
| 799 | POP DI | ||
| 800 | POP ES | ||
| 801 | ; | ||
| 802 | POP DX ;exit | ||
| 803 | POP CX | ||
| 804 | POP BX | ||
| 805 | POP AX | ||
| 806 | ; | ||
| 807 | RET | ||
| 808 | PROCESS_KEY ENDP | ||
| 809 | ; | ||
| 810 | PAGE | ||
| 811 | ;-----------------------------------------------------------------------------+ | ||
| 812 | ; P5197 : | ||
| 813 | ; GET_MONO_DOS : | ||
| 814 | ; Get segment and offset of the DOS monocasing table and return it : | ||
| 815 | ; : | ||
| 816 | ; Entry: None : | ||
| 817 | ; : | ||
| 818 | ; Exit: None : | ||
| 819 | ; P5197 : | ||
| 820 | ;-----------------------------------------------------------------------------+ | ||
| 821 | GET_MONO_DOS PROC NEAR | ||
| 822 | ; | ||
| 823 | PUSH ES ; P5197 | ||
| 824 | PUSH DI ; P5197 | ||
| 825 | PUSH AX ; P5197 | ||
| 826 | ; | ||
| 827 | MOV AH,65H ;extended country info P5197 | ||
| 828 | MOV AL,04H ;get uppercase table ptrs P5197 | ||
| 829 | MOV BX,-1 ;default code page P5197 | ||
| 830 | MOV DX,-1 ;default country id P5197 | ||
| 831 | MOV CX,05H ;# bytes returned P5197 | ||
| 832 | PUSH DS | ||
| 833 | POP ES ;ES:DI ptrs to return buf P5197 | ||
| 834 | MOV DI,OFFSET TEMP_WKA ;use as temp buffer P5197 | ||
| 835 | INT 21H | ||
| 836 | JC GET_MONO_RET | ||
| 837 | ; | ||
| 838 | INC DI ;skip info id P5197 | ||
| 839 | ; | ||
| 840 | MOV AX,WORD PTR [DI] ;get DOS mono table offset P5197 | ||
| 841 | MOV IN_MONOOFF,AX ;save it P5197 | ||
| 842 | ADD DI,2 | ||
| 843 | MOV AX,WORD PTR [DI] ;get DOS mono table seg P5197 | ||
| 844 | MOV IN_MONOSEG,AX ;save it P5197 | ||
| 845 | ; | ||
| 846 | GET_MONO_RET: | ||
| 847 | POP AX ; P5197 | ||
| 848 | POP DI ;restore registers P5197 | ||
| 849 | POP ES ; P5197 | ||
| 850 | ; | ||
| 851 | RET ; P5197 | ||
| 852 | GET_MONO_DOS ENDP | ||
| 853 | ; | ||
| 854 | PAGE | ||
| 855 | ;-----------------------------------------------------------------------------+ | ||
| 856 | ; : | ||
| 857 | ; Name: CHK_OVERRUN : | ||
| 858 | ; : | ||
| 859 | ; Description: Check for multiple entries of cursor keys to : | ||
| 860 | ; eliminate overrun in typeamatic mode. : | ||
| 861 | ; : | ||
| 862 | ; Entry: INC_KS = Key stroke : | ||
| 863 | ; : | ||
| 864 | ; Exit: INC_KS = Returned keystroke : | ||
| 865 | ; : | ||
| 866 | ; Entry point: CHK_OVERRUN : | ||
| 867 | ; : | ||
| 868 | ; Notes: Duplicate cursor keystrokes are removed. : | ||
| 869 | ; : | ||
| 870 | ; Internal references: PCINCHA_CALL = Call to external CAS routine. : | ||
| 871 | ; : | ||
| 872 | ; External references: None. : | ||
| 873 | ; : | ||
| 874 | ;-----------------------------------------------------------------------------+ | ||
| 875 | ; | ||
| 876 | CHK_OVERRUN PROC NEAR | ||
| 877 | ; | ||
| 878 | PUSH CX | ||
| 879 | PUSH DI | ||
| 880 | PUSH ES | ||
| 881 | ; | ||
| 882 | MOV CX,KS_TABLE_LEN ;len of cursor keystroke table | ||
| 883 | ROR CX,1 ;set number of entries | ||
| 884 | MOV AX,DS ;get segment of table | ||
| 885 | MOV ES,AX ;set segment of table | ||
| 886 | MOV DI,OFFSET KS_TABLE ;offset of table | ||
| 887 | MOV AX,INC_KS ;current keystroke | ||
| 888 | CLD | ||
| 889 | REPNZ SCASW ;scan table for keystroke match | ||
| 890 | JNZ CHK_OVRET ;no match found | ||
| 891 | ; | ||
| 892 | CHK_OV10: MOV AH,1 ;keystroke status | ||
| 893 | TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732 | ||
| 894 | JZ CHK_OV20 ;no, get normal keystroke P*4732 | ||
| 895 | MOV AH,11H ;get extended keystroke P*4732 | ||
| 896 | CHK_OV20: ; P*4732 | ||
| 897 | INT 16H ;check for next keystroke | ||
| 898 | JZ CHK_OVRET ;no, keystroke available | ||
| 899 | ; | ||
| 900 | CMP AX,KS_CHAR ;is it the same as before MJK013 | ||
| 901 | JNE CHK_OVRET ;no, return | ||
| 902 | ; | ||
| 903 | MOV AH,0 ;keystroke read | ||
| 904 | TEST COM_PROCFLAG,COM_EXTKEYB ;extended keyboard? P*4732 | ||
| 905 | JZ CHK_OV30 ;no, get normal keystroke P*4732 | ||
| 906 | MOV AH,10H ;get extended keystroke P*4732 | ||
| 907 | CHK_OV30: ; P*4732 | ||
| 908 | INT 16H ;remove it | ||
| 909 | JMP CHK_OV10 ;check next keystroke | ||
| 910 | ; | ||
| 911 | CHK_OVRET: POP ES | ||
| 912 | POP DI | ||
| 913 | POP CX | ||
| 914 | ; | ||
| 915 | RET | ||
| 916 | CHK_OVERRUN ENDP | ||
| 917 | ; | ||
| 918 | PAGE | ||
| 919 | ;-----------------------------------------------------------------------------+ | ||
| 920 | ; : | ||
| 921 | ; Name: DISP_DATETIME : | ||
| 922 | ; : | ||
| 923 | ; Description: display the date and time on the display. : | ||
| 924 | ; : | ||
| 925 | ; Entry: COM_STATE2: : | ||
| 926 | ; COM_DATE = O - no date displayed : | ||
| 927 | ; 1 - display date and time : | ||
| 928 | ; : | ||
| 929 | ; Exit: Display updated : | ||
| 930 | ; : | ||
| 931 | ; Entry point: DISP_DATETIME : | ||
| 932 | ; : | ||
| 933 | ; Notes: None. : | ||
| 934 | ; : | ||
| 935 | ; Internal references: UPDATE_DISPLAY : | ||
| 936 | ; MOUSE_OFF : | ||
| 937 | ; MOUSE_ON : | ||
| 938 | ; : | ||
| 939 | ; External references: PCDATES_CALL = Call to external CAS routine. : | ||
| 940 | ; PCTIMES_CALL = Call to external CAS routine. : | ||
| 941 | ; : | ||
| 942 | ;-----------------------------------------------------------------------------+ | ||
| 943 | ; | ||
| 944 | DISP_DATETIME PROC NEAR | ||
| 945 | ; | ||
| 946 | PUSH AX ;save registers | ||
| 947 | PUSH BX | ||
| 948 | PUSH CX | ||
| 949 | PUSH DX | ||
| 950 | PUSH SI | ||
| 951 | PUSH DI | ||
| 952 | PUSH ES | ||
| 953 | ; | ||
| 954 | TEST COM_STATE2,COM_DATE ;is the date option active? | ||
| 955 | JNZ DT_02 ;yes, continue | ||
| 956 | JMP DT_RET ;return | ||
| 957 | ; | ||
| 958 | ; Set up to get the date and time. | ||
| 959 | ; | ||
| 960 | DT_02: MOV DI,OFFSET TIME_WKA ;time workarea | ||
| 961 | MOV BX,DS:[DI+4] ;save currect seconds | ||
| 962 | ; | ||
| 963 | CALL PCDATES_CALL ;get date | ||
| 964 | ; | ||
| 965 | CALL PCTIMES_CALL ;get time | ||
| 966 | ; | ||
| 967 | TEST COM_PROCFLAG,COM_NODATE ;should date not be displayed? | ||
| 968 | JNZ DT_RET ;yes, return | ||
| 969 | ; | ||
| 970 | TEST COM_PROCFLAG,COM_PSCEXEC ;has PSC ended execution? | ||
| 971 | JZ DT_05 ;no, continue | ||
| 972 | ; | ||
| 973 | AND COM_PROCFLAG,NOT COM_PSCEXEC ;reset PSC ended execution | ||
| 974 | JMP DT_20 ;display time/date | ||
| 975 | |||
| 976 | DT_05: MOV AX,COM_BASESCR ;get base screen | ||
| 977 | CMP AX,COM_BASE_WKA ;has it changed? | ||
| 978 | JE DT_10 ;no, see if time has changed | ||
| 979 | ; | ||
| 980 | MOV COM_BASE_WKA,AX ;save new base screen | ||
| 981 | JMP DT_20 ;continue | ||
| 982 | ; | ||
| 983 | DT_10: CMP BX,DS:[DI+4] ;has the time minutes changed? | ||
| 984 | JE DT_RET ;no, don't update it | ||
| 985 | ; | ||
| 986 | DT_20: MOV SI,PAN_ATITLE ;get panel id for moveg | ||
| 987 | MOV AX,1 ;row to display | ||
| 988 | MOV BX,3 ;column to display | ||
| 989 | MOV CX,LENGTH DATE_WKA ;len of date | ||
| 990 | MOV DX,OFFSET DATE_WKA | ||
| 991 | PUSH DS | ||
| 992 | POP ES | ||
| 993 | ; | ||
| 994 | CALL FAR PTR MOUSE_OFF ;turn mouse off | ||
| 995 | ; | ||
| 996 | PUSH AX ; | ||
| 997 | MOV AX, PAN_ATITLE ;set panel id | ||
| 998 | CALL FAR PTR GET_ATTR ;get color attr | ||
| 999 | AND AH, 0F0H ;mask off foreground | ||
| 1000 | CMP AH, 0F0H ;background is white? | ||
| 1001 | POP AX ; | ||
| 1002 | JNE DT_28 ;no, continue | ||
| 1003 | MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 | ||
| 1004 | DT_28: | ||
| 1005 | |||
| 1006 | ; CMP GV_VIDMODE,11H ;mode 11? P*4816 | ||
| 1007 | ; JNE DT_30 ;no, don't underline P*4816 | ||
| 1008 | ; MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 | ||
| 1009 | |||
| 1010 | |||
| 1011 | DT_30: ; P*4816 | ||
| 1012 | CALL UPDATE_DISPLAY ;display date | ||
| 1013 | ; | ||
| 1014 | MOV BX,69 ;column to display | ||
| 1015 | MOV CX,LENGTH TIME_WKA ;len of time | ||
| 1016 | MOV DX,OFFSET TIME_WKA | ||
| 1017 | ; | ||
| 1018 | PUSH AX ; | ||
| 1019 | MOV AX, PAN_ATITLE ;set panel id | ||
| 1020 | CALL FAR PTR GET_ATTR ;get color attr | ||
| 1021 | AND AH, 0F0H ;mask off foreground | ||
| 1022 | CMP AH, 0F0H ;background is white? | ||
| 1023 | POP AX ; | ||
| 1024 | JNE DT_38 ;no, continue | ||
| 1025 | MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 | ||
| 1026 | DT_38: | ||
| 1027 | |||
| 1028 | |||
| 1029 | ; CMP GV_VIDMODE,11H ;mode 11? P*4816 | ||
| 1030 | ; JNE DT_40 ;no, don't underline P*4816 | ||
| 1031 | ; MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816 | ||
| 1032 | DT_40: ; P*4816 | ||
| 1033 | CALL UPDATE_DISPLAY ;display time | ||
| 1034 | ; | ||
| 1035 | CALL FAR PTR MOUSE_ON ;turn mouse on | ||
| 1036 | ; | ||
| 1037 | DT_RET: POP ES ;restore registers | ||
| 1038 | POP DI | ||
| 1039 | POP SI | ||
| 1040 | POP DX | ||
| 1041 | POP CX | ||
| 1042 | POP BX | ||
| 1043 | POP AX | ||
| 1044 | ; | ||
| 1045 | RET | ||
| 1046 | DISP_DATETIME ENDP | ||
| 1047 | ; | ||
| 1048 | PAGE | ||
| 1049 | ;-----------------------------------------------------------------------------+ | ||
| 1050 | ; : | ||
| 1051 | ; Name: KEYLOCK : | ||
| 1052 | ; : | ||
| 1053 | ; Description: Determine if AT keyboard lock is on. : | ||
| 1054 | ; : | ||
| 1055 | ; Entry: None. : | ||
| 1056 | ; : | ||
| 1057 | ; Exit: ZF = 1 : keyboard is locked : | ||
| 1058 | ; ZF = 0 : keyboard is unlocked : | ||
| 1059 | ; : | ||
| 1060 | ; Entry point: KEYLOCK : | ||
| 1061 | ; : | ||
| 1062 | ; Notes: None. : | ||
| 1063 | ; : | ||
| 1064 | ; Internal references: None. : | ||
| 1065 | ; : | ||
| 1066 | ; External references: None. : | ||
| 1067 | ; : | ||
| 1068 | ;-----------------------------------------------------------------------------+ | ||
| 1069 | ; | ||
| 1070 | KEYLOCK PROC NEAR | ||
| 1071 | ; | ||
| 1072 | PUSH BX | ||
| 1073 | PUSH CX | ||
| 1074 | ; | ||
| 1075 | CLI ;disable ints while checking kybd | ||
| 1076 | MOV AL,READ_KBD_INPT ;get kybd read input command | ||
| 1077 | OUT STATUS_PORT,AL ;issue the command | ||
| 1078 | SUB CX,CX ;cls controller count cmd issue | ||
| 1079 | ; | ||
| 1080 | KEYLOCK10: IN AL,STATUS_PORT | ||
| 1081 | TEST AL,INPT_BUF_FULL | ||
| 1082 | LOOPNZ KEYLOCK10 ;wait for command to be accepted | ||
| 1083 | JNZ KEYLOCK50 ;exit if command not accepted | ||
| 1084 | ; | ||
| 1085 | SUB CX,CX | ||
| 1086 | MOV BL,6 | ||
| 1087 | ; | ||
| 1088 | KEYLOCK20: IN AL,STATUS_PORT | ||
| 1089 | TEST AL,OUTPT_BUF_FULL | ||
| 1090 | JNZ KEYLOCK30 ;branch if OBF | ||
| 1091 | ; | ||
| 1092 | LOOP KEYLOCK20 ;loop until response or timeout | ||
| 1093 | DEC BL ;timeout loop attempted six times | ||
| 1094 | JNZ KEYLOCK20 | ||
| 1095 | ; | ||
| 1096 | INC BL ;set ZF = 0 if no response | ||
| 1097 | JMP KEYLOCK50 | ||
| 1098 | ; | ||
| 1099 | KEYLOCK30: IN AL,INPUT_PORT ;read keyboard input port | ||
| 1100 | TEST AL,KYBD_INH ;test to see if kybd lock is on | ||
| 1101 | ; | ||
| 1102 | KEYLOCK50: | ||
| 1103 | ; | ||
| 1104 | KEYLOCK60: STI ;enable ints | ||
| 1105 | POP CX ;restore regs | ||
| 1106 | POP BX | ||
| 1107 | ; | ||
| 1108 | RET ;Exit | ||
| 1109 | KEYLOCK ENDP | ||
| 1110 | ; | ||
| 1111 | PAGE | ||
| 1112 | ;-----------------------------------------------------------------------------+ | ||
| 1113 | ; : | ||
| 1114 | ; Name: COMMAND_LINE : | ||
| 1115 | ; : | ||
| 1116 | ; Description: Command line dialog. : | ||
| 1117 | ; : | ||
| 1118 | ; Entry: COM_OLDCBKOFF = offset of original crtl+break : | ||
| 1119 | ; COM_OLDCBKSEG = segment of original crtl+break : | ||
| 1120 | ; COM_CMDBUF = required to invoke COMMAND.COM : | ||
| 1121 | ; COM_CMDINPBUF = command line input buffer : | ||
| 1122 | ; COM_CMDINPLEN = length of command line input buf : | ||
| 1123 | ; COM_CMDBUFLEN = length including '/C' : | ||
| 1124 | ; COM_CMDDRIVE = current drive and path to display : | ||
| 1125 | ; COM_CMDPATH for command line input prompt : | ||
| 1126 | ; KY_COMDLINE = command line Shift + F9 : | ||
| 1127 | ; KY_LASTCOMD = last command up arrow : | ||
| 1128 | ; KY_NEXTCOMD = next command dn arrow : | ||
| 1129 | ; Exit: : | ||
| 1130 | ; : | ||
| 1131 | ; Entry point: COMMAND_LINE : | ||
| 1132 | ; : | ||
| 1133 | ; Notes: Changed procedure to use a COMMAND.COM PSC execution. : | ||
| 1134 | ; : | ||
| 1135 | ; Internal references: PCTRACK_CALL : | ||
| 1136 | ; : | ||
| 1137 | ; External references: INT 21H AH=40H Write string to standard output. : | ||
| 1138 | ; INT 21H AH=25H Set interrupt vector address. : | ||
| 1139 | ; INT 21H AH=35H Get interrupt vector address. : | ||
| 1140 | ; INT 21H AH=49H Deallocate memory. : | ||
| 1141 | ; INT 21H AH=47H Read current directory. : | ||
| 1142 | ; INT 21H AH=19H Read current disk. : | ||
| 1143 | ; INT 21H AH=06H Write char to standard output. : | ||
| 1144 | ; INT 21H AH=4BH EXEC command line. : | ||
| 1145 | ; : | ||
| 1146 | ;-----------------------------------------------------------------------------+ | ||
| 1147 | ; | ||
| 1148 | COMMAND_LINE PROC FAR | ||
| 1149 | |||
| 1150 | TEST COM_STATE,COM_FLCL ;check if command line active | ||
| 1151 | JNE MC10 | ||
| 1152 | ; | ||
| 1153 | CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR | ||
| 1154 | JMP MCEXIT ;exit | ||
| 1155 | ; | ||
| 1156 | ; save registers | ||
| 1157 | ; | ||
| 1158 | MC10: CALL FAR PTR REMOVE_OLDPD ;remove last pull down panel | ||
| 1159 | MOV COM_CURPD,0 | ||
| 1160 | ; | ||
| 1161 | PUSH AX | ||
| 1162 | PUSH BX | ||
| 1163 | PUSH CX | ||
| 1164 | PUSH DX | ||
| 1165 | PUSH BP | ||
| 1166 | PUSH SI | ||
| 1167 | PUSH DI | ||
| 1168 | ; | ||
| 1169 | ; disable mouse tracker | ||
| 1170 | ; | ||
| 1171 | CALL FAR PTR MOUSE_OFF ;turn mouse pointer off | ||
| 1172 | CALL FAR PTR DEL_MOUSEF ;delete all mouse fields | ||
| 1173 | CALL FAR PTR MOUSE_DIS ;disable mouse support | ||
| 1174 | ; | ||
| 1175 | ; Set current directory path | ||
| 1176 | ; | ||
| 1177 | CMP COM_CDIALOG,COM_APPMENU ;check if program menu dialog | ||
| 1178 | JNE MC20 ; don't ask for dir from DOS Serv | ||
| 1179 | ; | ||
| 1180 | JMP MC30 | ||
| 1181 | ; | ||
| 1182 | MC20: CMP COM_CDIALOG,COM_PAAB ;check if program menu dialog | ||
| 1183 | JE MC30 ; don't ask for dir from DOS Serv | ||
| 1184 | ; | ||
| 1185 | CMP COM_CDIALOG,COM_DCLR ;check if program menu dialog | ||
| 1186 | JE MC30 ; don't ask for dir from DOS Serv | ||
| 1187 | ; | ||
| 1188 | XOR AX,AX ;get current selected directory | ||
| 1189 | MOV AX,1 ;get current selected dir ;P*4245 | ||
| 1190 | CALL RETURN_PATH ; in DOS services | ||
| 1191 | ; | ||
| 1192 | MOV BX,OFFSET FULLSPEC ;file name | ||
| 1193 | MOV DL,DS:BYTE PTR[BX] ;drive id | ||
| 1194 | CALL SET_DRIVE ;set to the drive | ||
| 1195 | ; | ||
| 1196 | PUSH DI | ||
| 1197 | MOV AH,0EH ;change to selected drive | ||
| 1198 | MOV DX,DATA | ||
| 1199 | MOV DS,DX | ||
| 1200 | LEA DI,FULLSPEC | ||
| 1201 | MOV DL,[DI] | ||
| 1202 | SUB DL,'A' | ||
| 1203 | INT 21H | ||
| 1204 | POP DI | ||
| 1205 | ; | ||
| 1206 | MOV AH,3BH ;change to selected directory | ||
| 1207 | MOV DX,DATA | ||
| 1208 | MOV DS,DX | ||
| 1209 | LEA DX,FULLSPEC | ||
| 1210 | INT 21H | ||
| 1211 | ; | ||
| 1212 | ; Move in COMSPEC to PSC workarea for new COMMAND.COM PSC execution. | ||
| 1213 | ; | ||
| 1214 | MC30: MOV SI,OFFSET COM_PFILSPEC ;COMSPEC location | ||
| 1215 | ; | ||
| 1216 | mov dl, byte ptr [si] ;get drive letter of comspec | ||
| 1217 | call set_drive ;set logical drive | ||
| 1218 | ; | ||
| 1219 | MOV DI,OFFSET PEC_COM ;PSC workarea location | ||
| 1220 | MOV PEC_BYTE,0 ;clear length | ||
| 1221 | ; | ||
| 1222 | MC40: MOV AL,DS:BYTE PTR [SI] ;get character | ||
| 1223 | CMP AL,0 ;end of string? | ||
| 1224 | JE MC50 ;yes, add parm sep char | ||
| 1225 | ; | ||
| 1226 | MOV DS:BYTE PTR [DI],AL ;put character in PSC workarea | ||
| 1227 | INC PEC_BYTE ;adjust length | ||
| 1228 | INC SI ;point to next COMSPEC char | ||
| 1229 | INC DI ;point to next PSC position | ||
| 1230 | JMP MC40 ;get next character | ||
| 1231 | ; | ||
| 1232 | MC50: MOV DS:BYTE PTR [DI],PEC_SEP ;set parameter seperator char | ||
| 1233 | INC PEC_BYTE ;adjust length | ||
| 1234 | PUSH DS | ||
| 1235 | POP ES ;set segment of PSC workarea | ||
| 1236 | MOV DI,OFFSET PEC_TITLE ;set offset of PSC workarea | ||
| 1237 | |||
| 1238 | OR COM_PROCFLAG,COM_CMDPSC ;set COMMAND.COM PSC exec P*3748 | ||
| 1239 | CALL FAR PTR PROCESS_PSC ;set up to process PSC | ||
| 1240 | ; | ||
| 1241 | POP DI ;restore registers | ||
| 1242 | POP SI | ||
| 1243 | POP BP | ||
| 1244 | POP DX | ||
| 1245 | POP CX | ||
| 1246 | POP BX | ||
| 1247 | POP AX | ||
| 1248 | ; | ||
| 1249 | MCEXIT: | ||
| 1250 | ; | ||
| 1251 | RET | ||
| 1252 | COMMAND_LINE ENDP | ||
| 1253 | ; | ||
| 1254 | PAGE | ||
| 1255 | ;-----------------------------------------------------------------------------+ | ||
| 1256 | ; : | ||
| 1257 | ; SET_DRIVE : | ||
| 1258 | ; : | ||
| 1259 | ; On a single drive system, set the logical to the physical drive. : | ||
| 1260 | ; : | ||
| 1261 | ; Entry: DL - Drive letter : | ||
| 1262 | ; : | ||
| 1263 | ; Exit: Logical drive set : | ||
| 1264 | ; : | ||
| 1265 | ; Notes: None : | ||
| 1266 | ; : | ||
| 1267 | ;-----------------------------------------------------------------------------+ | ||
| 1268 | ; | ||
| 1269 | SET_DRIVE PROC NEAR | ||
| 1270 | |||
| 1271 | PUSH BX ; P*4831 | ||
| 1272 | PUSH DX ; P*4831 | ||
| 1273 | PUSH AX ; P*4831 | ||
| 1274 | |||
| 1275 | AND DL,0DFH ; convert it to P*4831 | ||
| 1276 | SUB DL,40H ; an binary number. P*4831 | ||
| 1277 | MOV BL,DL | ||
| 1278 | MOV AX,440FH ; I/O control P*4831 | ||
| 1279 | INT 21H ; set logical drive letter P*4831 | ||
| 1280 | |||
| 1281 | POP AX ; P*4831 | ||
| 1282 | POP DX ; P*4831 | ||
| 1283 | POP BX ; P*4831 | ||
| 1284 | RET ; return to caller P*4831 | ||
| 1285 | |||
| 1286 | SET_DRIVE ENDP | ||
| 1287 | ; | ||
| 1288 | PAGE | ||
| 1289 | ;-----------------------------------------------------------------------------+ | ||
| 1290 | ; : | ||
| 1291 | ; Name: PCCLRRD_CALL : | ||
| 1292 | ; : | ||
| 1293 | ; Description: Call to PCCLRRD. : | ||
| 1294 | ; : | ||
| 1295 | ; Entry: PCCLRRD parameter block initialized. : | ||
| 1296 | ; : | ||
| 1297 | ; Exit: PCCLRRD parameter block initialized. : | ||
| 1298 | ; : | ||
| 1299 | ; Entry point: PCCLRRD_CALL : | ||
| 1300 | ; : | ||
| 1301 | ; Notes: None. : | ||
| 1302 | ; : | ||
| 1303 | ; Internal references: None. : | ||
| 1304 | ; : | ||
| 1305 | ; External references: None. : | ||
| 1306 | ; : | ||
| 1307 | ;-----------------------------------------------------------------------------+ | ||
| 1308 | ; | ||
| 1309 | PCCLRRD_CALL PROC NEAR ;*PCR (ENTIRE PROC) | ||
| 1310 | ; | ||
| 1311 | PUSH DS ;Set segment | ||
| 1312 | POP ES | ||
| 1313 | ; | ||
| 1314 | PUSH DS | ||
| 1315 | PUSH DI ;Save registers | ||
| 1316 | ; | ||
| 1317 | LEA DI,CRD_OPT1 ;Set DI to proper parameter block | ||
| 1318 | ; for call | ||
| 1319 | IF CASRM | ||
| 1320 | MOV AH,00H ;Make call to CAS-RM | ||
| 1321 | MOV BX,CRD_RN ;Set cas routine number | ||
| 1322 | INT CASINT ;Call routine | ||
| 1323 | ELSE | ||
| 1324 | CALL CLRRD | ||
| 1325 | ENDIF | ||
| 1326 | ; | ||
| 1327 | ; copy the color index vector into buffer below clrrd buffer | ||
| 1328 | ; | ||
| 1329 | MOV AX,16 ;calc length of color read and | ||
| 1330 | MOV BX,MAX_COLRBUF ; write buffers | ||
| 1331 | MUL BX ;# paragraphs * 16 = # bytes | ||
| 1332 | SUB AX,500 ;leave room for safe buffer | ||
| 1333 | ADD AX,CRD_BUFOFF ;add current crd buf offset | ||
| 1334 | MOV DI,AX | ||
| 1335 | MOV SI,CRD_CCBVECOFF ;get source address | ||
| 1336 | MOV CRD_CCBVECOFF,DI ;set destination offset | ||
| 1337 | ; | ||
| 1338 | CMP CRD_ERROR,0 ;was there an error | ||
| 1339 | JNE CR_EXIT ;yes, don't overwrite | ||
| 1340 | CMP CRD_DOSERROR,0 ;was there an error | ||
| 1341 | JNE CR_EXIT ;yes, don't overwrite | ||
| 1342 | ; | ||
| 1343 | MOV ES,CRD_BUFSEG ;set destination segment | ||
| 1344 | MOV CX,CRD_CCBVECLEN ;get the length to move | ||
| 1345 | PUSH DS | ||
| 1346 | MOV AX,CRD_CCBVECSEG ;set source segment | ||
| 1347 | MOV DS,AX | ||
| 1348 | ; | ||
| 1349 | REP MOVSB ;move the data | ||
| 1350 | POP DS | ||
| 1351 | ; | ||
| 1352 | CR_EXIT: POP DI ;Restore registers | ||
| 1353 | POP DS | ||
| 1354 | ; | ||
| 1355 | RET | ||
| 1356 | PCCLRRD_CALL ENDP | ||
| 1357 | ; | ||
| 1358 | PAGE | ||
| 1359 | ;-----------------------------------------------------------------------------+ | ||
| 1360 | ; : | ||
| 1361 | ; Name: SET_DEFAULT : | ||
| 1362 | ; : | ||
| 1363 | ; Description: Set default value in specified ICB control block. : | ||
| 1364 | ; : | ||
| 1365 | ; Entry: ES:DI = Address of default value. : | ||
| 1366 | ; CX = Length of string. : | ||
| 1367 | ; AX = ICB number of input field. : | ||
| 1368 | ; : | ||
| 1369 | ; Exit: None. : | ||
| 1370 | ; : | ||
| 1371 | ; Entry point: None. : | ||
| 1372 | ; : | ||
| 1373 | ; Notes: None. : | ||
| 1374 | ; : | ||
| 1375 | ; Internal references: None. : | ||
| 1376 | ; : | ||
| 1377 | ; External references: None. : | ||
| 1378 | ; : | ||
| 1379 | ;-----------------------------------------------------------------------------+ | ||
| 1380 | ; | ||
| 1381 | SET_DEFAULT PROC FAR | ||
| 1382 | ; | ||
| 1383 | PUSH ES ;save default segment | ||
| 1384 | PUSH DI ;save default offset | ||
| 1385 | ; | ||
| 1386 | CALL FAR PTR GET_ICB ;get input control block | ||
| 1387 | ; | ||
| 1388 | MOV ES:[DI]+ICB_CURCHAR,1 ;reset starting cursor position | ||
| 1389 | MOV ES:[DI]+ICB_DEFLEN,CX ;set length | ||
| 1390 | POP ES:[DI]+ICB_DEFOFF ;offset | ||
| 1391 | POP ES:[DI]+ICB_DEFSEG ;segment | ||
| 1392 | ; | ||
| 1393 | RET | ||
| 1394 | SET_DEFAULT ENDP | ||
| 1395 | ; | ||
| 1396 | PAGE | ||
| 1397 | ;-----------------------------------------------------------------------------+ | ||
| 1398 | ; : | ||
| 1399 | ; Name: GET_PCB : | ||
| 1400 | ; : | ||
| 1401 | ; Description: Return address of specified panel control block. : | ||
| 1402 | ; : | ||
| 1403 | ; Entry: AX = Number of PCB vector desired. : | ||
| 1404 | ; : | ||
| 1405 | ; COM_PCBVECSEG = PCB vector segment. : | ||
| 1406 | ; COM_PCBVECOFF = PCB vector offset. : | ||
| 1407 | ; COM_PCBVECLEN = number of bytes in each vector : | ||
| 1408 | ; : | ||
| 1409 | ; Exit: ES:DI = Address of specified PCB : | ||
| 1410 | ; : | ||
| 1411 | ; Entry point: : | ||
| 1412 | ; : | ||
| 1413 | ; Notes: None. : | ||
| 1414 | ; : | ||
| 1415 | ; Internal references: None. : | ||
| 1416 | ; : | ||
| 1417 | ; External references: None. : | ||
| 1418 | ; : | ||
| 1419 | ;-----------------------------------------------------------------------------+ | ||
| 1420 | ; | ||
| 1421 | GET_PCB PROC FAR | ||
| 1422 | ; | ||
| 1423 | PUSH AX | ||
| 1424 | PUSH BX | ||
| 1425 | PUSH CX | ||
| 1426 | PUSH DX | ||
| 1427 | ; | ||
| 1428 | ; read panel control block vector to obtain PCB address | ||
| 1429 | ; | ||
| 1430 | MOV BX,COM_PCBVECSEG ;get beginning PCB vector address | ||
| 1431 | MOV ES,BX | ||
| 1432 | MOV DI,COM_PCBVECOFF | ||
| 1433 | ; | ||
| 1434 | DEC AX ;make zero based | ||
| 1435 | MOV BX,COM_PCBVECLEN ;multiply PCB element length by | ||
| 1436 | ; desired vector number in BX | ||
| 1437 | MUL BX ; to determine offset into PCB vec | ||
| 1438 | ADD DI,AX ;add offset inside table | ||
| 1439 | MOV BX,ES:[DI] ;get actual PCB segment | ||
| 1440 | MOV CX,ES:[DI]+2 ;point past PCB seg to get PCB off | ||
| 1441 | ; | ||
| 1442 | MOV ES,BX ;set ES:DI to panel's actual | ||
| 1443 | MOV DI,CX ; PCB address | ||
| 1444 | ; | ||
| 1445 | POP DX | ||
| 1446 | POP CX | ||
| 1447 | POP BX | ||
| 1448 | POP AX | ||
| 1449 | ; | ||
| 1450 | RET | ||
| 1451 | GET_PCB ENDP | ||
| 1452 | ; | ||
| 1453 | PAGE | ||
| 1454 | ;-----------------------------------------------------------------------------+ | ||
| 1455 | ; : | ||
| 1456 | ; Name: GET_SCB : | ||
| 1457 | ; : | ||
| 1458 | ; Description: Return address of specified scroll control block. : | ||
| 1459 | ; : | ||
| 1460 | ; Entry: AX = Number of SCB vector desired. : | ||
| 1461 | ; : | ||
| 1462 | ; COM_SCBVECSEG = SCB vector segment. : | ||
| 1463 | ; COM_SCBVECOFF = SCB vector offset. : | ||
| 1464 | ; COM_SCBVECLEN = number bytes in each vector : | ||
| 1465 | ; : | ||
| 1466 | ; Exit: ES:DI = Address of specified SCB : | ||
| 1467 | ; : | ||
| 1468 | ; Entry point: : | ||
| 1469 | ; : | ||
| 1470 | ; Notes: None. : | ||
| 1471 | ; : | ||
| 1472 | ; Internal references: None. : | ||
| 1473 | ; : | ||
| 1474 | ; External references: None. : | ||
| 1475 | ; : | ||
| 1476 | ;-----------------------------------------------------------------------------+ | ||
| 1477 | ; | ||
| 1478 | GET_SCB PROC NEAR | ||
| 1479 | ; | ||
| 1480 | PUSH AX | ||
| 1481 | PUSH BX | ||
| 1482 | PUSH CX | ||
| 1483 | PUSH DX | ||
| 1484 | ; | ||
| 1485 | ; read panel control block vector to obtain SCB address | ||
| 1486 | ; | ||
| 1487 | MOV BX,COM_SCBVECSEG ;get beginning SCB vector address | ||
| 1488 | MOV ES,BX | ||
| 1489 | MOV DI,COM_SCBVECOFF | ||
| 1490 | ; | ||
| 1491 | DEC AX ;make zero based | ||
| 1492 | MOV BX,COM_SCBVECLEN ;multiply SCB element length by | ||
| 1493 | ; desired vector number in BX | ||
| 1494 | MUL BX ; to determine offset into SCB vec | ||
| 1495 | ADD DI,AX ;add offset inside table | ||
| 1496 | MOV BX,ES:[DI] ;get actual SCB segment | ||
| 1497 | MOV CX,ES:[DI]+2 ;point past SCB seg to get SCB off | ||
| 1498 | ; | ||
| 1499 | MOV ES,BX ;set ES:DI to panel's actual | ||
| 1500 | MOV DI,CX ; PCB address | ||
| 1501 | ; | ||
| 1502 | POP DX | ||
| 1503 | POP CX | ||
| 1504 | POP BX | ||
| 1505 | POP AX | ||
| 1506 | ; | ||
| 1507 | RET | ||
| 1508 | GET_SCB ENDP | ||
| 1509 | ; | ||
| 1510 | PAGE | ||
| 1511 | ;-----------------------------------------------------------------------------+ | ||
| 1512 | ; : | ||
| 1513 | ; Name: GET_ICB : | ||
| 1514 | ; : | ||
| 1515 | ; Description: Return address of specified input control block. : | ||
| 1516 | ; : | ||
| 1517 | ; Entry: AX = Number of ICB vector desired. : | ||
| 1518 | ; : | ||
| 1519 | ; COM_ICBVECSEG = ICB vector segment. : | ||
| 1520 | ; COM_ICBVECOFF = ICB vector offset. : | ||
| 1521 | ; COM_ICBVECLEN = vector length. : | ||
| 1522 | ; : | ||
| 1523 | ; Exit: ES:DI = Address of specified ICB : | ||
| 1524 | ; : | ||
| 1525 | ; Entry point: : | ||
| 1526 | ; : | ||
| 1527 | ; Notes: None. : | ||
| 1528 | ; : | ||
| 1529 | ; Internal references: None. : | ||
| 1530 | ; : | ||
| 1531 | ; External references: None. : | ||
| 1532 | ; : | ||
| 1533 | ;-----------------------------------------------------------------------------+ | ||
| 1534 | ; | ||
| 1535 | GET_ICB PROC FAR | ||
| 1536 | ; | ||
| 1537 | PUSH AX | ||
| 1538 | PUSH BX | ||
| 1539 | PUSH CX | ||
| 1540 | PUSH DX | ||
| 1541 | ; | ||
| 1542 | ; read input control block vector to obtain PCB address | ||
| 1543 | ; | ||
| 1544 | MOV BX,COM_ICBVECSEG ;get beginning ICB vector address | ||
| 1545 | MOV ES,BX | ||
| 1546 | MOV DI,COM_ICBVECOFF | ||
| 1547 | ; | ||
| 1548 | DEC AX ;make zero based | ||
| 1549 | MOV BX,COM_ICBVECLEN ;multiply ICB element length by | ||
| 1550 | ; desired vector number in BX | ||
| 1551 | MUL BX ; to determine offset into ICB vec | ||
| 1552 | ADD DI,AX ;add offset inside table | ||
| 1553 | MOV BX,ES:[DI] ;get actual ICB segment | ||
| 1554 | MOV CX,ES:[DI]+2 ;point past ICB seg to get ICB off | ||
| 1555 | ; | ||
| 1556 | MOV ES,BX ;set ES:DI to input's actual | ||
| 1557 | MOV DI,CX ; ICB address | ||
| 1558 | ; | ||
| 1559 | TEST COM_STATE,COM_TEXT ;check if in text mode | ||
| 1560 | JE GIEXIT | ||
| 1561 | ; | ||
| 1562 | AND ES:[DI]+ICB_OPT1,NOT ICB_BOX | ||
| 1563 | ;if in text mode deactivate box | ||
| 1564 | ; option | ||
| 1565 | ; | ||
| 1566 | GIEXIT: POP DX | ||
| 1567 | POP CX | ||
| 1568 | POP BX | ||
| 1569 | POP AX | ||
| 1570 | ; | ||
| 1571 | RET | ||
| 1572 | GET_ICB ENDP | ||
| 1573 | ; | ||
| 1574 | PAGE | ||
| 1575 | ;-----------------------------------------------------------------------------+ | ||
| 1576 | ; : | ||
| 1577 | ; Name: GET_ERROR : | ||
| 1578 | ; : | ||
| 1579 | ; Description: Return address of error message. : | ||
| 1580 | ; : | ||
| 1581 | ; Entry: AX = Number of vector desired. : | ||
| 1582 | ; : | ||
| 1583 | ; COM_ERRVECSEG = Error message vector segment. : | ||
| 1584 | ; COM_ERRVECOFF = Error message vector offset. : | ||
| 1585 | ; COM_ERRVECLEN = Length of each vector in bytes. : | ||
| 1586 | ; : | ||
| 1587 | ; Exit: ES:DI = Address of specified error message. : | ||
| 1588 | ; AX = length of error message. : | ||
| 1589 | ; : | ||
| 1590 | ; Entry point: GET_ERROR : | ||
| 1591 | ; : | ||
| 1592 | ; Notes: None. : | ||
| 1593 | ; : | ||
| 1594 | ; Internal references: None. : | ||
| 1595 | ; : | ||
| 1596 | ; External references: None. : | ||
| 1597 | ; : | ||
| 1598 | ;-----------------------------------------------------------------------------+ | ||
| 1599 | ; | ||
| 1600 | GET_ERROR PROC FAR | ||
| 1601 | ; | ||
| 1602 | PUSH BX | ||
| 1603 | PUSH CX | ||
| 1604 | PUSH DX | ||
| 1605 | ; | ||
| 1606 | ; read error message vector | ||
| 1607 | ; | ||
| 1608 | MOV BX,COM_ERRVECSEG ;get beginning vector address | ||
| 1609 | MOV ES,BX | ||
| 1610 | MOV DI,COM_ERRVECOFF | ||
| 1611 | ; | ||
| 1612 | DEC AX ;make zero based | ||
| 1613 | MOV BX,COM_ERRVECLEN ;multiply element length by | ||
| 1614 | ; desired vector number in BX | ||
| 1615 | MUL BX ; to determine offset into vector | ||
| 1616 | ADD DI,AX ;add offset inside table | ||
| 1617 | MOV CX,ES:[DI] ;get error text offset | ||
| 1618 | XOR AX,AX ;clear to zero | ||
| 1619 | MOV AL,ES:[DI]+2 ;get error text length | ||
| 1620 | ; | ||
| 1621 | MOV DI,CX ;set ES:DI to panel's actual | ||
| 1622 | ; PCB address | ||
| 1623 | ; | ||
| 1624 | POP DX | ||
| 1625 | POP CX | ||
| 1626 | POP BX | ||
| 1627 | ; | ||
| 1628 | RET | ||
| 1629 | GET_ERROR ENDP | ||
| 1630 | ; | ||
| 1631 | PAGE | ||
| 1632 | ;-----------------------------------------------------------------------------+ | ||
| 1633 | ; : | ||
| 1634 | ; Name: GET_BUTTON : | ||
| 1635 | ; : | ||
| 1636 | ; Description: Return address of graphics button. : | ||
| 1637 | ; : | ||
| 1638 | ; Entry: AX = Number of vector desired. : | ||
| 1639 | ; : | ||
| 1640 | ; COM_BCBVECSEG = vector segment. : | ||
| 1641 | ; COM_BCBVECOFF = vector offset. : | ||
| 1642 | ; COM_BCBVECLEN = Length of each vector in bytes. : | ||
| 1643 | ; : | ||
| 1644 | ; Exit: ES:DI = Address of specified string. : | ||
| 1645 | ; : | ||
| 1646 | ; Entry point: GET_BUTTON : | ||
| 1647 | ; : | ||
| 1648 | ; Notes: None. : | ||
| 1649 | ; : | ||
| 1650 | ; Internal references: None. : | ||
| 1651 | ; : | ||
| 1652 | ; External references: None. : | ||
| 1653 | ; : | ||
| 1654 | ;-----------------------------------------------------------------------------+ | ||
| 1655 | ; | ||
| 1656 | GET_BUTTON PROC NEAR | ||
| 1657 | ; | ||
| 1658 | PUSH BX | ||
| 1659 | PUSH CX | ||
| 1660 | PUSH DX | ||
| 1661 | ; | ||
| 1662 | ; read keystroke vector | ||
| 1663 | ; | ||
| 1664 | MOV BX,COM_BCBVECSEG ;get beginning vector address | ||
| 1665 | MOV ES,BX | ||
| 1666 | MOV DI,COM_BCBVECOFF | ||
| 1667 | ; | ||
| 1668 | DEC AX ;make zero based | ||
| 1669 | MOV BX,COM_BCBVECLEN ;multiply element length by | ||
| 1670 | ; desired vector number in BX | ||
| 1671 | MUL BX ; to determine offset into vector | ||
| 1672 | ADD DI,AX ;add offset inside table | ||
| 1673 | MOV CX,ES:[DI] ;get text offset | ||
| 1674 | MOV DI,CX ;set ES:DI to actual data | ||
| 1675 | ; | ||
| 1676 | POP DX | ||
| 1677 | POP CX | ||
| 1678 | POP BX | ||
| 1679 | ; | ||
| 1680 | RET | ||
| 1681 | GET_BUTTON ENDP | ||
| 1682 | ; | ||
| 1683 | PAGE | ||
| 1684 | ;-----------------------------------------------------------------------------+ | ||
| 1685 | ; : | ||
| 1686 | ; Name: GET_STRING : | ||
| 1687 | ; : | ||
| 1688 | ; Description: Return address of string. : | ||
| 1689 | ; : | ||
| 1690 | ; Entry: AX = Number of ICB vector desired. : | ||
| 1691 | ; : | ||
| 1692 | ; COM_STRVECSEG = String vector segment. : | ||
| 1693 | ; COM_STRVECOFF = String vector offset. : | ||
| 1694 | ; COM_STRVECLEN = Length of each vector in bytes. : | ||
| 1695 | ; : | ||
| 1696 | ; Exit: ES:DI = Address of specified string. : | ||
| 1697 | ; AX = length of string. : | ||
| 1698 | ; : | ||
| 1699 | ; Entry point: GET_STRING : | ||
| 1700 | ; : | ||
| 1701 | ; Notes: None. : | ||
| 1702 | ; : | ||
| 1703 | ; Internal references: None. : | ||
| 1704 | ; : | ||
| 1705 | ; External references: None. : | ||
| 1706 | ; : | ||
| 1707 | ;-----------------------------------------------------------------------------+ | ||
| 1708 | ; | ||
| 1709 | GET_STRING PROC FAR | ||
| 1710 | ; | ||
| 1711 | PUSH DX | ||
| 1712 | PUSH BX | ||
| 1713 | PUSH CX | ||
| 1714 | ; | ||
| 1715 | ; read error message vector | ||
| 1716 | ; | ||
| 1717 | MOV BX,COM_STRVECSEG ;get beginning vector address | ||
| 1718 | MOV ES,BX | ||
| 1719 | MOV DI,COM_STRVECOFF | ||
| 1720 | ; | ||
| 1721 | DEC AX ;make zero based | ||
| 1722 | MOV BX,COM_STRVECLEN ;multiply element length by | ||
| 1723 | ; desired vector number in BX | ||
| 1724 | MUL BX ; to determine offset into vector | ||
| 1725 | ADD DI,AX ;add offset inside table | ||
| 1726 | MOV CX,ES:[DI] ;get text offset | ||
| 1727 | XOR AX,AX ;clear to zero | ||
| 1728 | MOV AL,ES:[DI]+2 ;get text length | ||
| 1729 | ; | ||
| 1730 | MOV DI,CX ;set ES:DI to actual data | ||
| 1731 | ; | ||
| 1732 | POP CX | ||
| 1733 | POP BX | ||
| 1734 | POP DX | ||
| 1735 | ; | ||
| 1736 | RET | ||
| 1737 | GET_STRING ENDP | ||
| 1738 | ; | ||
| 1739 | PAGE | ||
| 1740 | ;-----------------------------------------------------------------------------+ | ||
| 1741 | ; : | ||
| 1742 | ; Name: GET_ATTR : | ||
| 1743 | ; : | ||
| 1744 | ; Description: Returns the normal and highlight color attributes : | ||
| 1745 | ; of a specified panel. : | ||
| 1746 | ; : | ||
| 1747 | ; : | ||
| 1748 | ; Entry: AX = Panel ID number. : | ||
| 1749 | ; : | ||
| 1750 | ; Exit: AH = Panel's normal color attr : | ||
| 1751 | ; AL = Panel's highlight color attr : | ||
| 1752 | ; : | ||
| 1753 | ; Entry point: GET_ATTR : | ||
| 1754 | ; : | ||
| 1755 | ; Notes: None. : | ||
| 1756 | ; : | ||
| 1757 | ; Internal references: None. : | ||
| 1758 | ; : | ||
| 1759 | ; External references: None. : | ||
| 1760 | ; : | ||
| 1761 | ;-----------------------------------------------------------------------------+ | ||
| 1762 | ; | ||
| 1763 | GET_ATTR PROC FAR | ||
| 1764 | ; | ||
| 1765 | PUSH ES ;save registers | ||
| 1766 | PUSH DI | ||
| 1767 | ; | ||
| 1768 | CALL FAR PTR GET_PCB ;load the panel's PCB in ES:DI | ||
| 1769 | MOV AX,ES:[DI]+PCB_CCBID ;get panel's color index number | ||
| 1770 | ; | ||
| 1771 | CALL FAR PTR GET_COLOR ;load the color index | ||
| 1772 | MOV AH,ES:[DI]+CCB_A1 ;get the normal color attr | ||
| 1773 | MOV AL,ES:[DI]+CCB_A2 ;get the highlighted color attr | ||
| 1774 | ; | ||
| 1775 | POP DI ;restore registers | ||
| 1776 | POP ES | ||
| 1777 | ; | ||
| 1778 | RET | ||
| 1779 | GET_ATTR ENDP | ||
| 1780 | ; | ||
| 1781 | PAGE | ||
| 1782 | ;-----------------------------------------------------------------------------+ | ||
| 1783 | ; : | ||
| 1784 | ; Name: GET_COLOR : | ||
| 1785 | ; : | ||
| 1786 | ; Description: Returns ES:DI pointing to color index specified in : | ||
| 1787 | ; AX. Use the CCB_PB to reference the desired color : | ||
| 1788 | ; attributes. : | ||
| 1789 | ; : | ||
| 1790 | ; Entry: AX = Color index to return. : | ||
| 1791 | ; CRD_CCBVECOFF = Offset of color index. : | ||
| 1792 | ; CRD_CCBVECSEG = Segment of color index. : | ||
| 1793 | ; : | ||
| 1794 | ; Exit: ES:DI = Address of color index : | ||
| 1795 | ; : | ||
| 1796 | ; Entry point: GET_COLOR : | ||
| 1797 | ; : | ||
| 1798 | ; Notes: None. : | ||
| 1799 | ; : | ||
| 1800 | ; Internal references: None. : | ||
| 1801 | ; : | ||
| 1802 | ; External references: None. : | ||
| 1803 | ; : | ||
| 1804 | ;-----------------------------------------------------------------------------+ | ||
| 1805 | ; | ||
| 1806 | GET_COLOR PROC FAR | ||
| 1807 | ; | ||
| 1808 | PUSH AX ;save registers | ||
| 1809 | PUSH BX | ||
| 1810 | PUSH DX | ||
| 1811 | ; | ||
| 1812 | DEC AX ; default index and make zero | ||
| 1813 | ; based | ||
| 1814 | PUSH CRD_CCBVECSEG ;get color index segment | ||
| 1815 | POP ES | ||
| 1816 | ; | ||
| 1817 | PUSH CRD_CCBVECOFF ;get color index offset | ||
| 1818 | POP DI | ||
| 1819 | ; | ||
| 1820 | MOV BX,COM_CCBLEN ;multiply CCB element length by | ||
| 1821 | MUL BX ; desired vector add offset | ||
| 1822 | ADD DI,AX ; to color index offset | ||
| 1823 | ; | ||
| 1824 | POP DX ;restore registers | ||
| 1825 | POP BX | ||
| 1826 | POP AX | ||
| 1827 | ; | ||
| 1828 | RET | ||
| 1829 | GET_COLOR ENDP | ||
| 1830 | ; | ||
| 1831 | PAGE | ||
| 1832 | ;-----------------------------------------------------------------------------+ | ||
| 1833 | ; : | ||
| 1834 | ; Name: SET_SHLVMDOS : | ||
| 1835 | ; : | ||
| 1836 | ; Description: Set shell video mode from current DOS video mode. : | ||
| 1837 | ; : | ||
| 1838 | ; Entry: COM_STATE = Option word indicating invocation : | ||
| 1839 | ; parameters passed through PSP. : | ||
| 1840 | ; : | ||
| 1841 | ; Exit: PCGVIDO = Parmeter block initialized. : | ||
| 1842 | ; COM_DVIDMODE = Original DOS video mode. : | ||
| 1843 | ; COM_SVIDMODE = Current Shell video mode. : | ||
| 1844 | ; : | ||
| 1845 | ; Entry point: SET_SHLVMDOS : | ||
| 1846 | ; : | ||
| 1847 | ; Notes: None. : | ||
| 1848 | ; : | ||
| 1849 | ; Internal references: PCGVIDO_CALL : | ||
| 1850 | ; : | ||
| 1851 | ; External references: None. : | ||
| 1852 | ; : | ||
| 1853 | ;-----------------------------------------------------------------------------+ | ||
| 1854 | ; | ||
| 1855 | SET_SHLVMDOS PROC NEAR | ||
| 1856 | ; | ||
| 1857 | LEA DI,GEN_DATA ;load offset of PCGRAPH PB | ||
| 1858 | MOV [DI]+G_INITVFLAG,0 ;init to VGA hardware available | ||
| 1859 | ; | ||
| 1860 | ; Check if mode 10H requested | ||
| 1861 | ; | ||
| 1862 | TEST COM_STATE,COM_M10H ;check if graphics mode 10H | ||
| 1863 | JE VMD20 ; requested (EGA/VGA) | ||
| 1864 | ; | ||
| 1865 | TEST GV_STAT1,GV_256K ;256K memory on EGA card | ||
| 1866 | JNE VMD10 | ||
| 1867 | ; | ||
| 1868 | MOV COM_ERRID,ERR_256K ;set error for less than 256KB | ||
| 1869 | JMP VMDEXIT ; available on graphics adaphter | ||
| 1870 | ; | ||
| 1871 | VMD10: MOV AL,10H ;set for mode 10H | ||
| 1872 | JMP VMD60 | ||
| 1873 | ; | ||
| 1874 | ; Check if mode 11H requested | ||
| 1875 | ; | ||
| 1876 | VMD20: TEST COM_STATE,COM_M11H ;check if graphics mode 11H | ||
| 1877 | JE VMD40 ; requested (VGA/MCGA) | ||
| 1878 | ; | ||
| 1879 | TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail | ||
| 1880 | JNE VMD30 | ||
| 1881 | ; | ||
| 1882 | CMP GE_MODEL,MODEL_30 ;check for MCGA support | ||
| 1883 | JNE VMD30 | ||
| 1884 | ; | ||
| 1885 | OR IN_OPT,IN_MCGA ;MCGA active | ||
| 1886 | MOV [DI]+G_INITVFLAG,G_INITNOVGA | ||
| 1887 | ;no VGA hardware available | ||
| 1888 | ; | ||
| 1889 | VMD30: MOV AL,11H ;set for mode 11H | ||
| 1890 | JMP VMD60 | ||
| 1891 | ; | ||
| 1892 | ; check if mode 12H requested | ||
| 1893 | ; | ||
| 1894 | VMD40: TEST COM_STATE,COM_M12H ;check if graphics mode 12H | ||
| 1895 | JE VMD70 | ||
| 1896 | ; | ||
| 1897 | TEST GV_STAT1,GV_256K ;256K memory on EGA card | ||
| 1898 | JNE VMD50 | ||
| 1899 | ; | ||
| 1900 | MOV COM_ERRID,ERR_256K ;set error for less than 256KB | ||
| 1901 | JMP VMDEXIT ; available on graphics adaphter | ||
| 1902 | ; | ||
| 1903 | VMD50: MOV AL,12H ;set for mode 12H | ||
| 1904 | ; | ||
| 1905 | ; set graphics video mode | ||
| 1906 | ; | ||
| 1907 | VMD60: CMP AL,12H ;check for mode 12H | ||
| 1908 | JE VMD62 | ||
| 1909 | ; | ||
| 1910 | CMP AL,11H ;check for mode 11H | ||
| 1911 | JE VMD62 | ||
| 1912 | ; | ||
| 1913 | JMP VMD65 ;must be mode 10H | ||
| 1914 | ; | ||
| 1915 | VMD62: CMP GE_MODEL,MODEL_30 ;check if model 30 | ||
| 1916 | JE VMD65 | ||
| 1917 | ; | ||
| 1918 | CMP GE_MODEL,MODEL_25 ;check if model 25 | ||
| 1919 | JE VMD65 | ||
| 1920 | ; | ||
| 1921 | PUSH AX | ||
| 1922 | MOV AX, 1A00H ;BIOS check display | ||
| 1923 | INT 10H | ||
| 1924 | CMP AL, 1AH ;VGA supported? | ||
| 1925 | POP AX | ||
| 1926 | JE VMD65 ;yes, continue | ||
| 1927 | ; | ||
| 1928 | MOV AL,0 ;set error in video mode | ||
| 1929 | JMP VMD80 ;exit | ||
| 1930 | ; | ||
| 1931 | VMD65: MOV [DI]+G_INITVMODE,AL ;set desired graphics video mode | ||
| 1932 | MOV [DI]+G_FUNC,G_INIT ;initialize graphics support | ||
| 1933 | MOV BX,DATA ;point to general PCGRAPH | ||
| 1934 | MOV ES,BX ; initialize parameter block | ||
| 1935 | PUSH AX | ||
| 1936 | CALL PCGRAPH_CALL ;initialize graphics | ||
| 1937 | POP AX | ||
| 1938 | JMP VMD80 | ||
| 1939 | ; | ||
| 1940 | ; set text video mode | ||
| 1941 | ; | ||
| 1942 | VMD70: MOV AL,7 ;initialize | ||
| 1943 | CMP AL,COM_DVIDMODE ;if monochrome text mode is active | ||
| 1944 | JE VMD80 ; no need to set mode | ||
| 1945 | ; | ||
| 1946 | MOV AL,3 | ||
| 1947 | CMP AL,COM_DVIDMODE ;if color text mode is active no | ||
| 1948 | JE VMD80 ; need to set mode | ||
| 1949 | ; | ||
| 1950 | XOR AH,AH ;set to color text mode | ||
| 1951 | PUSH AX ;save | ||
| 1952 | INT 10H | ||
| 1953 | POP AX ;restore | ||
| 1954 | ; | ||
| 1955 | ; read all video information and check if mode set successful | ||
| 1956 | ; | ||
| 1957 | VMD80: CALL PCGVIDO_CALL ;get new video information and | ||
| 1958 | CMP AL,GV_VIDMODE ; check if mode set successful | ||
| 1959 | JE VMD100 ;yes | ||
| 1960 | ; | ||
| 1961 | MOV COM_ERRID,ERR_MODE ;requested video mode failed | ||
| 1962 | JMP VMDEXIT | ||
| 1963 | ; | ||
| 1964 | VMD100: MOV COM_SVIDMODE,AL ;save current shell video mode | ||
| 1965 | cmp al, 7 ;monochrome text mode active? | ||
| 1966 | jne vmd101 ;no, continue | ||
| 1967 | and COM_STATE,not COM_FLCS ;inactivate color change | ||
| 1968 | vmd101: | ||
| 1969 | CALL FAR PTR CURSOROFF ;deactive cursor | ||
| 1970 | ; | ||
| 1971 | VMDEXIT: ;exit | ||
| 1972 | ; | ||
| 1973 | RET | ||
| 1974 | SET_SHLVMDOS ENDP | ||
| 1975 | ; | ||
| 1976 | PAGE | ||
| 1977 | ;-----------------------------------------------------------------------------+ | ||
| 1978 | ; : | ||
| 1979 | ; Name: SET_DOSVMSHL : | ||
| 1980 | ; : | ||
| 1981 | ; Description: Set original DOS video mode from current shell mode : | ||
| 1982 | ; and disable mouse support : | ||
| 1983 | ; : | ||
| 1984 | ; Entry: PCGVIDO = Parmeter block initialized. : | ||
| 1985 | ; COM_DVIDMODE = Original DOS video mode. : | ||
| 1986 | ; COM_SVIDMODE = Current Shell video mode. : | ||
| 1987 | ; COM_STATE = Invocation options. : | ||
| 1988 | ; : | ||
| 1989 | ; Exit: PCGVIDO = Parmeter block initialized. : | ||
| 1990 | ; : | ||
| 1991 | ; Entry point: SET_DOSVMSHL : | ||
| 1992 | ; : | ||
| 1993 | ; Notes: None. : | ||
| 1994 | ; : | ||
| 1995 | ; Internal references: PCGVIDO_CALL : | ||
| 1996 | ; PCTRACK_CALL : | ||
| 1997 | ; : | ||
| 1998 | ; External references: None. : | ||
| 1999 | ; : | ||
| 2000 | ;-----------------------------------------------------------------------------+ | ||
| 2001 | ; | ||
| 2002 | SET_DOSVMSHL PROC NEAR | ||
| 2003 | ; | ||
| 2004 | ; Disable mouse support | ||
| 2005 | ; | ||
| 2006 | CALL FAR PTR MOUSE_DIS ;disable mouse support | ||
| 2007 | ; | ||
| 2008 | ; Check if shell is in text mode | ||
| 2009 | ; | ||
| 2010 | VMS10: CMP COM_STATE,COM_TEXT | ||
| 2011 | JNE VMS20 | ||
| 2012 | ; | ||
| 2013 | ; Terminate shell graphics mode and restore original DOS video mode | ||
| 2014 | ; | ||
| 2015 | LEA DI,GEN_DATA ;load offset of PCGRAPH PB | ||
| 2016 | MOV [DI]+G_FUNC,G_TERM ;terminate graphics support | ||
| 2017 | MOV BX,DATA ;point to general PCGRAPH | ||
| 2018 | MOV ES,BX ;initialize parameter block | ||
| 2019 | CALL PCGRAPH_CALL ;initialize graphics | ||
| 2020 | JMP VMSEXIT | ||
| 2021 | ; | ||
| 2022 | ; Shell is in text video mode, restore original DOS video mode | ||
| 2023 | ; | ||
| 2024 | VMS20: MOV AL,COM_DVIDMODE ;if shell mode and DOS mode are | ||
| 2025 | XOR AH,AH ;shell and DOS modes are different | ||
| 2026 | INT 10H ; reset original DOS mode | ||
| 2027 | ; | ||
| 2028 | ; Exit | ||
| 2029 | ; | ||
| 2030 | VMSEXIT: MOV AL,0 ;clear screen | ||
| 2031 | MOV CH,0 | ||
| 2032 | MOV CL,0 | ||
| 2033 | MOV DX,GV_NUMLINES ;set DH to bottom row | ||
| 2034 | MOV DL,80 ;set DL to screen width in chars | ||
| 2035 | MOV BH,07H ;set white on black color | ||
| 2036 | MOV AH,6 | ||
| 2037 | INT 10H | ||
| 2038 | ; | ||
| 2039 | CALL FAR PTR CURSORON | ||
| 2040 | CALL PCGVIDO_CALL | ||
| 2041 | ; | ||
| 2042 | RET | ||
| 2043 | SET_DOSVMSHL ENDP | ||
| 2044 | ; | ||
| 2045 | PAGE | ||
| 2046 | ;-----------------------------------------------------------------------------+ | ||
| 2047 | ; : | ||
| 2048 | ; Name: SET_CMDVMSHL : | ||
| 2049 | ; : | ||
| 2050 | ; Description: Set shell command line video mode from current shell : | ||
| 2051 | ; mode. : | ||
| 2052 | ; : | ||
| 2053 | ; Entry: PCGVIDO = Parmeter block initialized. : | ||
| 2054 | ; COM_DVIDMODE = Original DOS video mode. : | ||
| 2055 | ; COM_STATE = Invocation options. : | ||
| 2056 | ; : | ||
| 2057 | ; Exit: COM_CVIDMODE = Shell command line video mode. : | ||
| 2058 | ; PCGVIDO = Parmeter block initialized. : | ||
| 2059 | ; : | ||
| 2060 | ; Entry point: SET_CMDVMSHL : | ||
| 2061 | ; : | ||
| 2062 | ; Notes: None. : | ||
| 2063 | ; : | ||
| 2064 | ; Internal references: PCGVIDO_CALL : | ||
| 2065 | ; : | ||
| 2066 | ; External references: None. : | ||
| 2067 | ; : | ||
| 2068 | ;-----------------------------------------------------------------------------+ | ||
| 2069 | ; | ||
| 2070 | SET_CMDVMSHL PROC FAR | ||
| 2071 | ; | ||
| 2072 | ; Check if shell text mode is active | ||
| 2073 | ; | ||
| 2074 | CMP COM_STATE,COM_TEXT | ||
| 2075 | JE CMDEXIT | ||
| 2076 | ; | ||
| 2077 | ; Terminate shell graphics mode and restore original DOS video mode | ||
| 2078 | ; | ||
| 2079 | LEA DI,GEN_DATA ;load offset of PCGRAPH PB | ||
| 2080 | MOV [DI]+G_FUNC,G_TERM ;terminate graphics support | ||
| 2081 | MOV BX,DATA ;point to general PCGRAPH | ||
| 2082 | MOV ES,BX ;initialize parameter block | ||
| 2083 | CALL PCGRAPH_CALL ;initialize graphics | ||
| 2084 | ; | ||
| 2085 | ; Set shell command line to text video mode | ||
| 2086 | ; | ||
| 2087 | MOV AL,7 ;initialize to monochrome mode | ||
| 2088 | CMP COM_DVIDMODE,AL ;check if DOS video mode was | ||
| 2089 | JE CMD10 ; monochrome | ||
| 2090 | ; | ||
| 2091 | MOV AL,3 ;set color text mode | ||
| 2092 | ; | ||
| 2093 | CMD10: XOR AH,AH ;set command line video mode | ||
| 2094 | INT 10H | ||
| 2095 | ; | ||
| 2096 | ; Exit | ||
| 2097 | ; | ||
| 2098 | CMDEXIT: CALL PCGVIDO_CALL | ||
| 2099 | ; | ||
| 2100 | RET | ||
| 2101 | SET_CMDVMSHL ENDP | ||
| 2102 | ; | ||
| 2103 | PAGE | ||
| 2104 | ;-----------------------------------------------------------------------------+ | ||
| 2105 | ; : | ||
| 2106 | ; Name: SET_SHLVMCMD : | ||
| 2107 | ; : | ||
| 2108 | ; Description: Set shell video mode from shell command line video : | ||
| 2109 | ; mode. : | ||
| 2110 | ; : | ||
| 2111 | ; Entry: COM_STATE = Option word indicating invocation : | ||
| 2112 | ; parameters passed through PSP. : | ||
| 2113 | ; : | ||
| 2114 | ; Exit: PCGVIDO = Parmeter block initialized. : | ||
| 2115 | ; COM_DVIDMODE = Original DOS video mode. : | ||
| 2116 | ; COM_SVIDMODE = Current Shell video mode. : | ||
| 2117 | ; : | ||
| 2118 | ; Entry point: SET_SHLVMCMD : | ||
| 2119 | ; : | ||
| 2120 | ; Notes: None. : | ||
| 2121 | ; : | ||
| 2122 | ; Internal references: PCGVIDO_CALL : | ||
| 2123 | ; : | ||
| 2124 | ; External references: None. : | ||
| 2125 | ; : | ||
| 2126 | ;-----------------------------------------------------------------------------+ | ||
| 2127 | ; | ||
| 2128 | SET_SHLVMCMD PROC FAR | ||
| 2129 | ; | ||
| 2130 | ; Check if shell graphics modes 10H, 11H, and 12H were active | ||
| 2131 | ; | ||
| 2132 | LEA DI,GEN_DATA ;load offset of PCGRAPH PB | ||
| 2133 | MOV [DI]+G_INITVFLAG,0 | ||
| 2134 | ; | ||
| 2135 | TEST COM_STATE,COM_M11H ;check if graphics mode 11H | ||
| 2136 | JE SMC20 ; requested (VGA/MCGA) | ||
| 2137 | ; | ||
| 2138 | TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail | ||
| 2139 | JNE SMC10 | ||
| 2140 | ; | ||
| 2141 | CMP GE_MODEL,MODEL_30 ;check for MCGA support | ||
| 2142 | JNE SMC10 | ||
| 2143 | ; | ||
| 2144 | OR IN_OPT,IN_MCGA ;MCGA active | ||
| 2145 | MOV [DI]+G_INITVFLAG,G_INITNOVGA | ||
| 2146 | ;no VGA hardware available | ||
| 2147 | ; | ||
| 2148 | SMC10: MOV AL,11H ;set for mode 11H | ||
| 2149 | JMP SMC50 | ||
| 2150 | ; | ||
| 2151 | SMC20: CMP COM_SVIDMODE,10H ;check if mode 10 active | ||
| 2152 | JE SMC50 | ||
| 2153 | ; | ||
| 2154 | CMP COM_SVIDMODE,12H ;check if mode 12 active | ||
| 2155 | JE SMC50 | ||
| 2156 | ; | ||
| 2157 | MOV AH,0FH ;get current video mode | ||
| 2158 | INT 10H | ||
| 2159 | ; | ||
| 2160 | CMP AL,COM_SVIDMODE ;check if command line video mode | ||
| 2161 | JNE SMC30 ; changed and reset if yes | ||
| 2162 | ; | ||
| 2163 | JMP SMCEXIT | ||
| 2164 | ; | ||
| 2165 | ; Switch to monochrome monitor | ||
| 2166 | ; | ||
| 2167 | SMC30: CMP COM_SVIDMODE,3H ;check if color mode should be set | ||
| 2168 | JE SMC40 | ||
| 2169 | ; | ||
| 2170 | PUSH DS | ||
| 2171 | ; | ||
| 2172 | XOR AX,AX ;clear to zero | ||
| 2173 | MOV ES,AX ;point to BIOS data area and | ||
| 2174 | MOV DL,ES:[410H] ; get mode byte | ||
| 2175 | OR DL,00110000B | ||
| 2176 | MOV ES:[410H],DL | ||
| 2177 | XOR AH,AH ;set color monochrome mode | ||
| 2178 | MOV AL,7H | ||
| 2179 | INT 10H | ||
| 2180 | ; | ||
| 2181 | POP DS | ||
| 2182 | ; | ||
| 2183 | JMP SMCEXIT | ||
| 2184 | ; | ||
| 2185 | ; Switch to color monitor in text mode 80x25 | ||
| 2186 | ; | ||
| 2187 | SMC40: PUSH DS | ||
| 2188 | ; | ||
| 2189 | XOR AX,AX ;clear to zero | ||
| 2190 | MOV ES,AX ;point to BIOS data area and | ||
| 2191 | MOV DL,ES:[410H] ; get mode byte | ||
| 2192 | AND DL,11001111B | ||
| 2193 | OR DL,00100000B | ||
| 2194 | MOV ES:[410H],DL | ||
| 2195 | XOR AH,AH ;set color mode | ||
| 2196 | MOV AL,3H | ||
| 2197 | INT 10H | ||
| 2198 | ; | ||
| 2199 | POP DS | ||
| 2200 | ; | ||
| 2201 | JMP SMCEXIT | ||
| 2202 | ; | ||
| 2203 | ; Initialize shell graphics mode from shell command line text mode | ||
| 2204 | ; | ||
| 2205 | SMC50: MOV AH,0FH ;get current video mode | ||
| 2206 | INT 10H | ||
| 2207 | ; | ||
| 2208 | CMP AL,7H ;check if command line mode set | ||
| 2209 | JNE SMC60 ; for monochrome, if yes reset to | ||
| 2210 | ; graphics monitor | ||
| 2211 | ; | ||
| 2212 | PUSH DS | ||
| 2213 | ; | ||
| 2214 | XOR AX,AX ;clear to zero | ||
| 2215 | MOV ES,AX ;point to BIOS data area and | ||
| 2216 | MOV DL,ES:[410H] ; get mode byte | ||
| 2217 | AND DL,11001111B | ||
| 2218 | OR DL,00100000B | ||
| 2219 | MOV ES:[410H],DL | ||
| 2220 | XOR AH,AH ;set color 80x25 mode before | ||
| 2221 | MOV AL,3H ; setting graphics mode | ||
| 2222 | INT 10H | ||
| 2223 | ; | ||
| 2224 | POP DS | ||
| 2225 | ; | ||
| 2226 | SMC60: LEA DI,GEN_DATA ;load offset of PCGRAPH PB | ||
| 2227 | MOV AL,COM_SVIDMODE ;set the shell graphics video mode | ||
| 2228 | MOV [DI]+G_INITVMODE,AL | ||
| 2229 | MOV [DI]+G_FUNC,G_INIT ;initialize graphics support | ||
| 2230 | MOV BX,DATA ;point to general PCGRAPH | ||
| 2231 | MOV ES,BX ;initialize parameter block | ||
| 2232 | CALL PCGRAPH_CALL ;initialize graphics | ||
| 2233 | ; | ||
| 2234 | ; Exit | ||
| 2235 | ; | ||
| 2236 | SMCEXIT: CALL PCGVIDO_CALL | ||
| 2237 | ; | ||
| 2238 | RET | ||
| 2239 | SET_SHLVMCMD ENDP | ||
| 2240 | ; | ||
| 2241 | PAGE | ||
| 2242 | ;-----------------------------------------------------------------------------+ | ||
| 2243 | ; : | ||
| 2244 | ; Name: CURSOROFF : | ||
| 2245 | ; : | ||
| 2246 | ; Description: Deactivates hardware cursor from display. : | ||
| 2247 | ; : | ||
| 2248 | ; Entry: None : | ||
| 2249 | ; : | ||
| 2250 | ; Exit: None. : | ||
| 2251 | ; : | ||
| 2252 | ; Entry point: CURSOROFF : | ||
| 2253 | ; : | ||
| 2254 | ; Notes: None. : | ||
| 2255 | ; : | ||
| 2256 | ; Internal references: None. : | ||
| 2257 | ; : | ||
| 2258 | ; External references: None. : | ||
| 2259 | ; : | ||
| 2260 | ;-----------------------------------------------------------------------------+ | ||
| 2261 | ; | ||
| 2262 | CURSOROFF PROC FAR | ||
| 2263 | ; | ||
| 2264 | PUSH AX ;save registers | ||
| 2265 | PUSH BX | ||
| 2266 | PUSH CX | ||
| 2267 | ; | ||
| 2268 | MOV AH,3 ;function to get cursor info | ||
| 2269 | MOV BH,0 ;page zero | ||
| 2270 | INT 10H | ||
| 2271 | OR CH,20H ;set bit 6 | ||
| 2272 | MOV AH,1 ;function to set cursor | ||
| 2273 | INT 10H | ||
| 2274 | ; | ||
| 2275 | POP CX ;restore registers | ||
| 2276 | POP BX | ||
| 2277 | POP AX | ||
| 2278 | ; | ||
| 2279 | RET | ||
| 2280 | CURSOROFF ENDP | ||
| 2281 | ; | ||
| 2282 | PAGE | ||
| 2283 | ;-----------------------------------------------------------------------------+ | ||
| 2284 | ; : | ||
| 2285 | ; Name: CURSORON : | ||
| 2286 | ; : | ||
| 2287 | ; Description: Displays the hardare cursor. : | ||
| 2288 | ; : | ||
| 2289 | ; Entry: None. : | ||
| 2290 | ; : | ||
| 2291 | ; Exit: None. : | ||
| 2292 | ; : | ||
| 2293 | ; Entry point: CURSORON : | ||
| 2294 | ; : | ||
| 2295 | ; Notes: None. : | ||
| 2296 | ; : | ||
| 2297 | ; Internal references: None. : | ||
| 2298 | ; : | ||
| 2299 | ; External references: None. : | ||
| 2300 | ; : | ||
| 2301 | ;-----------------------------------------------------------------------------+ | ||
| 2302 | ; | ||
| 2303 | CURSORON PROC FAR | ||
| 2304 | ; | ||
| 2305 | PUSH AX ;save registers | ||
| 2306 | PUSH BX | ||
| 2307 | PUSH CX | ||
| 2308 | PUSH DX ;>>SN | ||
| 2309 | ; | ||
| 2310 | MOV AH,3 ;function to get cursor info | ||
| 2311 | MOV BH,0 ;page zero | ||
| 2312 | INT 10H | ||
| 2313 | AND CH,NOT 20H ;clear bit 6 | ||
| 2314 | MOV AH,1 ;function to set cursor | ||
| 2315 | INT 10H | ||
| 2316 | ; | ||
| 2317 | POP DX ;>>SN | ||
| 2318 | POP CX ;restore registers | ||
| 2319 | POP BX | ||
| 2320 | POP AX | ||
| 2321 | ; | ||
| 2322 | RET | ||
| 2323 | CURSORON ENDP | ||
| 2324 | ; | ||
| 2325 | PAGE | ||
| 2326 | ;-----------------------------------------------------------------------------+ | ||
| 2327 | ; : | ||
| 2328 | ; Name: PCINPUT_CALL : | ||
| 2329 | ; : | ||
| 2330 | ; Description: Call to PCINPUT. : | ||
| 2331 | ; : | ||
| 2332 | ; Entry: PCINPUT parameter block initialized. : | ||
| 2333 | ; : | ||
| 2334 | ; Exit: PCINPUT parameter block initialized. : | ||
| 2335 | ; : | ||
| 2336 | ; Entry point: PCINPUT_CALL : | ||
| 2337 | ; : | ||
| 2338 | ; Notes: None. : | ||
| 2339 | ; : | ||
| 2340 | ; Internal references: None. : | ||
| 2341 | ; : | ||
| 2342 | ; External references: None. : | ||
| 2343 | ; : | ||
| 2344 | ;-----------------------------------------------------------------------------+ | ||
| 2345 | ; | ||
| 2346 | PCINPUT_CALL PROC FAR | ||
| 2347 | ; | ||
| 2348 | PUSH DS ;set segment | ||
| 2349 | POP ES | ||
| 2350 | ; | ||
| 2351 | PUSH DS | ||
| 2352 | PUSH DI ;save registers | ||
| 2353 | ; | ||
| 2354 | TEST COM_STATE2,COM_DBCS ;check if DBCS option active | ||
| 2355 | JE INPT10 | ||
| 2356 | ; | ||
| 2357 | OR IN_OPT,IN_DDBCS+IN_ADBCS ;activate DBCS | ||
| 2358 | ; | ||
| 2359 | INPT10: LEA DI,IN_OPT ;set DI to proper parameter block | ||
| 2360 | ; for call | ||
| 2361 | IF CASRM | ||
| 2362 | MOV AH,00H ;make call to CAS-RM | ||
| 2363 | MOV BX,IN_RN ;set CAS routine number | ||
| 2364 | INT CASINT ;call routine | ||
| 2365 | ELSE | ||
| 2366 | CALL INPUT | ||
| 2367 | ENDIF | ||
| 2368 | POP DI ;restore registers | ||
| 2369 | POP DS | ||
| 2370 | ; | ||
| 2371 | RET | ||
| 2372 | PCINPUT_CALL ENDP | ||
| 2373 | ; | ||
| 2374 | PAGE | ||
| 2375 | ;-----------------------------------------------------------------------------+ | ||
| 2376 | ; : | ||
| 2377 | ; Name: PCINCHA_CALL : | ||
| 2378 | ; : | ||
| 2379 | ; Description: Call to PCINCHA. : | ||
| 2380 | ; : | ||
| 2381 | ; Entry: PCINCHA parameter block initialized. : | ||
| 2382 | ; : | ||
| 2383 | ; Exit: PCINCHA parameter block initialized. : | ||
| 2384 | ; : | ||
| 2385 | ; Entry point: PCINCHA_CALL : | ||
| 2386 | ; : | ||
| 2387 | ; Notes: None. : | ||
| 2388 | ; : | ||
| 2389 | ; Internal references: None. : | ||
| 2390 | ; : | ||
| 2391 | ; External references: None. : | ||
| 2392 | ; : | ||
| 2393 | ;-----------------------------------------------------------------------------+ | ||
| 2394 | ; | ||
| 2395 | PCINCHA_CALL PROC NEAR | ||
| 2396 | ; | ||
| 2397 | PUSH DS ;set segment | ||
| 2398 | POP ES | ||
| 2399 | ; | ||
| 2400 | PUSH DS | ||
| 2401 | PUSH DI ;save registers | ||
| 2402 | ; | ||
| 2403 | TEST COM_STATE2,COM_DBCS ;check if DBCS option active | ||
| 2404 | JE INCH10 | ||
| 2405 | ; | ||
| 2406 | OR INC_OPT,INC_DDBCS ;activate DBCS | ||
| 2407 | ; | ||
| 2408 | INCH10: LEA DI,INC_OPT ;set DI to proper parameter block | ||
| 2409 | ; for call | ||
| 2410 | IF CASRM | ||
| 2411 | MOV AH,00H ;make call to CAS-RM | ||
| 2412 | MOV BX,INC_RN ;set CAS routine number | ||
| 2413 | INT CASINT ;call routine | ||
| 2414 | ELSE | ||
| 2415 | CALL INCHA | ||
| 2416 | ENDIF | ||
| 2417 | POP DI ;restore registers | ||
| 2418 | POP DS | ||
| 2419 | ; | ||
| 2420 | RET | ||
| 2421 | PCINCHA_CALL ENDP | ||
| 2422 | ; | ||
| 2423 | PAGE | ||
| 2424 | ;-----------------------------------------------------------------------------+ | ||
| 2425 | ; : | ||
| 2426 | ; Name: PCDISPQ_CALL : | ||
| 2427 | ; : | ||
| 2428 | ; Description: Call to PCDISPQ. : | ||
| 2429 | ; : | ||
| 2430 | ; Entry: PCDISPQ parameter block initialized. : | ||
| 2431 | ; : | ||
| 2432 | ; Exit: PCDISPQ parameter block initialized. : | ||
| 2433 | ; : | ||
| 2434 | ; Entry point: PCDISPQ_CALL : | ||
| 2435 | ; : | ||
| 2436 | ; Notes: None. : | ||
| 2437 | ; : | ||
| 2438 | ; Internal references: None. : | ||
| 2439 | ; : | ||
| 2440 | ; External references: None. : | ||
| 2441 | ; : | ||
| 2442 | ;-----------------------------------------------------------------------------+ | ||
| 2443 | ; | ||
| 2444 | PCDISPQ_CALL PROC NEAR | ||
| 2445 | ; | ||
| 2446 | PUSH DS ;set segment | ||
| 2447 | POP ES | ||
| 2448 | ; | ||
| 2449 | PUSH DS | ||
| 2450 | PUSH DI ;save registers | ||
| 2451 | ; | ||
| 2452 | LEA DI,QM_OPT1 ;set DI to proper parameter block | ||
| 2453 | ; for call | ||
| 2454 | IF CASRM | ||
| 2455 | MOV AH,00H ;make call to CAS-RM | ||
| 2456 | MOV BX,QM_RN ;set CAS routine number | ||
| 2457 | INT CASINT ;call routine | ||
| 2458 | ELSE | ||
| 2459 | CALL DISPQ | ||
| 2460 | ENDIF | ||
| 2461 | POP DI ;restore registers | ||
| 2462 | POP DS | ||
| 2463 | ; | ||
| 2464 | RET | ||
| 2465 | PCDISPQ_CALL ENDP | ||
| 2466 | ; | ||
| 2467 | PAGE | ||
| 2468 | ;-----------------------------------------------------------------------------+ | ||
| 2469 | ; : | ||
| 2470 | ; Name: PCPANEL_CALL : | ||
| 2471 | ; : | ||
| 2472 | ; Description: Initialize for call to PCPANEL including refresh of : | ||
| 2473 | ; input and scroll fields in the logical video buffer : | ||
| 2474 | ; before display. : | ||
| 2475 | ; : | ||
| 2476 | ; Entry: PCPANEL parameter block initialized. : | ||
| 2477 | ; : | ||
| 2478 | ; AX 0= Logical video buffer mode write : | ||
| 2479 | ; 1= Direct video mode write : | ||
| 2480 | ; : | ||
| 2481 | ; Exit: PCPANEL parameter block initialized. : | ||
| 2482 | ; : | ||
| 2483 | ; Entry point: PCPANEL_CALL : | ||
| 2484 | ; : | ||
| 2485 | ; Notes: None. : | ||
| 2486 | ; : | ||
| 2487 | ; Internal references: None. : | ||
| 2488 | ; : | ||
| 2489 | ; External references: None. : | ||
| 2490 | ; : | ||
| 2491 | ;-----------------------------------------------------------------------------+ | ||
| 2492 | ; | ||
| 2493 | PCPANEL_CALL PROC NEAR | ||
| 2494 | ; | ||
| 2495 | ; initialize PCDISPQ info for PCPANEL call | ||
| 2496 | ; | ||
| 2497 | CMP AX,1 ;check if direct video buffer | ||
| 2498 | JE PP10 ; write option active | ||
| 2499 | ; | ||
| 2500 | MOV BX,QM_PANQUENUM | ||
| 2501 | MOV PM_PANQUENUM,BX ;number of panels in parent queue | ||
| 2502 | ; | ||
| 2503 | MOV BX,QM_CHDQUENUM | ||
| 2504 | MOV PM_CHDQUENUM,BX ;number panels in child queue | ||
| 2505 | ; | ||
| 2506 | MOV BX,QM_ACTIVEPAN | ||
| 2507 | MOV PM_ACTIVEPAN,BX ;active parent panel number | ||
| 2508 | ; | ||
| 2509 | MOV PM_OPT1,PM_DOA+PM_DOV+PM_DOQ+PM_CL | ||
| 2510 | MOV PM_PANPDQNUM,1 ;beg/ending parent PDQ number | ||
| 2511 | MOV PM_PANBRKOFF,0 ;panel off in lvb of break panel | ||
| 2512 | ; | ||
| 2513 | ; actual PCPANEL call | ||
| 2514 | ; | ||
| 2515 | PP10: PUSH DS ;set segment | ||
| 2516 | POP ES | ||
| 2517 | ; | ||
| 2518 | PUSH DS | ||
| 2519 | PUSH DI ;save registers | ||
| 2520 | ; | ||
| 2521 | LEA DI,PM_OPT1 ;set DI to proper parameter block | ||
| 2522 | ; for call | ||
| 2523 | IF CASRM | ||
| 2524 | MOV AH,00H ;make call to CAS-RM | ||
| 2525 | MOV BX,PM_RN ;set CAS routine number | ||
| 2526 | INT CASINT ;call routine | ||
| 2527 | ELSE | ||
| 2528 | CALL PANEL | ||
| 2529 | ENDIF | ||
| 2530 | POP DI ;restore registers | ||
| 2531 | POP DS | ||
| 2532 | ; | ||
| 2533 | ; Exit | ||
| 2534 | ; | ||
| 2535 | PPEXIT: ;exit | ||
| 2536 | ; | ||
| 2537 | RET | ||
| 2538 | PCPANEL_CALL ENDP | ||
| 2539 | ; | ||
| 2540 | PAGE | ||
| 2541 | ;-----------------------------------------------------------------------------+ | ||
| 2542 | ; : | ||
| 2543 | ; Name: PCMBEEP_CALL : | ||
| 2544 | ; : | ||
| 2545 | ; Description: Call to PCMBEEP. : | ||
| 2546 | ; : | ||
| 2547 | ; Entry: PCMBEEP parameter block initialized. : | ||
| 2548 | ; : | ||
| 2549 | ; Exit: PCMBEEP parameter block initialized. : | ||
| 2550 | ; : | ||
| 2551 | ; Entry point: PCMBEEP_CALL : | ||
| 2552 | ; : | ||
| 2553 | ; Notes: None. : | ||
| 2554 | ; : | ||
| 2555 | ; Internal references: None. : | ||
| 2556 | ; : | ||
| 2557 | ; External references: None. : | ||
| 2558 | ; : | ||
| 2559 | ;-----------------------------------------------------------------------------+ | ||
| 2560 | ; | ||
| 2561 | PCMBEEP_CALL PROC FAR | ||
| 2562 | ; | ||
| 2563 | TEST COM_STATE2,COM_SOUD ;check if sound is off | ||
| 2564 | JE BEXIT | ||
| 2565 | ; | ||
| 2566 | PUSH CX ;save registers | ||
| 2567 | PUSH DX | ||
| 2568 | ; | ||
| 2569 | PUSH DS ;set segment | ||
| 2570 | POP ES | ||
| 2571 | ; | ||
| 2572 | PUSH DS | ||
| 2573 | PUSH DI ;save registers | ||
| 2574 | ; | ||
| 2575 | LEA DI,MB_FREQUENCY ;set DI to proper parameter block | ||
| 2576 | ; for call | ||
| 2577 | IF CASRM | ||
| 2578 | MOV AH,00H ;make call to CAS-RM | ||
| 2579 | MOV BX,MB_RN ;set CAS routine number | ||
| 2580 | INT CASINT ;call routine | ||
| 2581 | ELSE | ||
| 2582 | CALL MBEEP | ||
| 2583 | ENDIF | ||
| 2584 | POP DI ;restore registers | ||
| 2585 | POP DS | ||
| 2586 | ; | ||
| 2587 | POP DX ;restore registers | ||
| 2588 | POP CX | ||
| 2589 | ; | ||
| 2590 | BEXIT: | ||
| 2591 | ; | ||
| 2592 | RET | ||
| 2593 | PCMBEEP_CALL ENDP | ||
| 2594 | ; | ||
| 2595 | PAGE | ||
| 2596 | ;-----------------------------------------------------------------------------+ | ||
| 2597 | ; : | ||
| 2598 | ; Name: PCSLCTP_CALL : | ||
| 2599 | |||
| 2600 | ; : | ||
| 2601 | ; Description: Call to PCSLCTP. : | ||
| 2602 | ; : | ||
| 2603 | ; Entry: ES:DI = beginning address of PCSLCTP parameter block. : | ||
| 2604 | ; : | ||
| 2605 | ; Exit: PCSLCTP parameter block initialized. : | ||
| 2606 | ; : | ||
| 2607 | ; Entry point: PCSLCTP_CALL : | ||
| 2608 | ; : | ||
| 2609 | ; Notes: None. : | ||
| 2610 | ; : | ||
| 2611 | ; Internal references: None. : | ||
| 2612 | ; : | ||
| 2613 | ; External references: None. : | ||
| 2614 | ; : | ||
| 2615 | ;-----------------------------------------------------------------------------+ | ||
| 2616 | ; | ||
| 2617 | PCSLCTP_CALL PROC NEAR | ||
| 2618 | ; | ||
| 2619 | ; Initialize color index vector | ||
| 2620 | ; | ||
| 2621 | MOV AX,PM_CCBVECNUM ;set color index number | ||
| 2622 | MOV ES:[DI]+SCB_CCBVECNUM,AX | ||
| 2623 | ; | ||
| 2624 | MOV AX,CRD_CCBVECOFF ;set color index offset | ||
| 2625 | MOV ES:[DI]+SCB_CCBVECOFF,AX | ||
| 2626 | ; | ||
| 2627 | MOV AX,CRD_CCBVECSEG ;set color index segment | ||
| 2628 | MOV ES:[DI]+SCB_CCBVECSEG,AX | ||
| 2629 | ; | ||
| 2630 | IF CASRM | ||
| 2631 | MOV AH,00H ;make call to CAS-RM | ||
| 2632 | MOV BX,SCB_RN ;set CAS routine number | ||
| 2633 | INT CASINT ;call slctopt | ||
| 2634 | ELSE | ||
| 2635 | CALL SLCTP | ||
| 2636 | ENDIF | ||
| 2637 | ; | ||
| 2638 | RET | ||
| 2639 | PCSLCTP_CALL ENDP | ||
| 2640 | ; | ||
| 2641 | PAGE | ||
| 2642 | ;-----------------------------------------------------------------------------+ | ||
| 2643 | ; : | ||
| 2644 | ; Name: PCHLPRD_CALL : | ||
| 2645 | ; : | ||
| 2646 | ; Description: Call to PCHLPRD. : | ||
| 2647 | ; : | ||
| 2648 | ; Entry: PCHLPRD parameter block initialized. : | ||
| 2649 | ; : | ||
| 2650 | ; Exit: PCHLPRD parameter block initialized. : | ||
| 2651 | ; : | ||
| 2652 | ; Entry point: PCHLPRD_CALL : | ||
| 2653 | ; : | ||
| 2654 | ; Notes: None. : | ||
| 2655 | ; : | ||
| 2656 | ; Internal references: None. : | ||
| 2657 | ; : | ||
| 2658 | ; External references: None. : | ||
| 2659 | ; : | ||
| 2660 | ;-----------------------------------------------------------------------------+ | ||
| 2661 | ; | ||
| 2662 | PCHLPRD_CALL PROC NEAR | ||
| 2663 | ; | ||
| 2664 | PUSH DS ;set segment | ||
| 2665 | POP ES | ||
| 2666 | ; | ||
| 2667 | PUSH DS | ||
| 2668 | PUSH DI ;save registers | ||
| 2669 | ; | ||
| 2670 | LEA DI,HRD_OPT1 ;set DI to proper parameter block | ||
| 2671 | ; for call | ||
| 2672 | IF CASRM | ||
| 2673 | MOV AH,00H ;make call to CAS-RM | ||
| 2674 | MOV BX,HRD_RN ;set CAS routine number | ||
| 2675 | INT CASINT ;call routine | ||
| 2676 | ELSE | ||
| 2677 | CALL HLPRD | ||
| 2678 | ENDIF | ||
| 2679 | POP DI ;restore registers | ||
| 2680 | POP DS | ||
| 2681 | ; | ||
| 2682 | RET | ||
| 2683 | PCHLPRD_CALL ENDP | ||
| 2684 | ; | ||
| 2685 | PAGE | ||
| 2686 | ;-----------------------------------------------------------------------------+ | ||
| 2687 | ; : | ||
| 2688 | ; Name: PCINSTR_CALL : | ||
| 2689 | ; : | ||
| 2690 | ; Description: Call to PCINSTR. : | ||
| 2691 | ; : | ||
| 2692 | ; Entry: PCINSTR parameter block initialized. : | ||
| 2693 | ; : | ||
| 2694 | ; Exit: PCINSTR parameter block initialized. : | ||
| 2695 | ; : | ||
| 2696 | ; Entry point: PCINSTR_CALL : | ||
| 2697 | ; : | ||
| 2698 | ; Notes: None. : | ||
| 2699 | ; : | ||
| 2700 | ; Internal references: None. : | ||
| 2701 | ; : | ||
| 2702 | ; External references: None. : | ||
| 2703 | ; : | ||
| 2704 | ;-----------------------------------------------------------------------------+ | ||
| 2705 | ; | ||
| 2706 | PCINSTR_CALL PROC NEAR | ||
| 2707 | ; | ||
| 2708 | PUSH DS ;set segment | ||
| 2709 | POP ES | ||
| 2710 | ; | ||
| 2711 | PUSH DS | ||
| 2712 | PUSH DI ;save registers | ||
| 2713 | ; | ||
| 2714 | LEA DI,INS_OPT ;set DI to proper parameter block | ||
| 2715 | ; for call | ||
| 2716 | IF CASRM | ||
| 2717 | MOV AH,00H ;make call to CAS-RM | ||
| 2718 | MOV BX,INS_RN ;set CAS routine number | ||
| 2719 | INT CASINT ;call routine | ||
| 2720 | ELSE | ||
| 2721 | CALL INSTRN | ||
| 2722 | ENDIF | ||
| 2723 | POP DI ;restore registers | ||
| 2724 | POP DS | ||
| 2725 | ; | ||
| 2726 | RET | ||
| 2727 | PCINSTR_CALL ENDP | ||
| 2728 | ; | ||
| 2729 | PAGE | ||
| 2730 | ;-----------------------------------------------------------------------------+ | ||
| 2731 | ; : | ||
| 2732 | ; Name: PCGVIDO_CALL : | ||
| 2733 | ; : | ||
| 2734 | ; Description: Call to PCGVIDO. : | ||
| 2735 | ; : | ||
| 2736 | ; Entry: PCGVIDO parameter block initialized. : | ||
| 2737 | ; : | ||
| 2738 | ; Exit: PCGVIDO parameter block initialized. : | ||
| 2739 | ; : | ||
| 2740 | ; Entry point: PCGVIDO_CALL : | ||
| 2741 | ; : | ||
| 2742 | ; Notes: None. : | ||
| 2743 | ; : | ||
| 2744 | ; Internal references: None. : | ||
| 2745 | ; : | ||
| 2746 | ; External references: None. : | ||
| 2747 | ; : | ||
| 2748 | ;-----------------------------------------------------------------------------+ | ||
| 2749 | ; | ||
| 2750 | PCGVIDO_CALL PROC NEAR | ||
| 2751 | ; | ||
| 2752 | PUSH ES | ||
| 2753 | ; | ||
| 2754 | PUSH DS ;set segment | ||
| 2755 | POP ES | ||
| 2756 | ; | ||
| 2757 | PUSH DS | ||
| 2758 | PUSH DI ;save registers | ||
| 2759 | ; | ||
| 2760 | LEA DI,GV_STAT1 ;set DI to proper parameter block | ||
| 2761 | ; for call | ||
| 2762 | ; | ||
| 2763 | IF CASRM | ||
| 2764 | MOV AH,00H ;make call to CAS-RM | ||
| 2765 | MOV BX,GV_RN ;set CAS routine number | ||
| 2766 | INT CASINT ;call routine | ||
| 2767 | ELSE | ||
| 2768 | CALL GVIDO | ||
| 2769 | ENDIF | ||
| 2770 | POP DI ;restore registers | ||
| 2771 | POP DS | ||
| 2772 | ; | ||
| 2773 | POP ES | ||
| 2774 | ; | ||
| 2775 | RET | ||
| 2776 | PCGVIDO_CALL ENDP | ||
| 2777 | ; | ||
| 2778 | PAGE | ||
| 2779 | ;-----------------------------------------------------------------------------+ | ||
| 2780 | ; : | ||
| 2781 | ; Name: PCCLRWR_CALL : | ||
| 2782 | ; : | ||
| 2783 | ; Description: Call to PCCLRWR. : | ||
| 2784 | ; : | ||
| 2785 | ; Entry: PCCLRWR parameter block initialized. : | ||
| 2786 | ; : | ||
| 2787 | ; Exit: PCCLRWR parameter block initialized. : | ||
| 2788 | ; : | ||
| 2789 | ; Entry point: PCCLRWR_CALL : | ||
| 2790 | ; : | ||
| 2791 | ; Notes: None. : | ||
| 2792 | ; : | ||
| 2793 | ; Internal references: None. : | ||
| 2794 | ; : | ||
| 2795 | ; External references: None. : | ||
| 2796 | ; : | ||
| 2797 | ;-----------------------------------------------------------------------------+ | ||
| 2798 | ; | ||
| 2799 | PCCLRWR_CALL PROC NEAR | ||
| 2800 | ; | ||
| 2801 | PUSH DS ;set segment | ||
| 2802 | POP ES | ||
| 2803 | ; | ||
| 2804 | PUSH DS | ||
| 2805 | PUSH DI ;save registers | ||
| 2806 | ; | ||
| 2807 | LEA DI,CWR_OPT ;set DI to proper parameter block | ||
| 2808 | ; for call | ||
| 2809 | IF CASRM | ||
| 2810 | MOV AH,00H ;make call to CAS-RM | ||
| 2811 | MOV BX,CWR_RN ;set CAS routine number | ||
| 2812 | INT CASINT ;call routine | ||
| 2813 | ELSE | ||
| 2814 | CALL CLRWR | ||
| 2815 | ENDIF | ||
| 2816 | POP DI ;restore registers | ||
| 2817 | POP DS | ||
| 2818 | ; | ||
| 2819 | RET | ||
| 2820 | PCCLRWR_CALL ENDP | ||
| 2821 | ; | ||
| 2822 | PAGE | ||
| 2823 | ;-----------------------------------------------------------------------------+ | ||
| 2824 | ; : | ||
| 2825 | ; Name: PCCRITE_CALL : | ||
| 2826 | ; : | ||
| 2827 | ; Description: Call to PCCRITE. : | ||
| 2828 | ; : | ||
| 2829 | ; Entry: PCCRITE parameter block initialized. : | ||
| 2830 | ; : | ||
| 2831 | ; Exit: PCCRITE parameter block initialized. : | ||
| 2832 | ; : | ||
| 2833 | ; Entry point: PCCRITE_CALL : | ||
| 2834 | ; : | ||
| 2835 | ; Notes: None. : | ||
| 2836 | ; : | ||
| 2837 | ; Internal references: None. : | ||
| 2838 | ; : | ||
| 2839 | ; External references: None. : | ||
| 2840 | ; : | ||
| 2841 | ;-----------------------------------------------------------------------------+ | ||
| 2842 | ; | ||
| 2843 | PCCRITE_CALL PROC NEAR | ||
| 2844 | ; | ||
| 2845 | PUSH DS ;set segment | ||
| 2846 | POP ES | ||
| 2847 | ; | ||
| 2848 | PUSH DS | ||
| 2849 | PUSH DI ;save registers | ||
| 2850 | ; | ||
| 2851 | LEA DI,CE_OPT ;set DI to proper parameter block | ||
| 2852 | ; for call | ||
| 2853 | ; | ||
| 2854 | IF CASRM | ||
| 2855 | MOV AH,00H ;make call to CAS-RM | ||
| 2856 | MOV BX,CE_RN ;set CAS routine number | ||
| 2857 | INT CASINT ;call routine | ||
| 2858 | ELSE | ||
| 2859 | CALL CRITE | ||
| 2860 | ENDIF | ||
| 2861 | POP DI ;restore registers | ||
| 2862 | POP DS | ||
| 2863 | ; | ||
| 2864 | RET | ||
| 2865 | PCCRITE_CALL ENDP | ||
| 2866 | ; | ||
| 2867 | PAGE | ||
| 2868 | ;-----------------------------------------------------------------------------+ | ||
| 2869 | ; : | ||
| 2870 | ; Name: PCWWRAP_CALL : | ||
| 2871 | ; : | ||
| 2872 | ; Description: Call to PCWWRAP. : | ||
| 2873 | ; : | ||
| 2874 | ; Entry: PCWWRAP parameter block initialized. : | ||
| 2875 | ; : | ||
| 2876 | ; Exit: PCWWRAP parameter block initialized. : | ||
| 2877 | ; : | ||
| 2878 | ; Entry point: PCWWRAP_CALL : | ||
| 2879 | ; : | ||
| 2880 | ; Notes: None. : | ||
| 2881 | ; : | ||
| 2882 | ; Internal references: None. : | ||
| 2883 | ; : | ||
| 2884 | ; External references: None. : | ||
| 2885 | ; : | ||
| 2886 | ;-----------------------------------------------------------------------------+ | ||
| 2887 | ; | ||
| 2888 | PCWWRAP_CALL PROC NEAR | ||
| 2889 | ; | ||
| 2890 | PUSH DS ;set segment | ||
| 2891 | POP ES | ||
| 2892 | ; | ||
| 2893 | PUSH DS | ||
| 2894 | PUSH DI ;save registers | ||
| 2895 | ; | ||
| 2896 | LEA DI,WWP_OPT1 ;set DI to proper parameter block | ||
| 2897 | ; for call | ||
| 2898 | ; | ||
| 2899 | IF CASRM | ||
| 2900 | MOV AH,00H ;make call to CAS-RM | ||
| 2901 | MOV BX,WWP_RN ;set CAS routine number | ||
| 2902 | INT CASINT ;call routine | ||
| 2903 | ELSE | ||
| 2904 | CALL WWRAP | ||
| 2905 | ENDIF | ||
| 2906 | POP DI ;restore registers | ||
| 2907 | POP DS | ||
| 2908 | ; | ||
| 2909 | RET | ||
| 2910 | PCWWRAP_CALL ENDP | ||
| 2911 | ; | ||
| 2912 | PAGE | ||
| 2913 | ;-----------------------------------------------------------------------------+ | ||
| 2914 | ; : | ||
| 2915 | ; Name: PCTRACK_CALL : | ||
| 2916 | ; : | ||
| 2917 | ; Description: Call to PCTRACK. : | ||
| 2918 | ; : | ||
| 2919 | ; Entry: PCTRACK parameter block initialized. : | ||
| 2920 | ; : | ||
| 2921 | ; Exit: PCTRACK parameter block initialized. : | ||
| 2922 | ; : | ||
| 2923 | ; Entry point: PCTRACK_CALL : | ||
| 2924 | ; : | ||
| 2925 | ; Notes: None. : | ||
| 2926 | ; : | ||
| 2927 | ; Internal references: None. : | ||
| 2928 | ; : | ||
| 2929 | ; External references: None. : | ||
| 2930 | ; : | ||
| 2931 | ;-----------------------------------------------------------------------------+ | ||
| 2932 | ; | ||
| 2933 | PCTRACK_CALL PROC FAR | ||
| 2934 | ; | ||
| 2935 | PUSH DS | ||
| 2936 | PUSH DI ;save registers | ||
| 2937 | ; | ||
| 2938 | PUSH DS ;point to PCTRACK parameter block | ||
| 2939 | POP ES | ||
| 2940 | ; | ||
| 2941 | IF CASRM | ||
| 2942 | MOV AH,00H ;make call to CAS-RM | ||
| 2943 | MOV BX,MS_RN ;set CAS routine number | ||
| 2944 | INT CASINT ;call routine | ||
| 2945 | ELSE | ||
| 2946 | CALL TRACK | ||
| 2947 | ENDIF | ||
| 2948 | POP DI ;restore registers | ||
| 2949 | POP DS | ||
| 2950 | ; | ||
| 2951 | RET | ||
| 2952 | PCTRACK_CALL ENDP | ||
| 2953 | ; | ||
| 2954 | PAGE | ||
| 2955 | ;-----------------------------------------------------------------------------+ | ||
| 2956 | ; : | ||
| 2957 | ; Name: PCGRAPH_CALL : | ||
| 2958 | ; : | ||
| 2959 | ; Description: Call to PCGRAPH. : | ||
| 2960 | ; : | ||
| 2961 | ; Entry: PCGRAPH parameter block initialized. : | ||
| 2962 | ; : | ||
| 2963 | ; Exit: PCGRAPH parameter block initialized. : | ||
| 2964 | ; : | ||
| 2965 | ; Entry point: PCGRAPH_CALL : | ||
| 2966 | ; : | ||
| 2967 | ; Notes: None. : | ||
| 2968 | ; : | ||
| 2969 | ; Internal references: None. : | ||
| 2970 | ; : | ||
| 2971 | ; External references: None. : | ||
| 2972 | ; : | ||
| 2973 | ;-----------------------------------------------------------------------------+ | ||
| 2974 | ; | ||
| 2975 | PCGRAPH_CALL PROC NEAR | ||
| 2976 | ; | ||
| 2977 | PUSH DS | ||
| 2978 | PUSH DI ;save registers | ||
| 2979 | ; | ||
| 2980 | IF CASRM | ||
| 2981 | MOV AH,00H ;make call to CAS-RM | ||
| 2982 | MOV BX,MS_RN ;set CAS routine number | ||
| 2983 | INT CASINT ;call routine | ||
| 2984 | ELSE | ||
| 2985 | CALL GRAPH | ||
| 2986 | ENDIF | ||
| 2987 | POP DI ;restore registers | ||
| 2988 | POP DS | ||
| 2989 | ; | ||
| 2990 | RET | ||
| 2991 | PCGRAPH_CALL ENDP | ||
| 2992 | ; | ||
| 2993 | PAGE | ||
| 2994 | ;-----------------------------------------------------------------------------+ | ||
| 2995 | ; : | ||
| 2996 | ; Name: PCST2IN_CALL : | ||
| 2997 | ; : | ||
| 2998 | ; Description: Call to PCST2IN. : | ||
| 2999 | ; : | ||
| 3000 | ; Entry: PCST2IN parameter block initialized. : | ||
| 3001 | ; : | ||
| 3002 | ; Exit: PCST2IN parameter block initialized. : | ||
| 3003 | ; : | ||
| 3004 | ; Entry point: PCST2IN_CALL : | ||
| 3005 | ; : | ||
| 3006 | ; Notes: None. : | ||
| 3007 | ; : | ||
| 3008 | ; Internal references: None. : | ||
| 3009 | ; : | ||
| 3010 | ; External references: None. : | ||
| 3011 | ; : | ||
| 3012 | ;-----------------------------------------------------------------------------+ | ||
| 3013 | ; | ||
| 3014 | PCST2IN_CALL PROC NEAR | ||
| 3015 | ; | ||
| 3016 | PUSH DS ;set segment | ||
| 3017 | POP ES | ||
| 3018 | ; | ||
| 3019 | PUSH DS | ||
| 3020 | PUSH DI ;save registers | ||
| 3021 | ; | ||
| 3022 | LEA DI,ST2_OPT1 ;set DI to proper parameter block | ||
| 3023 | ; for call | ||
| 3024 | ; | ||
| 3025 | IF CASRM | ||
| 3026 | MOV AH,00H ;make call to CAS-RM | ||
| 3027 | MOV BX,S2I_RN ;set CAS routine number | ||
| 3028 | INT CASINT ;call routine | ||
| 3029 | ELSE | ||
| 3030 | CALL ST2IN | ||
| 3031 | ENDIF | ||
| 3032 | POP DI ;restore registers | ||
| 3033 | POP DS | ||
| 3034 | ; | ||
| 3035 | RET | ||
| 3036 | PCST2IN_CALL ENDP | ||
| 3037 | ; | ||
| 3038 | PAGE | ||
| 3039 | ;-----------------------------------------------------------------------------+ | ||
| 3040 | ; : | ||
| 3041 | ; Name: PCMOVEC_CALL : | ||
| 3042 | ; : | ||
| 3043 | ; Description: Call to PCMOVEC. : | ||
| 3044 | ; : | ||
| 3045 | ; Entry: PCMOVEC parameter block initialized. : | ||
| 3046 | ; : | ||
| 3047 | ; Exit: PCMOVEC parameter block initialized. : | ||
| 3048 | ; : | ||
| 3049 | ; Entry point: PCMOVEC_CALL : | ||
| 3050 | ; : | ||
| 3051 | ; Notes: None. : | ||
| 3052 | ; : | ||
| 3053 | ; Internal references: None. : | ||
| 3054 | ; : | ||
| 3055 | ; External references: None. : | ||
| 3056 | ; : | ||
| 3057 | ;-----------------------------------------------------------------------------+ | ||
| 3058 | ; | ||
| 3059 | PCMOVEC_CALL PROC NEAR | ||
| 3060 | ; | ||
| 3061 | PUSH DS ;set segment | ||
| 3062 | POP ES | ||
| 3063 | ; | ||
| 3064 | PUSH DS | ||
| 3065 | PUSH DI ;save registers | ||
| 3066 | ; | ||
| 3067 | LEA DI,MO_OPT ;set DI to proper parameter block | ||
| 3068 | ; for call | ||
| 3069 | ; | ||
| 3070 | IF CASRM | ||
| 3071 | MOV AH,00H ;make call to CAS-RM | ||
| 3072 | MOV BX,MO_RN ;set CAS routine number | ||
| 3073 | INT CASINT ;call routine | ||
| 3074 | ELSE | ||
| 3075 | CALL MOVEC | ||
| 3076 | ENDIF | ||
| 3077 | POP DI ;restore registers | ||
| 3078 | POP DS | ||
| 3079 | ; | ||
| 3080 | RET | ||
| 3081 | PCMOVEC_CALL ENDP | ||
| 3082 | ; | ||
| 3083 | PAGE | ||
| 3084 | ;-----------------------------------------------------------------------------+ | ||
| 3085 | ; : | ||
| 3086 | ; Name: SHELLDA_CALL : | ||
| 3087 | ; : | ||
| 3088 | ; Description: Call to SHELLDA. : | ||
| 3089 | ; : | ||
| 3090 | ; Entry: None : | ||
| 3091 | ; : | ||
| 3092 | ; Exit: None : | ||
| 3093 | ; : | ||
| 3094 | ; Entry point: SHELLDA_CALL : | ||
| 3095 | ; : | ||
| 3096 | ; Notes: None. : | ||
| 3097 | ; : | ||
| 3098 | ; Internal references: None. : | ||
| 3099 | ; : | ||
| 3100 | ; External references: None. : | ||
| 3101 | ; : | ||
| 3102 | ;-----------------------------------------------------------------------------+ | ||
| 3103 | ; | ||
| 3104 | SHELLDA_CALL PROC NEAR | ||
| 3105 | ; | ||
| 3106 | CALL SHELLDA | ||
| 3107 | ; | ||
| 3108 | RET | ||
| 3109 | SHELLDA_CALL ENDP | ||
| 3110 | ; | ||
| 3111 | PAGE | ||
| 3112 | ;-----------------------------------------------------------------------------+ | ||
| 3113 | ; : | ||
| 3114 | ; PCROWCL_CALL : | ||
| 3115 | ; : | ||
| 3116 | ; Call to PCROWCL. : | ||
| 3117 | ; : | ||
| 3118 | ; Entry: PB initialized. : | ||
| 3119 | ; : | ||
| 3120 | ; Exit: None : | ||
| 3121 | ; : | ||
| 3122 | ; Notes: None : | ||
| 3123 | ; : | ||
| 3124 | ;-----------------------------------------------------------------------------+ | ||
| 3125 | ; | ||
| 3126 | PCROWCL_CALL PROC NEAR | ||
| 3127 | |||
| 3128 | PUSH ES | ||
| 3129 | PUSH DS ;set segment | ||
| 3130 | POP ES | ||
| 3131 | |||
| 3132 | PUSH DS | ||
| 3133 | PUSH DI ;save registers | ||
| 3134 | |||
| 3135 | LEA DI,CR_SCRWIDTH ;set DI to proper parameter block | ||
| 3136 | ; for call | ||
| 3137 | IF CASRM | ||
| 3138 | MOV AH,00H ;make call to CAS-RM | ||
| 3139 | MOV BX,CR_RN ;set CAS routine number | ||
| 3140 | INT CASINT ;call routine | ||
| 3141 | ELSE | ||
| 3142 | CALL ROWCL | ||
| 3143 | ENDIF | ||
| 3144 | POP DI ;restore registers | ||
| 3145 | POP DS | ||
| 3146 | POP ES | ||
| 3147 | ; | ||
| 3148 | RET | ||
| 3149 | PCROWCL_CALL ENDP | ||
| 3150 | ; | ||
| 3151 | PAGE | ||
| 3152 | ;-----------------------------------------------------------------------------+ | ||
| 3153 | ; : | ||
| 3154 | ; PCMOVEG_CALL : | ||
| 3155 | ; : | ||
| 3156 | ; Call to PCMOVEG. : | ||
| 3157 | ; : | ||
| 3158 | ; Entry: PB initialized. : | ||
| 3159 | ; : | ||
| 3160 | ; Exit: None : | ||
| 3161 | ; : | ||
| 3162 | ; Notes: None : | ||
| 3163 | ; : | ||
| 3164 | ;-----------------------------------------------------------------------------+ | ||
| 3165 | ; | ||
| 3166 | PCMOVEG_CALL PROC NEAR | ||
| 3167 | |||
| 3168 | PUSH ES | ||
| 3169 | PUSH DS ;set segment | ||
| 3170 | POP ES | ||
| 3171 | |||
| 3172 | PUSH DS | ||
| 3173 | PUSH DI ;save registers | ||
| 3174 | |||
| 3175 | LEA DI,MG_OPT ;set DI to proper parameter block | ||
| 3176 | ; for call | ||
| 3177 | IF CASRM | ||
| 3178 | MOV AH,00H ;make call to CAS-RM | ||
| 3179 | MOV BX,MG_RN ;set CAS routine number | ||
| 3180 | INT CASINT ;call routine | ||
| 3181 | ELSE | ||
| 3182 | CALL MOVEG | ||
| 3183 | ENDIF | ||
| 3184 | POP DI ;restore registers | ||
| 3185 | POP DS | ||
| 3186 | POP ES | ||
| 3187 | ; | ||
| 3188 | RET | ||
| 3189 | PCMOVEG_CALL ENDP | ||
| 3190 | ; | ||
| 3191 | PAGE | ||
| 3192 | ;-----------------------------------------------------------------------------+ | ||
| 3193 | ; : | ||
| 3194 | ; PCGEQUP_CALL : | ||
| 3195 | ; : | ||
| 3196 | ; Call to PCGEQUP. : | ||
| 3197 | ; : | ||
| 3198 | ; Entry: PB initialized. : | ||
| 3199 | ; : | ||
| 3200 | ; Exit: None : | ||
| 3201 | ; : | ||
| 3202 | ; Notes: None : | ||
| 3203 | ; : | ||
| 3204 | ;-----------------------------------------------------------------------------+ | ||
| 3205 | ; | ||
| 3206 | PCGEQUP_CALL PROC NEAR | ||
| 3207 | |||
| 3208 | PUSH ES | ||
| 3209 | PUSH DS ;set segment | ||
| 3210 | POP ES | ||
| 3211 | |||
| 3212 | PUSH DS | ||
| 3213 | PUSH DI ;save registers | ||
| 3214 | |||
| 3215 | LEA DI,GE_OPT ;set DI to proper parameter block | ||
| 3216 | ; for call | ||
| 3217 | IF CASRM | ||
| 3218 | MOV AH,00H ;make call to CAS-RM | ||
| 3219 | MOV BX,MG_RN ;set CAS routine number | ||
| 3220 | INT CASINT ;call routine | ||
| 3221 | ELSE | ||
| 3222 | CALL GEQUP | ||
| 3223 | ENDIF | ||
| 3224 | POP DI ;restore registers | ||
| 3225 | POP DS | ||
| 3226 | POP ES | ||
| 3227 | ; | ||
| 3228 | RET | ||
| 3229 | PCGEQUP_CALL ENDP | ||
| 3230 | ; | ||
| 3231 | PAGE | ||
| 3232 | ;-----------------------------------------------------------------------------+ | ||
| 3233 | ; : | ||
| 3234 | ; PCDATES_CALL : | ||
| 3235 | ; : | ||
| 3236 | ; Call to PCDATES. : | ||
| 3237 | ; : | ||
| 3238 | ; Entry: PB initialized. : | ||
| 3239 | ; : | ||
| 3240 | ; Exit: None : | ||
| 3241 | ; : | ||
| 3242 | ; Notes: None : | ||
| 3243 | ; : | ||
| 3244 | ;-----------------------------------------------------------------------------+ | ||
| 3245 | ; | ||
| 3246 | PCDATES_CALL PROC NEAR | ||
| 3247 | |||
| 3248 | PUSH ES | ||
| 3249 | PUSH DS ;set segment | ||
| 3250 | POP ES | ||
| 3251 | |||
| 3252 | PUSH DS | ||
| 3253 | PUSH DI ;save registers | ||
| 3254 | |||
| 3255 | LEA DI,DTS_OPT ;set DI to proper parameter block | ||
| 3256 | ; for call | ||
| 3257 | IF CASRM | ||
| 3258 | MOV AH,00H ;make call to CAS-RM | ||
| 3259 | MOV BX,DTS_RN ;set CAS routine number | ||
| 3260 | INT CASINT ;call routine | ||
| 3261 | ELSE | ||
| 3262 | CALL DATES | ||
| 3263 | ENDIF | ||
| 3264 | POP DI ;restore registers | ||
| 3265 | POP DS | ||
| 3266 | POP ES | ||
| 3267 | ; | ||
| 3268 | RET | ||
| 3269 | PCDATES_CALL ENDP | ||
| 3270 | ; | ||
| 3271 | PAGE | ||
| 3272 | ;-----------------------------------------------------------------------------+ | ||
| 3273 | ; : | ||
| 3274 | ; PCTIMES_CALL : | ||
| 3275 | ; : | ||
| 3276 | ; Call to PCTIMES. : | ||
| 3277 | ; : | ||
| 3278 | ; Entry: PB initialized. : | ||
| 3279 | ; : | ||
| 3280 | ; Exit: None : | ||
| 3281 | ; : | ||
| 3282 | ; Notes: None : | ||
| 3283 | ; : | ||
| 3284 | ;-----------------------------------------------------------------------------+ | ||
| 3285 | ; | ||
| 3286 | PCTIMES_CALL PROC NEAR | ||
| 3287 | |||
| 3288 | PUSH ES | ||
| 3289 | PUSH DS ;set segment | ||
| 3290 | POP ES | ||
| 3291 | |||
| 3292 | PUSH DS | ||
| 3293 | PUSH DI ;save registers | ||
| 3294 | |||
| 3295 | LEA DI,TMS_OPT ;set DI to proper parameter block | ||
| 3296 | ; for call | ||
| 3297 | IF CASRM | ||
| 3298 | MOV AH,00H ;make call to CAS-RM | ||
| 3299 | MOV BX,TMS_RN ;set CAS routine number | ||
| 3300 | INT CASINT ;call routine | ||
| 3301 | ELSE | ||
| 3302 | CALL TIMES | ||
| 3303 | ENDIF | ||
| 3304 | POP DI ;restore registers | ||
| 3305 | POP DS | ||
| 3306 | POP ES | ||
| 3307 | ; | ||
| 3308 | RET | ||
| 3309 | PCTIMES_CALL ENDP | ||
| 3310 | ; | ||
| 3311 | PAGE | ||
| 3312 | ;-----------------------------------------------------------------------------+ | ||
| 3313 | ; : | ||
| 3314 | ; Name: CHANGE_APPM : | ||
| 3315 | ; : | ||
| 3316 | ; Description: Display Application menu screen. : | ||
| 3317 | ; : | ||
| 3318 | ; Entry: None. : | ||
| 3319 | ; : | ||
| 3320 | ; Exit: COM_CDIALOG : | ||
| 3321 | ; : | ||
| 3322 | ; Entry point: CHANGE_APPM : | ||
| 3323 | ; : | ||
| 3324 | ; Notes: None. : | ||
| 3325 | ; : | ||
| 3326 | ; Internal references: None. : | ||
| 3327 | ; : | ||
| 3328 | ; External references: None. : | ||
| 3329 | ; : | ||
| 3330 | ;-----------------------------------------------------------------------------+ | ||
| 3331 | ; | ||
| 3332 | CHANGE_APPM PROC FAR | ||
| 3333 | ; | ||
| 3334 | TEST COM_STATE,COM_APPM ;check if app menu active | ||
| 3335 | JNE CAM10 | ||
| 3336 | ; | ||
| 3337 | CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR | ||
| 3338 | JMP CAMEXIT | ||
| 3339 | ; | ||
| 3340 | CAM10: MOV COM_HLPOPT2,0 ;set for normal shell help | ||
| 3341 | MOV COM_HCBIDAAB,HLP_AABPROGRAM | ||
| 3342 | MOV COM_HCBID,HLP_AABPROGRAM | ||
| 3343 | ; | ||
| 3344 | MOV AX,MFF_AABAOPT ;default to program menu AAB field | ||
| 3345 | CALL FAR PTR LOC_MOUSEF | ||
| 3346 | MOV COM_CURAABF,AX | ||
| 3347 | ; | ||
| 3348 | MOV APP_SKIN,0 ;set to reinitialize app menu fld | ||
| 3349 | MOV COM_CDIALOG,COM_PAAB ;set for menu action bar dialog | ||
| 3350 | MOV COM_BASESCR,COM_APPSCR ;initialize for display of DOS scr | ||
| 3351 | ; | ||
| 3352 | CAMEXIT: | ||
| 3353 | ; | ||
| 3354 | RET | ||
| 3355 | CHANGE_APPM ENDP | ||
| 3356 | ; | ||
| 3357 | PAGE | ||
| 3358 | ;-----------------------------------------------------------------------------+ | ||
| 3359 | ; : | ||
| 3360 | ; Name: ALLOCATE_BUFB : | ||
| 3361 | ; : | ||
| 3362 | ; Description: Allocate memory for directory and file buffers. : | ||
| 3363 | ; : | ||
| 3364 | ; Entry: COM_STATE2 = Invocation parameters. : | ||
| 3365 | ; COM_DFSIZE = Optional buffer override size in parags.: | ||
| 3366 | ; : | ||
| 3367 | ; MAX_DIR1BUF = Size of directory buffer 1 in paragraph : | ||
| 3368 | ; MAX_DIR2BUF = Size of directory buffer 2 in paragraph : | ||
| 3369 | ; MAX_DOSWBUF = Size of view, copy, move working buffer : | ||
| 3370 | ; MAX_EXECBUF = Size of app menu and/or command prompt : | ||
| 3371 | ; free space to be made avail to dos in : | ||
| 3372 | ; resident mode only. : | ||
| 3373 | ; : | ||
| 3374 | ; Allocated by one DOS call with COM_DATA4SEG as : | ||
| 3375 | ; starting segment. : | ||
| 3376 | ; : | ||
| 3377 | ; COM_DATA4LEN Optional DOS Services directory : | ||
| 3378 | ; COM_DATA4OFF list 1 buffer. : | ||
| 3379 | ; COM_DATA4SEG : | ||
| 3380 | ; : | ||
| 3381 | ; COM_DATA5LEN Optional DOS Services directory : | ||
| 3382 | ; COM_DATA5OFF list 2 buffer. : | ||
| 3383 | ; COM_DATA5SEG : | ||
| 3384 | ; : | ||
| 3385 | ; COM_DATA6LEN Optional DOS Services file list 1 : | ||
| 3386 | ; COM_DATA6OFF buffer : | ||
| 3387 | ; COM_DATA6SEG : | ||
| 3388 | ; : | ||
| 3389 | ; COM_DATA7LEN Optional DOS Services file list 2 : | ||
| 3390 | ; COM_DATA7OFF buffer : | ||
| 3391 | ; COM_DATA7SEG : | ||
| 3392 | ; : | ||
| 3393 | ; COM_DATA8LEN Optional DOS Services : | ||
| 3394 | ; COM_DATA8OFF buffer : | ||
| 3395 | ; COM_DATA8SEG : | ||
| 3396 | ; : | ||
| 3397 | ; Entry point: ALLOCATE_BUFB : | ||
| 3398 | ; : | ||
| 3399 | ; Notes: None. : | ||
| 3400 | ; : | ||
| 3401 | ; Internal references: None. : | ||
| 3402 | ; : | ||
| 3403 | ; External references: INT 21H 48H Allocate memory : | ||
| 3404 | ; : | ||
| 3405 | ;-----------------------------------------------------------------------------+ | ||
| 3406 | ; | ||
| 3407 | ALLOCATE_BUFB PROC FAR | ||
| 3408 | ; | ||
| 3409 | TEST COM_STATE,COM_DOSS ;check if DOS Services configured | ||
| 3410 | JNE AMB05 ;exit | ||
| 3411 | ; | ||
| 3412 | JMP AMBEXIT | ||
| 3413 | ; | ||
| 3414 | ; Determine avail memory, calc memory to allocate for shell functions | ||
| 3415 | ; | ||
| 3416 | AMB05: MOV AH,48H ;find out how many parags are aval | ||
| 3417 | MOV BX,0FFFFH ; in BX on return | ||
| 3418 | INT 21H | ||
| 3419 | ; | ||
| 3420 | ; adjust for resident mode operation | ||
| 3421 | ; | ||
| 3422 | TEST COM_STATE,COM_RESS ;check if resident mode is active | ||
| 3423 | JE AMB11 ; if yes, check if prompt or menu | ||
| 3424 | ; options are active, if yes, | ||
| 3425 | ; reduce avail size by 64KB to | ||
| 3426 | ; allow room for command line | ||
| 3427 | ; or prog menu operation | ||
| 3428 | ; | ||
| 3429 | AMB08: CMP BX,MAX_EXECBUF ;64K remaining? | ||
| 3430 | JB AMB_ERR ;no, error | ||
| 3431 | ; | ||
| 3432 | SUB BX,MAX_EXECBUF ;save 64KB for execution of | ||
| 3433 | ; command prompt or program menu | ||
| 3434 | ; only if in resident mode | ||
| 3435 | ; | ||
| 3436 | AMB11: MOV CX,BX ;save avail paraghs for compare | ||
| 3437 | ; | ||
| 3438 | TEST COM_STATE,COM_RESS ;check if resident mode is active | ||
| 3439 | JNE AMB12 ; if yes, reserve room required | ||
| 3440 | ; memory for view, copy,,, | ||
| 3441 | ; if not, DOS funcs in shell will | ||
| 3442 | ; automatically allocate memory | ||
| 3443 | ; as needed | ||
| 3444 | ; | ||
| 3445 | CMP BX,MAX_DOSWBUF ;10K remaining? | ||
| 3446 | JB AMB_ERR ;no, error | ||
| 3447 | ; | ||
| 3448 | SUB BX,MAX_DOSWBUF ;reserve working memory for copy | ||
| 3449 | ; and view functions (10KB) | ||
| 3450 | ; | ||
| 3451 | ; Check for minimum storage to run DOS Services | ||
| 3452 | ; | ||
| 3453 | AMB12: MOV TMP_DOSWBUF,MAX_DOSWBUF ;max work buffer | ||
| 3454 | MOV TMP_DIRBUF,MAX_DIR1BUF ;max directory buffer | ||
| 3455 | ; | ||
| 3456 | CALL CHK_MINDOS ;check for minimum DOS | ||
| 3457 | JNC AMB30 ;OK to allocate | ||
| 3458 | ; | ||
| 3459 | TEST COM_STATE2,COM_BUFO ;/B specified? | ||
| 3460 | JZ AMB14 ;no, try for minimum system | ||
| 3461 | ; | ||
| 3462 | CMP COM_DFSIZE,SM_FILEBUF ;User specified a small file buf? | ||
| 3463 | JA AMB_ERR ;no, /B just too large | ||
| 3464 | ; | ||
| 3465 | AMB14: MOV TMP_DOSWBUF,MIN_DOSWBUF ;min work buffer | ||
| 3466 | MOV TMP_DIRBUF,MIN_DIR1BUF ;min directory buffer | ||
| 3467 | TEST COM_STATE,COM_RESS ;resident mode? | ||
| 3468 | JNZ AMB16 ;yes, no need to adjust avail stg | ||
| 3469 | ; | ||
| 3470 | ADD BX,MAX_DOSWBUF ;change from 16K | ||
| 3471 | SUB BX,MIN_DOSWBUF ; to 8K for View/Copy buffer | ||
| 3472 | ; | ||
| 3473 | AMB16: CALL CHK_MINDOS ;check for absolutely minimum DOS | ||
| 3474 | JNC AMB30 ;OK to allocate | ||
| 3475 | ; | ||
| 3476 | AMB_ERR: MOV COM_ERRID,ERR_INSM ;insufficent memory available | ||
| 3477 | JMP AMBEXIT | ||
| 3478 | ; | ||
| 3479 | ; Allocate required shell memory | ||
| 3480 | ; | ||
| 3481 | AMB30: XOR AX,AX | ||
| 3482 | MOV AH,48H ;set allocate function number | ||
| 3483 | INT 21H ;allocate memory | ||
| 3484 | JNC AMB40 ;check for error | ||
| 3485 | ; | ||
| 3486 | MOV COM_ERRID,ERR_INSM ;insufficent memory available | ||
| 3487 | JMP AMBEXIT | ||
| 3488 | ; | ||
| 3489 | ; Check if resident mode active and preallocate working DOS buffers | ||
| 3490 | ; | ||
| 3491 | AMB40: MOV CX,AX ;save beginning segment | ||
| 3492 | ; | ||
| 3493 | TEST COM_STATE,COM_RESS ;check if resident mode is active | ||
| 3494 | JE AMB70 ; if yes, pre-allocate required | ||
| 3495 | ; memory for view, copy,,, | ||
| 3496 | ; if not, DOS funcs in shell will | ||
| 3497 | ; automatically allocate memory | ||
| 3498 | ; as needed | ||
| 3499 | ; | ||
| 3500 | TEST COM_STATE,COM_APPM ;check if app menu active | ||
| 3501 | JNE AMB60 | ||
| 3502 | ; | ||
| 3503 | MOV COM_DATA8SEG,CX ;set segment of DOS work buffer | ||
| 3504 | MOV COM_DATA8OFF,0 ;offset starts at zero | ||
| 3505 | MOV AX,TMP_DOSWBUF ;calculate length of buffer | ||
| 3506 | MOV BX,16 ; in bytes | ||
| 3507 | SUB COM_DFSIZE,AX ;adjust remaining paragraphs | ||
| 3508 | MUL BX | ||
| 3509 | MOV COM_DATA8LEN,AX | ||
| 3510 | ADD CX,MAX_DOSWBUF ;adjust segment | ||
| 3511 | JMP AMB70 | ||
| 3512 | ; | ||
| 3513 | AMB60: MOV AX,COM_DATA3SEG ;reuse app menu buffer | ||
| 3514 | MOV COM_DATA8SEG,AX ;set segment | ||
| 3515 | MOV AX,COM_DATA3OFF | ||
| 3516 | MOV COM_DATA8OFF,AX ;set offset | ||
| 3517 | MOV AX,COM_DATA3LEN ;set DOS working buffer size in | ||
| 3518 | MOV COM_DATA8LEN,AX ; bytes | ||
| 3519 | ; | ||
| 3520 | ; Use next available memory for dir buffer 1 and 2 | ||
| 3521 | ; | ||
| 3522 | AMB70: MOV COM_DATA4SEG,CX ;set segment of directory list 1 | ||
| 3523 | MOV COM_DATA4OFF,0 ;offset starts at zero | ||
| 3524 | MOV AX,TMP_DIRBUF ;calculate length of buffer | ||
| 3525 | ADD CX,AX ;adjust new segment | ||
| 3526 | SUB COM_DFSIZE,AX ;adjust remaining paragraphs | ||
| 3527 | MOV BX,16 | ||
| 3528 | MUL BX | ||
| 3529 | MOV COM_DATA4LEN,AX ;set length in paragraphs | ||
| 3530 | ; | ||
| 3531 | TEST COM_STATE,COM_DRV2 ;check if multiple drive display | ||
| 3532 | JE AMB80 ; active | ||
| 3533 | ; | ||
| 3534 | MOV COM_DATA5SEG,CX ;set segment of directory list 2 | ||
| 3535 | MOV COM_DATA5OFF,0 ;offset starts at zero | ||
| 3536 | MOV AX,TMP_DIRBUF ;calculate length of buffer | ||
| 3537 | ADD CX,AX ;adjust new segment | ||
| 3538 | SUB COM_DFSIZE,AX ;adjust remaining paragraphs | ||
| 3539 | MOV BX,16 | ||
| 3540 | MUL BX | ||
| 3541 | MOV COM_DATA5LEN,AX ;set length in paragraphs | ||
| 3542 | ; | ||
| 3543 | ; Use remaining memory for file buffers 1 and 2 | ||
| 3544 | ; | ||
| 3545 | AMB80: MOV COM_DATA6SEG,CX ;set segment of file buf 1 | ||
| 3546 | MOV COM_DATA6OFF,0 ;offset starts at zero | ||
| 3547 | ; | ||
| 3548 | MOV AX,COM_DFSIZE ;get remaining buffer | ||
| 3549 | ; | ||
| 3550 | TEST COM_STATE,COM_DRV2 ;check if multiple drive display | ||
| 3551 | JE AMB90 ; active | ||
| 3552 | ; | ||
| 3553 | SHR AX,1 ;divide remaining buffer by 2 | ||
| 3554 | ; | ||
| 3555 | AMB90: MOV COM_DATA6LEN,AX ;set file buffer 1 len in paraghs | ||
| 3556 | ADD CX,AX ;adjust new segment | ||
| 3557 | SUB COM_DFSIZE,AX ;adjust remaining buffer paraghs | ||
| 3558 | ; | ||
| 3559 | TEST COM_STATE,COM_DRV2 ;check if multiple drive display | ||
| 3560 | JE AMBEXIT ; active | ||
| 3561 | ; | ||
| 3562 | MOV COM_DATA7SEG,CX ;set segment of file buf 2 | ||
| 3563 | MOV COM_DATA7OFF,0 ;offset starts at zero | ||
| 3564 | MOV AX,COM_DFSIZE ;set # parags in file buf 2 | ||
| 3565 | MOV COM_DATA7LEN,AX | ||
| 3566 | ; | ||
| 3567 | AMBEXIT: ;exit | ||
| 3568 | ; | ||
| 3569 | RET | ||
| 3570 | ALLOCATE_BUFB ENDP | ||
| 3571 | ; | ||
| 3572 | PAGE | ||
| 3573 | ; | ||
| 3574 | ;-----------------------------------------------------------------------------+ | ||
| 3575 | ; : | ||
| 3576 | ; Name: CHK_MINDOS : | ||
| 3577 | ; : | ||
| 3578 | ; Description: Check for enough storage to run minimum DOS Services. : | ||
| 3579 | ; : | ||
| 3580 | ; Entry: TMP_DOSWBUF - Size of DOS work buffer : | ||
| 3581 | ; TMP_DIRBUF - Size of DOS directory buffer : | ||
| 3582 | ; COM_DFSIZE - User specified file buffer size : | ||
| 3583 | ; BX - Maximum memory available : | ||
| 3584 | ; : | ||
| 3585 | ; Exit: Carry flag set : | ||
| 3586 | ; : | ||
| 3587 | ; Entry point: CHK_MINDOS : | ||
| 3588 | ; : | ||
| 3589 | ; Notes: None. : | ||
| 3590 | ; : | ||
| 3591 | ; Internal references: None : | ||
| 3592 | ; : | ||
| 3593 | ; External references: None : | ||
| 3594 | ; : | ||
| 3595 | ;-----------------------------------------------------------------------------+ | ||
| 3596 | ; | ||
| 3597 | CHK_MINDOS PROC NEAR | ||
| 3598 | ; | ||
| 3599 | XOR AX,AX ;clear out | ||
| 3600 | TEST COM_STATE,COM_RESS ;resident mode? | ||
| 3601 | JZ CHS14 ;no, storage already adjusted | ||
| 3602 | ; | ||
| 3603 | TEST COM_STATE,COM_APPM ;appl configured? | ||
| 3604 | JNZ CHS14 ;yes, reuse appl workarea | ||
| 3605 | ; | ||
| 3606 | ADD AX,TMP_DOSWBUF ;10K or 8K for View/Copy buffer | ||
| 3607 | ; | ||
| 3608 | CHS14: ADD AX,TMP_DIRBUF ;8K or 4K for first dir buffer | ||
| 3609 | TEST COM_STATE,COM_DRV2 ;multiple buffers configured? | ||
| 3610 | JZ CHS16 ;no, no second buffer needed | ||
| 3611 | ; | ||
| 3612 | ADD AX,TMP_DIRBUF ;8K or 4K for second dir buffer | ||
| 3613 | ; | ||
| 3614 | CHS16: TEST COM_STATE2,COM_BUFO ;/B specified? | ||
| 3615 | JZ CHS18 ;no, add in for min file buffer | ||
| 3616 | ; | ||
| 3617 | ADD AX,COM_DFSIZE ;update total storage needed | ||
| 3618 | CMP BX,AX ;is storage available? | ||
| 3619 | JA CHS17 ;yes | ||
| 3620 | ; | ||
| 3621 | SUB AX,COM_DFSIZE ;back out and use all of storage | ||
| 3622 | JMP CHS18 ;continue | ||
| 3623 | |||
| 3624 | ; JB CHS_ERR ;no, display error message | ||
| 3625 | ; | ||
| 3626 | CHS17: MOV BX,AX ;set to allocate storage | ||
| 3627 | JMP CHS20 | ||
| 3628 | ; | ||
| 3629 | CHS18: ADD AX,MIN_FILEBUF ;minimun file buffer to alloc | ||
| 3630 | CMP BX,AX ;is storage available | ||
| 3631 | JB CHS_ERR ;no, display error message | ||
| 3632 | ; | ||
| 3633 | CHS20: MOV COM_DFSIZE,BX ;set to allocate all avail storage | ||
| 3634 | JMP CHS_OK | ||
| 3635 | ; | ||
| 3636 | CHS_ERR: STC ;error | ||
| 3637 | JMP CHS_RET | ||
| 3638 | ; | ||
| 3639 | CHS_OK: CLC ;OK | ||
| 3640 | |||
| 3641 | CHS_RET: ;exit | ||
| 3642 | ; | ||
| 3643 | RET | ||
| 3644 | CHK_MINDOS ENDP | ||
| 3645 | ; | ||
| 3646 | PAGE | ||
| 3647 | ;-----------------------------------------------------------------------------+ | ||
| 3648 | ; : | ||
| 3649 | ; Name: MANAGE_ERROR : | ||
| 3650 | ; : | ||
| 3651 | ; Description: Manage error messages. : | ||
| 3652 | ; : | ||
| 3653 | ; Entry: COM_ERRID = ID number of error message. : | ||
| 3654 | ; : | ||
| 3655 | ; Exit: None. : | ||
| 3656 | ; : | ||
| 3657 | ; Entry point: MANAGE_ERROR : | ||
| 3658 | ; : | ||
| 3659 | ; Notes: None. : | ||
| 3660 | ; : | ||
| 3661 | ; Internal references: GET_ERROR : | ||
| 3662 | ; : | ||
| 3663 | ; External references: INT 21H AH=09H Print string to standard output. : | ||
| 3664 | ; : | ||
| 3665 | ;-----------------------------------------------------------------------------+ | ||
| 3666 | ; | ||
| 3667 | MANAGE_ERROR PROC NEAR | ||
| 3668 | ; | ||
| 3669 | ; Process critcal error messages before initialization is complete | ||
| 3670 | ; | ||
| 3671 | CALL SET_DOSVMSHL ;set DOS video mode from shell | ||
| 3672 | ; video mode | ||
| 3673 | ; | ||
| 3674 | MOV AX,COM_ERRID ;calculate offset into error | ||
| 3675 | CALL FAR PTR GET_ERROR | ||
| 3676 | ; | ||
| 3677 | PUSH DS ;save data segment address | ||
| 3678 | ; | ||
| 3679 | MOV CX,AX ;set message length | ||
| 3680 | MOV DX,DI ;set message offset | ||
| 3681 | MOV AX,ES ;set message segment | ||
| 3682 | MOV DS,AX | ||
| 3683 | ; | ||
| 3684 | XOR AX,AX ;clear to zero | ||
| 3685 | MOV AH,40H ;set print string function number | ||
| 3686 | MOV BX,1 ;standard output | ||
| 3687 | INT 21H ;print string | ||
| 3688 | ; | ||
| 3689 | MOV AH,06 ;print <CR> to screen | ||
| 3690 | MOV DL,CR | ||
| 3691 | INT 21H | ||
| 3692 | ; | ||
| 3693 | MOV AH,06 ;print <LF> to screen | ||
| 3694 | MOV DL,LF | ||
| 3695 | INT 21H | ||
| 3696 | ; | ||
| 3697 | POP DS ;restore data segment address | ||
| 3698 | ; | ||
| 3699 | RET | ||
| 3700 | MANAGE_ERROR ENDP | ||
| 3701 | ; | ||
| 3702 | PAGE | ||
| 3703 | ;-----------------------------------------------------------------------------+ | ||
| 3704 | ; : | ||
| 3705 | ; Name: EXAMINE_PSP : | ||
| 3706 | ; : | ||
| 3707 | ; Description: Examine Program Segment Prefix string for current : | ||
| 3708 | ; SHELLRD.EXE invocation parameters. : | ||
| 3709 | ; : | ||
| 3710 | ; Entry: PSP initialized. : | ||
| 3711 | ; : | ||
| 3712 | ; Exit: COM_STATE = Option word indicating invocation : | ||
| 3713 | ; parameters passed through PSP. : | ||
| 3714 | ; : | ||
| 3715 | ; Label Bit Description : | ||
| 3716 | ; -------- --- ----------------------------------- : | ||
| 3717 | ; COM_APPM 0 0= Application menu not configured. : | ||
| 3718 | ; 1= Application menu configured. : | ||
| 3719 | ; COM_DOSS 1 0= DOS Services not configured. : | ||
| 3720 | ; 1= DOS Services configured. : | ||
| 3721 | ; COM_REFD 2 0= Do not refresh directory buffer : | ||
| 3722 | ; during command line or PEC execution: | ||
| 3723 | ; 1= Refresh directory buffer during : | ||
| 3724 | ; command line or PEC execution. : | ||
| 3725 | ; COM_RESS 3 0= Transient shell. : | ||
| 3726 | ; 1= Resident shell. : | ||
| 3727 | ; COM_AUTI 4 0= Automatic predefined menu : | ||
| 3728 | ; installation is not active. : | ||
| 3729 | ; 1= Automatic predefined menu : | ||
| 3730 | ; installation is active. : | ||
| 3731 | ; COM_DRV2 5 0= Multiple drive buffer not active. : | ||
| 3732 | ; 1= Multiple drive buffer active. : | ||
| 3733 | ; COM_FLCL 6 0= Command line access is not active. : | ||
| 3734 | ; 1= Command line access is active. : | ||
| 3735 | ; COM_FLMI 7 0= Maintain menu item access is not : | ||
| 3736 | ; active. : | ||
| 3737 | ; 1= Maintain menu item access is active.: | ||
| 3738 | ; COM_FLCS 8 0= Maintain color selections access is : | ||
| 3739 | ; not active. : | ||
| 3740 | ; 1= Maintain color selections access is : | ||
| 3741 | ; active. : | ||
| 3742 | ; COM_FLED 9 0= Exit to DOS is not active. : | ||
| 3743 | ; 1= Exit to DOS is active. : | ||
| 3744 | ; COM_MOUS 10 0= Mouse is not active. : | ||
| 3745 | ; 1= Mouse is active. : | ||
| 3746 | ; COM_LFMS 11 0= Right hand mouse. : | ||
| 3747 | ; 1= Left hand mouse. : | ||
| 3748 | ; COM_M10H 12 0= No function assigned. : | ||
| 3749 | ; 1= Graphics EGA mode 10H requested : | ||
| 3750 | ; COM_M11H 13 0= No function assigned. : | ||
| 3751 | ; 1= Graphics VGA/MCGA mode 11H requested: | ||
| 3752 | ; COM_M12H 14 0= No function assigned. : | ||
| 3753 | ; 1= Graphics VGA mode 12H requested : | ||
| 3754 | ; COM_TEXT 15 0= No function assigned. : | ||
| 3755 | ; 1= Text mode is requested. : | ||
| 3756 | ; : | ||
| 3757 | ; COM_STATE2 = Option word indicating invocation : | ||
| 3758 | ; parameters passed through PSP. : | ||
| 3759 | ; : | ||
| 3760 | ; Label Bit Description : | ||
| 3761 | ; -------- --- ----------------------------------- : | ||
| 3762 | ; COM_SOUD 0 0= Sound not active. : | ||
| 3763 | ; 1= Sound active. : | ||
| 3764 | ; : | ||
| 3765 | ; COM_NLS 1 0= Not active. : | ||
| 3766 | ; 1= NLS help index display option active: | ||
| 3767 | ; : | ||
| 3768 | ; COM_DFSAV 2 0= Not active. : | ||
| 3769 | ; 1= Directory and file save active. : | ||
| 3770 | ; : | ||
| 3771 | ; COM_BUFO 3 0= Not active. : | ||
| 3772 | ; 1= Dir/file buffer size override on. : | ||
| 3773 | ; : | ||
| 3774 | ; COM_DBCS 4 0= Not active. : | ||
| 3775 | ; 1= DBCS active. : | ||
| 3776 | ; : | ||
| 3777 | ; COM_DATE 5 0= Not active. : | ||
| 3778 | ; 1= Date/time active. : | ||
| 3779 | ; : | ||
| 3780 | ; COM_COM2 5 0= Not active. D491: | ||
| 3781 | ; 1= COM2 active. D491: | ||
| 3782 | ; : | ||
| 3783 | ; COM_DFSIZE = Size of DOS directory and file buffer : | ||
| 3784 | ; to allocate in paragraphs. Used only : | ||
| 3785 | ; if buffer override option is active : | ||
| 3786 | ; in COM_STATE2. : | ||
| 3787 | ; : | ||
| 3788 | ; COM_PSPOFF = Offset of SHELL.EXE PSP : | ||
| 3789 | ; COM_PSPSEG = Segment of SHELL.EXE PSP : | ||
| 3790 | ; : | ||
| 3791 | ; Entry point: EXAMINE_PSP : | ||
| 3792 | ; : | ||
| 3793 | ; Notes: EXAMINE_PSP is beginning overlay point for mouse : | ||
| 3794 | ; driver. : | ||
| 3795 | ; : | ||
| 3796 | ; Internal references: MANAGE_ERROR : | ||
| 3797 | ; PCINSTR_CALL : | ||
| 3798 | ; : | ||
| 3799 | ; External references: INT 21H 19H Return current drive : | ||
| 3800 | ; INT 21H 47H Return current path : | ||
| 3801 | ; : | ||
| 3802 | ;-----------------------------------------------------------------------------+ | ||
| 3803 | ; | ||
| 3804 | EXAMINE_PSP PROC NEAR | ||
| 3805 | ; | ||
| 3806 | ; Intialize to search PSP for invocation options | ||
| 3807 | ; | ||
| 3808 | MOV INS_OPT,0 ;set to find string | ||
| 3809 | MOV ES, COM_PSPSEG ;get PSP segment | ||
| 3810 | MOV DI, 80H ;get offset of PSP length byte | ||
| 3811 | MOV CL, ES:[DI] ;get PSP length byte | ||
| 3812 | CMP CL, 0 ;any command line options? | ||
| 3813 | JA EP03 ;yes, continue | ||
| 3814 | MOV COM_ERRID,ERR_PSP ;invalid psp command line | ||
| 3815 | JMP EPEXIT ;exit | ||
| 3816 | EP03: XOR CH, CH ;clear high byte | ||
| 3817 | MOV SI, COM_PSPOFF ;set offset of PSP | ||
| 3818 | ADD SI, 81H ;get command line buffer | ||
| 3819 | LEA DI, EP_CMDLIN ;set offset of command line buffer | ||
| 3820 | MOV INS_SOFF, DI ;save offset of command buffer | ||
| 3821 | MOV INS_SSEG, DATA ;save segment of command buffer | ||
| 3822 | MOV ES, INS_SSEG ;set segment of command buffer | ||
| 3823 | mov dl, 0 ;init comment flag | ||
| 3824 | mov ins_slen, 0 ;init length of command search str | ||
| 3825 | mov com_cmdact, 0 ;init actual length of commands | ||
| 3826 | mov com_cmdnum, 0 ;init length of commands found | ||
| 3827 | ; | ||
| 3828 | EP034: PUSH DS ;save data seg | ||
| 3829 | MOV DS, COM_PSPSEG ;PSP segment is source seg | ||
| 3830 | mov al, ds:[si] ; | ||
| 3831 | POP DS ; | ||
| 3832 | ; | ||
| 3833 | cmp al, ' ' ; | ||
| 3834 | jbe ep039 ; | ||
| 3835 | ; | ||
| 3836 | cmp al, '{' ; | ||
| 3837 | jne ep037 ; | ||
| 3838 | mov dl, 1 ; | ||
| 3839 | jmp ep039 ; | ||
| 3840 | ; | ||
| 3841 | EP037: cmp al, '}' ; | ||
| 3842 | jne ep038 ; | ||
| 3843 | mov dl, 0 ; | ||
| 3844 | jmp ep039 ; | ||
| 3845 | ; | ||
| 3846 | EP038: cmp dl, 1 ; | ||
| 3847 | je ep039 ; | ||
| 3848 | ; | ||
| 3849 | cmp al, 'a' ; | ||
| 3850 | jb ep0385 ; | ||
| 3851 | cmp al, 'z' ; | ||
| 3852 | ja ep0385 ; | ||
| 3853 | sub al, 32 ; | ||
| 3854 | ; | ||
| 3855 | ep0385: mov es:[di], al ; | ||
| 3856 | inc ins_slen ; | ||
| 3857 | inc com_cmdact ; | ||
| 3858 | inc di ; | ||
| 3859 | ; | ||
| 3860 | ep039: inc si ; | ||
| 3861 | loop ep034 ; | ||
| 3862 | ; | ||
| 3863 | MOV EP_ENDOFF, DI ;set offset of last byte in buffer | ||
| 3864 | ; | ||
| 3865 | ; Check for profile filename /PRO:filename.PRO | ||
| 3866 | ; | ||
| 3867 | EP1900: XOR AX,AX ;get current drive | ||
| 3868 | MOV AH,19H | ||
| 3869 | INT 21H | ||
| 3870 | ADD AL,65 ;convert from # to alpha char | ||
| 3871 | MOV COM_RFILSPEC,AL ;complete current drive and path | ||
| 3872 | ; | ||
| 3873 | MOV AH,47H ;read current path | ||
| 3874 | MOV DL,0 | ||
| 3875 | LEA SI,COM_RFILSPEC+3 ;point past C:\ | ||
| 3876 | INT 21H | ||
| 3877 | JNC EP1910 ;check for error | ||
| 3878 | ; | ||
| 3879 | MOV COM_ERRID,ERR_BADD ;bad disk or drive door open | ||
| 3880 | JMP EPEXIT | ||
| 3881 | ; | ||
| 3882 | EP1910: MOV AX,STR_PROFACT ;profile active | ||
| 3883 | CALL CHECK_STRING ;search for string | ||
| 3884 | CMP INS_RSLT,0 ;check if not found, error | ||
| 3885 | JG EP1920 | ||
| 3886 | ; | ||
| 3887 | JMP EP05 ;profile not active get next var | ||
| 3888 | ; | ||
| 3889 | EP1920: ADD COM_CMDNUM,AX | ||
| 3890 | ; | ||
| 3891 | PUSH INS_FOFF ;save invocation parameter offset | ||
| 3892 | ; | ||
| 3893 | MOV CX,INS_RSLT ;save starting search point | ||
| 3894 | ADD CX,INS_FLEN ;point past /PRO: to beginning of | ||
| 3895 | ; profile file name | ||
| 3896 | ; | ||
| 3897 | MOV AX,STR_PROEXT ;profile extension | ||
| 3898 | CALL FAR PTR GET_STRING | ||
| 3899 | ; | ||
| 3900 | MOV INS_FLEN,AX ;length of find string | ||
| 3901 | MOV INS_FOFF,DI ;offset of find string '.PRO' | ||
| 3902 | MOV INS_FSEG,ES ;segment of string | ||
| 3903 | CALL PCINSTR_CALL ;search for string | ||
| 3904 | ; | ||
| 3905 | POP INS_FOFF ;restore before exit | ||
| 3906 | ; | ||
| 3907 | CMP INS_RSLT,0 | ||
| 3908 | JG EP1930 | ||
| 3909 | ; | ||
| 3910 | MOV COM_ERRID,ERR_MOUS ;invalid profile file | ||
| 3911 | JMP EPEXIT | ||
| 3912 | ; | ||
| 3913 | EP1930: PUSH SI | ||
| 3914 | PUSH DS | ||
| 3915 | ; | ||
| 3916 | MOV AX,INS_RSLT | ||
| 3917 | SUB AX,CX ;ending offset - starting offset | ||
| 3918 | ADD AX,INS_FLEN ; + length of extension = # bytes | ||
| 3919 | ; to move | ||
| 3920 | ADD COM_CMDNUM,AX ; | ||
| 3921 | MOV BX,INS_SOFF ;calculate offset of source strg | ||
| 3922 | ADD BX,CX ; to move | ||
| 3923 | DEC BX | ||
| 3924 | ; | ||
| 3925 | PUSH BX ;save source offset | ||
| 3926 | PUSH INS_SSEG ;save source segment | ||
| 3927 | ; | ||
| 3928 | MOV CX,AX ; = number of bytes to move | ||
| 3929 | LEA DI,COM_RFILSPEC ;get dest offset | ||
| 3930 | ; | ||
| 3931 | PUSH DS | ||
| 3932 | PUSH ES | ||
| 3933 | POP DS | ||
| 3934 | POP ES | ||
| 3935 | ; | ||
| 3936 | EP1940: MOV AL,ES:[DI] ;locate end of drive and path | ||
| 3937 | CMP AL,0 ; in shell profile name buffer | ||
| 3938 | JE EP1980 | ||
| 3939 | ; | ||
| 3940 | INC DI ;point to next character | ||
| 3941 | JMP EP1940 | ||
| 3942 | ; | ||
| 3943 | EP1980: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of | ||
| 3944 | JE EP1990 ; file separator | ||
| 3945 | ; | ||
| 3946 | MOV BYTE PTR ES:[DI],'\' ;add path and filename separator | ||
| 3947 | INC DI ;point to where filename goes | ||
| 3948 | ; | ||
| 3949 | EP1990: POP DS ;now move profile filename string | ||
| 3950 | POP SI ; to end of profile buffer path | ||
| 3951 | ; | ||
| 3952 | REP MOVSB ;copy profile filespec | ||
| 3953 | ; | ||
| 3954 | POP DS | ||
| 3955 | POP SI | ||
| 3956 | ; | ||
| 3957 | ; Open profile file | ||
| 3958 | ; | ||
| 3959 | MOV AH, 3DH ;DOS open handle | ||
| 3960 | MOV AL, 010B ;open for read/write | ||
| 3961 | LEA DX, COM_RFILSPEC ;set offset of profile filename | ||
| 3962 | INT 21H ;open profile file | ||
| 3963 | JNC EP_1992 ;continue if no error | ||
| 3964 | MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open | ||
| 3965 | JMP EPEXIT | ||
| 3966 | ; | ||
| 3967 | ; Read profile file to command buffer ; | ||
| 3968 | ; | ||
| 3969 | ep_1992: mov dl, 0 | ||
| 3970 | mov di, ep_endoff | ||
| 3971 | MOV BX, AX ;set file handle | ||
| 3972 | ; | ||
| 3973 | ep_1993: push dx | ||
| 3974 | MOV AH, 3FH ;DOS read handle | ||
| 3975 | mov cx, 1 | ||
| 3976 | lea dx, gen_data | ||
| 3977 | INT 21H ;read profile into buffer | ||
| 3978 | JNC EP_1994 ;continue if no error | ||
| 3979 | pop dx | ||
| 3980 | MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open | ||
| 3981 | JMP EPEXIT | ||
| 3982 | |||
| 3983 | EP_1994: ; ADD INS_SLEN, AX ; | ||
| 3984 | |||
| 3985 | |||
| 3986 | epx034: | ||
| 3987 | cmp ax, 0 ; | ||
| 3988 | ja epx035 | ||
| 3989 | ; | ||
| 3990 | pop dx | ||
| 3991 | jmp ep1995 | ||
| 3992 | ; | ||
| 3993 | epx035: pop dx | ||
| 3994 | ; | ||
| 3995 | mov al, byte ptr gen_data ; | ||
| 3996 | ; | ||
| 3997 | cmp al, ' ' ; | ||
| 3998 | jbe epx039 ; | ||
| 3999 | ; | ||
| 4000 | cmp al, '{' ; | ||
| 4001 | jne epx037 ; | ||
| 4002 | mov dl, 1 ; | ||
| 4003 | jmp epx039 ; | ||
| 4004 | ; | ||
| 4005 | epx037: cmp al, '}' ; | ||
| 4006 | jne epx038 ; | ||
| 4007 | mov dl, 0 ; | ||
| 4008 | jmp epx039 ; | ||
| 4009 | ; | ||
| 4010 | epx038: cmp dl, 1 ; | ||
| 4011 | je epx039 ; | ||
| 4012 | ; | ||
| 4013 | cmp al, 'a' ; | ||
| 4014 | jb epx0385 ; | ||
| 4015 | cmp al, 'z' ; | ||
| 4016 | ja epx0385 ; | ||
| 4017 | sub al, 32 ; | ||
| 4018 | ; | ||
| 4019 | epx0385: mov [di], al ; | ||
| 4020 | inc ins_slen ; | ||
| 4021 | inc com_cmdact ; | ||
| 4022 | inc di ; | ||
| 4023 | ; | ||
| 4024 | epx039: jmp ep_1993 ; | ||
| 4025 | ; | ||
| 4026 | ; Close profile handle | ||
| 4027 | ; | ||
| 4028 | EP1995: MOV AH, 3EH ; | ||
| 4029 | INT 21H ;close handle | ||
| 4030 | JNC EP05 ;continue if no error | ||
| 4031 | MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open | ||
| 4032 | JMP EPEXIT | ||
| 4033 | ; | ||
| 4034 | ; Convert command string alpha to upper case | ||
| 4035 | ; | ||
| 4036 | EP05: MOV ES,INS_SSEG ;get PSP command line segment | ||
| 4037 | MOV DI,INS_SOFF ;point to PSP command line string | ||
| 4038 | MOV CX,INS_SLEN ;get length of PSP | ||
| 4039 | ; | ||
| 4040 | MOV COM_STATE, 0 ; | ||
| 4041 | MOV COM_STATE2,0 ;initialize to zero | ||
| 4042 | ; | ||
| 4043 | MOV AX,STR_CDON ; | ||
| 4044 | CALL CHECK_STRING ; | ||
| 4045 | CMP INS_RSLT,0 ; | ||
| 4046 | JE EP2510 ; | ||
| 4047 | ADD COM_CMDNUM,AX ; | ||
| 4048 | OR COM_CONFIRM, COM_CONFDEL ; | ||
| 4049 | ep2510: | ||
| 4050 | MOV AX,STR_CDOFF ; | ||
| 4051 | CALL CHECK_STRING ; | ||
| 4052 | CMP INS_RSLT,0 ; | ||
| 4053 | JE EP2511 ; | ||
| 4054 | ADD COM_CMDNUM,AX ; | ||
| 4055 | AND COM_CONFIRM,NOT COM_CONFDEL | ||
| 4056 | ep2511: | ||
| 4057 | MOV AX,STR_CRON ; | ||
| 4058 | CALL CHECK_STRING ; | ||
| 4059 | CMP INS_RSLT,0 ; | ||
| 4060 | JE EP2520 ; | ||
| 4061 | ADD COM_CMDNUM,AX ; | ||
| 4062 | OR COM_CONFIRM, COM_CONFREPL; | ||
| 4063 | ep2520: | ||
| 4064 | MOV AX,STR_CROFF ; | ||
| 4065 | CALL CHECK_STRING ; | ||
| 4066 | CMP INS_RSLT,0 ; | ||
| 4067 | JE EP2521 ; | ||
| 4068 | ADD COM_CMDNUM,AX ; | ||
| 4069 | AND COM_CONFIRM,NOT COM_CONFREPL | ||
| 4070 | ep2521: | ||
| 4071 | MOV AX,STR_ASON ; | ||
| 4072 | CALL CHECK_STRING ; | ||
| 4073 | CMP INS_RSLT,0 ; | ||
| 4074 | JE EP2530 ; | ||
| 4075 | ADD COM_CMDNUM,AX ; | ||
| 4076 | OR COM_CONFIRM, COM_ALLOWSEL; | ||
| 4077 | ep2530: | ||
| 4078 | MOV AX,STR_ASOFF ; | ||
| 4079 | CALL CHECK_STRING ; | ||
| 4080 | CMP INS_RSLT,0 ; | ||
| 4081 | JE EP2540 ; | ||
| 4082 | ADD COM_CMDNUM,AX ; | ||
| 4083 | AND COM_CONFIRM,NOT COM_ALLOWSEL | ||
| 4084 | ep2540: | ||
| 4085 | MOV AX,STR_SBNAME ; | ||
| 4086 | CALL CHECK_STRING ; | ||
| 4087 | CMP INS_RSLT,0 ; | ||
| 4088 | JE EP2550 ; | ||
| 4089 | ADD COM_CMDNUM,AX ; | ||
| 4090 | MOV SORTSTAT, SST_NAME ; | ||
| 4091 | JMP EP2590 | ||
| 4092 | ep2550: | ||
| 4093 | MOV AX,STR_SBEXT ; | ||
| 4094 | CALL CHECK_STRING ; | ||
| 4095 | CMP INS_RSLT,0 ; | ||
| 4096 | JE EP2560 ; | ||
| 4097 | ADD COM_CMDNUM,AX ; | ||
| 4098 | MOV SORTSTAT, SST_EXT ; | ||
| 4099 | JMP EP2590 | ||
| 4100 | ep2560: | ||
| 4101 | MOV AX,STR_SBSIZE ; | ||
| 4102 | CALL CHECK_STRING ; | ||
| 4103 | CMP INS_RSLT,0 ; | ||
| 4104 | JE EP2570 ; | ||
| 4105 | ADD COM_CMDNUM,AX ; | ||
| 4106 | MOV SORTSTAT, SST_SIZE ; | ||
| 4107 | JMP EP2590 | ||
| 4108 | ep2570: | ||
| 4109 | MOV AX,STR_SBDATE ; | ||
| 4110 | CALL CHECK_STRING ; | ||
| 4111 | CMP INS_RSLT,0 ; | ||
| 4112 | JE EP2580 ; | ||
| 4113 | ADD COM_CMDNUM,AX ; | ||
| 4114 | MOV SORTSTAT, SST_DATE ; | ||
| 4115 | JMP EP2590 | ||
| 4116 | ep2580: | ||
| 4117 | MOV AX,STR_SBDISK ; | ||
| 4118 | CALL CHECK_STRING ; | ||
| 4119 | CMP INS_RSLT,0 ; | ||
| 4120 | JE EP2590 ; | ||
| 4121 | ADD COM_CMDNUM,AX ; | ||
| 4122 | MOV SORTSTAT, 0 ; | ||
| 4123 | ep2590: | ||
| 4124 | ; | ||
| 4125 | ; Check for NLS translation option for help index display | ||
| 4126 | ; | ||
| 4127 | MOV AX,STR_NLS ;NLS configured | ||
| 4128 | CALL CHECK_STRING ;search for string | ||
| 4129 | CMP INS_RSLT,0 | ||
| 4130 | JE EP25 | ||
| 4131 | ; | ||
| 4132 | ADD COM_CMDNUM,AX ;add length to found length | ||
| 4133 | OR COM_STATE2,COM_NLS ;app menu configured | ||
| 4134 | ; | ||
| 4135 | ; Check for application menu option | ||
| 4136 | ; | ||
| 4137 | EP25: MOV AX,STR_APPMENU ;app menu configured | ||
| 4138 | CALL CHECK_STRING ;search for string | ||
| 4139 | CMP INS_RSLT,0 | ||
| 4140 | JE EP30 | ||
| 4141 | ; | ||
| 4142 | ADD COM_CMDNUM,AX | ||
| 4143 | OR COM_STATE,COM_APPM ;app menu configured | ||
| 4144 | ; | ||
| 4145 | ; Check for DOS Services option | ||
| 4146 | ; | ||
| 4147 | EP30: MOV AX,STR_DOSSERV ;DOS services configured | ||
| 4148 | CALL CHECK_STRING ;search for string | ||
| 4149 | CMP INS_RSLT,0 | ||
| 4150 | JE EP50 | ||
| 4151 | ; | ||
| 4152 | ADD COM_CMDNUM,AX | ||
| 4153 | OR COM_STATE,COM_DOSS ;DOS services configured | ||
| 4154 | ; | ||
| 4155 | ; Check for transient mode operation | ||
| 4156 | ; | ||
| 4157 | EP50: MOV AX,STR_TRANS ;transient shell configured | ||
| 4158 | CALL CHECK_STRING ;search for string | ||
| 4159 | CMP INS_RSLT,0 | ||
| 4160 | JNE EP51 | ||
| 4161 | ; | ||
| 4162 | OR COM_STATE,COM_RESS ;resident shell configured | ||
| 4163 | JMP EP60 | ||
| 4164 | ; | ||
| 4165 | EP51: ADD COM_CMDNUM,AX | ||
| 4166 | ; | ||
| 4167 | ; Check for hi-res graphics mode operation = Mode 10 | ||
| 4168 | ; | ||
| 4169 | EP60: MOV AX,STR_MODE10H ;graphics mode 10H | ||
| 4170 | CALL CHECK_STRING ;search for string | ||
| 4171 | CMP INS_RSLT,0 | ||
| 4172 | JE EP62 | ||
| 4173 | ; | ||
| 4174 | ADD COM_CMDNUM,AX | ||
| 4175 | OR COM_STATE,COM_M10H ;activate graphics mode flag | ||
| 4176 | JMP EP74 | ||
| 4177 | ; | ||
| 4178 | ; Check for hi-res graphics mode operation = Mode 11 | ||
| 4179 | ; | ||
| 4180 | EP62: MOV AX,STR_MODE11H ;graphics mode 11H | ||
| 4181 | CALL CHECK_STRING ;search for string | ||
| 4182 | CMP INS_RSLT,0 | ||
| 4183 | JE EP64 | ||
| 4184 | ; | ||
| 4185 | ADD COM_CMDNUM,AX | ||
| 4186 | OR COM_STATE,COM_M11H ;activate graphics mode flag | ||
| 4187 | JMP EP74 | ||
| 4188 | ; | ||
| 4189 | ; Check for hi-res graphics mode operation = Mode 12 | ||
| 4190 | ; | ||
| 4191 | EP64: MOV AX,STR_MODE12H ;graphics mode 12H | ||
| 4192 | CALL CHECK_STRING ;search for string | ||
| 4193 | CMP INS_RSLT,0 | ||
| 4194 | JE EP65 | ||
| 4195 | ; | ||
| 4196 | ADD COM_CMDNUM,AX | ||
| 4197 | OR COM_STATE,COM_M12H ;activate graphics mode flag | ||
| 4198 | JMP EP74 | ||
| 4199 | ; | ||
| 4200 | ; Check for text mode operation = Mode 7 or 3 | ||
| 4201 | ; | ||
| 4202 | EP65: MOV AX,STR_TEXTS ;graphics mode 12H | ||
| 4203 | CALL CHECK_STRING ;search for string | ||
| 4204 | CMP INS_RSLT,0 | ||
| 4205 | JE EP66 | ||
| 4206 | ; | ||
| 4207 | ADD COM_CMDNUM,AX | ||
| 4208 | OR COM_STATE,COM_TEXT ;activate text mode flag | ||
| 4209 | JMP EP74 | ||
| 4210 | ; | ||
| 4211 | ; User did not set desired video mode, default to highest available | ||
| 4212 | ; | ||
| 4213 | EP66: CMP GE_MODEL,MODEL_30 ;check if model 25 and 30 | ||
| 4214 | JNE EP68 | ||
| 4215 | ; | ||
| 4216 | CMP GE_SUBMODEL,SUBMD_30 | ||
| 4217 | JE EP67 | ||
| 4218 | ; | ||
| 4219 | CMP GE_SUBMODEL,SUBMD_25 | ||
| 4220 | JNE EP68 | ||
| 4221 | ; | ||
| 4222 | EP67: OR COM_STATE,COM_M11H ;default to mode 11H | ||
| 4223 | JMP EP74 | ||
| 4224 | ; | ||
| 4225 | ; Check for VGA video | ||
| 4226 | ; | ||
| 4227 | EP68: MOV AX,1A00H ;BIOS check display | ||
| 4228 | INT 10H ; | ||
| 4229 | CMP AL,1AH ;VGA supported? | ||
| 4230 | JNE EP686 ;no, continue | ||
| 4231 | ; | ||
| 4232 | ; VGA video, check for INFOWINDOW display | ||
| 4233 | ; | ||
| 4234 | CMP BL, 4 ;infowindow display? | ||
| 4235 | JNE EP685 ;no, continue | ||
| 4236 | ; | ||
| 4237 | OR COM_STATE, COM_M10H ;mode for VGA with infowindow | ||
| 4238 | JMP EP74 ;continue | ||
| 4239 | ; | ||
| 4240 | ; VGA video, non-INFOWINDOW, set highest available mode | ||
| 4241 | ; | ||
| 4242 | EP685: MOV AH, 1BH | ||
| 4243 | MOV BX, 0 | ||
| 4244 | PUSH DS | ||
| 4245 | POP ES | ||
| 4246 | LEA DI, GEN_DATA | ||
| 4247 | INT 10H | ||
| 4248 | PUSH ES:[DI] | ||
| 4249 | PUSH ES:[DI+2] | ||
| 4250 | POP ES | ||
| 4251 | POP DI | ||
| 4252 | ; | ||
| 4253 | TEST BYTE PTR ES:[DI+2], 00000100B | ||
| 4254 | JZ EP6851 | ||
| 4255 | OR COM_STATE, COM_M12H | ||
| 4256 | JMP EP74 | ||
| 4257 | EP6851: TEST BYTE PTR ES:[DI+2], 00000010B | ||
| 4258 | JZ EP6852 | ||
| 4259 | OR COM_STATE, COM_M11H | ||
| 4260 | JMP EP74 | ||
| 4261 | EP6852: TEST BYTE PTR ES:[DI+2], 00000001B | ||
| 4262 | JZ EP6853 | ||
| 4263 | OR COM_STATE, COM_M10H | ||
| 4264 | JMP EP74 | ||
| 4265 | EP6853: OR COM_STATE, COM_TEXT | ||
| 4266 | JMP EP74 | ||
| 4267 | ; | ||
| 4268 | ; Check for EGA video | ||
| 4269 | ; | ||
| 4270 | EP686: MOV AH,12H ;BIOS alternate select | ||
| 4271 | MOV BL,10H ;return EGA info | ||
| 4272 | INT 10H ; | ||
| 4273 | CMP BL,10H ;EGA video? | ||
| 4274 | JNE EP687 ;yes, continue | ||
| 4275 | ; | ||
| 4276 | ; CGA or Monochrome video | ||
| 4277 | ; | ||
| 4278 | OR COM_STATE,COM_TEXT ;text mode operation | ||
| 4279 | JMP EP74 ;continue | ||
| 4280 | ; | ||
| 4281 | ; EGA video, check for sufficient memory for mode 10 | ||
| 4282 | ; | ||
| 4283 | EP687: CMP BL,3H ;256K available? | ||
| 4284 | JAE EP688 ;yes, continue | ||
| 4285 | ; | ||
| 4286 | OR COM_STATE,COM_TEXT ;ega has no memory for mode 10 | ||
| 4287 | JMP EP74 ;continue | ||
| 4288 | ; | ||
| 4289 | ; EGA with 256K, check for cga or monochrome emulation | ||
| 4290 | ; | ||
| 4291 | EP688: AND CL,1111B ;save registers | ||
| 4292 | CMP CL,9 | ||
| 4293 | JE EP689 | ||
| 4294 | ; | ||
| 4295 | ; EGA emulating CGA or Monochrome | ||
| 4296 | ; | ||
| 4297 | OR COM_STATE,COM_TEXT | ||
| 4298 | JMP EP74 | ||
| 4299 | ; | ||
| 4300 | ; EGA in EGA mode | ||
| 4301 | ; | ||
| 4302 | EP689: OR COM_STATE,COM_M10H | ||
| 4303 | ; | ||
| 4304 | ; Check for application main menu filename | ||
| 4305 | ; | ||
| 4306 | EP74: TEST COM_STATE,COM_APPM ;if app menu not configured do not | ||
| 4307 | JNE EP75 ; search for app main menu filespc | ||
| 4308 | ; | ||
| 4309 | MOV AX,STR_APMFILE ;app main menu filename | ||
| 4310 | CALL CHECK_STRING ;search for string | ||
| 4311 | CALL PCINSTR_CALL | ||
| 4312 | CMP INS_RSLT,0 ;check if parameter found | ||
| 4313 | JG EP75 | ||
| 4314 | ; | ||
| 4315 | JMP EP112 ;check next parameter | ||
| 4316 | ; | ||
| 4317 | EP75: XOR AX,AX ;get current drive | ||
| 4318 | MOV AH,19H | ||
| 4319 | INT 21H | ||
| 4320 | ADD AL,65 ;convert from # to alpha char | ||
| 4321 | MOV APP_MFILSPEC,AL ;complete current drive and path | ||
| 4322 | ; | ||
| 4323 | MOV AH,47H ;read current path | ||
| 4324 | MOV DL,0 | ||
| 4325 | LEA SI,APP_MFILSPEC+3 ;point past C:\ | ||
| 4326 | INT 21H | ||
| 4327 | JNC EP78 ;check for error | ||
| 4328 | ; | ||
| 4329 | MOV COM_ERRID,ERR_BADD ;bad disk or drive door open | ||
| 4330 | JMP EPEXIT | ||
| 4331 | ; | ||
| 4332 | EP78: MOV AX,STR_APMFILE ;app main menu filename | ||
| 4333 | CALL CHECK_STRING ;search for string | ||
| 4334 | CMP INS_RSLT,0 | ||
| 4335 | JG EP80 | ||
| 4336 | ; | ||
| 4337 | MOV AX,STR_APPMFILE ;default app menu filename | ||
| 4338 | CALL FAR PTR GET_STRING ;user did not supply new app menu | ||
| 4339 | ; | ||
| 4340 | PUSH SI ;save data segment | ||
| 4341 | PUSH DS | ||
| 4342 | ; | ||
| 4343 | PUSH DI ;save filename offset | ||
| 4344 | PUSH ES ;save filename segment | ||
| 4345 | ; | ||
| 4346 | JMP EP92 ; SHELL.MEU file instead | ||
| 4347 | ; | ||
| 4348 | EP80: PUSH INS_FOFF ;save invocation parameter offset | ||
| 4349 | ADD COM_CMDNUM,AX | ||
| 4350 | ; | ||
| 4351 | MOV CX,INS_RSLT ;save starting search point | ||
| 4352 | ADD CX,INS_FLEN ;point past /MEU: to beginning of | ||
| 4353 | ; menu file name | ||
| 4354 | MOV AX,STR_AAPEXT ;main application menu extension | ||
| 4355 | CALL FAR PTR GET_STRING | ||
| 4356 | ; | ||
| 4357 | MOV INS_FLEN,AX ;length of string | ||
| 4358 | MOV INS_FOFF,DI ;offset of string '.MEU' | ||
| 4359 | MOV INS_FSEG,ES ;segment of string | ||
| 4360 | CALL PCINSTR_CALL ;search for string | ||
| 4361 | ; | ||
| 4362 | POP INS_FOFF | ||
| 4363 | ; | ||
| 4364 | CMP INS_RSLT,0 | ||
| 4365 | JG EP90 | ||
| 4366 | ; | ||
| 4367 | MOV COM_ERRID,ERR_APIF ;invalid main app menu filename | ||
| 4368 | JMP EPEXIT | ||
| 4369 | ; | ||
| 4370 | EP90: PUSH SI ;save data segment | ||
| 4371 | PUSH DS | ||
| 4372 | ; | ||
| 4373 | MOV AX,INS_RSLT | ||
| 4374 | SUB AX,CX ;ending offset - starting offset | ||
| 4375 | ADD AX,INS_FLEN ; + length of extension = # bytes | ||
| 4376 | ; to move | ||
| 4377 | ADD COM_CMDNUM,AX | ||
| 4378 | ; | ||
| 4379 | MOV BX,INS_SOFF ;calculate offset of source strg | ||
| 4380 | ADD BX,CX ; to move | ||
| 4381 | DEC BX | ||
| 4382 | ; | ||
| 4383 | PUSH BX ;save source offset | ||
| 4384 | PUSH INS_SSEG ;save source segment | ||
| 4385 | ; | ||
| 4386 | EP92: MOV CX,AX ; = number of bytes to move | ||
| 4387 | LEA DI,APP_MFILSPEC ;get dest offset | ||
| 4388 | ; | ||
| 4389 | PUSH DS | ||
| 4390 | PUSH ES | ||
| 4391 | POP DS | ||
| 4392 | POP ES | ||
| 4393 | ; | ||
| 4394 | EP94: MOV AL,ES:[DI] ;locate end of drive and path | ||
| 4395 | CMP AL,0 ; in shell app menu file buffer | ||
| 4396 | JE EP98 | ||
| 4397 | ; | ||
| 4398 | INC DI ;point to next character | ||
| 4399 | JMP EP94 | ||
| 4400 | ; | ||
| 4401 | EP98: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of | ||
| 4402 | JE EP99 ; file separator | ||
| 4403 | ; | ||
| 4404 | MOV BYTE PTR ES:[DI],'\' ;add path and filename separator | ||
| 4405 | INC DI ;point to where filename goes | ||
| 4406 | ; | ||
| 4407 | EP99: POP DS ;now move shell menu filename to | ||
| 4408 | POP SI ; end of app menu file path | ||
| 4409 | ; | ||
| 4410 | REP MOVSB ;copy application menu filespec | ||
| 4411 | ; | ||
| 4412 | POP DS | ||
| 4413 | POP SI | ||
| 4414 | ; | ||
| 4415 | ; Move copy of menu filename to first menu buffer | ||
| 4416 | ; | ||
| 4417 | EP100: MOV AX,STR_APMFILE ;app main menu filename | ||
| 4418 | CALL CHECK_STRING ;search for string | ||
| 4419 | CMP INS_RSLT,0 | ||
| 4420 | JG EP103 | ||
| 4421 | ; | ||
| 4422 | MOV AX,STR_APPMFILE ;default app menu filename | ||
| 4423 | CALL FAR PTR GET_STRING ;user did not supply new app menu | ||
| 4424 | ; | ||
| 4425 | PUSH SI ;save data segment | ||
| 4426 | PUSH DS | ||
| 4427 | ; | ||
| 4428 | PUSH DI ;save filename offset | ||
| 4429 | PUSH ES ;save filename segment | ||
| 4430 | ; | ||
| 4431 | JMP EP105 ; SHELL.MEU file instead | ||
| 4432 | ; | ||
| 4433 | EP103: PUSH INS_FOFF ;save invocation parameter offset | ||
| 4434 | ; | ||
| 4435 | MOV CX,INS_RSLT ;save starting search point | ||
| 4436 | ADD CX,INS_FLEN ;point past /MEU: to beginning of | ||
| 4437 | ; menu file name | ||
| 4438 | MOV AX,STR_AAPEXT ;main application menu extension | ||
| 4439 | CALL FAR PTR GET_STRING | ||
| 4440 | ; | ||
| 4441 | MOV INS_FLEN,AX ;length of string | ||
| 4442 | MOV INS_FOFF,DI ;offset of string '.MEU' | ||
| 4443 | MOV INS_FSEG,ES ;segment of string | ||
| 4444 | CALL PCINSTR_CALL ;search for string | ||
| 4445 | ; | ||
| 4446 | POP INS_FOFF | ||
| 4447 | ; | ||
| 4448 | CMP INS_RSLT,0 | ||
| 4449 | JG EP104 | ||
| 4450 | ; | ||
| 4451 | MOV COM_ERRID,ERR_APIF ;invalid main app menu filename | ||
| 4452 | JMP EPEXIT | ||
| 4453 | ; | ||
| 4454 | EP104: PUSH SI ;save data segment | ||
| 4455 | PUSH DS | ||
| 4456 | ; | ||
| 4457 | MOV AX,INS_RSLT | ||
| 4458 | SUB AX,CX ;ending offset - starting offset | ||
| 4459 | ADD AX,INS_FLEN ; + length of extension = # bytes | ||
| 4460 | ; to move | ||
| 4461 | ; | ||
| 4462 | MOV BX,INS_SOFF ;calculate offset of source strg | ||
| 4463 | ADD BX,CX ; to move | ||
| 4464 | DEC BX | ||
| 4465 | ; | ||
| 4466 | PUSH BX ;save source offset | ||
| 4467 | PUSH INS_SSEG ;save source segment | ||
| 4468 | ; | ||
| 4469 | EP105: MOV CX,AX ; = number of bytes to move | ||
| 4470 | LEA DI,APP_MFILNAME ;get dest offset | ||
| 4471 | ; | ||
| 4472 | PUSH DS | ||
| 4473 | PUSH ES | ||
| 4474 | POP DS | ||
| 4475 | POP ES | ||
| 4476 | ; | ||
| 4477 | EP108: POP DS ;now move shell menu filename to | ||
| 4478 | POP SI ; end of app menu file path | ||
| 4479 | ; | ||
| 4480 | REP MOVSB ;copy application menu filespec | ||
| 4481 | ; | ||
| 4482 | POP DS | ||
| 4483 | POP SI | ||
| 4484 | ; | ||
| 4485 | ; Check for color filename | ||
| 4486 | ; | ||
| 4487 | EP112: XOR AX,AX ;get current drive | ||
| 4488 | MOV AH,19H | ||
| 4489 | INT 21H | ||
| 4490 | ADD AL,65 ;convert from # to alpha char | ||
| 4491 | MOV COM_CFILSPEC,AL ;complete current drive and path | ||
| 4492 | ; | ||
| 4493 | MOV AH,47H ;read current path | ||
| 4494 | MOV DL,0 | ||
| 4495 | LEA SI,COM_CFILSPEC+3 ;point past C:\ | ||
| 4496 | INT 21H | ||
| 4497 | JNC EP115 ;check for error | ||
| 4498 | ; | ||
| 4499 | MOV COM_ERRID,ERR_BADD ;bad disk or drive door open | ||
| 4500 | JMP EPEXIT | ||
| 4501 | ; | ||
| 4502 | EP115: MOV AX,STR_CLFILE ;color filename | ||
| 4503 | CALL CHECK_STRING ;search for string | ||
| 4504 | CMP INS_RSLT,0 ;check if not found, error | ||
| 4505 | JG EP118 | ||
| 4506 | ; | ||
| 4507 | MOV AX,STR_CLRFILE ;default color filename | ||
| 4508 | CALL FAR PTR GET_STRING ;user did not supply new app menu | ||
| 4509 | ; | ||
| 4510 | PUSH SI ;save data segment | ||
| 4511 | PUSH DS | ||
| 4512 | ; | ||
| 4513 | PUSH DI ;save offset of filename | ||
| 4514 | PUSH ES ;save segment of filename | ||
| 4515 | ; | ||
| 4516 | JMP EP122 ; SHELL.CLR file | ||
| 4517 | ; | ||
| 4518 | EP118: PUSH INS_FOFF ;save invocation parameter offset | ||
| 4519 | ADD COM_CMDNUM,AX | ||
| 4520 | ; | ||
| 4521 | MOV CX,INS_RSLT ;save starting search point | ||
| 4522 | ADD CX,INS_FLEN ;point past /K: to beginning of | ||
| 4523 | ; color file name | ||
| 4524 | ; | ||
| 4525 | MOV AX,STR_CLREXT ;color profile extension | ||
| 4526 | CALL FAR PTR GET_STRING | ||
| 4527 | ; | ||
| 4528 | MOV INS_FLEN,AX ;length of find string | ||
| 4529 | MOV INS_FOFF,DI ;offset of find string '.CLR' | ||
| 4530 | MOV INS_FSEG,ES ;segment of string | ||
| 4531 | CALL PCINSTR_CALL ;search for string | ||
| 4532 | ; | ||
| 4533 | POP INS_FOFF ;restore before exit | ||
| 4534 | ; | ||
| 4535 | CMP INS_RSLT,0 | ||
| 4536 | JG EP120 | ||
| 4537 | ; | ||
| 4538 | MOV COM_ERRID,ERR_CLRF ;invalid user color profile | ||
| 4539 | JMP EPEXIT | ||
| 4540 | ; | ||
| 4541 | EP120: PUSH SI | ||
| 4542 | PUSH DS | ||
| 4543 | ; | ||
| 4544 | MOV AX,INS_RSLT | ||
| 4545 | SUB AX,CX ;ending offset - starting offset | ||
| 4546 | ADD AX,INS_FLEN ; + length of extension = # bytes | ||
| 4547 | ; to move | ||
| 4548 | ADD COM_CMDNUM,AX | ||
| 4549 | MOV BX,INS_SOFF ;calculate offset of source strg | ||
| 4550 | ADD BX,CX ; to move | ||
| 4551 | DEC BX | ||
| 4552 | ; | ||
| 4553 | PUSH BX ;save source offset | ||
| 4554 | PUSH INS_SSEG ;save source segment | ||
| 4555 | ; | ||
| 4556 | EP122: MOV CX,AX ; = number of bytes to move | ||
| 4557 | LEA DI,COM_CFILSPEC ;get dest offset | ||
| 4558 | ; | ||
| 4559 | PUSH DS | ||
| 4560 | PUSH ES | ||
| 4561 | POP DS | ||
| 4562 | POP ES | ||
| 4563 | ; | ||
| 4564 | EP124: MOV AL,ES:[DI] ;locate end of drive and path | ||
| 4565 | CMP AL,0 ; in shell color file buffer | ||
| 4566 | JE EP128 | ||
| 4567 | ; | ||
| 4568 | INC DI ;point to next character | ||
| 4569 | JMP EP124 | ||
| 4570 | ; | ||
| 4571 | EP128: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of | ||
| 4572 | JE EP129 ; file separator | ||
| 4573 | ; | ||
| 4574 | MOV BYTE PTR ES:[DI],'\' ;add path and filename separator | ||
| 4575 | INC DI ;point to where filename goes | ||
| 4576 | ; | ||
| 4577 | EP129: POP DS ;now move color filename string | ||
| 4578 | POP SI ; to end of color buffer path | ||
| 4579 | ; | ||
| 4580 | REP MOVSB ;copy color index filespec | ||
| 4581 | ; | ||
| 4582 | POP DS | ||
| 4583 | POP SI | ||
| 4584 | ; | ||
| 4585 | ; Check for multiple DOS Service drive buffers | ||
| 4586 | ; | ||
| 4587 | EP130: MOV AX,STR_MULTIPE ;multiple drive display | ||
| 4588 | CALL CHECK_STRING ;search for string | ||
| 4589 | CMP INS_RSLT,0 | ||
| 4590 | JE EP140 | ||
| 4591 | ; | ||
| 4592 | ADD COM_CMDNUM,AX | ||
| 4593 | OR COM_STATE,COM_DRV2 | ||
| 4594 | ; | ||
| 4595 | ; Check for active maintain color option | ||
| 4596 | ; | ||
| 4597 | EP140: MOV AX,STR_CLRACT ;color active | ||
| 4598 | CALL CHECK_STRING ;search for string | ||
| 4599 | CMP INS_RSLT,0 ; | ||
| 4600 | JE EP150 ; | ||
| 4601 | ; | ||
| 4602 | ADD COM_CMDNUM,AX | ||
| 4603 | OR COM_STATE,COM_FLCS ;maintain color is active | ||
| 4604 | ; | ||
| 4605 | ; Check for active maintain menu option | ||
| 4606 | ; | ||
| 4607 | EP150: MOV AX,STR_MENUACT ;menu maintainance active | ||
| 4608 | CALL CHECK_STRING ;search for string | ||
| 4609 | CMP INS_RSLT,0 | ||
| 4610 | JE EP160 | ||
| 4611 | ; | ||
| 4612 | ADD COM_CMDNUM,AX | ||
| 4613 | OR COM_STATE,COM_FLMI ;maintain menu is active | ||
| 4614 | ; | ||
| 4615 | ; Check for active exit to DOS option | ||
| 4616 | ; | ||
| 4617 | EP160: AND FLAG_FSEXIT, NOT DIT_L1 ;turn exit to DOS dither off start | ||
| 4618 | AND FLAG_FDEXIT, NOT DIT_L1 ;turn exit file system dither off | ||
| 4619 | ; | ||
| 4620 | MOV AX,STR_EXITDOS ;exit to DOS active | ||
| 4621 | CALL CHECK_STRING ;search for string | ||
| 4622 | ; | ||
| 4623 | OR FLAG_FSEXIT, DIT_L1 ;turn exit to DOS dither on start | ||
| 4624 | ; | ||
| 4625 | TEST COM_STATE,COM_APPM ;app menu configured | ||
| 4626 | JNZ EP161 ; | ||
| 4627 | ; | ||
| 4628 | OR FLAG_FDEXIT, DIT_L1 ;turn exit from file system dither | ||
| 4629 | ; on | ||
| 4630 | ; | ||
| 4631 | EP161: CMP INS_RSLT,0 | ||
| 4632 | JE EP170 | ||
| 4633 | ; | ||
| 4634 | ADD COM_CMDNUM,AX | ||
| 4635 | OR COM_STATE,COM_FLED ;exit to DOS is active | ||
| 4636 | ; | ||
| 4637 | AND FLAG_FSEXIT, NOT DIT_L1 ;turn exit to DOS dither off start | ||
| 4638 | AND FLAG_FDEXIT, NOT DIT_L1 ;turn exit file system dither off | ||
| 4639 | ; | ||
| 4640 | ; Check for active command line option | ||
| 4641 | ; | ||
| 4642 | EP170: MOV AX,STR_CMDLINE ;command line active | ||
| 4643 | CALL CHECK_STRING ;search for string | ||
| 4644 | CMP INS_RSLT,0 | ||
| 4645 | JE EP180 | ||
| 4646 | ; | ||
| 4647 | ADD COM_CMDNUM,AX | ||
| 4648 | OR COM_STATE,COM_FLCL ;command line is active | ||
| 4649 | ; | ||
| 4650 | ; Check for predefined menu installation option | ||
| 4651 | ; | ||
| 4652 | EP180: MOV AX,STR_PREDACT ;predefined menu active | ||
| 4653 | CALL CHECK_STRING ;search for string | ||
| 4654 | CMP INS_RSLT,0 | ||
| 4655 | JE EP190 | ||
| 4656 | ; | ||
| 4657 | ADD COM_CMDNUM,AX | ||
| 4658 | OR COM_STATE,COM_AUTI ;predefined is active | ||
| 4659 | ; | ||
| 4660 | ; Check for mouse filename /MOS:filename.MOS | ||
| 4661 | ; | ||
| 4662 | EP190: XOR AX,AX ;get current drive | ||
| 4663 | MOV AH,19H | ||
| 4664 | INT 21H | ||
| 4665 | ADD AL,65 ;convert from # to alpha char | ||
| 4666 | MOV COM_VFILSPEC,AL ;complete current drive and path | ||
| 4667 | ; | ||
| 4668 | MOV AH,47H ;read current path | ||
| 4669 | MOV DL,0 | ||
| 4670 | LEA SI,COM_VFILSPEC+3 ;point past C:\ | ||
| 4671 | INT 21H | ||
| 4672 | JNC EP191 ;check for error | ||
| 4673 | ; | ||
| 4674 | MOV COM_ERRID,ERR_BADD ;bad disk or drive door open | ||
| 4675 | JMP EPEXIT | ||
| 4676 | ; | ||
| 4677 | EP191: MOV AX,STR_MOUSACT ;mouse active | ||
| 4678 | CALL CHECK_STRING ;search for string | ||
| 4679 | CMP INS_RSLT,0 ;check if not found, error | ||
| 4680 | JG EP192 | ||
| 4681 | ; | ||
| 4682 | JMP EP200 ;mouse is not active get next var | ||
| 4683 | ; | ||
| 4684 | EP192: OR COM_STATE,COM_MOUS ;mouse is active | ||
| 4685 | ADD COM_CMDNUM,AX | ||
| 4686 | ; | ||
| 4687 | PUSH INS_FOFF ;save invocation parameter offset | ||
| 4688 | ; | ||
| 4689 | MOV CX,INS_RSLT ;save starting search point | ||
| 4690 | ADD CX,INS_FLEN ;point past /MOS: to beginning of | ||
| 4691 | ; mouse file name | ||
| 4692 | ; | ||
| 4693 | MOV AX,STR_MOSEXT ;mouse extension | ||
| 4694 | CALL FAR PTR GET_STRING | ||
| 4695 | ; | ||
| 4696 | MOV INS_FLEN,AX ;length of find string | ||
| 4697 | MOV INS_FOFF,DI ;offset of find string '.MOS' | ||
| 4698 | MOV INS_FSEG,ES ;segment of string | ||
| 4699 | CALL PCINSTR_CALL ;search for string | ||
| 4700 | ; | ||
| 4701 | POP INS_FOFF ;restore before exit | ||
| 4702 | ; | ||
| 4703 | CMP INS_RSLT,0 | ||
| 4704 | JG EP193 | ||
| 4705 | ; | ||
| 4706 | MOV COM_ERRID,ERR_MOUS ;invalid mouse driver | ||
| 4707 | JMP EPEXIT | ||
| 4708 | ; | ||
| 4709 | EP193: PUSH SI | ||
| 4710 | PUSH DS | ||
| 4711 | ; | ||
| 4712 | MOV AX,INS_RSLT | ||
| 4713 | SUB AX,CX ;ending offset - starting offset | ||
| 4714 | ADD AX,INS_FLEN ; + length of extension = # bytes | ||
| 4715 | ; to move | ||
| 4716 | ADD COM_CMDNUM,AX | ||
| 4717 | MOV BX,INS_SOFF ;calculate offset of source strg | ||
| 4718 | ADD BX,CX ; to move | ||
| 4719 | DEC BX | ||
| 4720 | ; | ||
| 4721 | PUSH BX ;save source offset | ||
| 4722 | PUSH INS_SSEG ;save source segment | ||
| 4723 | ; | ||
| 4724 | MOV CX,AX ; = number of bytes to move | ||
| 4725 | LEA DI,COM_VFILSPEC ;get dest offset | ||
| 4726 | ; | ||
| 4727 | PUSH DS | ||
| 4728 | PUSH ES | ||
| 4729 | POP DS | ||
| 4730 | POP ES | ||
| 4731 | ; | ||
| 4732 | EP194: MOV AL,ES:[DI] ;locate end of drive and path | ||
| 4733 | CMP AL,0 ; in shell mouse file buffer | ||
| 4734 | JE EP198 | ||
| 4735 | ; | ||
| 4736 | INC DI ;point to next character | ||
| 4737 | JMP EP194 | ||
| 4738 | ; | ||
| 4739 | EP198: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of | ||
| 4740 | JE EP199 ; file separator | ||
| 4741 | ; | ||
| 4742 | MOV BYTE PTR ES:[DI],'\' ;add path and filename separator | ||
| 4743 | INC DI ;point to where filename goes | ||
| 4744 | ; | ||
| 4745 | EP199: POP DS ;now move mouse filename string | ||
| 4746 | POP SI ; to end of mouse buffer path | ||
| 4747 | ; | ||
| 4748 | REP MOVSB ;copy mouse index filespec | ||
| 4749 | ; | ||
| 4750 | POP DS | ||
| 4751 | POP SI | ||
| 4752 | ; | ||
| 4753 | ; Check for left hand mouse option | ||
| 4754 | ; | ||
| 4755 | EP200: MOV AX,STR_LEFTACT ;left hand mouse | ||
| 4756 | CALL CHECK_STRING ;search for string | ||
| 4757 | CMP INS_RSLT,0 | ||
| 4758 | JE EP205 | ||
| 4759 | ; | ||
| 4760 | ADD COM_CMDNUM,AX | ||
| 4761 | OR COM_STATE,COM_LFMS ;left hand mouse | ||
| 4762 | ; | ||
| 4763 | ; Check for sound active option | ||
| 4764 | ; | ||
| 4765 | EP205: MOV AX,STR_SOUDACT ;sound active | ||
| 4766 | CALL CHECK_STRING ;search for string | ||
| 4767 | CMP INS_RSLT,0 | ||
| 4768 | JE EP207 | ||
| 4769 | ; | ||
| 4770 | ADD COM_CMDNUM,AX | ||
| 4771 | OR COM_STATE2,COM_SOUD ;sound active | ||
| 4772 | ; | ||
| 4773 | ; Check for dir/file buffer save option | ||
| 4774 | ; | ||
| 4775 | EP207: MOV AX,STR_DFSAVE ;check if option active | ||
| 4776 | CALL CHECK_STRING ;search for string | ||
| 4777 | CMP INS_RSLT,0 | ||
| 4778 | JE EP210 | ||
| 4779 | ; | ||
| 4780 | ADD COM_CMDNUM,AX | ||
| 4781 | OR COM_STATE2,COM_DFSAVE ;dir/file buffer save option | ||
| 4782 | ; active | ||
| 4783 | ; | ||
| 4784 | ; Save filespec of shell.hlp at COM_HFILSPEC | ||
| 4785 | ; | ||
| 4786 | EP210: XOR AX,AX ;get current drive | ||
| 4787 | MOV AH,19H | ||
| 4788 | INT 21H | ||
| 4789 | ADD AL,65 ;convert from # to alpha char | ||
| 4790 | MOV COM_HFILSPEC,AL ;complete current drive and path | ||
| 4791 | ; | ||
| 4792 | MOV AH,47H ;read current path | ||
| 4793 | MOV DL,0 | ||
| 4794 | LEA SI,COM_HFILSPEC+3 ;point past C:\ | ||
| 4795 | INT 21H | ||
| 4796 | JNC EP250 | ||
| 4797 | ; | ||
| 4798 | MOV COM_ERRID,ERR_BADD ;bad disk or drive door open | ||
| 4799 | JMP EPEXIT | ||
| 4800 | ; | ||
| 4801 | EP250: LEA DI,COM_HFILSPEC ;get dest offset | ||
| 4802 | ; | ||
| 4803 | MOV AX,DS | ||
| 4804 | MOV ES,AX | ||
| 4805 | ; | ||
| 4806 | EP260: MOV AL,ES:[DI] ;locate end of drive and path | ||
| 4807 | CMP AL,0 ; in shell help file buffer | ||
| 4808 | JE EP270 | ||
| 4809 | ; | ||
| 4810 | INC DI ;point to next character | ||
| 4811 | JMP EP260 | ||
| 4812 | ; | ||
| 4813 | EP270: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of | ||
| 4814 | JE EP275 ; file separator | ||
| 4815 | ; | ||
| 4816 | MOV BYTE PTR ES:[DI],'\' ;add path and filename separator | ||
| 4817 | INC DI ;point to where filename goes | ||
| 4818 | ; | ||
| 4819 | EP275: PUSH DS ;save register | ||
| 4820 | ; | ||
| 4821 | PUSH DI | ||
| 4822 | MOV AX,STR_HLPFILE ;default help text filename | ||
| 4823 | CALL FAR PTR GET_STRING | ||
| 4824 | MOV SI,DI ;get offset of SHELL.HLP | ||
| 4825 | MOV CX,AX ;get length | ||
| 4826 | POP DI | ||
| 4827 | ; | ||
| 4828 | PUSH ES ;set source segment | ||
| 4829 | POP DS | ||
| 4830 | ; | ||
| 4831 | REP MOVSB | ||
| 4832 | ; | ||
| 4833 | POP DS ;restore | ||
| 4834 | ; | ||
| 4835 | ; Check for associate filename /ASC:filename.ASC | ||
| 4836 | ; | ||
| 4837 | EP300: XOR AX,AX ;get current drive | ||
| 4838 | MOV AH,19H | ||
| 4839 | INT 21H | ||
| 4840 | ADD AL,65 ;convert from # to alpha char | ||
| 4841 | MOV COM_AFILSPEC,AL ;complete current drive and path | ||
| 4842 | ; | ||
| 4843 | MOV AH,47H ;read current path | ||
| 4844 | MOV DL,0 | ||
| 4845 | LEA SI,COM_AFILSPEC+3 ;point past C:\ | ||
| 4846 | INT 21H | ||
| 4847 | JNC EP315 ;check for error | ||
| 4848 | ; | ||
| 4849 | MOV COM_ERRID,ERR_BADD ;bad disk or drive door open | ||
| 4850 | JMP EPEXIT | ||
| 4851 | ; | ||
| 4852 | EP315: MOV AX,STR_ASOFILE ;associate filename /ASO | ||
| 4853 | CALL CHECK_STRING ;search for string | ||
| 4854 | CMP INS_RSLT,0 ;check if not found, error | ||
| 4855 | JG EP318 | ||
| 4856 | ; | ||
| 4857 | MOV AX,STR_ASCEXT ;default associate filename | ||
| 4858 | CALL FAR PTR GET_STRING ;user did not supply new app menu | ||
| 4859 | ; | ||
| 4860 | PUSH SI ;save data segment | ||
| 4861 | PUSH DS | ||
| 4862 | ; | ||
| 4863 | PUSH DI ;save offset of filename | ||
| 4864 | PUSH ES ;save segment of filename | ||
| 4865 | ; | ||
| 4866 | JMP EP322 ; SHELL.ASO file | ||
| 4867 | ; | ||
| 4868 | EP318: PUSH INS_FOFF ;save invocation parameter offset | ||
| 4869 | ADD COM_CMDNUM,AX | ||
| 4870 | ; | ||
| 4871 | MOV CX,INS_RSLT ;save starting search point | ||
| 4872 | ADD CX,INS_FLEN ;point past /ASO: to beginning of | ||
| 4873 | ; associate file name | ||
| 4874 | ; | ||
| 4875 | MOV AX,STR_ASOEXT ;assoicate profile extension | ||
| 4876 | CALL FAR PTR GET_STRING | ||
| 4877 | ; | ||
| 4878 | MOV INS_FLEN,AX ;length of find string | ||
| 4879 | MOV INS_FOFF,DI ;offset of find string '.ASO' | ||
| 4880 | MOV INS_FSEG,ES ;segment of string | ||
| 4881 | CALL PCINSTR_CALL ;search for string | ||
| 4882 | ; | ||
| 4883 | POP INS_FOFF ;restore before exit | ||
| 4884 | ; | ||
| 4885 | CMP INS_RSLT,0 | ||
| 4886 | JG EP320 | ||
| 4887 | ; | ||
| 4888 | MOV COM_ERRID,ERR_ASRF ;invalid user associate profile | ||
| 4889 | JMP EPEXIT | ||
| 4890 | ; | ||
| 4891 | EP320: PUSH SI | ||
| 4892 | PUSH DS | ||
| 4893 | ; | ||
| 4894 | MOV AX,INS_RSLT | ||
| 4895 | SUB AX,CX ;ending offset - starting offset | ||
| 4896 | ADD AX,INS_FLEN ; + length of extension = # bytes | ||
| 4897 | ; to move | ||
| 4898 | ADD COM_CMDNUM,AX | ||
| 4899 | MOV BX,INS_SOFF ;calculate offset of source strg | ||
| 4900 | ADD BX,CX ; to move | ||
| 4901 | DEC BX | ||
| 4902 | ; | ||
| 4903 | PUSH BX ;save source offset | ||
| 4904 | PUSH INS_SSEG ;save source segment | ||
| 4905 | ; | ||
| 4906 | EP322: MOV CX,AX ; = number of bytes to move | ||
| 4907 | LEA DI,COM_AFILSPEC ;get dest offset | ||
| 4908 | ; | ||
| 4909 | PUSH DS | ||
| 4910 | PUSH ES | ||
| 4911 | POP DS | ||
| 4912 | POP ES | ||
| 4913 | ; | ||
| 4914 | EP324: MOV AL,ES:[DI] ;locate end of drive and path | ||
| 4915 | CMP AL,0 ; in shell associate file buffer | ||
| 4916 | JE EP328 | ||
| 4917 | ; | ||
| 4918 | INC DI ;point to next character | ||
| 4919 | JMP EP324 | ||
| 4920 | ; | ||
| 4921 | EP328: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of | ||
| 4922 | JE EP329 ; file separator | ||
| 4923 | ; | ||
| 4924 | MOV BYTE PTR ES:[DI],'\' ;add path and filename separator | ||
| 4925 | INC DI ;point to where filename goes | ||
| 4926 | ; | ||
| 4927 | EP329: POP DS ;now move filename string | ||
| 4928 | POP SI ; to end of buffer path | ||
| 4929 | ; | ||
| 4930 | REP MOVSB ;copy associate filespec | ||
| 4931 | ; | ||
| 4932 | POP DS | ||
| 4933 | POP SI | ||
| 4934 | ; | ||
| 4935 | ; Check for buffer size override | ||
| 4936 | ; | ||
| 4937 | EP350: MOV AX,STR_BUFO ;buffer size override active | ||
| 4938 | CALL CHECK_STRING ;search for string | ||
| 4939 | CMP INS_RSLT,0 | ||
| 4940 | JE EP390 | ||
| 4941 | ; | ||
| 4942 | ADD COM_CMDNUM,AX | ||
| 4943 | MOV AX,INS_SSEG ;segment of PSP | ||
| 4944 | MOV ES,AX | ||
| 4945 | MOV BX,INS_SOFF ;offset of PSP | ||
| 4946 | ADD BX,INS_RSLT ;start of /B: parm | ||
| 4947 | ADD BX,INS_FLEN ;start of kilobyte value | ||
| 4948 | DEC BX ;adjust for zero offset | ||
| 4949 | PUSH BX | ||
| 4950 | ; | ||
| 4951 | EP360: CMP ES:BYTE PTR[BX],'0' ;ASCII digit GE 0 | ||
| 4952 | JB EP370 ;no, end of digits | ||
| 4953 | ; | ||
| 4954 | CMP ES:BYTE PTR[BX],'9' ;ASCII digit LE 9 | ||
| 4955 | JA EP370 ;no, end of digits | ||
| 4956 | ; | ||
| 4957 | INC BX | ||
| 4958 | JMP EP360 ;check next digit | ||
| 4959 | ; | ||
| 4960 | EP370: POP AX | ||
| 4961 | CMP AX,BX ;any digits? | ||
| 4962 | JE EP390 ;no, ignore /B parm | ||
| 4963 | ; | ||
| 4964 | MOV ST2_OPT1,ST2_DEC16BI+ST2_SETSTRLEN | ||
| 4965 | ;convert ASCII value | ||
| 4966 | MOV ST2_STRGSEG,ES ;segment of value | ||
| 4967 | MOV ST2_STRGOFF,AX ;offset of value | ||
| 4968 | SUB BX,AX ;calculate numbers of digits | ||
| 4969 | MOV ST2_STRGLEN,BX ;set length to convert | ||
| 4970 | ADD COM_CMDNUM,BX | ||
| 4971 | ; | ||
| 4972 | CALL PCST2IN_CALL ;convert the value | ||
| 4973 | ; | ||
| 4974 | TEST ST2_ERROR,ST2_OUTOFMEM ;value too large | ||
| 4975 | JNZ EP375 ;yes, set to fail during alloc | ||
| 4976 | ; | ||
| 4977 | CMP ST2_NUMH,0 ;value too large | ||
| 4978 | JNE EP375 ;yes, set to fail during alloc | ||
| 4979 | ; | ||
| 4980 | CMP ST2_NUML,960 ;value to large | ||
| 4981 | JB EP380 ;no, attempt to alloc it | ||
| 4982 | ; | ||
| 4983 | EP375: MOV COM_DFSIZE,0F000H ;set to fail during alloc | ||
| 4984 | JMP EP385 | ||
| 4985 | |||
| 4986 | EP380: MOV AX,ST2_NUML ;get kilobyte value | ||
| 4987 | MOV BX,64 ;convert to paragraphs | ||
| 4988 | MUL BX ;kilo -> para | ||
| 4989 | MOV COM_DFSIZE,AX ;set value to allocate | ||
| 4990 | |||
| 4991 | EP385: OR COM_STATE2,COM_BUFO ;buffer size override active | ||
| 4992 | ; | ||
| 4993 | ; Check if DBCS is active | ||
| 4994 | ; | ||
| 4995 | EP390: MOV AX,STR_DBCS ;DBCS active | ||
| 4996 | CALL CHECK_STRING ;search for string | ||
| 4997 | CMP INS_RSLT,0 | ||
| 4998 | JE EP395 | ||
| 4999 | ; | ||
| 5000 | ADD COM_CMDNUM,AX | ||
| 5001 | OR COM_STATE2,COM_DBCS ;DBCS active | ||
| 5002 | ; | ||
| 5003 | ; Check for date/time active option | ||
| 5004 | ; | ||
| 5005 | EP395: MOV AX,STR_DATE ;date active | ||
| 5006 | CALL CHECK_STRING ;search for string | ||
| 5007 | CMP INS_RSLT,0 | ||
| 5008 | JE EP397 | ||
| 5009 | ; | ||
| 5010 | ADD COM_CMDNUM,AX | ||
| 5011 | OR COM_STATE2,COM_DATE ;date/time active | ||
| 5012 | ; | ||
| 5013 | ; Check for COM2 active option | ||
| 5014 | ; | ||
| 5015 | EP397: MOV AX,STR_COM2 ;COM2 active | ||
| 5016 | CALL CHECK_STRING ;search for string | ||
| 5017 | CMP INS_RSLT,0 | ||
| 5018 | JE EP398 | ||
| 5019 | ; | ||
| 5020 | ADD COM_CMDNUM,AX | ||
| 5021 | OR COM_STATE2,COM_COM2 ;COM2 active | ||
| 5022 | ; | ||
| 5023 | ; Check for enhancement activation | ||
| 5024 | ; | ||
| 5025 | EP398: MOV AX,STR_ENH ;COM2 active | ||
| 5026 | CALL CHECK_STRING ;search for string | ||
| 5027 | CMP INS_RSLT,0 ; | ||
| 5028 | ;>>SN JE EP400 | ||
| 5029 | JE EP399 ;>>SN | ||
| 5030 | ; | ||
| 5031 | ADD COM_CMDNUM,AX | ||
| 5032 | OR COM_STATE2,COM_ENHA ;COM2 active | ||
| 5033 | ; ;>>SN | ||
| 5034 | ; Check for Special Needs option ;>>SN | ||
| 5035 | ; ;>>SN | ||
| 5036 | EP399: MOV AX, STR_SN ;>>SN | ||
| 5037 | CALL CHECK_STRING ;>>SN | ||
| 5038 | CMP INS_RSLT,0 ;>>SN | ||
| 5039 | JE EP400 ;>>SN | ||
| 5040 | ; ;>>SN | ||
| 5041 | ADD COM_CMDNUM, AX ;>>SN | ||
| 5042 | OR COM_STATE2,COM_SNA ;>>SN | ||
| 5043 | ; | ||
| 5044 | ; Check for invalid parameters | ||
| 5045 | ; | ||
| 5046 | EP400: | ||
| 5047 | MOV AX, COM_CMDACT | ||
| 5048 | CMP AX, COM_CMDNUM | ||
| 5049 | JE EP405 | ||
| 5050 | ; | ||
| 5051 | MOV COM_ERRID,ERR_BADCMD | ||
| 5052 | JMP EPEXIT | ||
| 5053 | ; | ||
| 5054 | ; Check for missing invocation parameter errors | ||
| 5055 | ; | ||
| 5056 | EP405: TEST COM_STATE,COM_APPM | ||
| 5057 | JNE EP410 | ||
| 5058 | ; | ||
| 5059 | TEST COM_STATE,COM_DOSS | ||
| 5060 | JNE EP410 | ||
| 5061 | ; | ||
| 5062 | MOV COM_ERRID,ERR_NODA ;dos/app both not active | ||
| 5063 | JMP EPEXIT | ||
| 5064 | ; | ||
| 5065 | ; Turn off color selection if mode 11 active | ||
| 5066 | ; | ||
| 5067 | EP410: TEST COM_STATE,COM_M11H ; | ||
| 5068 | JZ EPEXIT ; | ||
| 5069 | ; | ||
| 5070 | AND COM_STATE, NOT COM_FLCS ; | ||
| 5071 | ; | ||
| 5072 | EPEXIT: ;exit | ||
| 5073 | ; | ||
| 5074 | RET | ||
| 5075 | EXAMINE_PSP ENDP | ||
| 5076 | ; | ||
| 5077 | PAGE | ||
| 5078 | ;-----------------------------------------------------------------------------+ | ||
| 5079 | ; : | ||
| 5080 | ; Name: CHECK_STRING : | ||
| 5081 | ; : | ||
| 5082 | ; Description: Search for string identified by AX. : | ||
| 5083 | ; : | ||
| 5084 | ; Entry: AX = String ID. : | ||
| 5085 | ; : | ||
| 5086 | ; Exit: INS_RSLT = Offset into search string where match : | ||
| 5087 | ; found. : | ||
| 5088 | ; Entry point: CHECK_STRING : | ||
| 5089 | ; : | ||
| 5090 | ; Notes: None. : | ||
| 5091 | ; : | ||
| 5092 | ; Internal references: None. : | ||
| 5093 | ; : | ||
| 5094 | ; External references: None. : | ||
| 5095 | ; : | ||
| 5096 | ;-----------------------------------------------------------------------------+ | ||
| 5097 | ; | ||
| 5098 | CHECK_STRING PROC NEAR | ||
| 5099 | ; | ||
| 5100 | CALL FAR PTR GET_STRING ;get address and length of string | ||
| 5101 | ; | ||
| 5102 | MOV INS_SPOFF,0 ;start at beginning of command lin | ||
| 5103 | MOV INS_FLEN,AX ;set length of string to find | ||
| 5104 | MOV INS_FOFF,DI ;set offset of string to find | ||
| 5105 | MOV INS_FSEG,ES ;set segment of string to find | ||
| 5106 | CALL PCINSTR_CALL | ||
| 5107 | ; | ||
| 5108 | CHKSEXIT: ;exit | ||
| 5109 | ; | ||
| 5110 | RET | ||
| 5111 | CHECK_STRING ENDP | ||