]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/MODE/INVOKE.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / CMD / MODE / INVOKE.ASM
1 ;AN000;
2 ;\em ;AN000;
3 PAGE ,132 ;\ f ;AN000;
4 TITLE ANALYZE_AND_INVOKE - call appropriate routine based on request ;AN000;
5 .XLIST ;AN000;
6 INCLUDE STRUC.INC ;AN000;
7 .LIST ;AN000;
8 ;.SALL ;AN000;
9
10
11 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P R O L O G ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
12 ;º º ;AN000;
13 ;AN000;
14 ; AC000 - P2944: Was displaying the lines and column settings for CON even
15 ; though couldn't get them when ANSI.SYS isn't loaded. Now
16 ; check if ANSI loaded before trying to display the settings.
17
18 ; AC002 - P3331: ES was getting zeroed, which caused problems later in MODECP.
19
20 ; AC003 - P3541: The retry status routine was assuming different format than
21 ; the retry type byte was in. I fixed the status checking
22 ; routine.
23
24 ; AX004 - P3982: The screen was being cleared after the "Unable to shift
25 ; screen ..." message.
26
27 ; AC005 - P4934: The multiplex number for ANSI.SYS was changed due to a
28 ; 5/20/88 conflict with a Microsoft product that has already been
29 ; shipped.
30
31 ;º º ;AN000;
32 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P R O L O G ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
33 ;AN000;
34 ;AN000;
35 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
36 ;º º ;AN000;
37 ;AN000;
38 GET_EXTENDED_ERROR MACRO ;AN000;
39 ;AN000;
40 MOV BX,0 ;level for 3.00 to 4.00 ;AN000;
41 MOV AH,59H ;function number for get extended error ;AN000;
42 INT 21H ;AN000;
43 ;AN000;
44 ENDM ;AN000;
45 ;AN000;
46 ;AN000;
47 BREAK MACRO X ;AN000;
48 JMP endcase_&X ;AN000;
49 ENDM ;AN000;
50 ;AN000;
51 ;AN000;
52 ;AN000;
53 ;AN000;
54 DISPLAY MACRO MESSAGE ;AN000;
55 MOV DX,OFFSET MESSAGE ;AN000;
56 CALL PRINTF ;AN000;
57 ENDM ;AN000;
58 ;AN000;
59 ;AN000;
60 ;º º ;AN000;
61 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
62 ;AN000;
63 ;AN000;
64 ;AN000;
65 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
66 ;º º ;AN000;
67 ;AN000;
68 INCLUDE modequat.inc ;AN000;
69 ;AN000;
70 ANSIINT2F EQU 1AH ;INT 2F multiplex number for ANSI.SYS ;AC005;
71 ASCII_0 EQU "0" ;change one based binary printer number into ASCII printer number ;AN000;
72 ASCII_1 EQU "1" ;AN000;
73 B EQU 2 ;retry setting ;AN000;
74 blink EQU 0000H ;value for flags field of IOCTL data block ;AN000;
75 busy_retry_active EQU 2 ;indicates bust retry is active ;AN000;
76 check_installed EQU 0 ;request installed state for INT2F (ANSI) ;AN000;
77 ;COLUMNS EQU 00000010B ; ;AN000;
78 com1_retry_type_status EQU 0 ;request for retry status on com1 ;AN000;
79 com2_retry_type_status EQU 2 ;request for retry status on com2 ;AN000;
80 com3_retry_type_status EQU 4 ;request for retry status on com3 ;AN000;
81 com4_retry_type_status EQU 6 ;request for retry status on com4 ;AN000;
82 display_device EQU 3 ;type of device, used for calls to IOCTL 0C function ;AN000;
83 E EQU 1 ;retry setting ;AN000;
84 error_retry_active EQU 1 ;indicates error retry is active ;AN000;
85 false EQU 00H ;AN000;
86 font_not_loaded EQU 31 ;return from IOCTL 0C (via ext err) indicating DISPLAY.SYS don't have necessary font loaded
87 get_current_settings EQU 07FH ;request for IOCTL 0C call ;AN000;
88 installed EQU 0FFH ;return from get_installed_state function ;AN000;
89 intense EQU 0001H ;value for flags field of IOCTL data block ;AN000;
90 IOCTL0C EQU [SI] ;AN000;
91 ;LINES EQU 00000001B ;flag for IOCTL0C_functions_requested ;AN000;
92 lowercase EQU 020H ;when ORed with char value it changes it to lowercase ;AN000;
93 LPT1 EQU 1 ;mask for input to display_device_reroute_status, see modeecho ;AN000;
94 LPT2 EQU 2 ;mask for input to display_device_reroute_status, see modeecho ;AN000;
95 LPT3 EQU 4 ;mask for input to display_device_reroute_status, see modeecho ;AN000;
96 lpt1_retry_type_status EQU 0 ;request for retry status on lpt1 ;AN000;
97 lpt2_retry_type_status EQU 1 ;request for retry status on lpt2 ;AN000;
98 lpt3_retry_type_status EQU 2 ;request for retry status on lpt3 ;AN000;
99 MODE_INT2F_MULTIPLEX_NUMBER EQU 0 ;AN000;
100 no_retry EQU 3 ;retry setting ;AN000;
101 no_retry_active EQU 0 ;indicates no retry active on device ;AN000;
102 not_supported_on_machine EQU 29 ;return from IOCTL 0C (via ext err) indicating hardware don't support the function ;AN000;
103 parm_list_BX EQU [BX] ;AN000;
104 prn_ports_attached EQU CL ;used in printer_reroute_case and check_prn_ports_attached
105 R EQU 3 ;retry setting for com ports ;AN000;
106 ready_retry_active EQU 3 ;indicates ready retry is active ;AN000;
107 redirected EQU 2 ;network puts a 2 in printer address word for printers redirected
108 rerouted_printer_mask EQU BL ;holds the mask to check ptsflag1 with, see modeecho.asm
109 returned_retry_type EQU AL ;holds the returned status value ;AN000;
110 set_display_characteristics EQU 05FH ;request for IOCTL 0C call ;AN000;
111 status EQU 0 ;request for modecp ;AN000;
112 StdOut equ 1 ;AN000;
113 text EQU 01 ;mode field of IOCTL 0C call indicating screen mode type (vs APA mode) ;AN000;
114 true EQU 0FFH ;AN000;
115 unspecified EQU 0FFH ;state of item_tags in parm_list if the positonal parm was not specified ;AN664;
116 ;AN000;
117 ;º º ;AN000;
118 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
119 ;AN000;
120 ;AN000;
121 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ S T R U C T U R E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
122 ;º º ;AN000;
123 ;AN000;
124 ;AN000;
125 des_strt_packet STRUC ;AN000;
126 des_strt_pkfl DW 0000 ;assume a filename specified ;AN000;
127 des_strt_pklen DW 02 ;start with size of 'des_strt_pknum' ;AN000;
128 des_strt_pknum DW 0 ;number of cp numbers in the packet ;AN000;
129 des_strt_pkcp1 DW -1 ;code page number for 1st slot ;AN000;
130 des_strt_pkcp2 DW -1 ;AN000;
131 des_strt_pkcp3 DW -1 ;AN000;
132 des_strt_pkcp4 DW -1 ;AN000;
133 des_strt_pkcp5 DW -1 ;AN000;
134 des_strt_pkcp6 DW -1 ;AN000;
135 des_strt_pkcp7 DW -1 ;AN000;
136 des_strt_pkcp8 DW -1 ;AN000;
137 des_strt_pkcp9 DW -1 ;AN000;
138 des_strt_pkcpA DW -1 ;AN000;
139 des_strt_pkcpB DW -1 ;AN000;
140 des_strt_pkcpC DW -1 ;code page number for 12th slot ;AN000;
141 des_strt_packet ENDS ;AN000;
142 ;AN000;
143 ;The info_level is 0 on input, and contains a return code on exit. If carry set ;AN000;
144 ;and 2 then the requested function is not supported on this machine. If carry ;AN000;
145 ;set and 3 then DISPLAY.SYS does not have the appropriate RAM font loaded to ;AN000;
146 ;support the requested function. ;AN000;
147 ;AN000;
148 IOCTL0C_def STRUC ;AN000;
149 ;AN000;
150 info_level DB 0 ;return code: 0 on input, 1 ?, 2 or 3 as returns ;AN000;
151 DB 0 ;reserved ;AN000;
152 data_length DW 14 ;length of the data block not including this field ;AN000;
153 flags DW 0 ;filled with intense or blink ;AN000;
154 mode DB text ;filled with text, may be returned as 2 which means APA ;AN000;
155 DB 0 ;reserved ;AN000;
156 colors DW 16 ;0 means monochrome ;AN000;
157 DW bogus ;width in pixels for APA modes ;AN000;
158 DW bogus ;length in pixels for APA modes ;AN000;
159 cols DW bogus ;nubmer of text columns ;AN000;
160 rows DW bogus ;number of text rows ;AN000;
161 ;AN000;
162 IOCTL0C_def ENDS ;AN000;
163 ;AN000;
164 INCLUDE COMMON.STC ;includes the following strucs ;AN000;
165 ;AN000;
166 ;codepage_parms STRUC ;AN000;
167 ; cp_device DW ? ;AN000;
168 ; des_pack_ptr DW ? ;AN000;
169 ; font_filespec DW ? ;AN000;
170 ; request_typ DW ? ;AN000;
171 ;codepage_parms ENDS ;AN000;
172 ;AN000;
173 ;AN000;
174 ;parm_list_entry STRUC ;used by parse_parameters and invoke ;AN000;
175 ;AN000;
176 ;parm_type DB bogus ;AN000;
177 ;item_tag DB 0FFH ;AN000;
178 ;value1 DW bogus ;used only for filespecs and code page numbers ;AN000;
179 ;value2 DW bogus ;used only for filespecs and code page numbers ;AN000;
180 ;keyword_switch_ptr DW 0 ;AN000;
181 ;AN000;
182 ;parm_list_entry ENDS ;AN000;
183 ;AN000;
184 ;AN000;
185 ;º º ;AN000;
186 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ S T R U C T U R E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
187 ;AN000;
188 ROM SEGMENT AT 0 ;AN000;
189 ORG 530H ;AN000;
190 resseg LABEL DWORD ;location of resident mode code vector ;AN000;
191 ROM ENDS ;AN000;
192 ;AN000;
193 ;AN000;
194 PAGE ;AN000;
195 PRINTF_CODE SEGMENT PUBLIC ;AN000;
196 ASSUME CS:PRINTF_CODE,DS:PRINTF_CODE,SS:PRINTF_CODE ;AN000;
197 ;AN000;
198 ;AN000;
199 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
200 ;º º ;AN000;
201 ;AN000;
202 PUBLIC analyze_and_invoke ;make available to "MAIN" ;AN000;
203 PUBLIC busy_retry_active ;used by modecom ;AN000;
204 PUBLIC cp_cb ;modepars needs to set the font file name ;AN000;
205 PUBLIC error_retry_active ;used by modecom ;AN000;
206 PUBLIC initialize_printer_port_case ;AN000;
207 PUBLIC no_retry_active ;used by modecom ;AN000;
208 PUBLIC parm_list_holder ;used by modeprin ;AN664;
209 PUBLIC ready_retry_active ;used by modecom ;AN000;
210 ;AN000;
211 ;º º ;AN000;
212 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
213 ;AN000;
214 ;AN000;
215 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
216 ;º º ;AN000;
217 ;AN000;
218 EXTRN ANSI_not_loaded:BYTE ;see modedefs.inc ;AN000;
219 EXTRN BAUD_equal:BYTE ;the string "BAUD=", see modepars ;AN000;
220 EXTRN BAUD_index:WORD ;see modecom.asm ;AN000;
221 EXTRN B_str:BYTE ;see MODEPARS.ASM ;AN000;
222 EXTRN BW40:NEAR ;see modedefs.inc ;AN000;
223 EXTRN BW40_item_tag:ABS ;see MODEPARS.ASM ;AN000;
224 EXTRN BW80:NEAR ;see modedefs.inc ;AN000;
225 EXTRN BW80_item_tag:ABS ;see MODEPARS.ASM ;AN000;
226 EXTRN busy_status:ABS
227 EXTRN close:ABS ;EQU 3EH ;CLOSE A FILE HANDLE,see modecpeq.inc ;AN000;
228 EXTRN columns_ptr:WORD ;see modesubs.inc ;AN000;
229 EXTRN CO40:NEAR ;see modedefs.inc ;AN000;
230 EXTRN CO40_item_tag:ABS ;see MODEPARS.ASM ;AN000;
231 EXTRN CO80:NEAR ;see modedefs.inc ;AN000;
232 EXTRN CO80_item_tag:ABS ;see MODEPARS.ASM ;AN000;
233 EXTRN codepage_index_holder:WORD ;see MODEPARS.ASM ;AN000;
234 EXTRN codepage_item_tag:ABS ;see MODEPARS.ASM ;AN000;
235 EXTRN columns_equal:BYTE ;see MODEPARS.ASM ;AN000;
236 EXTRN columns_equal_msg:BYTE ;see MODEdefS.inc ;AN000;
237 EXTRN columns_holder:BYTE ;holder for printer chars per line (binary) value, see modeprin ;AN000;
238 EXTRN COLS_equal:BYTE ;see MODEPARS.ASM ;AN000;
239 EXTRN columns_item_tag:ABS ;see MODEPARS.ASM ;AN000;
240 EXTRN COM1_str:BYTE ;see MODEPARS.ASM ;AN000;
241 EXTRN COM2_str:BYTE ;see MODEPARS.ASM ;AN000;
242 EXTRN COM3_str:BYTE ;see MODEPARS.ASM ;AN000;
243 EXTRN COM4_str:BYTE ;see MODEPARS.ASM ;AN000;
244 EXTRN COMX:ABS ;one of two possible values for "device_type"
245 EXTRN CON_str:BYTE ;"CON"see MODEPARS.ASM ;AN000;
246 EXTRN CRLF:BYTE ;see MODEDEFS.ASM, used before "Invalid parameter - " for consistent spacing ;AN000;
247 EXTRN data_bits_index:WORD ;see modecom.asm ;AN000;
248 EXTRN DATA_equal:BYTE ;see MODEPARS.ASM ;AN000;
249 EXTRN DELAY_equal:BYTE ;see MODEPars.asm ;AN000;
250 EXTRN DEL_equal:BYTE ;see MODEPARS.ASM ;AN000;
251 EXTRN des_start_packet:WORD ;AX000; des_strt_packet <>, see modepars ;AN000;
252 EXTRN device:BYTE ;holder of com number for invoke and modeecho ;AN000;
253 EXTRN device_name:WORD ;AN000;
254 EXTRN device_type:BYTE ;see MODEPARS.ASM ;AN000;
255 EXTRN dev_name_size:WORD ;see MODEPARS.ASM ;AN000;
256 EXTRN dev_open_mode:ABS ;read write access ;AN000;
257 EXTRN display_printer_reroute_status:NEAR ;see modeecho.asm
258 EXTRN eighty_item_tag:ABS ;see MODEPARS.ASM ;AN000;
259 EXTRN eighty_str:BYTE ;see MODEPARS.ASM ;AN000;
260 EXTRN error_status:ABS ;see MODEPRIN
261 EXTRN five_char_underline:BYTE ;see modedefs.inc ;AN000;
262 EXTRN four_char_underline:BYTE ;see modedefs.inc ;AN000;
263 EXTRN function_not_supported:BYTE ;see modedefs.inc ;AN000;
264 EXTRN err1:BYTE ;see modedefs.inc
265 EXTRN E_str:BYTE ;see MODEPARS.ASM ;AN000;
266 EXTRN fourty_item_tag:ABS ;see MODEPARS.ASM ;AN000;
267 EXTRN fourty_str:BYTE ;see MODEPARS.ASM ;AN000;
268 EXTRN handle_40_or_80:NEAR ;see modescrn ;AN000;
269 EXTRN illegal_device_ptr:WORD ;see modesubs.inc
270 EXTRN keyword:ABS ;see MODEPARS ;AN000;
271 EXTRN invalid_number_of_parameters:WORD ;AN000;
272 ;EXTRN invalid_parameter:WORD ;<CR><LF>"Invalid parameter '????'",beep ;AN000;
273 EXTRN len_COMX_str:ABS ;see MODEPARS.ASM ;AN000;
274 EXTRN len_CON_str:ABS ;see MODEPARS.ASM ;AN000;
275 EXTRN len_LPTX_str:ABS ;see MODEPARS.ASM ;AN000;
276 EXTRN L_item_tag:ABS ;see MODEPARS.ASM ;AN000;
277 EXTRN LINES_equal:BYTE ;see MODEPARS.ASM ;AN000;
278 EXTRN LINES_equal_msg:BYTE ;see MODEDEFS.INC ;AN000;
279 EXTRN lines_item_tag:ABS ;see MODEPARS.ASM ;AN000;
280 EXTRN long_underline:BYTE ;see modedefs.inc ;AN000;
281 EXTRN lptno:BYTE ;holder of printer number for invoke and modeecho ;AN000;
282 EXTRN lpt1_retry_type:BYTE ;see RESCODE
283 EXTRN LPT1_str:BYTE ;see MODEPARS.ASM ;AN000;
284 EXTRN LPT2_str:BYTE ;see MODEPARS.ASM ;AN000;
285 EXTRN LPT3_str:BYTE ;see MODEPARS.ASM ;AN000;
286 EXTRN notredpt:BYTE ;printer number in "LPTn not rerouted"
287 EXTRN max_request_type:ABS ;see MODEPARS.ASM ;AN000;
288 EXTRN modecom:NEAR ;AN000;
289 EXTRN modecp:NEAR ;AN000;
290 EXTRN modeecho:NEAR ;AN000;
291 EXTRN modeecno:NEAR ;AN000;
292 EXTRN modeprin:NEAR ;AN000;
293 EXTRN modify_resident_code:NEAR ;see modeprin ;AN000;
294 EXTRN MONO:NEAR ;see modedefs.inc ;AN000;
295 EXTRN MONO_item_tag:ABS ;see MODEPARS.ASM ;AN000;
296 EXTRN no_retry_flag:ABS ;see MODEPRIN
297 EXTRN noerror:BYTE ;AN000;
298 EXTRN none_item_tag:ABS ;see modepars.asm ;AN000;
299 EXTRN none_str:BYTE ;see MODEPARS.ASM ;AN000;
300 EXTRN offending_parameter:BYTE ;see MODEMES ;AN000;
301 EXTRN OFF_item_tag:ABS ;see pares.asm ;AN000;
302 EXTRN off_str:BYTE ;see MODEPARS.ASM ;AN000;
303 EXTRN onethirtytwo_item_tag:ABS ;see modepars.asm ;AN000;
304 EXTRN ON_item_tag:ABS ;see pares.asm ;AN000;
305 EXTRN on_str:BYTE ;see MODEPARS.ASM ;AN000;
306 EXTRN open:ABS ;open a device handle, see modecpeq.inc ;AN000;
307 EXTRN parity_equal:BYTE ;see modepars.asm ;AN000;
308 EXTRN parity_index:WORD ;see modecom ;AN000;
309 EXTRN parm2:BYTE ;see MODEPRIN.ASM ;AN000;
310 EXTRN parm3:BYTE ;see MODEPARS.ASM ;AN000;
311 ;EXTRN parm_lst:BYTE ;parm_list_entry max_pos_parms DUP (<>), see MODEPARS.ASM ;AN000;
312 EXTRN parms_form:byte ;indicator of whether the parameters were entered as positionals or as keywords ;AN000;
313 EXTRN pbaud_ptr:WORD ;AN000;;pointer to the baud rate string in the initialization message for COM, see modesubs.inc
314 EXTRN pdata:BYTE ;see modesubs.inc ;AN000;
315 EXTRN pparity_ptr:WORD ;see modesubs.inc ;AN000;
316 EXTRN pparm:BYTE ;used by modecom and for message, see modesubs.inc ;AN000;
317 EXTRN prepare:ABS ;AN000;
318 EXTRN prepare_item_tag:ABS ;see MODEPARS.ASM ;AN000;
319 EXTRN PRINTR:WORD ;PRINTER BASE (40:8), HOLDS PORT ADDRESSES OF PRINTER CARDS
320 EXTRN pstop_ptr:WORD ;see modesubs.inc ;AN000;
321 EXTRN PRINTF:NEAR ;AN000;
322 EXTRN rate_equal:BYTE ;see MODEPARS.ASM ;AN000;
323 EXTRN ready_status:ABS ;see modeprin
324 EXTRN redpt:BYTE ;printer number (n) in message "LPTn rerouted to COMm"
325 EXTRN refresh:ABS ;AN000;
326 EXTRN retry_item_tag:ABS ;see MODEPARS.ASM ;AN000;
327 EXTRN request_type:BYTE ;see "MODEPARS.ASM" ;AN000;
328 EXTRN retry_equal:BYTE ;see MODEDEFS.INC ;AN000;
329 EXTRN retry_equal_str:BYTE ;AN000;
330 EXTRN retry_index:WORD ;see MODECOM.ASM ;AN000;
331 EXTRN retry_type_ptr:WORD ;see MODESUBS.INC ;AN000;
332 EXTRN row_ptr:WORD ;see modesubs.inc ;AN000;
333 EXTRN row_type:WORD ;see modesubs.inc ;AN000;
334 EXTRN R_item_tag:ABS ;see MODEPARS.ASM ;AN000;
335 EXTRN R_str:BYTE ;see MODEPARS.ASM ;AN000;
336 EXTRN Required_font_not_loaded:BYTE ;see modedefs.asm ;AN000;
337 EXTRN res_com_retry_type:ABS ;see RESCODE.SAL ;AN000;
338 ;EXTRN res_lpt_retry_type:ABS ;see RESCODE.SAL ;AN000;
339 EXTRN select:ABS ;request type for 'modecp' ;AN000;
340 EXTRN select_item_tag:ABS ;see MODEPARS.ASM ;AN000;
341 EXTRN serial_base:WORD ;see modecom ;AN000;
342 EXTRN set_con_features:ABS ;AN000;
343 EXTRN set_retry_type:NEAR ;see modeprin ;AN000;
344 EXTRN shift_screen:NEAR ;see modescrn ;AN000;
345 EXTRN stat_dev_ptr:WORD ;see modedefs.inc ;AN000;
346 EXTRN status_for_device:BYTE ;"Status for device %1:" see modedefs.inc ;AN000;
347 EXTRN status_for_everything:ABS ;AN000;
348 EXTRN stop_bits_index:WORD ;see modecom.asm ;AN000;
349 EXTRN stop_equal:BYTE ;"STOP=", see modepars ;AN000;
350 EXTRN typamat:NEAR ;see "typamat.asm" ;AN000;
351 ;AN000;
352 ;possible values of "request_type" ;AN000;
353 ;AN000;
354 EXTRN all_con_status:ABS ;AN000;
355 EXTRN codepage_prepare:ABS ;AN000;
356 EXTRN codepage_refresh:ABS ;AN000;
357 EXTRN codepage_select:ABS ;AN000;
358 EXTRN codepage_status:ABS ;AN000;
359 EXTRN codepage_prepared_status:ABS ;AN000;
360 EXTRN codepage_selected_status:ABS ;AN000;
361 EXTRN com_status:ABS ;AN000;
362 ;EXTRN con_status:ABS ;AN000;
363 EXTRN initialize_com_port:ABS ;AN000;
364 EXTRN initialize_printer_port:ABS ;AN000;
365 EXTRN old_initialize_printer_port:ABS ;AN000;
366 EXTRN old_video_mode_set:ABS ;AN000;
367 EXTRN printer_reroute:ABS ;AN000;
368 EXTRN printer_status:ABS ;AN000;
369 EXTRN turn_off_reroute:ABS ;AN000;
370 ;AN000;
371 ;AN000;
372 ;º º ;AN000;
373 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
374 ;AN000;
375 ;AN000;
376 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
377 ;º º ;AN000;
378 ;AN000;
379 ANSI_installed DB false ;boolean indicator of whether ANSI.SYS is installed ;AN000;
380 columns_specified DB false ;indicates if columns= was on the command line, see set_con_features_case;AN000;
381 code_page_numbers_encountered DB 0 ;AN000;
382 cp_cb codepage_parms <> ;codepage subroutine parameter block ;AN000;
383 com_ports_attached DB 0 ;number of com ports in the machine
384 current_packet_cp_number DW -2 ;adjustment for accessing current 'des_strt_pkcp?' in 'des_start_packet' ;AN000;
385 delay_holder DB 1 ;holder for binary form of delay requested ;AN000;
386 device_request DB ? ;holds device request value ;AN000;
387 max_pknum EQU ($ - OFFSET des_start_packet.des_strt_pkcp1)/2 ;most cp numbers can send at once ;AN000;
388 ;IOCTL0C_functions_requested DB 0 ;for displaying messages, flag byte indicating IOCTL functions requested ;AN000;
389 need_typamat_call DB false ;boolean for saving up delay and rate settings ;AN000;
390 need_IOCTL0C DB false ;boolean for saving up parts of an IOCTL 0CH call ;AN000;
391 parm_list_holder DW bogus ;holder for address of parsed parameter list for when BX is needed elsewhere ;AN000;
392 parm_list_index_holder DW bogus ;holder for index of parsed parameter list for when DI is needed elsewhere ;AN000;
393 i DB 0 ;index for status loop ;AN000;
394 rate_holder DB 32 ;holder for binary form of rate value ;AN000;
395 row_value DB ? ;holder for binary form of row value during status display ;AN000;
396 ;AN000;
397 IOCTL0C_data_block IOCTL0C_def<> ;AN000;
398
399 PUBLIC IOCTL0C_data_block
400 ;AN000;
401 ;º º ;AN000;
402 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
403 ;AN000;
404 check_ANSI_installed PROC NEAR ;See if ANSI.SYS is installed ;AC001;
405
406 MOV AH,ANSIINT2F ;AC001;
407 MOV AL,check_installed ;AC001;
408 INT 2FH ;AC001;
409 .IF <AL EQ installed> THEN ;AC001;
410 MOV ANSI_installed,true ;initialized to false, so no ELSE needed ;AC001;
411 .ENDIF
412
413 check_ANSI_installed ENDP ;AC001;
414
415 ;------------------------------------------------------------------------------
416
417
418
419 setup_device_name PROC NEAR ;AN000;
420 ;AN000;
421 MOV DX,device_name ;DX=pointer to ASCIIZ device name ;AN000;
422 MOV cp_cb.cp_device,DX ;Set the pointer to the device name ASCIIZ in the parameter block for 'modecp'. ;AN000;
423 ;AN000;
424 RET ;AN000;
425 ;AN000;
426 setup_device_name ENDP ;AN000;
427 ;AN000;
428 ;------------------------------------------------------------------------------- ;AN000;
429 ;AN000;
430 ;AN000;
431 do_IOCTL0C PROC NEAR ;AN000;
432 PUBLIC DO_IOCTL0C ;AN000;
433 MOV AH,open ;open device ;AN000;
434 MOV AL,dev_open_mode ;AL=open mode for devices, see modecpeq.inc ;AN000;
435 MOV DX,OFFSET CON_str ;know that CON is being opened, avoid using user input and having to remove colon ;AN000;
436 INT 21H ;AN000;
437 ;AN000;
438 MOV BX,AX ;BX=handle of CON ;AN000;
439 MOV AX,440CH ;AN000;
440 MOV CH,display_device ;type of device ;AN000;
441 MOV DX,OFFSET IOCTL0C_data_block ;AN000;
442 INT 21H ;the IOCTL data block is filled with the current settings ;AN000;
443 PUSHF ;save result of the IOCTL ;AN000;
444 ;AN000;
445 MOV AH,3EH ;assume that BX still has the handle ;AN000;
446 INT 21H ;close CON, open and close each time because if error may not be back to close ;AN000;
447 ;AN000;
448 POPF ;restore result of the IOCTL ;AN000;
449 ;AN000;
450 RET ;AN000;
451 ;AN000;
452 do_IOCTL0C ENDP ;AN000;
453 ;AN000;
454 ;------------------------------------------------------------------------------- ;AN000;
455 ;AN000;
456 display_columns_status PROC NEAR ;AN000;
457 ;AN000;
458 MOV CL,get_current_settings ;AN000;
459 CALL do_IOCTL0C ;get current settings of CON ;AN000;
460 .IF <IOCTL0C_data_block.mode EQ text> THEN ;AN000;
461 .IF <IOCTL0C_data_block.cols EQ 80> THEN ;AN000;
462 MOV columns_ptr,OFFSET eighty_str ;set up message block with pointer to "80" ;AN000;
463 .ELSE ;AN000;
464 MOV columns_ptr,OFFSET fourty_str ;AN000;
465 .ENDIF ;AN000;
466 .ELSE ;AN000;
467 MOV columns_ptr,OFFSET NONE_str ;AN000;
468 .ENDIF ;AN000;
469 display COLUMNS_equal_msg ;AN000;
470 ;AN000;
471 RET ;AN000;
472 ;AN000;
473 display_columns_status ENDP ;AN000;
474 ;AN000;
475 ;------------------------------------------------------------------------------- ;AN000;
476 ;AN000;
477 display_lines_status PROC NEAR ;AN000;
478 ;AN000;
479 MOV CL,get_current_settings ;AN000;
480 CALL do_IOCTL0C ;get current settings of CON ;AN000;
481 .IF <IOCTL0C_data_block.mode EQ text> THEN ;AN000;
482 MOV AX,IOCTL0C_data_block.rows ;AN000;
483 MOV row_value,AL ;row_value=binary row value ;AN000;
484 MOV row_type,right_align+unsgn_bin_byte ;set up sublist so msg ret knows it is a binary byte ;AN000;
485 MOV row_ptr,OFFSET row_value ;set up LINES_equal sublist ;AN000;
486 .ELSE ;AN000;
487 MOV row_ptr,OFFSET NONE_str ;AN000;
488 .ENDIF ;AN000;
489 display LINES_equal_msg ;AN000;
490 ;AN000;
491 RET ;AN000;
492 ;AN000;
493 display_lines_status ENDP ;AN000;
494
495 ;-------------------------------------------------------------------------------
496
497 old_video_mode_set_IOCTL PROC NEAR ;AN004;
498
499 MOV CL,set_display_characteristics ;AN000;
500 CALL do_IOCTL0C ;AN000;
501 .IF C THEN ;AN000;
502 get_extended_error ;AN000;
503 .IF <AX EQ not_supported_on_machine> THEN ;AN000;
504 DISPLAY Function_not_supported ;AN000;
505 .ELSEIF <AX EQ font_not_loaded> THEN ;AN000;
506 DISPLAY Required_font_not_loaded ;AN000;
507 .ENDIF ;AN000;
508 MOV noerror,false ;AN000;
509 .ENDIF ;AN000;carry ;AN000;
510
511 RET
512 ;AN004;
513 old_video_mode_set_IOCTL ENDP ;AN004;
514
515 ;AN000;
516 ;------------------------------------------------------------------------------- ;AN000;
517 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
518
519 ;³ CHECK_COM_PORTS_ATTACHED
520 ;³ ------------------------
521
522 ;³ Return the number of com ports in the machine.
523
524 ;³ INPUT: none
525
526
527 ;³ RETURN: com_ports_attached - number of com ports
528
529
530 ;³ MESSAGES: none
531
532 ;³ REGISTER
533 ;³ USAGE: SI - index of the FOR loop and displacement from serial_base
534 ;³ ES - holds segment of ROM data area
535
536
537 ;³ ASSUMPTIONS: The user has initialized com_ports_attached to zero.
538
539
540 ;³ SIDE EFFECT: ES is lost
541 ;³ SI is lost
542 ;³ ;AN000;
543 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
544
545 check_com_ports_attached PROC NEAR
546
547 MOV SI,0
548 MOV ES,SI ;now ES:SERIAL_BASE addresses 40:0=0:400
549
550 .FOR SI = 0 TO 6 STEP 2
551
552 .IF <<WORD PTR ES:SERIAL_BASE[SI]> NE 0> THEN ;SEE IF THE COM PORT EXISTS
553 INC com_ports_attached
554 .ENDIF
555
556 .NEXT SI
557
558 RET
559
560 check_com_ports_attached ENDP
561
562
563 ;------------------------------------------------------------------------------- ;AN000;
564 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
565
566 ;³ CHECK_PRN_PORTS_ATTACHED
567 ;³ ------------------------
568
569 ;³ Return the number of printer ports in the machine. The network will put a 2
570 ;³ in th address word if the printer is redirected, so for the printer to
571 ;³ actually exist the address must be greater than 2 ("redirected"). Since
572 ;³ can't have infinite retry on redirected printers only want to count ports
573 ;³ with >2 for addresses.
574
575 ;³ INPUT: none
576
577
578 ;³ RETURN: prn_ports_attached - number of printer ports
579
580
581 ;³ MESSAGES: none
582
583 ;³ REGISTER
584 ;³ USAGE: SI - index of the FOR loop and displacement from printr
585 ;³ ES - holds segment of ROM data area (0 in this case)
586
587
588 ;³ ASSUMPTIONS: All valid printer port addresses are >2.
589
590
591 ;³ SIDE EFFECT: ES is lost
592 ;³ SI is lost
593 ;³ ;AN000;
594 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
595
596 check_prn_ports_attached PROC NEAR
597
598
599 MOV SI,0
600 MOV ES,SI ;now ES:printr addresses 40:8=0:408
601
602 .FOR SI = 0 TO 4 STEP 2 ;for each of 3 printer port address holder words
603
604 .IF <<WORD PTR ES:printr[SI]> GT redirected> THEN ;SEE IF THE PORT EXISTS
605 INC prn_ports_attached
606 .ENDIF
607
608 .NEXT SI
609
610 RET
611
612 check_prn_ports_attached ENDP
613
614
615 ;------------------------------------------------------------------------------- ;AN000;
616 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
617 ;³ ;AN000;
618 ;³ GET_DEVICE_RETRY_TYPE ;AN000;
619 ;³ --------------------- ;AN000;
620 ;³ ;AN000;
621 ;³ Return the type of retry active for comX or lptX. ;AN000;
622 ;³ ;AN000;
623 ;³ INPUT: device_request - scalar indicating what status the user requested. ;AN000;
624 ;³ use the following equates: ;AN000;
625 ;³ ;AN000;
626 ;³ com1_retry_type_status EQU 0 ;AN000;
627 ;³ com2_retry_type_status EQU 2 ;AN000;
628 ;³ com3_retry_type_status EQU 4 ;AN000;
629 ;³ com4_retry_type_status EQU 6 ;AN000;
630 ;³ lpt1_retry_type_status ;AN000;
631 ;³ lpt2_retry_type_status ;AN000;
632 ;³ lpt3_retry_type_status ;AN000;
633 ;³ ;AN000;
634 ;³ ;AN000;
635 ;³ RETURN: returned_retry_type - scalar indicating type of retry active for ;AN000;
636 ;³ the requested device. compare with the following equates: ;AN000;
637 ;³ ;AN000;
638 ;³ no_retry_flag ;AN000;
639 ;³ error_status ;AN000;
640 ;³ busy_status ;AN000;
641 ;³ ready_status ;AN000;
642 ;³ ;AN000;
643 ;³ retry_type_ptr - set to proper string ;AN000;
644 ;³ ;AN000;
645 ;³ ;AN000;
646 ;³ MESSAGES: none ;AN000;
647 ;³ ;AN000;
648 ;³ REGISTER ;AN000;
649 ;³ USAGE: CL - For com ports it serves as bit shift count for the retry type byte.
650 ;³ ;AN000;
651 ;³ AL - On exit holds retry type scalar on exit (returned_retry_type) ;AN000;
652 ;³ ;AN000;
653 ;³ ES - holds segment of resident mode code ;AN000;
654 ;³ ;AN000;
655 ;³ ;AN000;
656 ;³ CONVENTIONS: The value in device_request is used as an index into the LPTX ;AN000;
657 ;³ array of retry type flags, or as a bit shift count for the ;AN000;
658 ;³ COM retry type byte. ;AN000;
659 ;³ ;AN000;
660 ;³ ;AN000;
661 ;³ ASSUMPTIONS: The user has initialized device_request on entry with ;AN000;
662 ;³ the equates provided. ;AN000;
663 ;³ ;AN000;
664 ;³ ;AN000;
665 ;³ SIDE EFFECT: none. ;AN000;
666 ;³ ;AN000;
667 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
668 ;AN000;
669 get_device_retry_type PROC NEAR ;AN665;
670
671 PUBLIC get_device_retry_type
672
673 PUSH BX ;AN665;
674 PUSH ES ;AN665;
675
676 XOR BX,BX ;AN665;
677 MOV ES,BX ;set segment to zero ;AN665;
678
679 .IF <<ES:WORD PTR resseg> NE 0000H> THEN ;IF code resident THEN ;AN665;
680 MOV ES,ES:WORD PTR resseg[2] ;ES=seg of resident code ;AN665;
681 .IF <device_type EQ COMx> THEN
682 MOV CL,device_request ;CL has 0, 2, 4 or 6 for COM 1, 2, 3 or 4 respectively ;AC003;
683 MOV returned_retry_type,BYTE PTR ES:res_com_retry_type ;AL=the status byte for all 4 com ports ;AN665;
684 SHR returned_retry_type,CL ;AL=XXXXXX??, where ?? is the retry bits for port in question ;AC003;
685 AND returned_retry_type,00000011B ;AL=000000??, where ?? is the retry bits for port in question ;AC003;
686 .ELSE ;AN665;
687 MOV BL,device_request ;BX=index into retry bytes in resident code ;AN665;
688 MOV returned_retry_type,BYTE PTR ES:lpt1_retry_type[BX] ;AN665;
689 .ENDIF ;AN665;
690 .ELSE ;AN665;
691 MOV returned_retry_type,no_retry_flag ;AN665;
692 .ENDIF ;AN665;
693
694 .IF <returned_retry_type EQ B> OR ;COM form of busy flag ;AN665;
695 .IF <returned_retry_type EQ busy_status> THEN ;AN665;
696 MOV retry_type_ptr,OFFSET B_str ;AN665;
697 .ELSEIF <returned_retry_type EQ E> OR ;COM form of error flag ;AN665;
698 .IF <returned_retry_type EQ error_status> THEN ;AN665;
699 MOV retry_type_ptr,OFFSET E_str ;AN665;
700 .ELSEIF <returned_retry_type EQ R> OR ;COM form of ready flag ;AN665;
701 .IF <returned_retry_type EQ ready_status> THEN ;AN665;
702 MOV retry_type_ptr,OFFSET R_str ;AN665;
703 .ELSE ;AN665;
704 MOV retry_type_ptr,OFFSET NONE_str ;not E, B or R. ;AN665;
705 .ENDIF ;AN665;
706
707 POP ES ;AN665;
708 POP BX ;AN665;
709 RET ;AN665;
710
711 get_device_retry_type ENDP ;AN665;
712 ;AN000;
713 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
714 ;³ ;AN000;
715 ;³ ANALYZE_AND_INVOKE ;AN000;
716 ;³ ------------------ ;AN000;
717 ;³ ;AN000;
718 ;³ The command line is boken down into pieces by "parse_parameters". Each piece ;AN000;
719 ;³ is analyzed here, and the appropriate routine called to setup and/or execute ;AN000;
720 ;³ the requested function. ;AN000;
721 ;³ ;AN000;
722 ;³ ;AN000;
723 ;³ ;AN000;
724 ;³ ;AN000;
725 ;³ ;AN000;
726 ;³ ;AN000;
727 ;³ INPUT: request_type - scalar indicating what operation the user requested. ;AN000;
728 ;³ ;AN000;
729 ;³ ;AN000;
730 ;³ ;AN000;
731 ;³ ;AN000;
732 ;³ RETURN: none ;AN000;
733 ;³ ;AN000;
734 ;³ ;AN000;
735 ;³ MESSAGES: none ;AN000;
736 ;³ ;AN000;
737 ;³ ;AN000;
738 ;³ ;AN000;
739 ;³ ;AN000;
740 ;³ REGISTER ;AN000;
741 ;³ USAGE: DI - index into the list of parsed parms, the array parm_list. ;AN000;
742 ;³ ;AN000;
743 ;³ CX - temporary holder for memory to memory MOVs ;AN000;
744 ;³ ;AN000;
745 ;³ ;AN000;
746 ;³ CONVENTIONS: ;AN000;
747 ;³ ;AN000;
748 ;³ ;AN000;
749 ;³ ;AN000;
750 ;³ ASSUMPTIONS: All the input are valid. The parm_list entry past the last one ;AN000;
751 ;³ has a parm_type of bogus. ;AN000;
752 ;³ ;AN000;
753 ;³ The lines and columns values are in binary for request_type= ;AN000;
754 ;³ set_con_features ;AN000;
755 ;³ ;AN000;
756 ;³ The codepage numbers were put into des_start_packet. ;AN000;
757 ;³ ;AN000;
758 ;³ ;AN000;
759 ;³ ;AN000;
760 ;³ ;AN000;
761 ;³ SIDE EFFECT: ;AN000;
762 ;³ ;AN000;
763 ;³ ;AN000;
764 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
765 ;AN000;
766 analyze_and_invoke PROC NEAR ;AX000; ;AN000;
767 ;AN000;
768 ;AN000;
769 ;CASE request_type= ;AN000;
770 ;AN000;
771 MOV cp_cb.des_pack_ptr,OFFSET des_start_packet ;AX000;In case a codepage request ;AN000;
772 ;AN000;
773 MOV DI,0 ;initialize index into the list of parsed parameters ;AN000;
774 ;AN000;
775 ;calculate the displacement for the jump to the jump ;AN000;
776 MOV parm_list_holder,BX ;save parm_list_BX ;AN000;
777 XOR BX,BX ;AX000; ;AN000;
778 MOV BL,max_request_type ;AX000; ;AN000;
779 SUB BL,request_type ;AX000;see the list of equates for request_type ;AN000;
780 SHL BX,1 ;AX000;BX=word displacement into jump table ;AN000;
781 JMP jump_table1[BX] ;AX000;jump to appropriate jump ;AN000;
782 ;AN000;
783 jump_table1 LABEL WORD ;the order of the following entries is critical ;AN000;
784 ;AN000;
785 DW OFFSET all_con_status_case ;AN000;
786 DW OFFSET codepage_prepare_case ;AN000;
787 DW OFFSET codepage_refresh_case ;AN000;
788 DW OFFSET codepage_select_case ;AN000;
789 DW OFFSET codepage_status_case ;AN000;
790 DW OFFSET codepage_prepared_status_case ;AN000;
791 DW OFFSET codepage_selected_status_case ;AN000;
792 DW OFFSET com_status_case ;AN000;
793 DW OFFSET initialize_com_port_case ;AN000;
794 DW OFFSET initialize_printer_port_case ;AN000;
795 DW OFFSET old_initialize_printer_port_case ;AN000;
796 DW OFFSET old_video_mode_set_case ;AN000;
797 DW OFFSET printer_reroute_case ;AN000;
798 DW OFFSET printer_status_case ;AN000;
799 DW OFFSET set_con_features_case ;AN000;
800 DW OFFSET status_for_everything_case ;AN000;
801 DW OFFSET turn_off_reroute_case ;AN000;
802 ;AN000;
803 ;AN000;
804 all_con_status_case: ;know that all con status is requested ;AN000;
805 ;AN000;
806 ;AN000;
807 MOV stat_dev_ptr,OFFSET CON_str ;set up msg ser input ;AN000;
808 MOV dev_name_size,len_CON_str ;set up for msg service, see MODEPARS.ASM ;AN000;
809 display status_for_device ;AN000;
810 display long_underline ;Status for device CON: ;AN000;
811 display four_char_underline ;---------------------- ;AN000;
812 ;AN000;
813 CAll check_ANSI_installed ;see if ANSI.SYS is installed ;AC001;
814 .IF <ANSI_installed EQ true> THEN ;IF can get info on settings THEN display them ELSE don't display them
815 CALL display_columns_status ;AN000;
816 CALL display_lines_status ;AN000;
817 .ENDIF ;AC001;
818 MOV cp_cb.request_typ,status ;set up variables for modecp ;AN000;
819 MOV cp_cb.cp_device,OFFSET CON_str ;AN000;
820 ;AN000;
821 CALL modecp ;display codepage status ;AN000;
822 ;AN000;
823 BREAK 0 ;AN000;
824 ;AN000;
825 ;AN000;
826 codepage_prepare_case: ;AN000;
827 ;AN000;
828 MOV cp_cb.request_typ,prepare ;AN000;
829 CALL setup_device_name ;Set the pointer to the device name ASCIIZ in the parameter block for 'modecp'. ;AN000;
830 ;AN000;
831 call modecp ;AN000;
832 ;AN000;
833 BREAK 0 ;AN000;
834 ;AN000;
835 ;AN000;
836 codepage_refresh_case: ;AN000;
837 ;AN000;
838 MOV cp_cb.request_typ,refresh ;AN000;
839 CALL setup_device_name ;Set the pointer to the device name ASCIIZ in the parameter block for 'modecp'. ;AN000;
840 ;AN000;
841 call modecp ;AN000;
842 ;AN000;
843 BREAK 0 ;AN000;
844 ;AN000;
845 ;AN000;
846 ;AN000;
847 codepage_select_case: ;AN000;
848 ;AN000;
849 MOV cp_cb.request_typ,select ;AN000;
850 CALL setup_device_name ;Set the pointer to the device name ASCIIZ in the parameter block for 'modecp'. ;AN000;
851 MOV des_start_packet.des_strt_pknum,1 ;one cp number ;AN000;
852 MOV des_start_packet.des_strt_pklen,4 ;bytes for count (word) and one number (word) ;AN000;
853 MOV BX,parm_list_holder ;restore parm_list_BX ;AN000;
854 MOV DI,codepage_index_holder ;DI=index in parm list of the entry for the codepage to be selected;AN000;
855 MOV AX,parm_list_BX[DI].value1 ;AX=codepage number in binary form ;AN000;
856 MOV des_start_packet.des_strt_pkcp1,AX ;setup parm block with the (single) cp number ;AN000;
857 ;AN000;
858 CALL modecp ;AN000;
859 ;AN000;
860 BREAK 0 ;AN000;
861 ;AN000;
862 ;AN000;
863 codepage_status_case: ;AN000;
864 codepage_prepared_status_case: ;AN000;
865 codepage_selected_status_case: ;AN000;
866 ;AN000;
867 MOV cp_cb.request_typ,status ;AN000;
868 CALL setup_device_name ;Set the pointer to the device name ASCIIZ in the parameter block for 'modecp'. ;AN000;
869 ;AN000;
870 CALL modecp ;AN000;
871 ;AN000;
872 BREAK 0 ;AN000;
873 ;AN000;
874 ;AN000;
875 com_status_case: ;AN000;
876 ;AN000;
877 ; INPUT: device_type = COMx
878 ; device = ASCII COM number
879
880
881 CALL check_com_ports_attached ;return number of com ports in com_ports_attached ;AN000;
882 ;AN000;
883 .IF <device_name EQ <OFFSET COM1_str>> AND ;AN000;
884 .IF <com_ports_attached GE 1> THEN ;COM1 exists
885 MOV BL,COM1 ;AN000;
886 MOV stat_dev_ptr,OFFSET COM1_str ;set up msg ser input ;AN000;
887 MOV device_request,com1_retry_type_status ;AN000;
888 .ELSEIF <device_name EQ <OFFSET COM2_str>> AND ;AN000;
889 .IF <com_ports_attached GE 2> THEN ;COM2 exists
890 MOV BL,COM2 ;AN000;
891 MOV stat_dev_ptr,OFFSET COM2_str ;set up msg ser input ;AN000;
892 MOV device_request,com2_retry_type_status ;AN000;
893 .ELSEIF <device_name EQ <OFFSET COM3_str>> AND ;AN000;
894 .IF <com_ports_attached GE 3> THEN ;COM3 exists
895 MOV BL,COM3 ;AN000;
896 MOV stat_dev_ptr,OFFSET COM3_str ;set up msg ser input ;AN000;
897 MOV device_request,com3_retry_type_status ;AN000;
898 .ELSEIF <device_name EQ <OFFSET COM4_str>> AND ;AN000;
899 .IF <com_ports_attached EQ 4> THEN ;COM4 exists
900 MOV BL,COM4 ;AN000;
901 MOV stat_dev_ptr,OFFSET COM4_str ;set up msg ser input ;AN000;
902 MOV device_request,com4_retry_type_status ;AN000;
903 .ELSE ;device does not exist ;AN000;
904 MOV CX,device_name ;AN000; ;AN000;
905 MOV illegal_device_ptr,CX ;put pointer to com port string in message ;AN000;
906 DISPLAY err1 ;AN000;"Illegal device name - COMX" ;AN000;
907 MOV noerror,false ;set flag for displaying status to be skipped
908 .ENDIF ;AN000;
909 .IF <noerror EQ true> THEN
910 MOV dev_name_size,len_COMX_str ;set up for msg service, see MODEPARS.ASM ;AN000;
911 display status_for_device ;"Status for device COM?:" ;AN000;
912 display long_underline ;"------------------" ;AN000;
913 display five_char_underline ;has CRLF on it "-----" ;AN000;
914 call get_device_retry_type ;AN000;
915 display retry_equal ;AN000;
916 .ENDIF
917 ;AN000;
918 BREAK 0 ;AN000;
919 ;AN000;
920 ;AN000;
921 ; con_status_case: ;don't know which con status is requested ;AN000;
922 ;AN000;
923 ; MOV request_type,all_con_status ;AC000;DCR76 ;AN000;
924 ; CALL analyze_and_invoke ;AC000;DCR76 ;AN000;
925 ;AN000;
926 ; MOV dev_name_size,len_CON_str ;set up for msg service, see MODEPARS.ASM ;AN000;
927 ; MOV stat_dev_ptr,OFFSET CON_str ;set up msg ser input ;AN000;
928 ; display status_for_device ;AN000;
929 ; display long_underline ;Status for device CON: ;AN000;
930 ; display four_char_underline ;---------------------- ;AN000;
931 ; ;AN000;
932 ; MOV DI,0 ;AN000;
933 ; ;AN000;
934 ; .WHILE <parm_list_BX[DI].parm_type NE bogus> DO ;the entry after the last has parm_type of bogus ;AN000;
935 ; ;AN000;
936 ; ;CASE parm_list_BX[DI].item_tag= ;AN000;
937 ; ;AN000;
938 ; ;CODEPAGE, ;AN000;
939 ; ;PREPARE, ;AN000;
940 ; ;SELECT: ;AN000;
941 ; ;AN000;
942 ; .IF <parm_list_BX[DI].item_tag EQ CODEPAGE_item_tag> OR ;AN000;
943 ; .IF <parm_list_BX[DI].item_tag EQ SELECT_item_tag> OR ;AN000;
944 ; .IF <parm_list_BX[DI].item_tag EQ PREPARE_item_tag> THEN ;AN000;
945 ; ;AN000;
946 ; MOV cp_cb.request_typ,status ;AN000;
947 ; MOV cp_cb.cp_device,OFFSET CON_str ;AN000;
948 ; CALL modecp ;display codepage status ;AN000;
949 ; ;AN000;
950 ; BREAK 2 ;AN000;
951 ; ;AN000;
952 ; .ENDIF ;AN000;
953 ; ;AN000;
954 ; ;BLINK: ;AN000;
955 ; ;AN000;
956 ; .IF <parm_list_BX[DI].item_tag EQ BLINK_item_tag> THEN ;AN000;
957 ; ;AN000;
958 ; CALL display_blink_status ;AN000;
959 ; ;AN000;
960 ; BREAK 2 ;AN000;
961 ; ;AN000;
962 ; .ENDIF ;AN000;
963 ; ;AN000;
964 ; ;AN000;
965 ; ;COLUMNS: ;AN000;
966 ; ;AN000;
967 ; .IF <parm_list_BX[DI].item_tag EQ COLUMNS_item_tag> THEN ;AN000;
968 ; ;AN000;
969 ; CALL display_COLUMNS_status ;AN000;
970 ; ;AN000;
971 ; BREAK 2 ;AN000;
972 ; ;AN000;
973 ; .ENDIF ;AN000;
974 ; ;AN000;
975 ; ;AN000;
976 ; ;LINES: ;AN000;
977 ; ;AN000;
978 ; .IF <parm_list_BX[DI].item_tag EQ LINES_item_tag> THEN ;AN000;
979 ; ;AN000;
980 ; CALL display_lines_status ;AN000;
981 ; ;AN000;
982 ; BREAK 2 ;AN000;
983 ; ;AN000;
984 ; .ENDIF ;AN000;
985 ; ;AN000;
986 ; ENDCASE_2: ;AN000;
987 ; ;AN000;
988 ; ADD DI,TYPE parm_list_entry ;AN000;
989 ; ;AN000;
990 ; .ENDWHILE ;AN000;
991 ;AN000;
992 ; BREAK 0 ;AN000;
993 ;AN000;
994 ;AN000;
995 ;AN000;
996 initialize_com_port_case: ;AN000;
997 ;AN000;
998
999 MOV BX,parm_list_holder ;restore parm_list_BX ;AN000;
1000
1001 .IF <parms_form EQ keyword> THEN ;IF the parms were input as keywords THEN ;AN000;
1002 ;AN000;
1003 MOV DI,TYPE parm_list_entry ;skip COMN parm ;AN000;
1004 ;AN000;
1005 .WHILE <parm_list_BX[DI].parm_type NE bogus> DO NEAR ;the entry after the last has parm_type of bogus ;AN000;
1006 ;AN000;
1007 ;CASE parm_list_BX[DI].keyword_switch_ptr= ;AN000;
1008 ;AN000;
1009 ;BAUD_equal: ;AN000;
1010 ;AN000;
1011 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET BAUD_equal>> THEN ;AN000;
1012 ;AN000;
1013 MOV AX,parm_list_BX[DI].value1 ;AX= pointer to the baud rate string ;AN000;
1014 MOV pbaud_ptr,AX ;set pointer to the baud rate string in the messge ;AN000;
1015 MOV baud_index,DI ;set index into parm list for setcom ;AN000;
1016 BREAK 3 ;AN000;
1017 ;AN000;
1018 .ENDIF ;AN000;
1019 ;AN000;
1020 ;AN000;
1021 ;PARITY_equal: ;AN000;
1022 ;AN000;
1023 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET PARITY_equal>> THEN ;AN000;
1024 ;AN000;
1025 MOV SI,parm_list_BX[DI].value1 ;AX= pointer to the parity string ;AN000;
1026 MOV pparity_ptr,SI ;set pointer to the parity string in the messge ;AN000;
1027 OR BYTE PTR [SI],lowercase ;convert to lowercase for compatibility with previous versions
1028 MOV parity_index,DI ;set index into parm list for setcom ;AN000;
1029 BREAK 3 ;AN000;
1030 ;AN000;
1031 .ENDIF ;AN000;
1032 ;AN000;
1033 ;AN000;
1034 ;DATA_equal: ;AN000;
1035 ;AN000;
1036 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET DATA_equal>> THEN ;AN000;
1037 ;AN000;
1038 MOV BP,parm_list_BX[DI].value1 ;BP= pointer to the data bits string ;AN000;
1039 MOV AL,[BP] ;AL= data bits character ;AN000;
1040 MOV pdata,AL ;set the data bits string in the messge ;AN000;
1041 MOV data_bits_index,DI ;set index into parm list for setcom ;AN000;
1042 BREAK 3 ;AN000;
1043 ;AN000;
1044 .ENDIF ;AN000;
1045 ;AN000;
1046 ;AN000;
1047 ;STOP_equal: ;AN000;
1048 ;AN000;
1049 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET STOP_equal>> THEN ;AN000;
1050 ;AN000;
1051 MOV AX,parm_list_BX[DI].value1 ;AX= pointer to the stop bit string ;AN000;
1052 MOV pstop_ptr,AX ;set pointer to the parity string in the messge ;AN000;
1053 MOV stop_bits_index,DI ;set index into parm list for setcom ;AN000;
1054 BREAK 3 ;AN000;
1055 ;AN000;
1056 .ENDIF ;AN000;
1057 ;AN000;
1058 ;AN000;
1059 ;RETRY_equal: ;AN000;
1060 ;AN000;
1061 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET RETRY_equal_str>> THEN ;AN000;
1062 ;AN000;
1063 MOV retry_index,DI ;indicate to modecom which parm is retry ;AN000;
1064 ; BREAK 3 ;AN000;
1065 ;AN000;
1066 .ENDIF ;AN000;
1067 ;AN000;
1068 ;AN000;
1069 ENDCASE_3: ;AN000;
1070 ;AN000;
1071 ADD DI,TYPE parm_list_entry ;AN000;
1072 ;AN000;
1073 ;AN000;
1074 .ENDWHILE ;AN000;
1075 ;AN000;
1076 .ELSE ;the parms were entered as positionals (the old form) ;AN000;
1077 ;AN000;
1078 MOV baud_index,TYPE parm_list_entry ;AN000;
1079 MOV DI,2 * (TYPE parm_list_entry) ;AN000;
1080 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN ;AN000;IF stopbits requested THEN
1081 MOV parity_index,DI ;AN000;
1082 .ENDIF
1083 MOV DI,3 * (TYPE parm_list_entry) ;AN000;
1084 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN ;AN000;IF stopbits requested THEN
1085 MOV data_bits_index,DI ;AN000;
1086 .ENDIF
1087 MOV DI,4 * (TYPE parm_list_entry) ;DI=stopbits index ;AN000;
1088 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN ;AN000;IF stopbits requested THEN
1089 MOV stop_bits_index,DI ;AN000;
1090 .ENDIF
1091 MOV DI,5 * (TYPE parm_list_entry) ;AN000;DI=index of retry parm
1092 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN ;AN000;IF retry requested THEN
1093 MOV retry_index,DI ;AN000;set up index for modecom
1094 .ENDIF ;AN000;
1095 ;AN000;
1096 .ENDIF ;AN000;
1097 ;AN000;
1098 CALL modecom ;AN000;
1099 ;AN000;
1100 BREAK 0 ;AN000;
1101
1102 ;AN000;
1103 ;AN000;
1104 old_initialize_printer_port_case: ;Assume that parms not specified have an entry in parm_list that is in initial state;AN000;
1105
1106 ;printer_no has ASCII form of printer number ;AN000;
1107 ;need to put binary form of columns in columns_holder (80 or 132) ;AN000;
1108 ;need to put "6" or "8" in parm2 ;AN000;
1109 ;need to set retry_index ;AN000;
1110
1111
1112 PUBLIC old_initialize_printer_port_case
1113
1114 MOV BX,parm_list_holder ;restore parm_list_BX ;AN000;
1115 MOV DI,TYPE parm_list_entry ;skip LPTN parm, point at chars per line ;AN000;
1116
1117 .IF <parm_list_BX[DI].item_tag EQ onethirtytwo_item_tag> THEN ;AN000;
1118 MOV columns_holder,132 ;AN000;
1119 .ELSEIF <parm_list_BX[DI].item_tag EQ eighty_item_tag> THEN ;AN000;
1120 MOV columns_holder,80 ;AN000;
1121 .ENDIF ;if not 80 or 132 modeprin assumes not specified, and makes no change;AN000;
1122 ADD DI,TYPE parm_list_entry ;look at lines per inch ;AN000;
1123
1124 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN ;IF chars per line specified THEN ;AN000;
1125 MOV SI,parm_list_BX[DI].value1 ;SI=>"6" or "8" ;AN000;
1126 MOV AL,BYTE PTR DS:[SI] ;AN000;
1127 MOV parm2,AL ;parm2="6" or "8" ;AN000;
1128 .ENDIF ;otherwise leave parm2=0FFH (unspecified) ;AN000;
1129
1130 ADD DI,TYPE parm_list_entry ;look at retry request ;AN000;
1131 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN ;AN000;
1132 MOV retry_index,DI ;AN000;let modeprin know retry was requested and the index of it.
1133 .ENDIF ;AN000;
1134
1135 CALL modeecno ;AN000;
1136 CALL modeprin ;AN000;
1137 ;AN000;
1138 BREAK 0 ;AN000;
1139
1140
1141
1142 initialize_printer_port_case: ;printer_no has ASCII form of printer number ;AN000;
1143 ;need to put binary form of columns in columns_holder (80 or 132) ;AN000;
1144 ;need to put "6" or "8" in parm2 ;AN000;
1145 ;need to set retry_index ;AN000;
1146 ;AN000;
1147 MOV BX,parm_list_holder ;restore parm_list_BX ;AN000;
1148 MOV DI,TYPE parm_list_entry ;skip LPTN parm ;AN000;
1149
1150 .WHILE <parm_list_BX[DI].parm_type NE bogus> DO ;the entry after the last has parm_type of bogus ;AN000;
1151 ;AN000;
1152 ;CASE parm_list_BX[DI].keyword_switch_ptr= ;AN000;
1153 ;AN000;
1154 ;AN000;
1155 ;LINES_equal: ;AN000;
1156 ;AN000;
1157 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET LINES_equal>> THEN ;AN000;
1158 ;AN000;
1159 MOV SI,parm_list_BX[DI].value1 ;SI=>"6" or "8" ;AN000;
1160 MOV AL,BYTE PTR DS:[SI] ;AN000;
1161 MOV parm2,AL ;parm2="6" or "8" ;AN000;
1162 BREAK 4 ;AN000;
1163 ;AN000;
1164 .ENDIF ;AN000;
1165 ;AN000;
1166 ;AN000;
1167 ;COLUMNS_equal: ;AN000;
1168 ;AN000;
1169 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET COLUMNS_equal>> OR ;AN000;
1170 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET COLS_equal>> THEN ;AN000;
1171 ;AN000;
1172 .IF <parm_list_BX[DI].item_tag EQ onethirtytwo_item_tag> THEN ;AN000;
1173 MOV columns_holder,132 ;AN000;
1174 .ELSE ;AN000;
1175 MOV columns_holder,80 ;AN000;
1176 .ENDIF ;AN000;
1177 BREAK 4 ;AN000;
1178 ;AN000;
1179 .ENDIF ;AN000;
1180 ;AN000;
1181 ;AN000;
1182 ;RETRY_equal: ;AN000;
1183 ;AN000;
1184 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET RETRY_equal_str>> THEN ;AN000;
1185
1186 MOV retry_index,DI ;AN664;
1187 BREAK 4 ;AN000;
1188 ;AN000;
1189 .ENDIF ;AN000;
1190 ;AN000;
1191 ;AN000;
1192 ENDCASE_4: ;AN000;
1193 ;AN000;
1194 ADD DI,TYPE parm_list_entry ;AN000;
1195 ;AN000;
1196 ;AN000;
1197 .ENDWHILE ;AN000;
1198
1199 CALL modeecno ;turn of rerouting ;AN000;
1200 CALL modeprin ;AN000;
1201 ;AN000;
1202 BREAK 0 ;AN000;
1203 ;AN000;
1204 ;AN000;
1205 ;AN000;
1206 ;AN000;
1207 old_video_mode_set_case: ;AN000;
1208 ;AN000;
1209 PUBLIC old_video_mode_set_case ;AN000;
1210 ;AN000;
1211 ;AN000;
1212 ;first see if ANSI.SYS is loaded ;AN000;
1213 CALL check_ANSI_installed ;AC001;
1214 .IF <ANSI_installed EQ true> THEN ;AC001;
1215 MOV CL,get_current_settings ;AN000;
1216 PUSH BX ;save parm_list ;AN000;
1217 CALL do_IOCTL0C ;get current settings of CON ;AN000;
1218 POP BX ;restore parm_list ;AN000;
1219 MOV IOCTL0C_data_block.mode,text ;AN000;
1220 .ENDIF ;AN000;ANSI installed ;AN000;
1221 MOV BX,parm_list_holder ;restore parm_list_BX ;AN000;
1222 PUSH DI ;save parm list index ;AN000;
1223 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN
1224 .IF <parm_list_BX[DI].item_tag EQ BW40_item_tag> THEN ;IF BW40 REQUESTED ;AN000;
1225 CALL BW40 ;AN000;
1226 .ELSEIF <parm_list_BX[DI].item_tag EQ BW80_item_tag> THEN ;IF BW80 REQUESTED ;AN000;
1227 CALL BW80 ;AN000;
1228 .ELSEIF <parm_list_BX[DI].item_tag EQ CO40_item_tag> THEN ;IF CO40 REQUESTED ;AN000;
1229 CALL CO40 ;AN000;
1230 .ELSEIF <parm_list_BX[DI].item_tag EQ CO80_item_tag> THEN ;IF CO80 REQUESTED ;AN000;
1231 CALL CO80 ;AN000;
1232 .ELSEIF <parm_list_BX[DI].item_tag EQ MONO_item_tag> THEN ;IF MONO REQUESTED ;AN000;
1233 CALL MONO ;AN000;
1234 .ELSE ;AN000;
1235 .IF <ANSI_installed EQ true> THEN ;AN000;
1236 ;AC004; MOV need_IOCTL0C,true ;use IOCTL if possible to retain lines setting ;AN000;
1237 .IF <parm_list_BX[DI].value1 EQ <OFFSET fourty_str>> THEN ;AN000;
1238 MOV IOCTL0C_data_block.cols,40 ;setup IOCTL input block with the columns requested ;AN000;
1239 .ELSE
1240 MOV IOCTL0C_data_block.cols,80 ;setup IOCTL input block with the columns requested ;AN000;
1241 .ENDIF ;AN000;
1242 CALL old_video_mode_set_IOCTL ;AN004;use IOCTL if possible to retain lines setting ;AN000;
1243 .ELSE
1244 .IF <parm_list_BX[DI].item_tag EQ fourty_item_tag> THEN ;IF 40 REQUESTED ;AN000;
1245 MOV BL,40 ;set up for handle_40_or_80 ;AN000;
1246 .ELSE ;AN000;
1247 MOV BL,80 ;set up for handle_40_or_80 ;AN000;
1248 .ENDIF ;AN000;
1249 CALL HANDLE_40_OR_80 ;AN000;
1250 .ENDIF
1251 .ENDIF ;AN000;
1252 .ENDIF
1253
1254 dummy9:
1255 PUBLIC dummy9
1256 ;AN000;
1257 POP DI ;restore parm list index ;AN000;
1258
1259 .IF <NOERROR EQ TRUE> AND ;process ,r ³ l,[T] ;AN000;
1260 MOV BX,parm_list_holder ;restore parm_list_BX ;AN000;
1261 ADD DI,TYPE parm_list_entry ;process second parm, shift direction ;AN000;
1262 .IF <parm_list_BX[DI].item_tag NE unspecified> THEN ;AN000;
1263 .IF <parm_list_BX[DI].item_tag EQ R_item_tag> OR ;AN000;
1264 .IF <parm_list_BX[DI].item_tag EQ L_item_tag> THEN ;AN000;
1265 MOV CL,parm_list_BX[DI].item_tag ;AN000;
1266 MOV PARM2,CL ;set up for SHIFT_SCREEN ;AN000;
1267 ADD DI,TYPE parm_list_entry ;look at third parm ;AN000;
1268 MOV CL,parm_list_BX[DI].item_tag ;CL=T_item_tag or bogus ;AN000;
1269 MOV PARM3,CL ;may be bogus, but shift_screen will handle it correctly ;AN000;
1270 CALL SHIFT_SCREEN ;AN000;
1271 .ELSE ;AN000;must be a rows value
1272 .IF <ANSI_installed EQ true> THEN ;AN000;
1273 ;AC004; MOV need_IOCTL0C,true ;use IOCTL if possible to retain lines setting ;AN000;
1274 MOV DX,parm_list_BX[DI].value1 ;AN000;
1275 MOV IOCTL0C_data_block.rows,DX ;the IOCTL input block has the columns requested ;AN000;
1276 CALL old_video_mode_set_IOCTL ;AN004;use IOCTL if possible to retain lines setting ;AN000;
1277 .ELSE ;AN000;ANSI not installed ;AN000;
1278 DISPLAY ANSI_not_loaded ;AN000;
1279 MOV noerror,false ;AN000;
1280 .ENDIF ;AN000;ANSI installed ;AN000;
1281 .ENDIF ;AN000;
1282 .ENDIF ;AN000;
1283 ;AN000;
1284 BREAK 0 ;AN000;
1285
1286
1287 ;AN000;
1288 PUBLIC printer_reroute_case
1289 ;AN000;
1290 printer_reroute_case:
1291 ;INPUT:lptno=zero based printer number OUTPUT:;AH=printer number mask: lpt1=1, lpt2=2, lpt3=4 ;AN000;
1292 ;device=COM number in ASCII form ;SI=printer number value (one based) ;AN000;
1293 ;AL=com number character ;AN000;
1294 XOR CX,CX
1295 MOV CL,lptno ;lptno always <= 255
1296 MOV SI,CX ;SI=zero based printer number (0, 1, or 2) ;AN000;
1297 INC SI ;SI=one based printer number (1, 2, or 3) ;AN000;
1298 MOV AH,1 ;AN000;
1299 SAL AH,CL ;AH=2**SI,AH=printer number mask for MODEECHO ;AN000;
1300 MOV DH,CL
1301 ADD DH,ASCII_1 ;DH=ASCII printer number ;AN000;
1302 MOV AL,device ;AL=ASCII form of com device number ;AN000;
1303 MOV REDPT,DH ;PUT n OF LPTn IN REDIRECT MESSAGE
1304 MOV NOTREDPT,DH ;AND INTO NOT REDIRECTED MSG
1305 CALL modeecho ;AN000;
1306 ;AN000;
1307 BREAK 0 ;AN000;
1308 ;AN000;
1309 ;AN000;
1310 ;AN000;
1311 printer_status_case: ;AN000;
1312
1313 PUBLIC printer_status_case
1314
1315 ; INPUT: device_type = LPTx
1316 ; device = ASCII printer number
1317 ; lptno = ASCII printer number
1318 ; device_name = offset of printer string
1319 ;AN000;
1320
1321 MOV cp_cb.request_typ,status ;AN000;
1322 MOV AX,device_name ;AN000;
1323 MOV stat_dev_ptr,AX ;AC665;set up msg ser input ;AN000;
1324 MOV dev_name_size,len_LPTX_str ;AN000;set up for msg service, see MODEPARS.ASM ;AN000;
1325 MOV cp_cb.cp_device,AX ;AN665;set up for call to modecp ;AN000;
1326 ;AN000;
1327 .IF <device_name EQ <OFFSET LPT1_str>> THEN ;AN000;
1328 MOV device_request,lpt1_retry_type_status ;AN000;
1329 MOV rerouted_printer_mask,LPT1
1330 MOV redpt,"1" ;set up for reroute message
1331 MOV notredpt,"1" ;set up for not rerouted message
1332 .ELSEIF <device_name EQ <OFFSET LPT2_str>> THEN ;AN000;
1333 MOV device_request,lpt2_retry_type_status ;AN000;
1334 MOV rerouted_printer_mask,LPT2
1335 MOV redpt,"2" ;set up for reroute message
1336 MOV notredpt,"2" ;set up for not rerouted message
1337 .ELSEIF <device_name EQ <OFFSET LPT3_str>> THEN ;AN000;
1338 MOV device_request,lpt3_retry_type_status ;AN000;
1339 MOV rerouted_printer_mask,LPT3
1340 MOV redpt,"3" ;set up for reroute message
1341 MOV notredpt,"3" ;set up for not rerouted message
1342 .ENDIF ;AN000;
1343 ;AN000;
1344 PUSH ES ;save ES, used in MODECP ;AC002;
1345 ;AC002;PUSH AX ;AN000;save
1346 ;AN000;
1347 display status_for_device ;AN000;
1348 display long_underline "Status for device LPTX?" ;AN000;
1349 display five_char_underline ;has CRLF on it ----------------------- ;AN000;
1350 call display_printer_reroute_status ;see modeecho.asm ;AN000;
1351 ;AC002;POP AX ;restore "device_request" ;AN000;
1352 XOR CX,CX ;initialize prn_ports_attached ;AN000;
1353 CALL check_prn_ports_attached ;return number of printer cards in prn_ports_attached ;AN000;
1354 POP ES ;restore ES ;AC002;
1355 ADD prn_ports_attached,ASCII_0 ;CX=ASCII form of last printer number ;AN000;
1356 .IF <prn_ports_attached GE redpt> THEN ;IF the printer exists THEN ;AN000;
1357 call get_device_retry_type ;AN000;
1358 display retry_equal ;AN000;
1359 CALL modecp ;display codepage status ;AN000;
1360 .ENDIF ;AN000;
1361 ;AN000;
1362 BREAK 0 ;AN000;
1363 ;AN000;
1364 ;\ f\em ;AN000;
1365 set_con_features_case: ;the command line was nothing but con keywords ;AN000;
1366 ;AN000;
1367 ;first see if ANSI.SYS is loaded ;AN000;
1368 CALL check_ANSI_installed ;AC001;
1369 .IF <ANSI_installed EQ true> THEN ;AC001;
1370 MOV CL,get_current_settings ;AN000;
1371 CALL do_IOCTL0C ;get current settings of CON ;AN000;
1372 ;MOV SI,OFFSET IOCTL0C_data_block ;set up IOCTL0C, addressablitiy to the IOCTL data block ;AN000;
1373 ;AN000;
1374 MOV IOCTL0C_data_block.mode,text ;AN000;
1375 ;AN000;
1376 .ENDIF ;ANSI.SYS installed ;AN000;
1377 ;AN000;
1378 MOV BX,parm_list_holder ;restore parm_list_BX ;AN000;
1379 ADD DI,TYPE parm_list_entry ;skip CON parm ;AN000;
1380 .WHILE <parm_list_BX[DI].parm_type NE bogus> DO NEAR ;the entry after the last has parm_type of bogus ;AN000;
1381 ;AN000;
1382 ;CASE parm_list_BX[DI].keyword_switch_ptr= ;AN000;
1383 ;AN000;
1384 ;AN000;
1385 ;LINES_equal: ;AN000;
1386 ;AN000;
1387 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET LINES_equal>> THEN ;AN000;
1388 ;AN000;
1389 MOV DX,parm_list_BX[DI].value1 ;AN000;
1390 MOV IOCTL0C_data_block.rows,DX ;the IOCTL input block has the columns requested ;AN000;
1391 MOV need_IOCTL0C,true ;AN000;
1392 BREAK 1 ;AN000;
1393 ;AN000;
1394 .ENDIF ;AN000;
1395 ;AN000;
1396 ;AN000;
1397 ;COLUMNS_equal: ;the value is binary ;AN000;
1398 ;AN000;
1399 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET COLUMNS_equal>> OR ;AN000;
1400 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET COLS_equal>> THEN ;AN000;
1401 ;AN000;
1402 .IF <ANSI_installed EQ true> THEN ;AN000;
1403 MOV need_IOCTL0C,true ;use IOCTL if possible to retain lines setting ;AN000;
1404 MOV DX,parm_list_BX[DI].value1 ;AN000;
1405 MOV IOCTL0C_data_block.cols,DX ;the IOCTL input block has the columns requested ;AN000;
1406 .ELSE
1407 .IF <parm_list_BX[DI].item_tag EQ fourty_item_tag> THEN ;IF 40 REQUESTED ;AN000;
1408 MOV columns_specified,40 ;set up for handle_40_or_80 ;AN000;
1409 .ELSE ;AN000;
1410 MOV columns_specified,80 ;set up for handle_40_or_80 ;AN000;
1411 .ENDIF ;AN000;
1412 .ENDIF
1413 BREAK 1 ;AN000;
1414 ;AN000;
1415 .ENDIF ;AN000;
1416 ;AN000;
1417 ;AN000;
1418 ;RATE_equal: ;AN000;
1419 ;AN000;
1420 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET RATE_equal>> THEN ;AN000;
1421 ;AN000;
1422 MOV AL,BYTE PTR parm_list_BX[DI].value1 ;save the rate requested in binary form, always <255 ;AN000;
1423 MOV rate_holder,AL ;AN000;
1424 MOV need_typamat_call,true ;AN000;
1425 BREAK 1 ;AN000;
1426 ;AN000;
1427 .ENDIF ;AN000;
1428 ;AN000;
1429 ;AN000;
1430 ;DELAY_equal: ;AN000;
1431 ;AN000;
1432 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET DELAY_equal>> OR ;AN000;
1433 .IF <parm_list_BX[DI].keyword_switch_ptr EQ <OFFSET DEL_equal>> THEN ;AN000;
1434 ;AN000;
1435 MOV AL,BYTE PTR parm_list_BX[DI].value1 ;save delay requested (binary), always <255 ;AN000;
1436 MOV delay_holder,AL ;AN000;
1437 MOV need_typamat_call,true ;AN000;
1438 BREAK 1 ;AN000;
1439 ;AN000;
1440 .ENDIF ;AN000;
1441 ;AN000;
1442 ENDCASE_1: ;AN000;
1443 ;AN000;
1444 ADD DI,TYPE parm_list_entry ;address next parm ;AN000;
1445 ;AN000;
1446 .ENDWHILE ;AN000;
1447 ;AN000;
1448 DUMMY3: ;AN000;
1449 PUBLIC DUMMY3 ;AN000;
1450 ;AN000;
1451 .IF <need_IOCTL0C EQ true> THEN ;AN000;
1452 .IF <ANSI_installed EQ true> THEN ;AN000;
1453 MOV CL,set_display_characteristics ;AN000;
1454 CALL do_IOCTL0C ;AN000;
1455 .IF C THEN ;AN000;
1456 get_extended_error ;AN000;
1457 .IF <AX EQ not_supported_on_machine> THEN ;AN000;
1458 DISPLAY Function_not_supported ;AN000;
1459 .ELSEIF <AX EQ font_not_loaded> THEN ;AN000;
1460 DISPLAY Required_font_not_loaded ;AN000;
1461 .ENDIF ;AN000;
1462 MOV noerror,false ;AN000;
1463 .ENDIF ;AN000;
1464 .ELSE ;AN000;
1465 DISPLAY ANSI_not_loaded ;AN000;
1466 MOV noerror,false ;AN000;
1467 .ENDIF ;AN000;
1468 .ELSEIF <columns_specified NE false> THEN ;AN000;
1469 MOV BL,columns_specified ;set up for call to handle_40_or_80 ;AN000;
1470 CALL HANDLE_40_OR_80 ;AN000;
1471 .ENDIF ;AN000;
1472
1473 .IF <need_typamat_call EQ true> THEN ;AN000;
1474 MOV BL,rate_holder ;AN000;
1475 MOV BH,delay_holder ;AN000;
1476 CALL typamat ;AN000;
1477 .ENDIF ;AN000;
1478 ;AN000;
1479 BREAK 0 ;AN000;
1480 ;AN000;
1481 ;AN000;
1482 status_for_everything_case: ;AN000;
1483 ;AN000;
1484 MOV request_type,printer_status ;status routine for printers ;AN000;
1485 MOV device_name,OFFSET LPT1_str ;will display the reroute ;AN000;
1486 CALL analyze_and_invoke ;status for the printer whether ;AN000;
1487 MOV device_name,OFFSET LPT2_str ;it exists or not, so call for ;AN000;
1488 CALL analyze_and_invoke ;all of them ;AN000;
1489 MOV device_name,OFFSET LPT3_str ;AN000;
1490 CALL analyze_and_invoke ;AN000;
1491 ;AN000;
1492 MOV request_type,all_con_status ;AN000;
1493 CALL analyze_and_invoke ;AN000;
1494
1495 CALL check_com_ports_attached ;return number of com ports in com_ports_attached ;AN000;
1496
1497 MOV request_type,com_status ;AN000;
1498 MOV CL,com_ports_attached ;AN000;
1499 .FOR i = 1 TO CL ;AN000;
1500
1501 .SELECT ;AN000;
1502
1503 .WHEN <i EQ 1> ;AN000;
1504 MOV device_name,OFFSET COM1_str ;AN000; ;AN000;
1505
1506 .WHEN <i EQ 2> ;AN000;
1507 MOV device_name,OFFSET COM2_str ;AN000;
1508
1509 .WHEN <i EQ 3> ;AN000;
1510 MOV device_name,OFFSET COM3_str ;AN000;
1511
1512 .WHEN <i EQ 4> ;AN000;
1513 MOV device_name,OFFSET COM4_str ;AN0;AN000;
1514
1515 .ENDSELECT ;AN000;
1516
1517 CALL analyze_and_invoke ;AN000; ;AN000;
1518 .NEXT i ;AN000;
1519
1520 BREAK 0 ;AN000;
1521
1522
1523
1524 turn_off_reroute_case: ;user specified only LPTx[:] ;AN000;
1525 ;INPUT:lptno=ASCII printer number
1526
1527
1528
1529 CALL modeecno ;turn off rerouting ;AN000;
1530 XOR CX,CX ;initialize prn_ports_attached
1531 CALL check_prn_ports_attached ;return number of printer cards in prn_ports_attached
1532 ADD prn_ports_attached,ASCII_0 ;CX=ASCII form of last printer number
1533 .IF <prn_ports_attached GE LPTNO> THEN ;IF the printer exists THEN
1534 CALL set_retry_type ;turn off infinit retry ;AN000;
1535 CALL modify_resident_code ;modify resident code to reflect retry turned off ;AN000;
1536 .ENDIF
1537
1538 BREAK 0 ;AN000;
1539
1540 ;AN000;
1541 ENDCASE_0: ;AN000;
1542 ;AN000;
1543 RET ;AN000;
1544 ;AN000;
1545 analyze_and_invoke ENDP ;AN000;
1546 ;AN000;
1547 ;AN000;
1548 PRINTF_CODE ENDS ;AN000;
1549 END ;AN000;