3 ;-----------------------------------------------------------------------------+
7 ; Description: Include file for SHELLRD.ASM :
11 ;-----------------------------------------------------------------------------+
14 ;-----------------------------------------------------------------------------+
18 ; Description: Initialize the PCGRAPH parameter block with the PCB :
21 ; Entry: AX = Panel ID to initialize into PCGRAPH parameter :
24 ; Exit: ES:DI = Address of initialized PCGRAPH parameter :
27 ; Entry point: INIT_GTEXT :
31 ; Internal references: None. :
33 ; External references: None. :
35 ;-----------------------------------------------------------------------------+
39 CALL FAR PTR GET_PCB ;return panel address at ES:DI
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
52 LEA DI,GEN_DATA ;point graphics window structure
54 MOV [DI]+G_DRAWT_F,AL ;set flags
55 POP AX ;get color index
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
62 MOV [DI]+G_DRAWTLINES,CX
63 POP [DI]+G_DRAWTLEN ;width of panel text
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
72 DEC [DI]+G_DRAWTROWO ;window row origin (top left)
73 DEC [DI]+G_DRAWTCOLO ;window column origin
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
79 CMP WORD PTR [DI].G_DRAWTFLAGS,0
82 OR BX,G_DRAWT_UF ;set option to use source flags
85 IGT10: MOV [DI]+G_DRAWTOPT,BX ;option word
86 MOV [DI]+G_DRAWTSKIP,0 ;num bytes in source to next line
88 PUSH ES ;save pointer to panel data
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
94 MOV [DI]+G_DRAWT_A,AL ;window attribute
95 MOV [DI]+G_DRAWTOUT,AL ;outline color attribute
97 MOV AX,DATA ;point to segment containing
98 MOV ES,AX ; general data area
104 ;-----------------------------------------------------------------------------+
106 ; Name: PROCESS_SCROLL :
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. :
116 ; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ :
117 ; COM_HCBIDL ÄÄ 1. First element to highlight ÄÄÄÄ AX :
120 ; COM_HCBIDH ÄÄ 4. Last element to highlight ÄÄÄÄ BX :
121 ; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :
124 ; Entry: AX = First element to highlight :
125 ; BX = Last element to highlight :
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. :
132 ; COM_SCROPT = Set scroll option for multiple :
133 ; selections. COM_HCBID and COM_CURPUPF :
134 ; must be initialized before entry. :
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 :
150 ; Entry point: PROCESS_SCROLL :
152 ; Internal references: PCTRACK_CALL :
155 ; External references: None. :
157 ;-----------------------------------------------------------------------------+
159 PROCESS_SCROLL PROC FAR
161 PUSH AX ;save registers
170 ; initialize first highlighted field
172 MOV COM_HLPTEMP,0 ;set to unique scroll help
174 CMP COM_HCBIDL,0 ;check if unique scroll item
175 JNE SI04 ; help option active
180 PUSH COM_HCBID ;set help ID
183 SI04: MOV COM_FLDT,2 ;scroll field type
185 MOV CX,BX ;calulate number of entries
187 XOR CH,CH ;clear to zero
188 ADD CL,'1' ;adjust for string value
189 MOV COM_CNT,CX ;save value
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
196 MOV DX,AX ;get first field
197 MOV AX,COM_CURPUPF ;make new mouse field the current
198 MOV COM_LASTF,AX ; field
201 SI05: MOV CX,COM_HCBIDL ;initialize starting help ID
204 MOV COM_CURPUPF,AX ;make new mouse field the current
205 MOV COM_LASTF,AX ; field
206 MOV DX,AX ;get first field
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
214 ; Poll for keyboard or mouse input
216 SI10: CMP COM_HLPTEMP,0 ;check if single help ID selection
219 MOV AX,COM_HLPTEMP ;set single help ID for all scroll
220 MOV COM_HCBID,AX ; selections
222 SI11: MOV AX,0 ;turn monocasing off
223 CALL FAR PTR PROCESS_KEY ;get keystroke
225 MOV BX,COM_KEY ;get keystroke
227 ; Exit if mouse action
229 SI12: CMP COM_MOK,1 ;check if keyboard input
232 CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed
235 CMP COM_SCROPT,1 ;is this the multiple select opt?
236 JE SI13 ;yes, jump out of procedure
238 MOV AX,COM_CURPUPF ;get current highlighted field
239 CALL FAR PTR GET_MOUSEF ;get mouse structure
241 MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field
243 MOV COM_MOK,0 ;set for keystroke input
245 SI13: JMP SIEXIT ;mouse action exit
247 ; Process down arrow key
249 SI15: CMP BX,ES:[DI]+KY_DARROW ;check if up arrow pressed
252 CMP COM_CURPUPF,CX ;check if below last field
255 INC COM_HCBID ;point to next help equate
256 INC COM_CURPUPF ;no, point to next field
257 JMP SI45 ;now change highlight
259 SI20: PUSH COM_HCBIDL ;initialize help to first field
261 MOV COM_CURPUPF,DX ;yes, point to first field
262 JMP SI45 ;now change highlight
264 ; process up arrow key
266 SI30: CMP BX,ES:[DI]+KY_UARROW ;check if up arrow pressed
269 CMP COM_CURPUPF,DX ;check if above first field
272 DEC COM_HCBID ;point to next help equate
273 DEC COM_CURPUPF ;no, point to previous field
276 SI40: PUSH COM_HCBIDH ;initialize help to last field
278 MOV COM_CURPUPF,CX ;yes, point to last field
280 ; Remove last field highlight and display new highlight
282 SI45: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off
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
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
292 CALL FAR PTR MOUSE_ON ;turn mouse pointer on
294 MOV AX,COM_CURPUPF ;set last field as current
296 JMP SI10 ;poll for next keystroke
300 SI50: CMP BX,ES:[DI]+KY_ENTER ;check if Enter pressed
303 CMP COM_SCROPT,1 ;is this the multiple select opt?
304 JE SIEXIT ;yes, jump out of procedure
306 MOV AX,COM_CURPUPF ;get current highlighted field
307 CALL FAR PTR GET_MOUSEF ;get mouse structure
309 MOV AX,ES:[DI]+MS_KEYS ;keystroke assigned to field
311 MOV COM_MOK,0 ;set for keystroke input
312 JMP SIEXIT ;exit process_scroll
314 ; if escape key, exit
316 SI60: CMP BX,ES:[DI]+KY_CANCEL ;check if Escape pressed
321 ; if not multiple select, exit on number
323 SI70: CMP COM_SCROPT,1 ;is this the multiple select opt?
324 JE SI90 ;yes, jump to check space bar
326 CMP BX,'1' ;compare to a one
329 CMP BX,COM_CNT ;compare to number of entries
332 SI80: JMP SI100 ;poll for next keystroke
334 ; multiple select, exit on spacebar
336 SI90: CMP BX,ES:[DI]+KY_SELECT ;was this the space bar?
337 JE SIEXIT ;yes, exit routine
339 SI100: CALL FAR PTR PCMBEEP_CALL ;beep on unknown keystroke P*3940
340 JMP SI10 ;poll for next keystroke
342 ; Unhighlight field before exit
344 SIEXIT: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off
345 MOV AX,COM_CURPUPF ;get last field
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
351 MOV COM_FLDT,0 ;no field type
353 POP DS ;restore registers
366 ;-----------------------------------------------------------------------------+
368 ; Name: PROCESS_INPUT :
370 ; Description: Display input field contents relative to location of :
371 ; associated panel and optionally process keystroke :
372 ; before returning. :
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) :
379 ; Exit: ES:DI = Address of input field data :
380 ; CX = Length of data :
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 :
393 ; Entry point: PROCESS_INPUT :
397 ; Internal references: GET_ICB = Get specified input control block. :
399 ; PCINPUT_CALL = Call to external CAS routine. :
401 ; External references: None. :
403 ;-----------------------------------------------------------------------------+
405 PROCESS_INPUT PROC FAR
412 MOV COM_FLDT,1 ;input field
414 MOV IN_CURNOR,0607H ;non-mono cursor size
416 CMP GV_VIDMODE,7 ;check if mono mode
419 MOV IN_CURNOR,0C0DH ;mono cursor size
421 ; remove mouse pointer
423 PH03: CALL FAR PTR MOUSE_OFF ;turn mouse pointer off
425 ; locate specified input control block
427 MOV AX,COM_ICBID ;get PCINPUT field
429 CALL FAR PTR GET_ICB ;ES:DI points to ICB
431 ; initialize, display and exit field
433 AND ES:[DI]+ICB_OPT1,NOT ICB_PSW
434 ;deactivate password option
435 CMP COM_INOPT,0 ;check if password option is on
438 OR ES:[DI]+ICB_OPT1,ICB_PSW ;activate password option
440 PH04: AND ES:[DI]+ICB_STATUS,NOT ICB_DONE
441 AND ES:[DI]+ICB_STATUS,NOT ICB_SINS
443 MOV ES:[DI]+ICB_CURCHAR,1
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
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
460 MOV AX,0000000000000001B ;set monocasing option on
462 PH07: TEST IN_OPT,IN_UTRAN ;check if translation option actv
465 MOV AX,0000000000000010B ;set translation option on
467 ; display mouse pointer
469 PH10: CALL FAR PTR MOUSE_ON ;turn mouse pointer on
471 ; Poll keyboard and mouse
473 CALL FAR PTR PROCESS_KEY
474 MOV AX,COM_KEY ;get keystroke
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
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
497 ph1005: cmp ah, lfarrow ;
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
507 PH11: XOR AH, AH ;clear keystroke byte
509 PH12: MOV COM_KEY, AX ;update keystroke
510 CALL FAR PTR MOUSE_OFF ;
512 ; Pass keystroke to input field for processing
514 PH50: MOV ES,IN_ICBSEG ;point to current ICB
516 MOV ES:[DI]+ICB_KS,AX ;set keystroke to ICB
518 CALL FAR PTR PCINPUT_CALL ;process input field
520 MOV ES,IN_ICBSEG ;point to current ICB
523 MOV AX,ES:[DI]+ICB_KS ;return keystroke
525 TEST ES:[DI]+ICB_STATUS,ICB_DONE
527 jmp PH06 ;check for exit condition
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
534 MOV DX,ES:[DI]+ICB_OPT4 ;get option word 4
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
544 TEST DX,ICB_TRUN ;field is DOS pathname?
545 JZ PH60 ;no, continue
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
552 CALL TRUNC_NAME ;truncate DOS names & extensions
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
568 ;-----------------------------------------------------------------------------+
570 ; Name: PROCESS_KEY :
572 ; Description: Poll keyboard then mouse return only if action :
575 ; Entry: AX 0000000000000001 = Monocasing :
576 ; 0000000000000010 = Translation table :
578 ; COM_HLPOPT = set to 10 to deactivate help :
579 ; COM_HCBID = Help ID assigned to input field. :
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 :
590 ; COM_FLDT 0= no field used to determine if :
591 ; 1= input field cursor should be displayed :
594 ; Entry point: PROCESS_KEY :
598 ; Internal references: PCTRACK_CALL = Call to external CAS routine. :
599 ; PCINPUT_CALL = Call to external CAS routine. :
601 ; External references: None. :
603 ;-----------------------------------------------------------------------------+
607 PUSH AX ;save registers
612 MOV INC_KS,0 ;initialize to no keystroke
615 TEST AX,0000000000000001B ;check if monocasing
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
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
628 PK05: TEST AX,0000000000000010B ;check if translation table
631 OR INC_OPT,INC_UTRAN ;initialize for translation table
633 ; Poll keyboard for input
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
643 CALL INIT_MOUSE ;initialize mouse P*4457
644 CALL MOUSE_ON ;turn on mouse P*4457
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
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
658 CALL PCINCHA_CALL ;call CAS routine
660 CMP INC_KS,0 ;check if keystroke returned
661 JE PK20 ;yes, pass to input field
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
672 CMP INC_KS, 6800H ;keystroke is alt-f1?
674 JNE PK19 ;no, continue
675 MOV INC_KS, 8500H ;translate to f11
677 PK19: CALL CHK_OVERRUN ;check for overrun keystrokes
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
687 MOV AX,COM_CURRF ;sav field ID before help process
692 ; Poll mouse for action
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
698 PK22: LEA DI,GEN_DATA ;check mouse for button press
699 MOV [DI]+M_FUNC,M_GET
700 CALL FAR PTR PCTRACK_CALL
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
707 CMP CL, 2 ;process keystroke
710 TEST COM_STATE2,COM_ENHA
717 PK24X: MOV COM_BUT2,0
718 CMP CL,1 ;mouse configuration
719 JE PK24 ; 0= no button pressed
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
727 PK24: OR DL,DL ;check if pointer in active field
728 JNZ PK26 ; when button pressed, if not
729 JMP PK40 ; poll again
731 PK26: CMP GE_MODEL,MODEL_AT ;check if AT
734 CMP GE_SUBMODEL,SUBMD_AT ;make sure AT
737 CMP GE_SUBMODEL,SUBMD_AS ;make sure AT/skyrocket
740 PK28: CALL KEYLOCK ;check if keyboard on AT is
743 JMP PK40 ; locked, poll again
745 PK29: MOV COM_MOK,0 ;set to indicate mouse
746 MOV AX,COM_CURRF ;sav field ID before help process
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
756 MOV AX,[DI]+M_GETDELTA ;scroll delta (if in sb field)
759 MOV AX,[DI]+M_GETSPOS ;text row/col position in bar
762 ; Check for help option before exit
764 PK30: CMP COM_HLPOPT,10 ;check if help deactivated
767 MOV AX,STR_TOTAL ;get keystroke structure
768 CALL FAR PTR GET_STRING ;structure at ES:DI
770 MOV AX,COM_KEY ;get keystroke
771 CMP AX,ES:[DI]+KY_CHELP
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
779 CMP COM_FLDT,1 ;redisplay cursor if input field
782 CALL FAR PTR CURSORON ;turn hardware cursor on
784 ; Check if date and time should be updated.
786 PK40: CALL DISP_DATETIME ;update date/time
811 ;-----------------------------------------------------------------------------+
814 ; Get segment and offset of the DOS monocasing table and return it :
820 ;-----------------------------------------------------------------------------+
821 GET_MONO_DOS PROC NEAR
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
833 POP ES ;ES:DI ptrs to return buf P5197
834 MOV DI,OFFSET TEMP_WKA ;use as temp buffer P5197
838 INC DI ;skip info id P5197
840 MOV AX,WORD PTR [DI] ;get DOS mono table offset P5197
841 MOV IN_MONOOFF,AX ;save it P5197
843 MOV AX,WORD PTR [DI] ;get DOS mono table seg P5197
844 MOV IN_MONOSEG,AX ;save it P5197
848 POP DI ;restore registers P5197
855 ;-----------------------------------------------------------------------------+
857 ; Name: CHK_OVERRUN :
859 ; Description: Check for multiple entries of cursor keys to :
860 ; eliminate overrun in typeamatic mode. :
862 ; Entry: INC_KS = Key stroke :
864 ; Exit: INC_KS = Returned keystroke :
866 ; Entry point: CHK_OVERRUN :
868 ; Notes: Duplicate cursor keystrokes are removed. :
870 ; Internal references: PCINCHA_CALL = Call to external CAS routine. :
872 ; External references: None. :
874 ;-----------------------------------------------------------------------------+
876 CHK_OVERRUN PROC NEAR
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
889 REPNZ SCASW ;scan table for keystroke match
890 JNZ CHK_OVRET ;no match found
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
897 INT 16H ;check for next keystroke
898 JZ CHK_OVRET ;no, keystroke available
900 CMP AX,KS_CHAR ;is it the same as before MJK013
901 JNE CHK_OVRET ;no, return
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
909 JMP CHK_OV10 ;check next keystroke
919 ;-----------------------------------------------------------------------------+
921 ; Name: DISP_DATETIME :
923 ; Description: display the date and time on the display. :
925 ; Entry: COM_STATE2: :
926 ; COM_DATE = O - no date displayed :
927 ; 1 - display date and time :
929 ; Exit: Display updated :
931 ; Entry point: DISP_DATETIME :
935 ; Internal references: UPDATE_DISPLAY :
939 ; External references: PCDATES_CALL = Call to external CAS routine. :
940 ; PCTIMES_CALL = Call to external CAS routine. :
942 ;-----------------------------------------------------------------------------+
944 DISP_DATETIME PROC NEAR
946 PUSH AX ;save registers
954 TEST COM_STATE2,COM_DATE ;is the date option active?
955 JNZ DT_02 ;yes, continue
958 ; Set up to get the date and time.
960 DT_02: MOV DI,OFFSET TIME_WKA ;time workarea
961 MOV BX,DS:[DI+4] ;save currect seconds
963 CALL PCDATES_CALL ;get date
965 CALL PCTIMES_CALL ;get time
967 TEST COM_PROCFLAG,COM_NODATE ;should date not be displayed?
968 JNZ DT_RET ;yes, return
970 TEST COM_PROCFLAG,COM_PSCEXEC ;has PSC ended execution?
971 JZ DT_05 ;no, continue
973 AND COM_PROCFLAG,NOT COM_PSCEXEC ;reset PSC ended execution
974 JMP DT_20 ;display time/date
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
980 MOV COM_BASE_WKA,AX ;save new base screen
983 DT_10: CMP BX,DS:[DI+4] ;has the time minutes changed?
984 JE DT_RET ;no, don't update it
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
994 CALL FAR PTR MOUSE_OFF ;turn mouse off
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?
1002 JNE DT_28 ;no, continue
1003 MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816
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
1012 CALL UPDATE_DISPLAY ;display date
1014 MOV BX,69 ;column to display
1015 MOV CX,LENGTH TIME_WKA ;len of time
1016 MOV DX,OFFSET TIME_WKA
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?
1024 JNE DT_38 ;no, continue
1025 MOV MG_SOURCE_F,G_DRAWTUBOTM ;underline P*4816
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
1033 CALL UPDATE_DISPLAY ;display time
1035 CALL FAR PTR MOUSE_ON ;turn mouse on
1037 DT_RET: POP ES ;restore registers
1049 ;-----------------------------------------------------------------------------+
1053 ; Description: Determine if AT keyboard lock is on. :
1057 ; Exit: ZF = 1 : keyboard is locked :
1058 ; ZF = 0 : keyboard is unlocked :
1060 ; Entry point: KEYLOCK :
1064 ; Internal references: None. :
1066 ; External references: None. :
1068 ;-----------------------------------------------------------------------------+
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
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
1088 KEYLOCK20: IN AL,STATUS_PORT
1089 TEST AL,OUTPT_BUF_FULL
1090 JNZ KEYLOCK30 ;branch if OBF
1092 LOOP KEYLOCK20 ;loop until response or timeout
1093 DEC BL ;timeout loop attempted six times
1096 INC BL ;set ZF = 0 if no response
1099 KEYLOCK30: IN AL,INPUT_PORT ;read keyboard input port
1100 TEST AL,KYBD_INH ;test to see if kybd lock is on
1104 KEYLOCK60: STI ;enable ints
1105 POP CX ;restore regs
1112 ;-----------------------------------------------------------------------------+
1114 ; Name: COMMAND_LINE :
1116 ; Description: Command line dialog. :
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 :
1131 ; Entry point: COMMAND_LINE :
1133 ; Notes: Changed procedure to use a COMMAND.COM PSC execution. :
1135 ; Internal references: PCTRACK_CALL :
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. :
1146 ;-----------------------------------------------------------------------------+
1148 COMMAND_LINE PROC FAR
1150 TEST COM_STATE,COM_FLCL ;check if command line active
1153 CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR
1158 MC10: CALL FAR PTR REMOVE_OLDPD ;remove last pull down panel
1169 ; disable mouse tracker
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
1175 ; Set current directory path
1177 CMP COM_CDIALOG,COM_APPMENU ;check if program menu dialog
1178 JNE MC20 ; don't ask for dir from DOS Serv
1182 MC20: CMP COM_CDIALOG,COM_PAAB ;check if program menu dialog
1183 JE MC30 ; don't ask for dir from DOS Serv
1185 CMP COM_CDIALOG,COM_DCLR ;check if program menu dialog
1186 JE MC30 ; don't ask for dir from DOS Serv
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
1192 MOV BX,OFFSET FULLSPEC ;file name
1193 MOV DL,DS:BYTE PTR[BX] ;drive id
1194 CALL SET_DRIVE ;set to the drive
1197 MOV AH,0EH ;change to selected drive
1206 MOV AH,3BH ;change to selected directory
1212 ; Move in COMSPEC to PSC workarea for new COMMAND.COM PSC execution.
1214 MC30: MOV SI,OFFSET COM_PFILSPEC ;COMSPEC location
1216 mov dl, byte ptr [si] ;get drive letter of comspec
1217 call set_drive ;set logical drive
1219 MOV DI,OFFSET PEC_COM ;PSC workarea location
1220 MOV PEC_BYTE,0 ;clear length
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
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
1232 MC50: MOV DS:BYTE PTR [DI],PEC_SEP ;set parameter seperator char
1233 INC PEC_BYTE ;adjust length
1235 POP ES ;set segment of PSC workarea
1236 MOV DI,OFFSET PEC_TITLE ;set offset of PSC workarea
1238 OR COM_PROCFLAG,COM_CMDPSC ;set COMMAND.COM PSC exec P*3748
1239 CALL FAR PTR PROCESS_PSC ;set up to process PSC
1241 POP DI ;restore registers
1255 ;-----------------------------------------------------------------------------+
1259 ; On a single drive system, set the logical to the physical drive. :
1261 ; Entry: DL - Drive letter :
1263 ; Exit: Logical drive set :
1267 ;-----------------------------------------------------------------------------+
1275 AND DL,0DFH ; convert it to P*4831
1276 SUB DL,40H ; an binary number. P*4831
1278 MOV AX,440FH ; I/O control P*4831
1279 INT 21H ; set logical drive letter P*4831
1284 RET ; return to caller P*4831
1289 ;-----------------------------------------------------------------------------+
1291 ; Name: PCCLRRD_CALL :
1293 ; Description: Call to PCCLRRD. :
1295 ; Entry: PCCLRRD parameter block initialized. :
1297 ; Exit: PCCLRRD parameter block initialized. :
1299 ; Entry point: PCCLRRD_CALL :
1303 ; Internal references: None. :
1305 ; External references: None. :
1307 ;-----------------------------------------------------------------------------+
1309 PCCLRRD_CALL PROC NEAR ;*PCR (ENTIRE PROC)
1311 PUSH DS ;Set segment
1315 PUSH DI ;Save registers
1317 LEA DI,CRD_OPT1 ;Set DI to proper parameter block
1320 MOV AH,00H ;Make call to CAS-RM
1321 MOV BX,CRD_RN ;Set cas routine number
1322 INT CASINT ;Call routine
1327 ; copy the color index vector into buffer below clrrd buffer
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
1335 MOV SI,CRD_CCBVECOFF ;get source address
1336 MOV CRD_CCBVECOFF,DI ;set destination offset
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
1343 MOV ES,CRD_BUFSEG ;set destination segment
1344 MOV CX,CRD_CCBVECLEN ;get the length to move
1346 MOV AX,CRD_CCBVECSEG ;set source segment
1349 REP MOVSB ;move the data
1352 CR_EXIT: POP DI ;Restore registers
1359 ;-----------------------------------------------------------------------------+
1361 ; Name: SET_DEFAULT :
1363 ; Description: Set default value in specified ICB control block. :
1365 ; Entry: ES:DI = Address of default value. :
1366 ; CX = Length of string. :
1367 ; AX = ICB number of input field. :
1371 ; Entry point: None. :
1375 ; Internal references: None. :
1377 ; External references: None. :
1379 ;-----------------------------------------------------------------------------+
1381 SET_DEFAULT PROC FAR
1383 PUSH ES ;save default segment
1384 PUSH DI ;save default offset
1386 CALL FAR PTR GET_ICB ;get input control block
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
1397 ;-----------------------------------------------------------------------------+
1401 ; Description: Return address of specified panel control block. :
1403 ; Entry: AX = Number of PCB vector desired. :
1405 ; COM_PCBVECSEG = PCB vector segment. :
1406 ; COM_PCBVECOFF = PCB vector offset. :
1407 ; COM_PCBVECLEN = number of bytes in each vector :
1409 ; Exit: ES:DI = Address of specified PCB :
1415 ; Internal references: None. :
1417 ; External references: None. :
1419 ;-----------------------------------------------------------------------------+
1428 ; read panel control block vector to obtain PCB address
1430 MOV BX,COM_PCBVECSEG ;get beginning PCB vector address
1432 MOV DI,COM_PCBVECOFF
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
1442 MOV ES,BX ;set ES:DI to panel's actual
1443 MOV DI,CX ; PCB address
1454 ;-----------------------------------------------------------------------------+
1458 ; Description: Return address of specified scroll control block. :
1460 ; Entry: AX = Number of SCB vector desired. :
1462 ; COM_SCBVECSEG = SCB vector segment. :
1463 ; COM_SCBVECOFF = SCB vector offset. :
1464 ; COM_SCBVECLEN = number bytes in each vector :
1466 ; Exit: ES:DI = Address of specified SCB :
1472 ; Internal references: None. :
1474 ; External references: None. :
1476 ;-----------------------------------------------------------------------------+
1485 ; read panel control block vector to obtain SCB address
1487 MOV BX,COM_SCBVECSEG ;get beginning SCB vector address
1489 MOV DI,COM_SCBVECOFF
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
1499 MOV ES,BX ;set ES:DI to panel's actual
1500 MOV DI,CX ; PCB address
1511 ;-----------------------------------------------------------------------------+
1515 ; Description: Return address of specified input control block. :
1517 ; Entry: AX = Number of ICB vector desired. :
1519 ; COM_ICBVECSEG = ICB vector segment. :
1520 ; COM_ICBVECOFF = ICB vector offset. :
1521 ; COM_ICBVECLEN = vector length. :
1523 ; Exit: ES:DI = Address of specified ICB :
1529 ; Internal references: None. :
1531 ; External references: None. :
1533 ;-----------------------------------------------------------------------------+
1542 ; read input control block vector to obtain PCB address
1544 MOV BX,COM_ICBVECSEG ;get beginning ICB vector address
1546 MOV DI,COM_ICBVECOFF
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
1556 MOV ES,BX ;set ES:DI to input's actual
1557 MOV DI,CX ; ICB address
1559 TEST COM_STATE,COM_TEXT ;check if in text mode
1562 AND ES:[DI]+ICB_OPT1,NOT ICB_BOX
1563 ;if in text mode deactivate box
1575 ;-----------------------------------------------------------------------------+
1579 ; Description: Return address of error message. :
1581 ; Entry: AX = Number of vector desired. :
1583 ; COM_ERRVECSEG = Error message vector segment. :
1584 ; COM_ERRVECOFF = Error message vector offset. :
1585 ; COM_ERRVECLEN = Length of each vector in bytes. :
1587 ; Exit: ES:DI = Address of specified error message. :
1588 ; AX = length of error message. :
1590 ; Entry point: GET_ERROR :
1594 ; Internal references: None. :
1596 ; External references: None. :
1598 ;-----------------------------------------------------------------------------+
1606 ; read error message vector
1608 MOV BX,COM_ERRVECSEG ;get beginning vector address
1610 MOV DI,COM_ERRVECOFF
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
1621 MOV DI,CX ;set ES:DI to panel's actual
1632 ;-----------------------------------------------------------------------------+
1634 ; Name: GET_BUTTON :
1636 ; Description: Return address of graphics button. :
1638 ; Entry: AX = Number of vector desired. :
1640 ; COM_BCBVECSEG = vector segment. :
1641 ; COM_BCBVECOFF = vector offset. :
1642 ; COM_BCBVECLEN = Length of each vector in bytes. :
1644 ; Exit: ES:DI = Address of specified string. :
1646 ; Entry point: GET_BUTTON :
1650 ; Internal references: None. :
1652 ; External references: None. :
1654 ;-----------------------------------------------------------------------------+
1656 GET_BUTTON PROC NEAR
1662 ; read keystroke vector
1664 MOV BX,COM_BCBVECSEG ;get beginning vector address
1666 MOV DI,COM_BCBVECOFF
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
1684 ;-----------------------------------------------------------------------------+
1686 ; Name: GET_STRING :
1688 ; Description: Return address of string. :
1690 ; Entry: AX = Number of ICB vector desired. :
1692 ; COM_STRVECSEG = String vector segment. :
1693 ; COM_STRVECOFF = String vector offset. :
1694 ; COM_STRVECLEN = Length of each vector in bytes. :
1696 ; Exit: ES:DI = Address of specified string. :
1697 ; AX = length of string. :
1699 ; Entry point: GET_STRING :
1703 ; Internal references: None. :
1705 ; External references: None. :
1707 ;-----------------------------------------------------------------------------+
1715 ; read error message vector
1717 MOV BX,COM_STRVECSEG ;get beginning vector address
1719 MOV DI,COM_STRVECOFF
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
1730 MOV DI,CX ;set ES:DI to actual data
1740 ;-----------------------------------------------------------------------------+
1744 ; Description: Returns the normal and highlight color attributes :
1745 ; of a specified panel. :
1748 ; Entry: AX = Panel ID number. :
1750 ; Exit: AH = Panel's normal color attr :
1751 ; AL = Panel's highlight color attr :
1753 ; Entry point: GET_ATTR :
1757 ; Internal references: None. :
1759 ; External references: None. :
1761 ;-----------------------------------------------------------------------------+
1765 PUSH ES ;save registers
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
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
1775 POP DI ;restore registers
1782 ;-----------------------------------------------------------------------------+
1786 ; Description: Returns ES:DI pointing to color index specified in :
1787 ; AX. Use the CCB_PB to reference the desired color :
1790 ; Entry: AX = Color index to return. :
1791 ; CRD_CCBVECOFF = Offset of color index. :
1792 ; CRD_CCBVECSEG = Segment of color index. :
1794 ; Exit: ES:DI = Address of color index :
1796 ; Entry point: GET_COLOR :
1800 ; Internal references: None. :
1802 ; External references: None. :
1804 ;-----------------------------------------------------------------------------+
1808 PUSH AX ;save registers
1812 DEC AX ; default index and make zero
1814 PUSH CRD_CCBVECSEG ;get color index segment
1817 PUSH CRD_CCBVECOFF ;get color index offset
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
1824 POP DX ;restore registers
1832 ;-----------------------------------------------------------------------------+
1834 ; Name: SET_SHLVMDOS :
1836 ; Description: Set shell video mode from current DOS video mode. :
1838 ; Entry: COM_STATE = Option word indicating invocation :
1839 ; parameters passed through PSP. :
1841 ; Exit: PCGVIDO = Parmeter block initialized. :
1842 ; COM_DVIDMODE = Original DOS video mode. :
1843 ; COM_SVIDMODE = Current Shell video mode. :
1845 ; Entry point: SET_SHLVMDOS :
1849 ; Internal references: PCGVIDO_CALL :
1851 ; External references: None. :
1853 ;-----------------------------------------------------------------------------+
1855 SET_SHLVMDOS PROC NEAR
1857 LEA DI,GEN_DATA ;load offset of PCGRAPH PB
1858 MOV [DI]+G_INITVFLAG,0 ;init to VGA hardware available
1860 ; Check if mode 10H requested
1862 TEST COM_STATE,COM_M10H ;check if graphics mode 10H
1863 JE VMD20 ; requested (EGA/VGA)
1865 TEST GV_STAT1,GV_256K ;256K memory on EGA card
1868 MOV COM_ERRID,ERR_256K ;set error for less than 256KB
1869 JMP VMDEXIT ; available on graphics adaphter
1871 VMD10: MOV AL,10H ;set for mode 10H
1874 ; Check if mode 11H requested
1876 VMD20: TEST COM_STATE,COM_M11H ;check if graphics mode 11H
1877 JE VMD40 ; requested (VGA/MCGA)
1879 TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail
1882 CMP GE_MODEL,MODEL_30 ;check for MCGA support
1885 OR IN_OPT,IN_MCGA ;MCGA active
1886 MOV [DI]+G_INITVFLAG,G_INITNOVGA
1887 ;no VGA hardware available
1889 VMD30: MOV AL,11H ;set for mode 11H
1892 ; check if mode 12H requested
1894 VMD40: TEST COM_STATE,COM_M12H ;check if graphics mode 12H
1897 TEST GV_STAT1,GV_256K ;256K memory on EGA card
1900 MOV COM_ERRID,ERR_256K ;set error for less than 256KB
1901 JMP VMDEXIT ; available on graphics adaphter
1903 VMD50: MOV AL,12H ;set for mode 12H
1905 ; set graphics video mode
1907 VMD60: CMP AL,12H ;check for mode 12H
1910 CMP AL,11H ;check for mode 11H
1913 JMP VMD65 ;must be mode 10H
1915 VMD62: CMP GE_MODEL,MODEL_30 ;check if model 30
1918 CMP GE_MODEL,MODEL_25 ;check if model 25
1922 MOV AX, 1A00H ;BIOS check display
1924 CMP AL, 1AH ;VGA supported?
1926 JE VMD65 ;yes, continue
1928 MOV AL,0 ;set error in video mode
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
1936 CALL PCGRAPH_CALL ;initialize graphics
1940 ; set text video mode
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
1947 CMP AL,COM_DVIDMODE ;if color text mode is active no
1948 JE VMD80 ; need to set mode
1950 XOR AH,AH ;set to color text mode
1955 ; read all video information and check if mode set successful
1957 VMD80: CALL PCGVIDO_CALL ;get new video information and
1958 CMP AL,GV_VIDMODE ; check if mode set successful
1961 MOV COM_ERRID,ERR_MODE ;requested video mode failed
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
1969 CALL FAR PTR CURSOROFF ;deactive cursor
1977 ;-----------------------------------------------------------------------------+
1979 ; Name: SET_DOSVMSHL :
1981 ; Description: Set original DOS video mode from current shell mode :
1982 ; and disable mouse support :
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. :
1989 ; Exit: PCGVIDO = Parmeter block initialized. :
1991 ; Entry point: SET_DOSVMSHL :
1995 ; Internal references: PCGVIDO_CALL :
1998 ; External references: None. :
2000 ;-----------------------------------------------------------------------------+
2002 SET_DOSVMSHL PROC NEAR
2004 ; Disable mouse support
2006 CALL FAR PTR MOUSE_DIS ;disable mouse support
2008 ; Check if shell is in text mode
2010 VMS10: CMP COM_STATE,COM_TEXT
2013 ; Terminate shell graphics mode and restore original DOS video mode
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
2022 ; Shell is in text video mode, restore original DOS video mode
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
2030 VMSEXIT: MOV AL,0 ;clear screen
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
2039 CALL FAR PTR CURSORON
2046 ;-----------------------------------------------------------------------------+
2048 ; Name: SET_CMDVMSHL :
2050 ; Description: Set shell command line video mode from current shell :
2053 ; Entry: PCGVIDO = Parmeter block initialized. :
2054 ; COM_DVIDMODE = Original DOS video mode. :
2055 ; COM_STATE = Invocation options. :
2057 ; Exit: COM_CVIDMODE = Shell command line video mode. :
2058 ; PCGVIDO = Parmeter block initialized. :
2060 ; Entry point: SET_CMDVMSHL :
2064 ; Internal references: PCGVIDO_CALL :
2066 ; External references: None. :
2068 ;-----------------------------------------------------------------------------+
2070 SET_CMDVMSHL PROC FAR
2072 ; Check if shell text mode is active
2074 CMP COM_STATE,COM_TEXT
2077 ; Terminate shell graphics mode and restore original DOS video mode
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
2085 ; Set shell command line to text video mode
2087 MOV AL,7 ;initialize to monochrome mode
2088 CMP COM_DVIDMODE,AL ;check if DOS video mode was
2089 JE CMD10 ; monochrome
2091 MOV AL,3 ;set color text mode
2093 CMD10: XOR AH,AH ;set command line video mode
2098 CMDEXIT: CALL PCGVIDO_CALL
2104 ;-----------------------------------------------------------------------------+
2106 ; Name: SET_SHLVMCMD :
2108 ; Description: Set shell video mode from shell command line video :
2111 ; Entry: COM_STATE = Option word indicating invocation :
2112 ; parameters passed through PSP. :
2114 ; Exit: PCGVIDO = Parmeter block initialized. :
2115 ; COM_DVIDMODE = Original DOS video mode. :
2116 ; COM_SVIDMODE = Current Shell video mode. :
2118 ; Entry point: SET_SHLVMCMD :
2122 ; Internal references: PCGVIDO_CALL :
2124 ; External references: None. :
2126 ;-----------------------------------------------------------------------------+
2128 SET_SHLVMCMD PROC FAR
2130 ; Check if shell graphics modes 10H, 11H, and 12H were active
2132 LEA DI,GEN_DATA ;load offset of PCGRAPH PB
2133 MOV [DI]+G_INITVFLAG,0
2135 TEST COM_STATE,COM_M11H ;check if graphics mode 11H
2136 JE SMC20 ; requested (VGA/MCGA)
2138 TEST GV_STAT1,GV_EGAA ;check if VGA/EGA hardware avail
2141 CMP GE_MODEL,MODEL_30 ;check for MCGA support
2144 OR IN_OPT,IN_MCGA ;MCGA active
2145 MOV [DI]+G_INITVFLAG,G_INITNOVGA
2146 ;no VGA hardware available
2148 SMC10: MOV AL,11H ;set for mode 11H
2151 SMC20: CMP COM_SVIDMODE,10H ;check if mode 10 active
2154 CMP COM_SVIDMODE,12H ;check if mode 12 active
2157 MOV AH,0FH ;get current video mode
2160 CMP AL,COM_SVIDMODE ;check if command line video mode
2161 JNE SMC30 ; changed and reset if yes
2165 ; Switch to monochrome monitor
2167 SMC30: CMP COM_SVIDMODE,3H ;check if color mode should be set
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
2177 XOR AH,AH ;set color monochrome mode
2185 ; Switch to color monitor in text mode 80x25
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
2195 XOR AH,AH ;set color mode
2203 ; Initialize shell graphics mode from shell command line text mode
2205 SMC50: MOV AH,0FH ;get current video mode
2208 CMP AL,7H ;check if command line mode set
2209 JNE SMC60 ; for monochrome, if yes reset to
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
2220 XOR AH,AH ;set color 80x25 mode before
2221 MOV AL,3H ; setting graphics mode
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
2236 SMCEXIT: CALL PCGVIDO_CALL
2242 ;-----------------------------------------------------------------------------+
2246 ; Description: Deactivates hardware cursor from display. :
2252 ; Entry point: CURSOROFF :
2256 ; Internal references: None. :
2258 ; External references: None. :
2260 ;-----------------------------------------------------------------------------+
2264 PUSH AX ;save registers
2268 MOV AH,3 ;function to get cursor info
2271 OR CH,20H ;set bit 6
2272 MOV AH,1 ;function to set cursor
2275 POP CX ;restore registers
2283 ;-----------------------------------------------------------------------------+
2287 ; Description: Displays the hardare cursor. :
2293 ; Entry point: CURSORON :
2297 ; Internal references: None. :
2299 ; External references: None. :
2301 ;-----------------------------------------------------------------------------+
2305 PUSH AX ;save registers
2310 MOV AH,3 ;function to get cursor info
2313 AND CH,NOT 20H ;clear bit 6
2314 MOV AH,1 ;function to set cursor
2318 POP CX ;restore registers
2326 ;-----------------------------------------------------------------------------+
2328 ; Name: PCINPUT_CALL :
2330 ; Description: Call to PCINPUT. :
2332 ; Entry: PCINPUT parameter block initialized. :
2334 ; Exit: PCINPUT parameter block initialized. :
2336 ; Entry point: PCINPUT_CALL :
2340 ; Internal references: None. :
2342 ; External references: None. :
2344 ;-----------------------------------------------------------------------------+
2346 PCINPUT_CALL PROC FAR
2348 PUSH DS ;set segment
2352 PUSH DI ;save registers
2354 TEST COM_STATE2,COM_DBCS ;check if DBCS option active
2357 OR IN_OPT,IN_DDBCS+IN_ADBCS ;activate DBCS
2359 INPT10: LEA DI,IN_OPT ;set DI to proper parameter block
2362 MOV AH,00H ;make call to CAS-RM
2363 MOV BX,IN_RN ;set CAS routine number
2364 INT CASINT ;call routine
2368 POP DI ;restore registers
2375 ;-----------------------------------------------------------------------------+
2377 ; Name: PCINCHA_CALL :
2379 ; Description: Call to PCINCHA. :
2381 ; Entry: PCINCHA parameter block initialized. :
2383 ; Exit: PCINCHA parameter block initialized. :
2385 ; Entry point: PCINCHA_CALL :
2389 ; Internal references: None. :
2391 ; External references: None. :
2393 ;-----------------------------------------------------------------------------+
2395 PCINCHA_CALL PROC NEAR
2397 PUSH DS ;set segment
2401 PUSH DI ;save registers
2403 TEST COM_STATE2,COM_DBCS ;check if DBCS option active
2406 OR INC_OPT,INC_DDBCS ;activate DBCS
2408 INCH10: LEA DI,INC_OPT ;set DI to proper parameter block
2411 MOV AH,00H ;make call to CAS-RM
2412 MOV BX,INC_RN ;set CAS routine number
2413 INT CASINT ;call routine
2417 POP DI ;restore registers
2424 ;-----------------------------------------------------------------------------+
2426 ; Name: PCDISPQ_CALL :
2428 ; Description: Call to PCDISPQ. :
2430 ; Entry: PCDISPQ parameter block initialized. :
2432 ; Exit: PCDISPQ parameter block initialized. :
2434 ; Entry point: PCDISPQ_CALL :
2438 ; Internal references: None. :
2440 ; External references: None. :
2442 ;-----------------------------------------------------------------------------+
2444 PCDISPQ_CALL PROC NEAR
2446 PUSH DS ;set segment
2450 PUSH DI ;save registers
2452 LEA DI,QM_OPT1 ;set DI to proper parameter block
2455 MOV AH,00H ;make call to CAS-RM
2456 MOV BX,QM_RN ;set CAS routine number
2457 INT CASINT ;call routine
2461 POP DI ;restore registers
2468 ;-----------------------------------------------------------------------------+
2470 ; Name: PCPANEL_CALL :
2472 ; Description: Initialize for call to PCPANEL including refresh of :
2473 ; input and scroll fields in the logical video buffer :
2476 ; Entry: PCPANEL parameter block initialized. :
2478 ; AX 0= Logical video buffer mode write :
2479 ; 1= Direct video mode write :
2481 ; Exit: PCPANEL parameter block initialized. :
2483 ; Entry point: PCPANEL_CALL :
2487 ; Internal references: None. :
2489 ; External references: None. :
2491 ;-----------------------------------------------------------------------------+
2493 PCPANEL_CALL PROC NEAR
2495 ; initialize PCDISPQ info for PCPANEL call
2497 CMP AX,1 ;check if direct video buffer
2498 JE PP10 ; write option active
2501 MOV PM_PANQUENUM,BX ;number of panels in parent queue
2504 MOV PM_CHDQUENUM,BX ;number panels in child queue
2507 MOV PM_ACTIVEPAN,BX ;active parent panel number
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
2513 ; actual PCPANEL call
2515 PP10: PUSH DS ;set segment
2519 PUSH DI ;save registers
2521 LEA DI,PM_OPT1 ;set DI to proper parameter block
2524 MOV AH,00H ;make call to CAS-RM
2525 MOV BX,PM_RN ;set CAS routine number
2526 INT CASINT ;call routine
2530 POP DI ;restore registers
2541 ;-----------------------------------------------------------------------------+
2543 ; Name: PCMBEEP_CALL :
2545 ; Description: Call to PCMBEEP. :
2547 ; Entry: PCMBEEP parameter block initialized. :
2549 ; Exit: PCMBEEP parameter block initialized. :
2551 ; Entry point: PCMBEEP_CALL :
2555 ; Internal references: None. :
2557 ; External references: None. :
2559 ;-----------------------------------------------------------------------------+
2561 PCMBEEP_CALL PROC FAR
2563 TEST COM_STATE2,COM_SOUD ;check if sound is off
2566 PUSH CX ;save registers
2569 PUSH DS ;set segment
2573 PUSH DI ;save registers
2575 LEA DI,MB_FREQUENCY ;set DI to proper parameter block
2578 MOV AH,00H ;make call to CAS-RM
2579 MOV BX,MB_RN ;set CAS routine number
2580 INT CASINT ;call routine
2584 POP DI ;restore registers
2587 POP DX ;restore registers
2596 ;-----------------------------------------------------------------------------+
2598 ; Name: PCSLCTP_CALL :
2601 ; Description: Call to PCSLCTP. :
2603 ; Entry: ES:DI = beginning address of PCSLCTP parameter block. :
2605 ; Exit: PCSLCTP parameter block initialized. :
2607 ; Entry point: PCSLCTP_CALL :
2611 ; Internal references: None. :
2613 ; External references: None. :
2615 ;-----------------------------------------------------------------------------+
2617 PCSLCTP_CALL PROC NEAR
2619 ; Initialize color index vector
2621 MOV AX,PM_CCBVECNUM ;set color index number
2622 MOV ES:[DI]+SCB_CCBVECNUM,AX
2624 MOV AX,CRD_CCBVECOFF ;set color index offset
2625 MOV ES:[DI]+SCB_CCBVECOFF,AX
2627 MOV AX,CRD_CCBVECSEG ;set color index segment
2628 MOV ES:[DI]+SCB_CCBVECSEG,AX
2631 MOV AH,00H ;make call to CAS-RM
2632 MOV BX,SCB_RN ;set CAS routine number
2633 INT CASINT ;call slctopt
2642 ;-----------------------------------------------------------------------------+
2644 ; Name: PCHLPRD_CALL :
2646 ; Description: Call to PCHLPRD. :
2648 ; Entry: PCHLPRD parameter block initialized. :
2650 ; Exit: PCHLPRD parameter block initialized. :
2652 ; Entry point: PCHLPRD_CALL :
2656 ; Internal references: None. :
2658 ; External references: None. :
2660 ;-----------------------------------------------------------------------------+
2662 PCHLPRD_CALL PROC NEAR
2664 PUSH DS ;set segment
2668 PUSH DI ;save registers
2670 LEA DI,HRD_OPT1 ;set DI to proper parameter block
2673 MOV AH,00H ;make call to CAS-RM
2674 MOV BX,HRD_RN ;set CAS routine number
2675 INT CASINT ;call routine
2679 POP DI ;restore registers
2686 ;-----------------------------------------------------------------------------+
2688 ; Name: PCINSTR_CALL :
2690 ; Description: Call to PCINSTR. :
2692 ; Entry: PCINSTR parameter block initialized. :
2694 ; Exit: PCINSTR parameter block initialized. :
2696 ; Entry point: PCINSTR_CALL :
2700 ; Internal references: None. :
2702 ; External references: None. :
2704 ;-----------------------------------------------------------------------------+
2706 PCINSTR_CALL PROC NEAR
2708 PUSH DS ;set segment
2712 PUSH DI ;save registers
2714 LEA DI,INS_OPT ;set DI to proper parameter block
2717 MOV AH,00H ;make call to CAS-RM
2718 MOV BX,INS_RN ;set CAS routine number
2719 INT CASINT ;call routine
2723 POP DI ;restore registers
2730 ;-----------------------------------------------------------------------------+
2732 ; Name: PCGVIDO_CALL :
2734 ; Description: Call to PCGVIDO. :
2736 ; Entry: PCGVIDO parameter block initialized. :
2738 ; Exit: PCGVIDO parameter block initialized. :
2740 ; Entry point: PCGVIDO_CALL :
2744 ; Internal references: None. :
2746 ; External references: None. :
2748 ;-----------------------------------------------------------------------------+
2750 PCGVIDO_CALL PROC NEAR
2754 PUSH DS ;set segment
2758 PUSH DI ;save registers
2760 LEA DI,GV_STAT1 ;set DI to proper parameter block
2764 MOV AH,00H ;make call to CAS-RM
2765 MOV BX,GV_RN ;set CAS routine number
2766 INT CASINT ;call routine
2770 POP DI ;restore registers
2779 ;-----------------------------------------------------------------------------+
2781 ; Name: PCCLRWR_CALL :
2783 ; Description: Call to PCCLRWR. :
2785 ; Entry: PCCLRWR parameter block initialized. :
2787 ; Exit: PCCLRWR parameter block initialized. :
2789 ; Entry point: PCCLRWR_CALL :
2793 ; Internal references: None. :
2795 ; External references: None. :
2797 ;-----------------------------------------------------------------------------+
2799 PCCLRWR_CALL PROC NEAR
2801 PUSH DS ;set segment
2805 PUSH DI ;save registers
2807 LEA DI,CWR_OPT ;set DI to proper parameter block
2810 MOV AH,00H ;make call to CAS-RM
2811 MOV BX,CWR_RN ;set CAS routine number
2812 INT CASINT ;call routine
2816 POP DI ;restore registers
2823 ;-----------------------------------------------------------------------------+
2825 ; Name: PCCRITE_CALL :
2827 ; Description: Call to PCCRITE. :
2829 ; Entry: PCCRITE parameter block initialized. :
2831 ; Exit: PCCRITE parameter block initialized. :
2833 ; Entry point: PCCRITE_CALL :
2837 ; Internal references: None. :
2839 ; External references: None. :
2841 ;-----------------------------------------------------------------------------+
2843 PCCRITE_CALL PROC NEAR
2845 PUSH DS ;set segment
2849 PUSH DI ;save registers
2851 LEA DI,CE_OPT ;set DI to proper parameter block
2855 MOV AH,00H ;make call to CAS-RM
2856 MOV BX,CE_RN ;set CAS routine number
2857 INT CASINT ;call routine
2861 POP DI ;restore registers
2868 ;-----------------------------------------------------------------------------+
2870 ; Name: PCWWRAP_CALL :
2872 ; Description: Call to PCWWRAP. :
2874 ; Entry: PCWWRAP parameter block initialized. :
2876 ; Exit: PCWWRAP parameter block initialized. :
2878 ; Entry point: PCWWRAP_CALL :
2882 ; Internal references: None. :
2884 ; External references: None. :
2886 ;-----------------------------------------------------------------------------+
2888 PCWWRAP_CALL PROC NEAR
2890 PUSH DS ;set segment
2894 PUSH DI ;save registers
2896 LEA DI,WWP_OPT1 ;set DI to proper parameter block
2900 MOV AH,00H ;make call to CAS-RM
2901 MOV BX,WWP_RN ;set CAS routine number
2902 INT CASINT ;call routine
2906 POP DI ;restore registers
2913 ;-----------------------------------------------------------------------------+
2915 ; Name: PCTRACK_CALL :
2917 ; Description: Call to PCTRACK. :
2919 ; Entry: PCTRACK parameter block initialized. :
2921 ; Exit: PCTRACK parameter block initialized. :
2923 ; Entry point: PCTRACK_CALL :
2927 ; Internal references: None. :
2929 ; External references: None. :
2931 ;-----------------------------------------------------------------------------+
2933 PCTRACK_CALL PROC FAR
2936 PUSH DI ;save registers
2938 PUSH DS ;point to PCTRACK parameter block
2942 MOV AH,00H ;make call to CAS-RM
2943 MOV BX,MS_RN ;set CAS routine number
2944 INT CASINT ;call routine
2948 POP DI ;restore registers
2955 ;-----------------------------------------------------------------------------+
2957 ; Name: PCGRAPH_CALL :
2959 ; Description: Call to PCGRAPH. :
2961 ; Entry: PCGRAPH parameter block initialized. :
2963 ; Exit: PCGRAPH parameter block initialized. :
2965 ; Entry point: PCGRAPH_CALL :
2969 ; Internal references: None. :
2971 ; External references: None. :
2973 ;-----------------------------------------------------------------------------+
2975 PCGRAPH_CALL PROC NEAR
2978 PUSH DI ;save registers
2981 MOV AH,00H ;make call to CAS-RM
2982 MOV BX,MS_RN ;set CAS routine number
2983 INT CASINT ;call routine
2987 POP DI ;restore registers
2994 ;-----------------------------------------------------------------------------+
2996 ; Name: PCST2IN_CALL :
2998 ; Description: Call to PCST2IN. :
3000 ; Entry: PCST2IN parameter block initialized. :
3002 ; Exit: PCST2IN parameter block initialized. :
3004 ; Entry point: PCST2IN_CALL :
3008 ; Internal references: None. :
3010 ; External references: None. :
3012 ;-----------------------------------------------------------------------------+
3014 PCST2IN_CALL PROC NEAR
3016 PUSH DS ;set segment
3020 PUSH DI ;save registers
3022 LEA DI,ST2_OPT1 ;set DI to proper parameter block
3026 MOV AH,00H ;make call to CAS-RM
3027 MOV BX,S2I_RN ;set CAS routine number
3028 INT CASINT ;call routine
3032 POP DI ;restore registers
3039 ;-----------------------------------------------------------------------------+
3041 ; Name: PCMOVEC_CALL :
3043 ; Description: Call to PCMOVEC. :
3045 ; Entry: PCMOVEC parameter block initialized. :
3047 ; Exit: PCMOVEC parameter block initialized. :
3049 ; Entry point: PCMOVEC_CALL :
3053 ; Internal references: None. :
3055 ; External references: None. :
3057 ;-----------------------------------------------------------------------------+
3059 PCMOVEC_CALL PROC NEAR
3061 PUSH DS ;set segment
3065 PUSH DI ;save registers
3067 LEA DI,MO_OPT ;set DI to proper parameter block
3071 MOV AH,00H ;make call to CAS-RM
3072 MOV BX,MO_RN ;set CAS routine number
3073 INT CASINT ;call routine
3077 POP DI ;restore registers
3084 ;-----------------------------------------------------------------------------+
3086 ; Name: SHELLDA_CALL :
3088 ; Description: Call to SHELLDA. :
3094 ; Entry point: SHELLDA_CALL :
3098 ; Internal references: None. :
3100 ; External references: None. :
3102 ;-----------------------------------------------------------------------------+
3104 SHELLDA_CALL PROC NEAR
3112 ;-----------------------------------------------------------------------------+
3116 ; Call to PCROWCL. :
3118 ; Entry: PB initialized. :
3124 ;-----------------------------------------------------------------------------+
3126 PCROWCL_CALL PROC NEAR
3129 PUSH DS ;set segment
3133 PUSH DI ;save registers
3135 LEA DI,CR_SCRWIDTH ;set DI to proper parameter block
3138 MOV AH,00H ;make call to CAS-RM
3139 MOV BX,CR_RN ;set CAS routine number
3140 INT CASINT ;call routine
3144 POP DI ;restore registers
3152 ;-----------------------------------------------------------------------------+
3156 ; Call to PCMOVEG. :
3158 ; Entry: PB initialized. :
3164 ;-----------------------------------------------------------------------------+
3166 PCMOVEG_CALL PROC NEAR
3169 PUSH DS ;set segment
3173 PUSH DI ;save registers
3175 LEA DI,MG_OPT ;set DI to proper parameter block
3178 MOV AH,00H ;make call to CAS-RM
3179 MOV BX,MG_RN ;set CAS routine number
3180 INT CASINT ;call routine
3184 POP DI ;restore registers
3192 ;-----------------------------------------------------------------------------+
3196 ; Call to PCGEQUP. :
3198 ; Entry: PB initialized. :
3204 ;-----------------------------------------------------------------------------+
3206 PCGEQUP_CALL PROC NEAR
3209 PUSH DS ;set segment
3213 PUSH DI ;save registers
3215 LEA DI,GE_OPT ;set DI to proper parameter block
3218 MOV AH,00H ;make call to CAS-RM
3219 MOV BX,MG_RN ;set CAS routine number
3220 INT CASINT ;call routine
3224 POP DI ;restore registers
3232 ;-----------------------------------------------------------------------------+
3236 ; Call to PCDATES. :
3238 ; Entry: PB initialized. :
3244 ;-----------------------------------------------------------------------------+
3246 PCDATES_CALL PROC NEAR
3249 PUSH DS ;set segment
3253 PUSH DI ;save registers
3255 LEA DI,DTS_OPT ;set DI to proper parameter block
3258 MOV AH,00H ;make call to CAS-RM
3259 MOV BX,DTS_RN ;set CAS routine number
3260 INT CASINT ;call routine
3264 POP DI ;restore registers
3272 ;-----------------------------------------------------------------------------+
3276 ; Call to PCTIMES. :
3278 ; Entry: PB initialized. :
3284 ;-----------------------------------------------------------------------------+
3286 PCTIMES_CALL PROC NEAR
3289 PUSH DS ;set segment
3293 PUSH DI ;save registers
3295 LEA DI,TMS_OPT ;set DI to proper parameter block
3298 MOV AH,00H ;make call to CAS-RM
3299 MOV BX,TMS_RN ;set CAS routine number
3300 INT CASINT ;call routine
3304 POP DI ;restore registers
3312 ;-----------------------------------------------------------------------------+
3314 ; Name: CHANGE_APPM :
3316 ; Description: Display Application menu screen. :
3320 ; Exit: COM_CDIALOG :
3322 ; Entry point: CHANGE_APPM :
3326 ; Internal references: None. :
3328 ; External references: None. :
3330 ;-----------------------------------------------------------------------------+
3332 CHANGE_APPM PROC FAR
3334 TEST COM_STATE,COM_APPM ;check if app menu active
3337 CALL FAR PTR OPT_INACTIVE ;display error panel for inactive *PCR
3340 CAM10: MOV COM_HLPOPT2,0 ;set for normal shell help
3341 MOV COM_HCBIDAAB,HLP_AABPROGRAM
3342 MOV COM_HCBID,HLP_AABPROGRAM
3344 MOV AX,MFF_AABAOPT ;default to program menu AAB field
3345 CALL FAR PTR LOC_MOUSEF
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
3358 ;-----------------------------------------------------------------------------+
3360 ; Name: ALLOCATE_BUFB :
3362 ; Description: Allocate memory for directory and file buffers. :
3364 ; Entry: COM_STATE2 = Invocation parameters. :
3365 ; COM_DFSIZE = Optional buffer override size in parags.:
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. :
3374 ; Allocated by one DOS call with COM_DATA4SEG as :
3375 ; starting segment. :
3377 ; COM_DATA4LEN Optional DOS Services directory :
3378 ; COM_DATA4OFF list 1 buffer. :
3381 ; COM_DATA5LEN Optional DOS Services directory :
3382 ; COM_DATA5OFF list 2 buffer. :
3385 ; COM_DATA6LEN Optional DOS Services file list 1 :
3386 ; COM_DATA6OFF buffer :
3389 ; COM_DATA7LEN Optional DOS Services file list 2 :
3390 ; COM_DATA7OFF buffer :
3393 ; COM_DATA8LEN Optional DOS Services :
3394 ; COM_DATA8OFF buffer :
3397 ; Entry point: ALLOCATE_BUFB :
3401 ; Internal references: None. :
3403 ; External references: INT 21H 48H Allocate memory :
3405 ;-----------------------------------------------------------------------------+
3407 ALLOCATE_BUFB PROC FAR
3409 TEST COM_STATE,COM_DOSS ;check if DOS Services configured
3414 ; Determine avail memory, calc memory to allocate for shell functions
3416 AMB05: MOV AH,48H ;find out how many parags are aval
3417 MOV BX,0FFFFH ; in BX on return
3420 ; adjust for resident mode operation
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
3429 AMB08: CMP BX,MAX_EXECBUF ;64K remaining?
3430 JB AMB_ERR ;no, error
3432 SUB BX,MAX_EXECBUF ;save 64KB for execution of
3433 ; command prompt or program menu
3434 ; only if in resident mode
3436 AMB11: MOV CX,BX ;save avail paraghs for compare
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
3445 CMP BX,MAX_DOSWBUF ;10K remaining?
3446 JB AMB_ERR ;no, error
3448 SUB BX,MAX_DOSWBUF ;reserve working memory for copy
3449 ; and view functions (10KB)
3451 ; Check for minimum storage to run DOS Services
3453 AMB12: MOV TMP_DOSWBUF,MAX_DOSWBUF ;max work buffer
3454 MOV TMP_DIRBUF,MAX_DIR1BUF ;max directory buffer
3456 CALL CHK_MINDOS ;check for minimum DOS
3457 JNC AMB30 ;OK to allocate
3459 TEST COM_STATE2,COM_BUFO ;/B specified?
3460 JZ AMB14 ;no, try for minimum system
3462 CMP COM_DFSIZE,SM_FILEBUF ;User specified a small file buf?
3463 JA AMB_ERR ;no, /B just too large
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
3470 ADD BX,MAX_DOSWBUF ;change from 16K
3471 SUB BX,MIN_DOSWBUF ; to 8K for View/Copy buffer
3473 AMB16: CALL CHK_MINDOS ;check for absolutely minimum DOS
3474 JNC AMB30 ;OK to allocate
3476 AMB_ERR: MOV COM_ERRID,ERR_INSM ;insufficent memory available
3479 ; Allocate required shell memory
3482 MOV AH,48H ;set allocate function number
3483 INT 21H ;allocate memory
3484 JNC AMB40 ;check for error
3486 MOV COM_ERRID,ERR_INSM ;insufficent memory available
3489 ; Check if resident mode active and preallocate working DOS buffers
3491 AMB40: MOV CX,AX ;save beginning segment
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
3500 TEST COM_STATE,COM_APPM ;check if app menu active
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
3510 ADD CX,MAX_DOSWBUF ;adjust segment
3513 AMB60: MOV AX,COM_DATA3SEG ;reuse app menu buffer
3514 MOV COM_DATA8SEG,AX ;set segment
3516 MOV COM_DATA8OFF,AX ;set offset
3517 MOV AX,COM_DATA3LEN ;set DOS working buffer size in
3518 MOV COM_DATA8LEN,AX ; bytes
3520 ; Use next available memory for dir buffer 1 and 2
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
3529 MOV COM_DATA4LEN,AX ;set length in paragraphs
3531 TEST COM_STATE,COM_DRV2 ;check if multiple drive display
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
3541 MOV COM_DATA5LEN,AX ;set length in paragraphs
3543 ; Use remaining memory for file buffers 1 and 2
3545 AMB80: MOV COM_DATA6SEG,CX ;set segment of file buf 1
3546 MOV COM_DATA6OFF,0 ;offset starts at zero
3548 MOV AX,COM_DFSIZE ;get remaining buffer
3550 TEST COM_STATE,COM_DRV2 ;check if multiple drive display
3553 SHR AX,1 ;divide remaining buffer by 2
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
3559 TEST COM_STATE,COM_DRV2 ;check if multiple drive display
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
3574 ;-----------------------------------------------------------------------------+
3576 ; Name: CHK_MINDOS :
3578 ; Description: Check for enough storage to run minimum DOS Services. :
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 :
3585 ; Exit: Carry flag set :
3587 ; Entry point: CHK_MINDOS :
3591 ; Internal references: None :
3593 ; External references: None :
3595 ;-----------------------------------------------------------------------------+
3597 CHK_MINDOS PROC NEAR
3599 XOR AX,AX ;clear out
3600 TEST COM_STATE,COM_RESS ;resident mode?
3601 JZ CHS14 ;no, storage already adjusted
3603 TEST COM_STATE,COM_APPM ;appl configured?
3604 JNZ CHS14 ;yes, reuse appl workarea
3606 ADD AX,TMP_DOSWBUF ;10K or 8K for View/Copy buffer
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
3612 ADD AX,TMP_DIRBUF ;8K or 4K for second dir buffer
3614 CHS16: TEST COM_STATE2,COM_BUFO ;/B specified?
3615 JZ CHS18 ;no, add in for min file buffer
3617 ADD AX,COM_DFSIZE ;update total storage needed
3618 CMP BX,AX ;is storage available?
3621 SUB AX,COM_DFSIZE ;back out and use all of storage
3624 ; JB CHS_ERR ;no, display error message
3626 CHS17: MOV BX,AX ;set to allocate storage
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
3633 CHS20: MOV COM_DFSIZE,BX ;set to allocate all avail storage
3647 ;-----------------------------------------------------------------------------+
3649 ; Name: MANAGE_ERROR :
3651 ; Description: Manage error messages. :
3653 ; Entry: COM_ERRID = ID number of error message. :
3657 ; Entry point: MANAGE_ERROR :
3661 ; Internal references: GET_ERROR :
3663 ; External references: INT 21H AH=09H Print string to standard output. :
3665 ;-----------------------------------------------------------------------------+
3667 MANAGE_ERROR PROC NEAR
3669 ; Process critcal error messages before initialization is complete
3671 CALL SET_DOSVMSHL ;set DOS video mode from shell
3674 MOV AX,COM_ERRID ;calculate offset into error
3675 CALL FAR PTR GET_ERROR
3677 PUSH DS ;save data segment address
3679 MOV CX,AX ;set message length
3680 MOV DX,DI ;set message offset
3681 MOV AX,ES ;set message segment
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
3689 MOV AH,06 ;print <CR> to screen
3693 MOV AH,06 ;print <LF> to screen
3697 POP DS ;restore data segment address
3703 ;-----------------------------------------------------------------------------+
3705 ; Name: EXAMINE_PSP :
3707 ; Description: Examine Program Segment Prefix string for current :
3708 ; SHELLRD.EXE invocation parameters. :
3710 ; Entry: PSP initialized. :
3712 ; Exit: COM_STATE = Option word indicating invocation :
3713 ; parameters passed through PSP. :
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 :
3737 ; 1= Maintain menu item access is active.:
3738 ; COM_FLCS 8 0= Maintain color selections access is :
3740 ; 1= Maintain color selections access is :
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. :
3757 ; COM_STATE2 = Option word indicating invocation :
3758 ; parameters passed through PSP. :
3760 ; Label Bit Description :
3761 ; -------- --- ----------------------------------- :
3762 ; COM_SOUD 0 0= Sound not active. :
3763 ; 1= Sound active. :
3765 ; COM_NLS 1 0= Not active. :
3766 ; 1= NLS help index display option active:
3768 ; COM_DFSAV 2 0= Not active. :
3769 ; 1= Directory and file save active. :
3771 ; COM_BUFO 3 0= Not active. :
3772 ; 1= Dir/file buffer size override on. :
3774 ; COM_DBCS 4 0= Not active. :
3777 ; COM_DATE 5 0= Not active. :
3778 ; 1= Date/time active. :
3780 ; COM_COM2 5 0= Not active. D491:
3781 ; 1= COM2 active. D491:
3783 ; COM_DFSIZE = Size of DOS directory and file buffer :
3784 ; to allocate in paragraphs. Used only :
3785 ; if buffer override option is active :
3788 ; COM_PSPOFF = Offset of SHELL.EXE PSP :
3789 ; COM_PSPSEG = Segment of SHELL.EXE PSP :
3791 ; Entry point: EXAMINE_PSP :
3793 ; Notes: EXAMINE_PSP is beginning overlay point for mouse :
3796 ; Internal references: MANAGE_ERROR :
3799 ; External references: INT 21H 19H Return current drive :
3800 ; INT 21H 47H Return current path :
3802 ;-----------------------------------------------------------------------------+
3804 EXAMINE_PSP PROC NEAR
3806 ; Intialize to search PSP for invocation options
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
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
3828 EP034: PUSH DS ;save data seg
3829 MOV DS, COM_PSPSEG ;PSP segment is source seg
3841 EP037: cmp al, '}' ;
3855 ep0385: mov es:[di], al ;
3863 MOV EP_ENDOFF, DI ;set offset of last byte in buffer
3865 ; Check for profile filename /PRO:filename.PRO
3867 EP1900: XOR AX,AX ;get current drive
3870 ADD AL,65 ;convert from # to alpha char
3871 MOV COM_RFILSPEC,AL ;complete current drive and path
3873 MOV AH,47H ;read current path
3875 LEA SI,COM_RFILSPEC+3 ;point past C:\
3877 JNC EP1910 ;check for error
3879 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
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
3887 JMP EP05 ;profile not active get next var
3889 EP1920: ADD COM_CMDNUM,AX
3891 PUSH INS_FOFF ;save invocation parameter offset
3893 MOV CX,INS_RSLT ;save starting search point
3894 ADD CX,INS_FLEN ;point past /PRO: to beginning of
3897 MOV AX,STR_PROEXT ;profile extension
3898 CALL FAR PTR GET_STRING
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
3905 POP INS_FOFF ;restore before exit
3910 MOV COM_ERRID,ERR_MOUS ;invalid profile file
3917 SUB AX,CX ;ending offset - starting offset
3918 ADD AX,INS_FLEN ; + length of extension = # bytes
3921 MOV BX,INS_SOFF ;calculate offset of source strg
3925 PUSH BX ;save source offset
3926 PUSH INS_SSEG ;save source segment
3928 MOV CX,AX ; = number of bytes to move
3929 LEA DI,COM_RFILSPEC ;get dest offset
3936 EP1940: MOV AL,ES:[DI] ;locate end of drive and path
3937 CMP AL,0 ; in shell profile name buffer
3940 INC DI ;point to next character
3943 EP1980: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
3944 JE EP1990 ; file separator
3946 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
3947 INC DI ;point to where filename goes
3949 EP1990: POP DS ;now move profile filename string
3950 POP SI ; to end of profile buffer path
3952 REP MOVSB ;copy profile filespec
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
3967 ; Read profile file to command buffer ;
3971 MOV BX, AX ;set file handle
3974 MOV AH, 3FH ;DOS read handle
3977 INT 21H ;read profile into buffer
3978 JNC EP_1994 ;continue if no error
3980 MOV COM_ERRID,ERR_MOUS ;bad disk or drive door open
3983 EP_1994: ; ADD INS_SLEN, AX ;
3995 mov al, byte ptr gen_data ;
4005 epx037: cmp al, '}' ;
4019 epx0385: mov [di], al ;
4024 epx039: jmp ep_1993 ;
4026 ; Close profile handle
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
4034 ; Convert command string alpha to upper case
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
4041 MOV COM_STATE2,0 ;initialize to zero
4048 OR COM_CONFIRM, COM_CONFDEL ;
4055 AND COM_CONFIRM,NOT COM_CONFDEL
4062 OR COM_CONFIRM, COM_CONFREPL;
4069 AND COM_CONFIRM,NOT COM_CONFREPL
4076 OR COM_CONFIRM, COM_ALLOWSEL;
4083 AND COM_CONFIRM,NOT COM_ALLOWSEL
4090 MOV SORTSTAT, SST_NAME ;
4098 MOV SORTSTAT, SST_EXT ;
4106 MOV SORTSTAT, SST_SIZE ;
4114 MOV SORTSTAT, SST_DATE ;
4125 ; Check for NLS translation option for help index display
4127 MOV AX,STR_NLS ;NLS configured
4128 CALL CHECK_STRING ;search for string
4132 ADD COM_CMDNUM,AX ;add length to found length
4133 OR COM_STATE2,COM_NLS ;app menu configured
4135 ; Check for application menu option
4137 EP25: MOV AX,STR_APPMENU ;app menu configured
4138 CALL CHECK_STRING ;search for string
4143 OR COM_STATE,COM_APPM ;app menu configured
4145 ; Check for DOS Services option
4147 EP30: MOV AX,STR_DOSSERV ;DOS services configured
4148 CALL CHECK_STRING ;search for string
4153 OR COM_STATE,COM_DOSS ;DOS services configured
4155 ; Check for transient mode operation
4157 EP50: MOV AX,STR_TRANS ;transient shell configured
4158 CALL CHECK_STRING ;search for string
4162 OR COM_STATE,COM_RESS ;resident shell configured
4165 EP51: ADD COM_CMDNUM,AX
4167 ; Check for hi-res graphics mode operation = Mode 10
4169 EP60: MOV AX,STR_MODE10H ;graphics mode 10H
4170 CALL CHECK_STRING ;search for string
4175 OR COM_STATE,COM_M10H ;activate graphics mode flag
4178 ; Check for hi-res graphics mode operation = Mode 11
4180 EP62: MOV AX,STR_MODE11H ;graphics mode 11H
4181 CALL CHECK_STRING ;search for string
4186 OR COM_STATE,COM_M11H ;activate graphics mode flag
4189 ; Check for hi-res graphics mode operation = Mode 12
4191 EP64: MOV AX,STR_MODE12H ;graphics mode 12H
4192 CALL CHECK_STRING ;search for string
4197 OR COM_STATE,COM_M12H ;activate graphics mode flag
4200 ; Check for text mode operation = Mode 7 or 3
4202 EP65: MOV AX,STR_TEXTS ;graphics mode 12H
4203 CALL CHECK_STRING ;search for string
4208 OR COM_STATE,COM_TEXT ;activate text mode flag
4211 ; User did not set desired video mode, default to highest available
4213 EP66: CMP GE_MODEL,MODEL_30 ;check if model 25 and 30
4216 CMP GE_SUBMODEL,SUBMD_30
4219 CMP GE_SUBMODEL,SUBMD_25
4222 EP67: OR COM_STATE,COM_M11H ;default to mode 11H
4225 ; Check for VGA video
4227 EP68: MOV AX,1A00H ;BIOS check display
4229 CMP AL,1AH ;VGA supported?
4230 JNE EP686 ;no, continue
4232 ; VGA video, check for INFOWINDOW display
4234 CMP BL, 4 ;infowindow display?
4235 JNE EP685 ;no, continue
4237 OR COM_STATE, COM_M10H ;mode for VGA with infowindow
4240 ; VGA video, non-INFOWINDOW, set highest available mode
4253 TEST BYTE PTR ES:[DI+2], 00000100B
4255 OR COM_STATE, COM_M12H
4257 EP6851: TEST BYTE PTR ES:[DI+2], 00000010B
4259 OR COM_STATE, COM_M11H
4261 EP6852: TEST BYTE PTR ES:[DI+2], 00000001B
4263 OR COM_STATE, COM_M10H
4265 EP6853: OR COM_STATE, COM_TEXT
4268 ; Check for EGA video
4270 EP686: MOV AH,12H ;BIOS alternate select
4271 MOV BL,10H ;return EGA info
4273 CMP BL,10H ;EGA video?
4274 JNE EP687 ;yes, continue
4276 ; CGA or Monochrome video
4278 OR COM_STATE,COM_TEXT ;text mode operation
4281 ; EGA video, check for sufficient memory for mode 10
4283 EP687: CMP BL,3H ;256K available?
4284 JAE EP688 ;yes, continue
4286 OR COM_STATE,COM_TEXT ;ega has no memory for mode 10
4289 ; EGA with 256K, check for cga or monochrome emulation
4291 EP688: AND CL,1111B ;save registers
4295 ; EGA emulating CGA or Monochrome
4297 OR COM_STATE,COM_TEXT
4302 EP689: OR COM_STATE,COM_M10H
4304 ; Check for application main menu filename
4306 EP74: TEST COM_STATE,COM_APPM ;if app menu not configured do not
4307 JNE EP75 ; search for app main menu filespc
4309 MOV AX,STR_APMFILE ;app main menu filename
4310 CALL CHECK_STRING ;search for string
4312 CMP INS_RSLT,0 ;check if parameter found
4315 JMP EP112 ;check next parameter
4317 EP75: XOR AX,AX ;get current drive
4320 ADD AL,65 ;convert from # to alpha char
4321 MOV APP_MFILSPEC,AL ;complete current drive and path
4323 MOV AH,47H ;read current path
4325 LEA SI,APP_MFILSPEC+3 ;point past C:\
4327 JNC EP78 ;check for error
4329 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
4332 EP78: MOV AX,STR_APMFILE ;app main menu filename
4333 CALL CHECK_STRING ;search for string
4337 MOV AX,STR_APPMFILE ;default app menu filename
4338 CALL FAR PTR GET_STRING ;user did not supply new app menu
4340 PUSH SI ;save data segment
4343 PUSH DI ;save filename offset
4344 PUSH ES ;save filename segment
4346 JMP EP92 ; SHELL.MEU file instead
4348 EP80: PUSH INS_FOFF ;save invocation parameter offset
4351 MOV CX,INS_RSLT ;save starting search point
4352 ADD CX,INS_FLEN ;point past /MEU: to beginning of
4354 MOV AX,STR_AAPEXT ;main application menu extension
4355 CALL FAR PTR GET_STRING
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
4367 MOV COM_ERRID,ERR_APIF ;invalid main app menu filename
4370 EP90: PUSH SI ;save data segment
4374 SUB AX,CX ;ending offset - starting offset
4375 ADD AX,INS_FLEN ; + length of extension = # bytes
4379 MOV BX,INS_SOFF ;calculate offset of source strg
4383 PUSH BX ;save source offset
4384 PUSH INS_SSEG ;save source segment
4386 EP92: MOV CX,AX ; = number of bytes to move
4387 LEA DI,APP_MFILSPEC ;get dest offset
4394 EP94: MOV AL,ES:[DI] ;locate end of drive and path
4395 CMP AL,0 ; in shell app menu file buffer
4398 INC DI ;point to next character
4401 EP98: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4402 JE EP99 ; file separator
4404 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4405 INC DI ;point to where filename goes
4407 EP99: POP DS ;now move shell menu filename to
4408 POP SI ; end of app menu file path
4410 REP MOVSB ;copy application menu filespec
4415 ; Move copy of menu filename to first menu buffer
4417 EP100: MOV AX,STR_APMFILE ;app main menu filename
4418 CALL CHECK_STRING ;search for string
4422 MOV AX,STR_APPMFILE ;default app menu filename
4423 CALL FAR PTR GET_STRING ;user did not supply new app menu
4425 PUSH SI ;save data segment
4428 PUSH DI ;save filename offset
4429 PUSH ES ;save filename segment
4431 JMP EP105 ; SHELL.MEU file instead
4433 EP103: PUSH INS_FOFF ;save invocation parameter offset
4435 MOV CX,INS_RSLT ;save starting search point
4436 ADD CX,INS_FLEN ;point past /MEU: to beginning of
4438 MOV AX,STR_AAPEXT ;main application menu extension
4439 CALL FAR PTR GET_STRING
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
4451 MOV COM_ERRID,ERR_APIF ;invalid main app menu filename
4454 EP104: PUSH SI ;save data segment
4458 SUB AX,CX ;ending offset - starting offset
4459 ADD AX,INS_FLEN ; + length of extension = # bytes
4462 MOV BX,INS_SOFF ;calculate offset of source strg
4466 PUSH BX ;save source offset
4467 PUSH INS_SSEG ;save source segment
4469 EP105: MOV CX,AX ; = number of bytes to move
4470 LEA DI,APP_MFILNAME ;get dest offset
4477 EP108: POP DS ;now move shell menu filename to
4478 POP SI ; end of app menu file path
4480 REP MOVSB ;copy application menu filespec
4485 ; Check for color filename
4487 EP112: XOR AX,AX ;get current drive
4490 ADD AL,65 ;convert from # to alpha char
4491 MOV COM_CFILSPEC,AL ;complete current drive and path
4493 MOV AH,47H ;read current path
4495 LEA SI,COM_CFILSPEC+3 ;point past C:\
4497 JNC EP115 ;check for error
4499 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
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
4507 MOV AX,STR_CLRFILE ;default color filename
4508 CALL FAR PTR GET_STRING ;user did not supply new app menu
4510 PUSH SI ;save data segment
4513 PUSH DI ;save offset of filename
4514 PUSH ES ;save segment of filename
4516 JMP EP122 ; SHELL.CLR file
4518 EP118: PUSH INS_FOFF ;save invocation parameter offset
4521 MOV CX,INS_RSLT ;save starting search point
4522 ADD CX,INS_FLEN ;point past /K: to beginning of
4525 MOV AX,STR_CLREXT ;color profile extension
4526 CALL FAR PTR GET_STRING
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
4533 POP INS_FOFF ;restore before exit
4538 MOV COM_ERRID,ERR_CLRF ;invalid user color profile
4545 SUB AX,CX ;ending offset - starting offset
4546 ADD AX,INS_FLEN ; + length of extension = # bytes
4549 MOV BX,INS_SOFF ;calculate offset of source strg
4553 PUSH BX ;save source offset
4554 PUSH INS_SSEG ;save source segment
4556 EP122: MOV CX,AX ; = number of bytes to move
4557 LEA DI,COM_CFILSPEC ;get dest offset
4564 EP124: MOV AL,ES:[DI] ;locate end of drive and path
4565 CMP AL,0 ; in shell color file buffer
4568 INC DI ;point to next character
4571 EP128: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4572 JE EP129 ; file separator
4574 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4575 INC DI ;point to where filename goes
4577 EP129: POP DS ;now move color filename string
4578 POP SI ; to end of color buffer path
4580 REP MOVSB ;copy color index filespec
4585 ; Check for multiple DOS Service drive buffers
4587 EP130: MOV AX,STR_MULTIPE ;multiple drive display
4588 CALL CHECK_STRING ;search for string
4593 OR COM_STATE,COM_DRV2
4595 ; Check for active maintain color option
4597 EP140: MOV AX,STR_CLRACT ;color active
4598 CALL CHECK_STRING ;search for string
4603 OR COM_STATE,COM_FLCS ;maintain color is active
4605 ; Check for active maintain menu option
4607 EP150: MOV AX,STR_MENUACT ;menu maintainance active
4608 CALL CHECK_STRING ;search for string
4613 OR COM_STATE,COM_FLMI ;maintain menu is active
4615 ; Check for active exit to DOS option
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
4620 MOV AX,STR_EXITDOS ;exit to DOS active
4621 CALL CHECK_STRING ;search for string
4623 OR FLAG_FSEXIT, DIT_L1 ;turn exit to DOS dither on start
4625 TEST COM_STATE,COM_APPM ;app menu configured
4628 OR FLAG_FDEXIT, DIT_L1 ;turn exit from file system dither
4631 EP161: CMP INS_RSLT,0
4635 OR COM_STATE,COM_FLED ;exit to DOS is active
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
4640 ; Check for active command line option
4642 EP170: MOV AX,STR_CMDLINE ;command line active
4643 CALL CHECK_STRING ;search for string
4648 OR COM_STATE,COM_FLCL ;command line is active
4650 ; Check for predefined menu installation option
4652 EP180: MOV AX,STR_PREDACT ;predefined menu active
4653 CALL CHECK_STRING ;search for string
4658 OR COM_STATE,COM_AUTI ;predefined is active
4660 ; Check for mouse filename /MOS:filename.MOS
4662 EP190: XOR AX,AX ;get current drive
4665 ADD AL,65 ;convert from # to alpha char
4666 MOV COM_VFILSPEC,AL ;complete current drive and path
4668 MOV AH,47H ;read current path
4670 LEA SI,COM_VFILSPEC+3 ;point past C:\
4672 JNC EP191 ;check for error
4674 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
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
4682 JMP EP200 ;mouse is not active get next var
4684 EP192: OR COM_STATE,COM_MOUS ;mouse is active
4687 PUSH INS_FOFF ;save invocation parameter offset
4689 MOV CX,INS_RSLT ;save starting search point
4690 ADD CX,INS_FLEN ;point past /MOS: to beginning of
4693 MOV AX,STR_MOSEXT ;mouse extension
4694 CALL FAR PTR GET_STRING
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
4701 POP INS_FOFF ;restore before exit
4706 MOV COM_ERRID,ERR_MOUS ;invalid mouse driver
4713 SUB AX,CX ;ending offset - starting offset
4714 ADD AX,INS_FLEN ; + length of extension = # bytes
4717 MOV BX,INS_SOFF ;calculate offset of source strg
4721 PUSH BX ;save source offset
4722 PUSH INS_SSEG ;save source segment
4724 MOV CX,AX ; = number of bytes to move
4725 LEA DI,COM_VFILSPEC ;get dest offset
4732 EP194: MOV AL,ES:[DI] ;locate end of drive and path
4733 CMP AL,0 ; in shell mouse file buffer
4736 INC DI ;point to next character
4739 EP198: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4740 JE EP199 ; file separator
4742 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4743 INC DI ;point to where filename goes
4745 EP199: POP DS ;now move mouse filename string
4746 POP SI ; to end of mouse buffer path
4748 REP MOVSB ;copy mouse index filespec
4753 ; Check for left hand mouse option
4755 EP200: MOV AX,STR_LEFTACT ;left hand mouse
4756 CALL CHECK_STRING ;search for string
4761 OR COM_STATE,COM_LFMS ;left hand mouse
4763 ; Check for sound active option
4765 EP205: MOV AX,STR_SOUDACT ;sound active
4766 CALL CHECK_STRING ;search for string
4771 OR COM_STATE2,COM_SOUD ;sound active
4773 ; Check for dir/file buffer save option
4775 EP207: MOV AX,STR_DFSAVE ;check if option active
4776 CALL CHECK_STRING ;search for string
4781 OR COM_STATE2,COM_DFSAVE ;dir/file buffer save option
4784 ; Save filespec of shell.hlp at COM_HFILSPEC
4786 EP210: XOR AX,AX ;get current drive
4789 ADD AL,65 ;convert from # to alpha char
4790 MOV COM_HFILSPEC,AL ;complete current drive and path
4792 MOV AH,47H ;read current path
4794 LEA SI,COM_HFILSPEC+3 ;point past C:\
4798 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
4801 EP250: LEA DI,COM_HFILSPEC ;get dest offset
4806 EP260: MOV AL,ES:[DI] ;locate end of drive and path
4807 CMP AL,0 ; in shell help file buffer
4810 INC DI ;point to next character
4813 EP270: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4814 JE EP275 ; file separator
4816 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4817 INC DI ;point to where filename goes
4819 EP275: PUSH DS ;save register
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
4828 PUSH ES ;set source segment
4835 ; Check for associate filename /ASC:filename.ASC
4837 EP300: XOR AX,AX ;get current drive
4840 ADD AL,65 ;convert from # to alpha char
4841 MOV COM_AFILSPEC,AL ;complete current drive and path
4843 MOV AH,47H ;read current path
4845 LEA SI,COM_AFILSPEC+3 ;point past C:\
4847 JNC EP315 ;check for error
4849 MOV COM_ERRID,ERR_BADD ;bad disk or drive door open
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
4857 MOV AX,STR_ASCEXT ;default associate filename
4858 CALL FAR PTR GET_STRING ;user did not supply new app menu
4860 PUSH SI ;save data segment
4863 PUSH DI ;save offset of filename
4864 PUSH ES ;save segment of filename
4866 JMP EP322 ; SHELL.ASO file
4868 EP318: PUSH INS_FOFF ;save invocation parameter offset
4871 MOV CX,INS_RSLT ;save starting search point
4872 ADD CX,INS_FLEN ;point past /ASO: to beginning of
4873 ; associate file name
4875 MOV AX,STR_ASOEXT ;assoicate profile extension
4876 CALL FAR PTR GET_STRING
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
4883 POP INS_FOFF ;restore before exit
4888 MOV COM_ERRID,ERR_ASRF ;invalid user associate profile
4895 SUB AX,CX ;ending offset - starting offset
4896 ADD AX,INS_FLEN ; + length of extension = # bytes
4899 MOV BX,INS_SOFF ;calculate offset of source strg
4903 PUSH BX ;save source offset
4904 PUSH INS_SSEG ;save source segment
4906 EP322: MOV CX,AX ; = number of bytes to move
4907 LEA DI,COM_AFILSPEC ;get dest offset
4914 EP324: MOV AL,ES:[DI] ;locate end of drive and path
4915 CMP AL,0 ; in shell associate file buffer
4918 INC DI ;point to next character
4921 EP328: CMP BYTE PTR ES:[DI-1],'\' ;check if root and skip add of
4922 JE EP329 ; file separator
4924 MOV BYTE PTR ES:[DI],'\' ;add path and filename separator
4925 INC DI ;point to where filename goes
4927 EP329: POP DS ;now move filename string
4928 POP SI ; to end of buffer path
4930 REP MOVSB ;copy associate filespec
4935 ; Check for buffer size override
4937 EP350: MOV AX,STR_BUFO ;buffer size override active
4938 CALL CHECK_STRING ;search for string
4943 MOV AX,INS_SSEG ;segment of PSP
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
4951 EP360: CMP ES:BYTE PTR[BX],'0' ;ASCII digit GE 0
4952 JB EP370 ;no, end of digits
4954 CMP ES:BYTE PTR[BX],'9' ;ASCII digit LE 9
4955 JA EP370 ;no, end of digits
4958 JMP EP360 ;check next digit
4961 CMP AX,BX ;any digits?
4962 JE EP390 ;no, ignore /B parm
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
4972 CALL PCST2IN_CALL ;convert the value
4974 TEST ST2_ERROR,ST2_OUTOFMEM ;value too large
4975 JNZ EP375 ;yes, set to fail during alloc
4977 CMP ST2_NUMH,0 ;value too large
4978 JNE EP375 ;yes, set to fail during alloc
4980 CMP ST2_NUML,960 ;value to large
4981 JB EP380 ;no, attempt to alloc it
4983 EP375: MOV COM_DFSIZE,0F000H ;set to fail during alloc
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
4991 EP385: OR COM_STATE2,COM_BUFO ;buffer size override active
4993 ; Check if DBCS is active
4995 EP390: MOV AX,STR_DBCS ;DBCS active
4996 CALL CHECK_STRING ;search for string
5001 OR COM_STATE2,COM_DBCS ;DBCS active
5003 ; Check for date/time active option
5005 EP395: MOV AX,STR_DATE ;date active
5006 CALL CHECK_STRING ;search for string
5011 OR COM_STATE2,COM_DATE ;date/time active
5013 ; Check for COM2 active option
5015 EP397: MOV AX,STR_COM2 ;COM2 active
5016 CALL CHECK_STRING ;search for string
5021 OR COM_STATE2,COM_COM2 ;COM2 active
5023 ; Check for enhancement activation
5025 EP398: MOV AX,STR_ENH ;COM2 active
5026 CALL CHECK_STRING ;search for string
5032 OR COM_STATE2,COM_ENHA ;COM2 active
5034 ; Check for Special Needs option ;>>SN
5036 EP399: MOV AX, STR_SN ;>>SN
5037 CALL CHECK_STRING ;>>SN
5038 CMP INS_RSLT,0 ;>>SN
5041 ADD COM_CMDNUM, AX ;>>SN
5042 OR COM_STATE2,COM_SNA ;>>SN
5044 ; Check for invalid parameters
5051 MOV COM_ERRID,ERR_BADCMD
5054 ; Check for missing invocation parameter errors
5056 EP405: TEST COM_STATE,COM_APPM
5059 TEST COM_STATE,COM_DOSS
5062 MOV COM_ERRID,ERR_NODA ;dos/app both not active
5065 ; Turn off color selection if mode 11 active
5067 EP410: TEST COM_STATE,COM_M11H ;
5070 AND COM_STATE, NOT COM_FLCS ;
5078 ;-----------------------------------------------------------------------------+
5080 ; Name: CHECK_STRING :
5082 ; Description: Search for string identified by AX. :
5084 ; Entry: AX = String ID. :
5086 ; Exit: INS_RSLT = Offset into search string where match :
5088 ; Entry point: CHECK_STRING :
5092 ; Internal references: None. :
5094 ; External references: None. :
5096 ;-----------------------------------------------------------------------------+
5098 CHECK_STRING PROC NEAR
5100 CALL FAR PTR GET_STRING ;get address and length of string
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