4 TITLE ANALYZE_AND_INVOKE
- call appropriate routine based
on request
;AN000;
6 INCLUDE STRUC.INC ;AN000;
11 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P R O L O G ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;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.
18 ; AC002 - P3331: ES was getting zeroed, which caused problems later in MODECP.
20 ; AC003 - P3541: The retry status routine was assuming different format than
21 ; the retry type byte was in. I fixed the status checking
24 ; AX004 - P3982: The screen was being cleared after the "Unable to shift
25 ; screen ..." message.
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
32 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P R O L O G ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
35 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
38 GET_EXTENDED_ERROR
MACRO ;AN000;
40 MOV BX,0 ;level for 3.00 to 4.00 ;AN000;
41 MOV AH,59H
;function number for get extended error ;AN000;
48 JMP endcase_
&X
;AN000;
54 DISPLAY MACRO MESSAGE
;AN000;
55 MOV DX,OFFSET MESSAGE
;AN000;
61 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ M A C R O S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
65 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
68 INCLUDE modequat
.inc ;AN000;
70 ANSIINT2F EQU 1
AH ;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;
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;
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;
118 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E Q U A T E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
121 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ S T R U C T U R E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;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;
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;
148 IOCTL0C_def
STRUC ;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;
162 IOCTL0C_def ENDS
;AN000;
164 INCLUDE COMMON.STC ;includes the following strucs ;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;
174 ;parm_list_entry STRUC ;used by parse_parameters and invoke ;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;
182 ;parm_list_entry ENDS ;AN000;
186 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ S T R U C T U R E S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
188 ROM
SEGMENT AT 0 ;AN000;
190 resseg
LABEL DWORD ;location of resident mode code vector ;AN000;
195 PRINTF_CODE
SEGMENT PUBLIC ;AN000;
196 ASSUME
CS:PRINTF_CODE
,DS:PRINTF_CODE
,SS:PRINTF_CODE
;AN000;
199 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;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;
212 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
215 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;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;
352 ;possible values of "request_type" ;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;
373 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ E X T R N S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
376 ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;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;
397 IOCTL0C_data_block IOCTL0C_def
<> ;AN000;
399 PUBLIC IOCTL0C_data_block
402 ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ D A T A ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
404 check_ANSI_installed PROC
NEAR ;See if ANSI.SYS is installed ;AC001;
406 MOV AH,ANSIINT2F
;AC001;
407 MOV AL,check_installed
;AC001;
409 .IF <AL EQ installed
> THEN
;AC001;
410 MOV ANSI_installed
,true
;initialized to false, so no ELSE needed ;AC001;
413 check_ANSI_installed ENDP
;AC001;
415 ;------------------------------------------------------------------------------
419 setup_device_name PROC
NEAR ;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;
426 setup_device_name ENDP
;AN000;
428 ;------------------------------------------------------------------------------- ;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;
438 MOV BX,AX ;BX=handle of CON ;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;
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;
448 POPF ;restore result of the IOCTL ;AN000;
452 do_IOCTL0C ENDP
;AN000;
454 ;------------------------------------------------------------------------------- ;AN000;
456 display_columns_status PROC
NEAR ;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;
464 MOV columns_ptr
,OFFSET fourty_str
;AN000;
467 MOV columns_ptr
,OFFSET NONE_str
;AN000;
469 display COLUMNS_equal_msg
;AN000;
473 display_columns_status ENDP
;AN000;
475 ;------------------------------------------------------------------------------- ;AN000;
477 display_lines_status PROC
NEAR ;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;
487 MOV row_ptr
,OFFSET NONE_str
;AN000;
489 display LINES_equal_msg
;AN000;
493 display_lines_status ENDP
;AN000;
495 ;-------------------------------------------------------------------------------
497 old_video_mode_set_IOCTL PROC
NEAR ;AN004;
499 MOV CL,set_display_characteristics
;AN000;
500 CALL do_IOCTL0C
;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;
508 MOV noerror
,false
;AN000;
509 .ENDIF
;AN000;carry ;AN000;
513 old_video_mode_set_IOCTL ENDP
;AN004;
516 ;------------------------------------------------------------------------------- ;AN000;
517 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
519 ;³ CHECK_COM_PORTS_ATTACHED
520 ;³ ------------------------
522 ;³ Return the number of com ports in the machine.
527 ;³ RETURN: com_ports_attached - number of com ports
533 ;³ USAGE: SI - index of the FOR loop and displacement from serial_base
534 ;³ ES - holds segment of ROM data area
537 ;³ ASSUMPTIONS: The user has initialized com_ports_attached to zero.
540 ;³ SIDE EFFECT: ES is lost
543 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
545 check_com_ports_attached PROC
NEAR
548 MOV ES,SI ;now ES:SERIAL_BASE addresses 40:0=0:400
550 .FOR
SI = 0 TO
6 STEP
2
552 .IF <<WORD PTR ES:SERIAL_BASE
[SI]> NE
0> THEN
;SEE IF THE COM PORT EXISTS
553 INC com_ports_attached
560 check_com_ports_attached ENDP
563 ;------------------------------------------------------------------------------- ;AN000;
564 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
566 ;³ CHECK_PRN_PORTS_ATTACHED
567 ;³ ------------------------
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.
578 ;³ RETURN: prn_ports_attached - number of printer ports
584 ;³ USAGE: SI - index of the FOR loop and displacement from printr
585 ;³ ES - holds segment of ROM data area (0 in this case)
588 ;³ ASSUMPTIONS: All valid printer port addresses are >2.
591 ;³ SIDE EFFECT: ES is lost
594 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
596 check_prn_ports_attached PROC
NEAR
600 MOV ES,SI ;now ES:printr addresses 40:8=0:408
602 .FOR
SI = 0 TO
4 STEP
2 ;for each of 3 printer port address holder words
604 .IF <<WORD PTR ES:printr
[SI]> GT redirected
> THEN
;SEE IF THE PORT EXISTS
605 INC prn_ports_attached
612 check_prn_ports_attached ENDP
615 ;------------------------------------------------------------------------------- ;AN000;
616 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
618 ;³ GET_DEVICE_RETRY_TYPE ;AN000;
619 ;³ --------------------- ;AN000;
621 ;³ Return the type of retry active for comX or lptX. ;AN000;
623 ;³ INPUT: device_request - scalar indicating what status the user requested. ;AN000;
624 ;³ use the following equates: ;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;
635 ;³ RETURN: returned_retry_type - scalar indicating type of retry active for ;AN000;
636 ;³ the requested device. compare with the following equates: ;AN000;
638 ;³ no_retry_flag ;AN000;
639 ;³ error_status ;AN000;
640 ;³ busy_status ;AN000;
641 ;³ ready_status ;AN000;
643 ;³ retry_type_ptr - set to proper string ;AN000;
646 ;³ MESSAGES: none ;AN000;
649 ;³ USAGE: CL - For com ports it serves as bit shift count for the retry type byte.
651 ;³ AL - On exit holds retry type scalar on exit (returned_retry_type) ;AN000;
653 ;³ ES - holds segment of resident mode code ;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;
661 ;³ ASSUMPTIONS: The user has initialized device_request on entry with ;AN000;
662 ;³ the equates provided. ;AN000;
665 ;³ SIDE EFFECT: none. ;AN000;
667 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
669 get_device_retry_type PROC
NEAR ;AN665;
671 PUBLIC get_device_retry_type
677 MOV ES,BX ;set segment to zero ;AN665;
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;
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;
691 MOV returned_retry_type
,no_retry_flag
;AN665;
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;
704 MOV retry_type_ptr
,OFFSET NONE_str
;not E, B or R. ;AN665;
711 get_device_retry_type ENDP
;AN665;
713 ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
715 ;³ ANALYZE_AND_INVOKE ;AN000;
716 ;³ ------------------ ;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;
727 ;³ INPUT: request_type - scalar indicating what operation the user requested. ;AN000;
732 ;³ RETURN: none ;AN000;
735 ;³ MESSAGES: none ;AN000;
741 ;³ USAGE: DI - index into the list of parsed parms, the array parm_list. ;AN000;
743 ;³ CX - temporary holder for memory to memory MOVs ;AN000;
746 ;³ CONVENTIONS: ;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;
753 ;³ The lines and columns values are in binary for request_type= ;AN000;
754 ;³ set_con_features ;AN000;
756 ;³ The codepage numbers were put into des_start_packet. ;AN000;
761 ;³ SIDE EFFECT: ;AN000;
764 ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;AN000;
766 analyze_and_invoke PROC
NEAR ;AX000; ;AN000;
769 ;CASE request_type= ;AN000;
771 MOV cp_cb
.des_pack_ptr
,OFFSET des_start_packet
;AX000;In case a codepage request ;AN000;
773 MOV DI,0 ;initialize index into the list of parsed parameters ;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;
783 jump_table1
LABEL WORD ;the order of the following entries is critical ;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;
804 all_con_status_case: ;know that all con status is requested ;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;
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;
818 MOV cp_cb
.request_typ
,status
;set up variables for modecp ;AN000;
819 MOV cp_cb
.cp_device
,OFFSET CON_str
;AN000;
821 CALL modecp
;display codepage status ;AN000;
826 codepage_prepare_case: ;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;
836 codepage_refresh_case: ;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;
847 codepage_select_case: ;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;
863 codepage_status_case: ;AN000;
864 codepage_prepared_status_case: ;AN000;
865 codepage_selected_status_case: ;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;
875 com_status_case: ;AN000;
877 ; INPUT: device_type = COMx
878 ; device = ASCII COM number
881 CALL check_com_ports_attached
;return number of com ports in com_ports_attached ;AN000;
883 .IF <device_name
EQ <OFFSET COM1_str
>> AND ;AN000;
884 .IF <com_ports_attached GE
1> THEN
;COM1 exists
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
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
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
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
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;
921 ; con_status_case: ;don't know which con status is requested ;AN000;
923 ; MOV request_type,all_con_status ;AC000;DCR76 ;AN000;
924 ; CALL analyze_and_invoke ;AC000;DCR76 ;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;
934 ; .WHILE <parm_list_BX[DI].parm_type NE bogus> DO ;the entry after the last has parm_type of bogus ;AN000;
936 ; ;CASE parm_list_BX[DI].item_tag= ;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;
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;
956 ; .IF <parm_list_BX[DI].item_tag EQ BLINK_item_tag> THEN ;AN000;
958 ; CALL display_blink_status ;AN000;
967 ; .IF <parm_list_BX[DI].item_tag EQ COLUMNS_item_tag> THEN ;AN000;
969 ; CALL display_COLUMNS_status ;AN000;
978 ; .IF <parm_list_BX[DI].item_tag EQ LINES_item_tag> THEN ;AN000;
980 ; CALL display_lines_status ;AN000;
988 ; ADD DI,TYPE parm_list_entry ;AN000;
996 initialize_com_port_case: ;AN000;
999 MOV BX,parm_list_holder
;restore parm_list_BX ;AN000;
1001 .IF <parms_form
EQ keyword
> THEN
;IF the parms were input as keywords THEN ;AN000;
1003 MOV DI,TYPE parm_list_entry
;skip COMN parm ;AN000;
1005 .WHILE <parm_list_BX
[DI].parm_type NE bogus
> DO
NEAR ;the entry after the last has parm_type of bogus ;AN000;
1007 ;CASE parm_list_BX[DI].keyword_switch_ptr= ;AN000;
1009 ;BAUD_equal: ;AN000;
1011 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET BAUD_equal
>> THEN
;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;
1021 ;PARITY_equal: ;AN000;
1023 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET PARITY_equal
>> THEN
;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;
1034 ;DATA_equal: ;AN000;
1036 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET DATA_equal
>> THEN
;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;
1047 ;STOP_equal: ;AN000;
1049 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET STOP_equal
>> THEN
;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;
1059 ;RETRY_equal: ;AN000;
1061 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET RETRY_equal_str
>> THEN
;AN000;
1063 MOV retry_index
,DI ;indicate to modecom which parm is retry ;AN000;
1071 ADD DI,TYPE parm_list_entry
;AN000;
1076 .ELSE ;the parms were entered as positionals (the old form) ;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;
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;
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;
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
1098 CALL modecom
;AN000;
1104 old_initialize_printer_port_case: ;Assume that parms not specified have an entry in parm_list that is in initial state;AN000;
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;
1112 PUBLIC old_initialize_printer_port_case
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;
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;
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;
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.
1135 CALL modeecno
;AN000;
1136 CALL modeprin
;AN000;
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;
1147 MOV BX,parm_list_holder
;restore parm_list_BX ;AN000;
1148 MOV DI,TYPE parm_list_entry
;skip LPTN parm ;AN000;
1150 .WHILE <parm_list_BX
[DI].parm_type NE bogus
> DO
;the entry after the last has parm_type of bogus ;AN000;
1152 ;CASE parm_list_BX[DI].keyword_switch_ptr= ;AN000;
1155 ;LINES_equal: ;AN000;
1157 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET LINES_equal
>> THEN
;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;
1167 ;COLUMNS_equal: ;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;
1172 .IF <parm_list_BX
[DI].item_tag
EQ onethirtytwo_item_tag
> THEN
;AN000;
1173 MOV columns_holder
,132 ;AN000;
1175 MOV columns_holder
,80 ;AN000;
1182 ;RETRY_equal: ;AN000;
1184 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET RETRY_equal_str
>> THEN
;AN000;
1186 MOV retry_index
,DI ;AN664;
1194 ADD DI,TYPE parm_list_entry
;AN000;
1199 CALL modeecno
;turn of rerouting ;AN000;
1200 CALL modeprin
;AN000;
1207 old_video_mode_set_case: ;AN000;
1209 PUBLIC old_video_mode_set_case
;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;
1226 .ELSEIF
<parm_list_BX
[DI].item_tag
EQ BW80_item_tag
> THEN
;IF BW80 REQUESTED ;AN000;
1228 .ELSEIF
<parm_list_BX
[DI].item_tag
EQ CO40_item_tag
> THEN
;IF CO40 REQUESTED ;AN000;
1230 .ELSEIF
<parm_list_BX
[DI].item_tag
EQ CO80_item_tag
> THEN
;IF CO80 REQUESTED ;AN000;
1232 .ELSEIF
<parm_list_BX
[DI].item_tag
EQ MONO_item_tag
> THEN
;IF MONO REQUESTED ;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;
1240 MOV IOCTL0C_data_block
.cols
,80 ;setup IOCTL input block with the columns requested ;AN000;
1242 CALL old_video_mode_set_IOCTL
;AN004;use IOCTL if possible to retain lines setting ;AN000;
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;
1247 MOV BL,80 ;set up for handle_40_or_80 ;AN000;
1249 CALL HANDLE_40_OR_80
;AN000;
1257 POP DI ;restore parm list index ;AN000;
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;
1288 PUBLIC printer_reroute_case
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;
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;
1299 SAL AH,CL ;AH=2**SI,AH=printer number mask for MODEECHO ;AN000;
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;
1311 printer_status_case: ;AN000;
1313 PUBLIC printer_status_case
1315 ; INPUT: device_type = LPTx
1316 ; device = ASCII printer number
1317 ; lptno = ASCII printer number
1318 ; device_name = offset of printer string
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;
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
1344 PUSH ES ;save ES, used in MODECP ;AC002;
1345 ;AC002;PUSH AX ;AN000;save
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;
1365 set_con_features_case: ;the command line was nothing but con keywords ;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;
1374 MOV IOCTL0C_data_block
.mode
,text
;AN000;
1376 .ENDIF
;ANSI.SYS installed ;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;
1382 ;CASE parm_list_BX[DI].keyword_switch_ptr= ;AN000;
1385 ;LINES_equal: ;AN000;
1387 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET LINES_equal
>> THEN
;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;
1397 ;COLUMNS_equal: ;the value is binary ;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;
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;
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;
1410 MOV columns_specified
,80 ;set up for handle_40_or_80 ;AN000;
1418 ;RATE_equal: ;AN000;
1420 .IF <parm_list_BX
[DI].keyword_switch_ptr
EQ <OFFSET RATE_equal
>> THEN
;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;
1430 ;DELAY_equal: ;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;
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;
1444 ADD DI,TYPE parm_list_entry
;address next parm ;AN000;
1449 PUBLIC DUMMY3
;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;
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;
1462 MOV noerror
,false
;AN000;
1465 DISPLAY ANSI_not_loaded
;AN000;
1466 MOV noerror
,false
;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;
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;
1482 status_for_everything_case: ;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;
1492 MOV request_type
,all_con_status
;AN000;
1493 CALL analyze_and_invoke
;AN000;
1495 CALL check_com_ports_attached
;return number of com ports in com_ports_attached ;AN000;
1497 MOV request_type
,com_status
;AN000;
1498 MOV CL,com_ports_attached
;AN000;
1499 .FOR i
= 1 TO
CL ;AN000;
1503 .WHEN
<i
EQ 1> ;AN000;
1504 MOV device_name
,OFFSET COM1_str
;AN000; ;AN000;
1506 .WHEN
<i
EQ 2> ;AN000;
1507 MOV device_name
,OFFSET COM2_str
;AN000;
1509 .WHEN
<i
EQ 3> ;AN000;
1510 MOV device_name
,OFFSET COM3_str
;AN000;
1512 .WHEN
<i
EQ 4> ;AN000;
1513 MOV device_name
,OFFSET COM4_str
;AN0;AN000;
1517 CALL analyze_and_invoke
;AN000; ;AN000;
1524 turn_off_reroute_case: ;user specified only LPTx[:] ;AN000;
1525 ;INPUT:lptno=ASCII printer number
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;
1545 analyze_and_invoke ENDP
;AN000;
1548 PRINTF_CODE ENDS
;AN000;