summaryrefslogtreecommitdiff
path: root/v4.0/src/SELECT/MACROS6.INC
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/SELECT/MACROS6.INC')
-rw-r--r--v4.0/src/SELECT/MACROS6.INC719
1 files changed, 719 insertions, 0 deletions
diff --git a/v4.0/src/SELECT/MACROS6.INC b/v4.0/src/SELECT/MACROS6.INC
new file mode 100644
index 0000000..954e232
--- /dev/null
+++ b/v4.0/src/SELECT/MACROS6.INC
@@ -0,0 +1,719 @@
1;;**************************************************************************** ;;AN000;
2;; Assembler MACROS for use with SELECT. ;;AN000;
3;; File: MACROS6.INC ;;AN000;
4;; Latest Change Date: July 27, 1987 ;;AN000;
5;; ;;AN000;
6;; These macros define powerful assembler verbs neccessary for SELECT. ;;AN000;
7;; ;;AN000;
8;; Note: Many of the macros make use of an ASCII-N string for passing ;;AN000;
9;; parameters. The string is defined below. ;;AN000;
10;; DW count ;;AN000;
11;; DB "string_variable",? ;;AN000;
12;; ;;AN000;
13;; COUNT is the length of the string and is a word. ;;AN000;
14;; It is necessary to follow the string with at least one byte for the ;;AN000;
15;; purpose of changing the ASCII-N string to an ASCII-Z string. ;;AN000;
16;; ;;AN000;
17;;**************************************************************************** ;;AN000;
18page ;;AN000; ;;AN000;
19;;**************************************************************************** ;;AN000;
20;; ;;AN000;
21;; SCAN_PARAMETERS: Scan SELECT command line for parameters. ;;AN000;
22;; ;;AN000;
23;; SYNTAX: SCAN_PARAMETERS mode ;;AN000;
24;; ;;AN000;
25;; INPUT: ;;AN000;
26;; PSP command line ;;AN000;
27;; ;;AN000;
28;; OUTPUT: ;;AN000;
29;; mode = Install mode ;;AN000;
30;; = 0: Parameter is MENU ;;AN000;
31;; = 1: Parameter is FDISK ;;AN000;
32;; = 0FFH: Parameter is invalid ;;AN000;
33;; ;;AN000;
34;; OPERATION: The SELECT command line is scanned for parameters. The ;;AN000;
35;; return codes for the various parameters are provided in variables ;;AN000;
36;; defined above. ;;AN000;
37;; ;;AN000;
38;; Note: ;;AN000;
39;; Before this macro is executed, there must be as ASSUME ES:DATA ;;AN000;
40;; statement. If not, the parser will not execute properly and ;;AN000;
41;; either the computer will hang or erroneous values will be returned. ;;AN000;
42;; ;;AN000;
43;;**************************************************************************** ;;AN000;
44SCAN_PARAMETERS MACRO MODE ;;AN000;
45 ;;AN000;
46 CALL SCAN_PARAMETERS_ROUTINE ;;AN000;
47 MOV MODE, AX ;;AN000;
48 ENDM ;;AN000;
49;;**************************************************************************** ;;AN000;
50;; ;;AN000;
51;; SCAN_INFO_FILE: Scan SELECT.TMP for parameters. ;;AN000;
52;; ;;AN000;
53;; SYNTAX: SCAN_INFO_FILE option_0, option_1, option_2, option_3, path, filename, buffer, buff_size ;;AC033;SEH add option_3 parameter
54;; ;;AN000;
55;; INPUT: ;;AN000;
56;; filename = The name of the file which contains the FDISK parameters. ;;AN000;
57;; (ASCII-N format) ;;AN000;
58;; buffer = A buffer where the data read from the file can be stored. ;;AN000;
59;; buff_size = The size of the buffer. ;;AN000;
60;; ;;AN000;
61;; OUTPUT: ;;AN000;
62;; option_1 = 1 ;;AC033;
63;; = 2 ;;AC033;
64;; = 3 ;;AC033;
65;; = 0FFh: Parameter is invalid (not 1, 2, 3) ;;AC033;
66;; option_2 = 1 ;;AC033;
67;; = 2 ;;AC033;
68;; = 0FFh: Parameter is invalid (not 1, 2) ;;AC033;
69;; option_3 = 1 ;;AC033;
70;; = 2 ;;AC033;
71;; = 0FFh: Parameter is invalid (not 1, 2) ;;AC033;
72;; path = Install path in ASCII-N format ;;AN000;
73;; ;;AN000;
74;; OPERATION: ;;AN000;
75;; If the parameter on the command line is FDISK, then the ;;AN000;
76;; file specified in FILENAME is opened and additional parameters ;;AN000;
77;; are read. If the parameters in the file are invalid, or if the file ;;AN000;
78;; cannot be found, then 0FFh is returned in MODE and OPTION, and the ;;AN000;
79;; path length is set to zero. ;;AN000;
80;; ;;AN000;
81;;**************************************************************************** ;;AN000;
82SCAN_INFO_FILE MACRO OPTION_0, OPTION_1, OPTION_2, OPTION_3, PATH, FILENAME, BUFFER, BUFF_SIZE
83 ;;AN000;
84 MOV AX, OFFSET PATH ;;AN000;
85 PUSH AX ;;AN000;
86 MOV AX, OFFSET FILENAME ;;AN000;
87 PUSH AX ;;AN000;
88 MOV AX, OFFSET BUFFER ;;AN000;
89 PUSH AX ;;AN000;
90 MOV AX, BUFF_SIZE ;;AN000;
91 PUSH AX ;;AN000;
92 CALL SCAN_INFO_FILE_ROUTINE ;;AN000;
93 mov option_0, ax
94 MOV OPTION_1, BX ;;AN000;
95 MOV OPTION_2, CX ;;AN000;
96 MOV OPTION_3, DX ;;AN033;SEH return OPTION_3, also
97 ENDM ;;AN000;
98;;**************************************************************************** ;;AN000;
99;; ;;AN000;
100;; COPY_FILES: Copy a list of files from the A diskette to either the B ;;AN000;
101;; or C drive. ;;AN000;
102;; ;;AN000;
103;; SYNTAX: COPY_FILES target_disk, file_table, num_files, path ;;AN000;
104;; ;;AN000;
105;; INPUT: ;;AN000;
106;; target_disk = 1: Copy the files to the B drive ;;AN000;
107;; = 2: Copy the files to the C drive ;;AN000;
108;; ;;AN000;
109;; path = The path where the files are to be copied if the ;;AN000;
110;; destination is the hard disk. ;;AN000;
111;; ;;AN000;
112;; file_table = A table listing the files to copy. It is of the ;;AN000;
113;; following format. ;;AN000;
114;; ;;AN000;
115;; db filename ;;AN000;
116;; ;;AN000;
117;; - The filename must be padded out to 12 characters. ;;AN000;
118;; ;;AN000;
119;; num_files = The number of files in the list. ;;AN000;
120;; ;;AN000;
121;; OUTPUT: ;;AN000;
122;; None. ;;AN000;
123;; ;;AN000;
124;; OPERATION: The files listed in the table are copied to the destination ;;AN000;
125;; from the A drive. If the destination is C, then a path ;;AN000;
126;; path can be specified. ;;AN000;
127;; ;;AN000;
128;;**************************************************************************** ;;AN000;
129COPY_FILES MACRO DEST, FILE_TABLE, NUM_FILES ;;AN000;
130 ;;AN000;
131 MOV AX, DEST ;;AN000;
132 MOV BX, OFFSET FILE_TABLE ;;AN000;
133 MOV CX, NUM_FILES ;;AN000;
134 CALL HOOK_INT_24 ;AN000;JW ;;AN000;JW
135 CALL MOD_XCOPY ;;AN000;
136 CALL RESTORE_INT_24 ;AN000;JW ;;AN000;JW
137 ENDM ;;AN000;
138 ;;AN000;JW
139COPY_FILES2 MACRO DEST, FILE_TABLE, NUM_FILES, PATH ;;AN111;JW
140 ;;AN111;JW
141 MOV AX, DEST ;;AN111;JW
142 MOV BX, OFFSET FILE_TABLE ;;AN111;JW
143 MOV CX, NUM_FILES ;;AN111;JW
144 MOV SI, OFFSET PATH ;;AN111;JW
145 CALL HOOK_INT_24 ;AN000;JW ;;AN111;JW
146 CALL MOD_XCOPY ;;AN111;JW
147 CALL RESTORE_INT_24 ;AN000;JW ;;AN111;JW
148 ENDM ;;AN111;JW
149 ;;AN000;
150;;**************************************************************************** ;;AN000;
151;; ;;AN000;
152;; INSTALL_FILES: Install the files from the original diskettes to the ;;AN000;
153;; startup and the operations diskette. ;;AN000;
154;; ;;AN000;
155;; SYNTAX: INSTALL_FILES source_disk, target_disk ;;AN000;
156;; ;;AN000;
157;; INPUT: ;;AN000;
158;; source_disk = 1: Read the files from the first diskette ;;AN000;
159;; = 2: Read the files from the second diskette ;;AN000;
160;; ;;AN000;
161;; target_disk = 1: Copy the files to the start-up diskette ;;AN000;
162;; = 2: Copy the files to the operations diskette ;;AN000;
163;; = 3: Copy the files to the hard disk ;;AN000;
164;; ;;AN000;
165;; OUTPUT: ;;AN000;
166;; None. ;;AN000;
167;; ;;AN000;
168;; OPERATION: ;;AN000;
169;; ;;AN000;
170;;**************************************************************************** ;;AN000;
171INSTALL_FILES MACRO SOURCE_DISK, TARGET_DISK ;;AN000;
172 ;;AN000;
173 COPY_FILES SOURCE_DISK, TARGET_DISK, S_INSTALL_PATH, DOS_FILES, NUM_DOS_FILES ;;AN000;
174 ENDM ;;AN000;
175;;**************************************************************************** ;;AN000;
176;; ;;AN000;
177;; GET_PRINTER_TITLES: Read the printer profile file and load the printer ;;AN000;
178;; names into a table. ;;AN000;
179;; ;;AN000;
180;; SYNTAX: GET_PRINTER_TITLES filename ;;AN000;
181;; ;;AN000;
182;; INPUT: ;;AN000;
183;; filename = A ASCII-N string containing the name of the file containing ;;AN000;
184;; the printer profile. ;;AN000;
185;; ;;AN000;
186;; OUTPUT: ;;AN000;
187;; If CY = 0, No error was encountered. The following information is returned: ;;AN000;
188;; SEGMENT_LOCATION = The segment where the printer names table is held ( 16 bit ) ;;AN000;
189;; NAMES_TABLE_OFFSET = The offset in the segment of the printer names table ( 16 bit ) ;;AN000;
190;; LONGEST_NAME = The longest printer name in the file ( 16 bit ) ;;AN000;
191;; SIZE_NAMES_TABLE_ENTRY = The number of bytes between each printer name in the table (abs value ) ;;AN000;
192;; PRINTER_NAME_INDEX = The number of names in the table. ( 16 bit ) ;;AN000;
193;; If CY = 1, An error was encountered. ;;AN000;
194;; BX - Contains an error number as defined below. ;;AN000;
195;; AX - Contains the DOS error number if the error listed in BX is a ;;AN000;
196;; file related error. ;;AN000;
197;; ;;AN000;
198;; Error number Explaination. ;;AN000;
199;; ;;AN000;
200;; 1 There is not enough memory to build the names ;;AN000;
201;; table and provide a data buffer for reading the ;;AN000;
202;; file information. ;;AN000;
203;; ;;AN000;
204;; 2 There was an error opening the printer profile file. ;;AN000;
205;; AX contains the DOS error code. ;;AN000;
206;; ;;AN000;
207;; 3 There was an error reading the printer profile file. ;;AN000;
208;; AX contains the DOS error code. ;;AN000;
209;; ;;AN000;
210;; 4 The number at the beginning of the printer profile ;;AN000;
211;; giving the number of definitions in the file was ;;AN000;
212;; either missing or was greater then 255. ;;AN000;
213;; ;;AN000;
214;; 5 A line in the printer profile file was found to ;;AN000;
215;; be longer then allowed in the buffer. ;;AN000;
216;; ;;AN000;
217;; 6 There was an error find a printer name in the file ;;AN000;
218;; ;;AN000;
219;; 7 There was an error updating the file pointer ;;AN000;
220;; ;;AN000;
221;; 8 There are more then 255 printer definitions in the ;;AN000;
222;; file. ;;AN000;
223;; ;;AN000;
224;; 9 The number of actual definitions in the printer profile ;;AN000;
225;; file did not agree with the number given at the ;;AN000;
226;; beginning of the file. ;;AN000;
227;; ;;AN000;
228;; 10 There was an error allocating the memory needed for ;;AN000;
229;; the data. ;;AN000;
230;; ;;AN000;
231;; ;;AN000;
232;; OPERATION: ;;AN000;
233;; ;;AN000;
234;;**************************************************************************** ;;AN000;
235GET_PRINTER_TITLES MACRO FILENAME ;;AN000;
236 ;;AN000;
237 MOV DI, OFFSET FILENAME ; The name of the printer definition file ;;AN000;
238 CALL GET_PRINTER_TITLES_ROUTINE ; Subroutine to perform the function. ;;AN000;
239 ENDM ;;AN000;
240;;**************************************************************************** ;;AN000;
241;; ;;AN000;
242;; GET_PRINTER_INFO: Given the number of a printer, this routines retrieves ;;AN000;
243;; the information for this printer from the profile file. ;;AN000;
244;; ;;AN000;
245;; SYNTAX: GET_PRINTER_INFO printer_num ;;AN000;
246;; ;;AN000;
247;; INPUT: ;;AN000;
248;; printer_num = The number the printer to get the information on. ;;AN000;
249;; The number is the location of this printer in the ;;AN000;
250;; printer names list. ;;AN000;
251;; OUTPUT: ;;AN000;
252;; If CY = 0, there were no errors. ;;AN000;
253;; The following variable are updated with the information found in ;;AN000;
254;; the file: ;;AN000;
255;; I_PRINTER ;;AN000;
256;; N_PRINTER_TYPE ;;AN000;
257;; S_MODE_PARM ;;AN000;
258;; S_CP_DRIVER ;;AN000;
259;; S_CP_PREPARE ;;AN000;
260;; S_GRAPH_PARM ;;AN000;
261;; ;;AN000;
262;; If CY = 1, There were errors encountered. ;;AN000;
263;; BX = An error code indicating the type of error that occured. ;;AN000;
264;; ;;AN000;
265;; = 3 There was an error reading the file ;;AN000;
266;; = 7 There was a error accessing the file ;;AN000;
267;; = 11 A printer definition has either a CDP or a CPP ;;AN000;
268;; Prefix, but BOTH were not present. ;;AN000;
269;; = 12 There was an error in the printer definition. ;;AN000;
270;; - A line was found with an invalid prefix ;;AN000;
271;; ;;AN000;
272;; If the error was a result of a DOS function, then ;;AN000;
273;; on return, AX will contain the DOS error code. ;;AN000;
274;; ;;AN000;
275;; OPERATION: ;;AN000;
276;; ;;AN000;
277;;**************************************************************************** ;;AN000;
278GET_PRINTER_INFO MACRO VAR_PRT ;;AN000;
279 ;;AN000;
280 MOV AX, VAR_PRT ;;AN000;
281 CALL GET_PRINTER_INFO_ROUTINE ;;AN000;
282 ENDM ;;AN000;
283 ;;AN000;
284;;**************************************************************************** ;;AN000;
285;; ;;AN000;
286;; RELEASE_PRINTER_INFO: Close the printer profile file and free the ;;AN000;
287;; allocated memory. ;;AN000;
288;; ;;AN000;
289;; SYNTAX: RELEASE_PRINTER_INFO ;;AN000;
290;; ;;AN000;
291;; INPUT: ;;AN000;
292;; None. ;;AN000;
293;; ;;AN000;
294;; OUTPUT: ;;AN000;
295;; If CY = 0, There were no error encountered. ;;AN000;
296;; If CY = 1, There was an error. ;;AN000;
297;; AX = The DOS error code for the deallocate memory function ;;AN000;
298;; ;;AN000;
299;; OPERATION: Closes the printer profile file and deallocted memory. ;;AN000;
300;; ;;AN000;
301;;**************************************************************************** ;;AN000;
302RELEASE_PRINTER_INFO MACRO ;;AN000;
303 ;;AN000;
304 CALL RELEASE_PRINTER_INFO_ROUTINE ;;AN000;
305 ENDM ;;AN000;
306;;**************************************************************************** ;;AN000;
307;; ;;AN000;
308;; GET_PRINTER_PARAMS: Get parameters for specified printer. ;;AN000;
309;; ;;AN000;
310;; SYNTAX: GET_PRINTER_PARAMS var_prt, var_port, var_status ;;AN000;
311;; ;;AN000;
312;; INPUT: ;;AN000;
313;; var_prt = The printer number. ;;AN000;
314;; var_port = The number of the port to retrieve the information on. ;;AN000;
315;; If var_port = 0, the information that is returned is ;;AN000;
316;; that which cooresponds to var_prt. ;;AN000;
317;; var_port = 0 : Get the information on printer number VAR_PRT ;;AN000;
318;; = 1 : Get the information for the printer attached to LPT1 ;;AN000;
319;; = 2 : Get the information for the printer attached to LPT2 ;;AN000;
320;; = 3 : Get the information for the printer attached to LPT3 ;;AN000;
321;; = 4 : Get the information for the printer attached to COM1 ;;AN000;
322;; = 5 : Get the information for the printer attached to COM2 ;;AN000;
323;; = 6 : Get the information for the printer attached to COM3 ;;AN000;
324;; = 7 : Get the information for the printer attached to COM4 ;;AN000;
325;; ;;AN000;
326;; OUTPUT: ;;AN000;
327;; var_status = 1: Printer information is valid ;;AN000;
328;; = 0: Printer not valid: default values returned ;;AN000;
329;; ;;AN000;
330;; OPERATION: Printer information for the specified printer is returned. ;;AN000;
331;; If the specified printer is not defined, default values will be ;;AN000;
332;; returned. ;;AN000;
333;; I_PRINTER = Index into printer list (16 bit variable) : default 1 ;;AN000;
334;; N_PRINTER_TYPE = P: Parallel printer ;;AN000;
335;; = S: Serial printer ;;AN000;
336;; I_PORT = Port number (16 bit variable) : default 1 ;;AN000;
337;; I_REDIRECT = Redirection port number (16 bit variable) : default 1 ;;AN000;
338;; S_MODE_PARM = Mode parameters - ASCII-N format ;;AN000;
339;; S_CP_DRIVER = Code page driver parameters - ASCII-N format ;;AN000;
340;; S_CP_PREPARE = Code prepare parameters - ASCII-N format ;;AN000;
341;; S_GRAPH_PARM = Graphics parameters - ASCII-N format ;;AN000;
342;; ;;AN000;
343;; The structures of printer information are searched for the one with ;;AN000;
344;; the same number as specified by VAR_PRT. If found, the information ;;AN000;
345;; in that structure is returned in the variables listed above. ;;AN000;
346;; ;;AN000;
347;;**************************************************************************** ;;AN000;
348GET_PRINTER_PARAMS MACRO VAR_PRT, VAR_PORT, VAR_STATUS ;;AN000;
349 ;;AN000;
350 MOV AX, VAR_PRT ;;AN000;
351 MOV BX, VAR_PORT ;;AN000;
352 CALL GET_PRINTER_PARAMS_ROUTINE ;;AN000;
353 MOV VAR_STATUS, AX ;;AN000;
354 ENDM ;;AN000;
355;;**************************************************************************** ;;AN000;
356;; ;;AN000;
357;; SAVE_PRINTER_PARAMS: Save the printer information in the printer structures ;;AN000;
358;; ;;AN000;
359;; SYNTAX: SAVE_PRINTER_PARAMS var_prt ;;AN000;
360;; ;;AN000;
361;; INPUT: ;;AN000;
362;; var_prt = The printer number. ;;AN000;
363;; ;;AN000;
364;; OUTPUT: ;;AN000;
365;; None. ;;AN000;
366;; ;;AN000;
367;; OPERATION: Printer information for the specified printer is stored. ;;AN000;
368;; I_PRINTER = Index into printer list (16 bit variable) : default 1 ;;AN000;
369;; N_PRINTER_TYPE = P: Parallel printer ;;AN000;
370;; = S: Serial printer ;;AN000;
371;; I_PORT = Port number (16 bit variable) : default 1 ;;AN000;
372;; I_REDIRECT = Redirection port number (16 bit variable) : default 1 ;;AN000;
373;; S_MODE_PARM = Mode parameters - ASCII-N format ;;AN000;
374;; S_CP_DRIVER = Code page driver parameters - ASCII-N format ;;AN000;
375;; S_CP_PREPARE = Code prepare parameters - ASCII-N format ;;AN000;
376;; S_GRAPH_PARM = Graphics parameters - ASCII-N format ;;AN000;
377;; ;;AN000;
378;; The information is stored in the structures according to the type ;;AN000;
379;; and port number of this printer. The first three structures are for ;;AN000;
380;; LPT1 - LPT3, while the next four are for COM1 - COM2. ;;AN000;
381;; ;;AN000;
382;;**************************************************************************** ;;AN000;
383SAVE_PRINTER_PARAMS MACRO VAR_PRT ;;AN000;
384 ;;AN000;
385 MOV AX, VAR_PRT ;;AN000;
386 CALL SAVE_PRINTER_PARAMS_ROUTINE ;;AN000;
387 ENDM ;;AN000;
388;;**************************************************************************** ;;AN000;
389;; ;;AN000;
390;; CHANGE_AUTOEXEC: Search for the SELECT command in the autoexec.bat and ;;AN000;
391;; change the parameters for that line. ;;AN000;
392;; ;;AN000;
393;; SYNTAX: CHANGE_AUTOEXEC FILENAME, APPEND_STRING ;;AN000;
394;; ;;AN000;
395;; INPUT: ;;AN000;
396;; FILENAME = An ASCII-N string containing the name of the file to change. ;;AN000;
397;; Since the string has to be converted into an ASCII-Z string, ;;AN000;
398;; an extra byte must always be available following the string. ;;AN000;
399;; APPEND_STRING = An ASCII-N string containing the parameters to add to ;;AN000;
400;; the SELECT command. ;;AN000;
401;; ;;AN000;
402;; OUTPUT: ;;AN000;
403;; None. ;;AN000;
404;; ;;AN000;
405;; OPERATION: ;;AN000;
406;; ;;AN000;
407;;**************************************************************************** ;;AN000;
408CHANGE_AUTOEXEC MACRO FILENAME, APPEND_STRING ;;AN000;
409 ;;AN000;
410 MOV DI, OFFSET FILENAME ;;AN000;
411 MOV SI, OFFSET APPEND_STRING ;;AN000;
412 CALL CHANGE_AUTOEXEC_ROUTINE ;;AN000;
413 ENDM ;;AN000;
414 ;;AN000;
415;;**************************************************************************** ;;AN000;
416;; ;;AN000;
417;; LOAD_MESSAGES: Load the messages and initialize the message retriever. ;;AN000;
418;; ;;AN000;
419;; SYNTAX: LOAD_MESSAGES ;;AN000;
420;; ;;AN000;
421;; INPUT: ;;AN000;
422;; None. ;;AN000;
423;; ;;AN000;
424;; OUTPUT: ;;AN000;
425;; If CY = 1, there was an error loading the messages. ;;AN000;
426;; If CY = 0, there were no errors. ;;AN000;
427;; ;;AN000;
428;; OPERATION: ;;AN000;
429;; ;;AN000;
430;;**************************************************************************** ;;AN000;
431LOAD_MESSAGES MACRO ;;AN000;
432 ;;AN000;
433 CALL SYSLOADMSG ;;AN000;
434 ENDM ;;AN000;
435;;**************************************************************************** ;;AN000;
436;; ;;AN000;
437;; DISPLAY_MESSAGE: Call the message retriever to display a message. ;;AN000;
438;; ;;AN000;
439;; SYNTAX: DISPLAY_MESSAGE msg_number ;;AN000;
440;; ;;AN000;
441;; INPUT: ;;AN000;
442;; msg_number = The number of the message to be displayed. (16 bit value) ;;AN000;
443;; ;;AN000;
444;; OUTPUT: ;;AN000;
445;; If CY = 1, there was an error displaying the message. ;;AN000;
446;; If CY = 0, there were no errors. ;;AN000;
447;; ;;AN000;
448;; OPERATION: ;;AN000;
449;; ;;AN000;
450;;**************************************************************************** ;;AN000;
451DISPLAY_MESSAGE MACRO MSG_NUMBER ;;AN000;
452 ;;AN000;
453 MOV AX, MSG_NUMBER ;;AN000;
454 CALL DISPLAY_MESSAGE_ROUTINE ;;AN000;
455 ENDM ;;AN000;
456;;**************************************************************************** ;;AN000;
457;; ;;AN000;
458;; CHECK_DOS_PATH: Check to see if a path for the SET PATH command is valid ;;AN000;
459;; ;;AN000;
460;; SYNTAX: CHECK_DOS_PATH path_str ;;AN000;
461;; ;;AN000;
462;; INPUT: ;;AN000;
463;; path_str - An ASCII-N string containing the path to check. ;;AN000;
464;; ;;AN000;
465;; OUTPUT: ;;AN000;
466;; If CY = 0, the path is valid. ;;AN000;
467;; If CY = 1, The path is NOT valid: ;;AN000;
468;; ;;AN000;
469;; OPERATION: ;;AN000;
470;; ;;AN000;
471;;**************************************************************************** ;;AN000;
472CHECK_DOS_PATH MACRO PATH_STR ;;AN000;
473 ;;AN000;
474 LEA SI, PATH_STR ;;AN000;
475 CALL CHECK_DOS_PATH_ROUTINE ;;AN000;
476 ENDM ;;AN000;
477;;**************************************************************************** ;;AN000;
478;; ;;AN000;
479;; CHECK_PATH: Check to see if a path is valid. ;;AN000;
480;; ;;AN000;
481;; SYNTAX: CHECK_PATH path_str, drive, root ;;AN000;
482;; ;;AN000;
483;; INPUT: ;;AN000;
484;; path_str - An ASCII-N string containing the path to check. ;;AN000;
485;; ;;AN000;
486;; drive = 0: Drive letter cannot be specified. (8 bit or immediate value) ;;AN000;
487;; = 1: Drive letter is optional and can be specified. ;;AN000;
488;; = 2: Drive letter must be specified. ;;AN000;
489;; ;;AN000;
490;; root = 0: First non-drive character cannot be a backslash ('\') (8 bit or immediate value) ;;AN000;
491;; = 1: First non-drive character may be a backslash ('\') ;;AN000;
492;; = 2: First non-drive character must be a backslash ('\') ;;AN000;
493;; ;;AN000;
494;; OUTPUT: ;;AN000;
495;; If CY = 0, the path is valid. ;;AN000;
496;; If CY = 1, The path is NOT valid: ;;AN000;
497;; AX = 1, The drive specified is invalid. ;;AN000;
498;; = 2, There was no drive specified. ;;AN000;
499;; = 3, There was a drive specified. ;;AN000;
500;; = 4, There was a leading backslash ;;AN000;
501;; = 5, The leading backslash was NOT present. ;;AN000;
502;; = 6, There was a trailing backslash. ;;AN000;
503;; ;;AN000;
504;; OPERATION: ;;AN000;
505;; ;;AN000;
506;;**************************************************************************** ;;AN000;
507CHECK_PATH MACRO PATH_STR, DRIVE, ROOT ;;AN000;
508 ;;AN000;
509 LEA SI, PATH_STR ;;AN000;
510 MOV DI, SI ;;AN000;
511 CALL POS_ZERO ;;AN000;
512 MOV CX, [SI] ;;AN000;
513 ADD SI, 2 ;;AN000;
514 MOV AL, DRIVE ;;AN000;
515 MOV AH, ROOT ;;AN000;
516 CALL CHECK_VALID_PATH ;;AN000;
517 ENDM ;;AN000;
518;;**************************************************************************** ;;AN000;
519;; ;;AN000;
520;; GET_NUMBER_PORTS: Get the number of parallel and serial ports attached ;;AN000;
521;; to the computer. ;;AN000;
522;; ;;AN000;
523;; SYNTAX: GET_NUMBER_PORTS parallel, serial ;;AN000;
524;; ;;AN000;
525;; INPUT: ;;AN000;
526;; None. ;;AN000;
527;; ;;AN000;
528;; OUTPUT: ;;AN000;
529;; parallel = The number of parallel ports attached. (8 bit value) ;;AN000;
530;; serial = The number of serial ports attached. (8 bit value) ;;AN000;
531;; ;;AN000;
532;; OPERATION: The macro performs a call to interrupt 11H to determine ;;AN000;
533;; the number of ports available. ;;AN000;
534;; ;;AN000;
535;;**************************************************************************** ;;AN000;
536GET_NUMBER_PORTS MACRO PARALLEL, SERIAL ;;AN000;
537 ;;AN000;
538 INT 11H ;; Determine equipment attached ;;AN000;
539 SHR AH, 1 ;; Put the number of serial ports in L.S. Bits ;;AN000;
540 MOV BH, 0 ;;AN000;
541 MOV BL, AH ;;AN000;
542 MOV SERIAL, BX ;;AN000;
543 AND SERIAL, 0000000000000111B ;; Mask off the unwanted information ;;AN000;
544 MOV CL, 5 ;; Number of bits to shift ;;AN000;
545 SHR AH, CL ;; Put the number of parallel ports in L.S. Bits ;;AN000;
546 MOV BL, AH ;;AN000;
547 MOV PARALLEL, BX ;; Store ;;AN000;
548 AND PARALLEL, 0000000000000011B ;; Mask off the unwanted infromation ;;AN000;
549 ENDM ;;AN000;
550;;**************************************************************************** ;;AN000;
551;; ;;AN000;
552;; CHANGE_ATTRIBUTE: Change the attributes on a group of file to be hidden ;;AN000;
553;; files. ;;AN000;
554;; ;;AN000;
555;; SYNTAX: CHANGE_ATTRIBUTE list_ptr, num_files ;;AN000;
556;; ;;AN000;
557;; INPUT: ;;AN000;
558;; list_ptr = A pointer to a the list of files to change the attributes ;;AN000;
559;; of. The list must be of the form: ;;AN000;
560;; db filename,?,? ;;AN000;
561;; Where the filename takes up 12 bytes. ;;AN000;
562;; num_file = The number of files in the list. ;;AN000;
563;; ;;AN000;
564;; OUTPUT: ;;AN000;
565;; If CY = 1, there was an error encountered. ;;AN000;
566;; If CY = 0, there were no errors. ;;AN000;
567;; ;;AN000;
568;; OPERATION: The macro reads the attribute of the file, stores it in the ;;AN000;
569;; word following the filename in the list, and then assigns the new ;;AN000;
570;; attribute to the file. ;;AN000;
571;; ;;AN000;
572;;**************************************************************************** ;;AN000;
573CHANGE_ATTRIBUTE MACRO LIST_PTR, NUM_FILES ;;AN000;
574 ;;AN000;
575 LEA SI, LIST_PTR ;; Get the address of the file list ;;AN000;
576 MOV AX, 0 ;; Indicate we are to attach a new attribute to the file ;;AN000;
577 MOV BX, NUM_FILES ;; Load the number of files in the list ;;AN000;
578 CALL CHANGE_ATTRIBUTE_ROUTINE ;; Change the attributes ;;AN000;
579 ENDM ;;AN000;
580;;**************************************************************************** ;;AN000;
581;; ;;AN000;
582;; RESTORE_ATTRIBUTE: Restore the original attributes on a group of file. ;;AN000;
583;; ;;AN000;
584;; SYNTAX: RESTORE_ATTRIBUTE list_ptr, num_files ;;AN000;
585;; ;;AN000;
586;; INPUT: ;;AN000;
587;; list_ptr = A pointer to a the list of files to change the attributes ;;AN000;
588;; of. The list must be of the form: ;;AN000;
589;; db filename,?,? ;;AN000;
590;; Where the filename takes up 12 bytes. ;;AN000;
591;; num_files = The number of files in the list. ;;AN000;
592;; ;;AN000;
593;; OUTPUT: ;;AN000;
594;; If CY = 1, there was an error encountered. ;;AN000;
595;; If CY = 0, there were no errors. ;;AN000;
596;; ;;AN000;
597;; OPERATION: This macros restores the attribute previously stored for the ;;AN000;
598;; listed files. ;;AN000;
599;; ;;AN000;
600;;**************************************************************************** ;;AN000;
601RESTORE_ATTRIBUTE MACRO LIST_PTR, NUM_FILES ;;AN000;
602 ;;AN000;
603 LEA SI, LIST_PTR ;; Get the address of the file list ;;AN000;
604 MOV AX, 1 ;; Indicate we are to attach a new attribute to the file ;;AN000;
605 MOV BX, NUM_FILES ;; Load the number of files in the list ;;AN000;
606 CALL CHANGE_ATTRIBUTE_ROUTINE ;; Change the attributes ;;AN000;
607 ENDM ;;AN000;
608;;**************************************************************************** ;;AN000;
609;; ;;AN000;
610;; COMPARE_STRINGS: Compare two strings. ;;AN000;
611;; ;;AN000;
612;; SYNTAX: COMPARE_STRINGS string_1, string_2 ;;AN000;
613;; ;;AN000;
614;; INPUT: ;;AN000;
615;; string_1 = The address of the first string. (ASCII-N string) ;;AN000;
616;; string_2 = The address of the second string. (ASCII-N string) ;;AN000;
617;; ;;AN000;
618;; OUTPUT: ;;AN000;
619;; If CY = 1, the strings do no compare. ;;AN000;
620;; If CY = 0, the strings are the same. ;;AN000;
621;; ;;AN000;
622;; OPERATION: ;;AN000;
623;; ;;AN000;
624;;**************************************************************************** ;;AN000;
625COMPARE_STRINGS MACRO STRING_1, STRING_2 ;;AN000;
626 ;;AN000;
627 LEA SI, STRING_1 ;;AN000;
628 LEA DI, STRING_2 ;;AN000;
629 CALL COMPARE_ROUTINE ;;AN000;
630 ENDM ;;AN000;
631;;**************************************************************************** ;;AN000;
632;; ;;AN000;
633;; CHECK_WRITE_PROTECT Determine if the diskette in drive A/B is write ;;AC000;JW
634;; protected. ;;AN000;
635;; ;;AN000;
636;; SYNTAX: CHECK_WRITE_PROTECT RET_CODE ;;AN000;
637;; ;;AN000;
638;; INPUT: ;;AN000;
639;; DRIVE = A_DRIVE (0) Check the diskette in the A drive ;;AC000;JW
640;; DRIVE = B_DRIVE (1) Check the diskette in the B drive ;;AC000;JW
641;; ;;AN000;
642;; OUTPUT: ;;AN000;
643;; If CY = 1, There was an error accessing the drive. ;;AN000;
644;; If CY = 0, There were no errors. ;;AN000;
645;; RET_CODE = 1: The diskette IS write protected. ;;AN000;
646;; = 0: The diskette is NOT write protected. ;;AN000;
647;; ;;AN000;
648;; OPERATION: ;;AN000;
649;; ;;AN000;
650;;**************************************************************************** ;;AN000;
651CHECK_WRITE_PROTECT MACRO DRIVE, RET_CODE ;;AC000;JW
652 MOV CX,DRIVE ;;AN000;JW
653 CALL CHECK_WRITE_ROUTINE ;;AN000;
654 MOV RET_CODE, AX ;;AN000;
655 ENDM ;;AN000;
656;;**************************************************************************** ;;AN000;
657;; ;;AN000;
658;; GET_FREE_SPACE Determine the free disk space on a diskette. ;;AN000;
659;; ;;AN000;
660;; SYNTAX: GET_FREE_SPACE drive, space ;;AN000;
661;; ;;AN000;
662;; INPUT: ;;AN000;
663;; drive = 1: Examine diskette in drive A ;;AN000;
664;; = 2: Examine diskette in drive B ;;AN000;
665;; ;;AN000;
666;; OUTPUT: ;;AN000;
667;; If CY = 1, there was an error accessing the disk ;;AN000;
668;; If CY = 0, there were no errors. ;;AN000;
669;; space = The amount of free space on the disk (32-bit value) ;;AN000;
670;; ;;AN000;
671;; OPERATION: ;;AN000;
672;; ;;AN000;
673;;**************************************************************************** ;;AN000;
674GET_FREE_SPACE MACRO DRIVE, SPACE ;;AN000;
675 ;;AN000;
676 MOV DL, DRIVE ;;AN000;
677 MOV AH, 36H ;;AN000;
678 DOSCALL ;;AN000;
679 .IF < NC > ;;AN000;
680 MUL BX ;;AN000;
681 MUL CX ;;AN000;
682 MOV WORD PTR SPACE[0], AX ;;AN000;
683 MOV WORD PTR SPACE[2], DX ;;AN000;
684 .ENDIF ;;AN000;
685 ENDM ;;AN000;
686;;**************************************************************************** ;;AN000;
687;; ;;AN000;
688;; MATCH_DISK_FILES Determine if a list of file exist on a disk. ;;AN000;
689;; ;;AN000;
690;; SYNTAX: GET_FREE_SPACE path, file_list, list_type, num_files, ret_code ;;AN000;
691;; ;;AN000;
692;; INPUT: ;;AN000;
693;; path = ASCII-N string containing the drive, and path of where to ;;AN000;
694;; search. ;;AN000;
695;; file_list = The address of the list of files to use. If AX=2, then ;;AN000;
696;; the first two bytes are ignored. ;;AN000;
697;; list_type = 1: Use a small list with 12 byte between filenames. ;;AN000;
698;; = 2: Use a list with 14 bytes between filenames. ;;AN000;
699;; ;;AN000;
700;; OUTPUT: ;;AN000;
701;; If CY = 1, There was an error accessing the disk. ;;AN000;
702;; If CY = 0, there were no errors. ;;AN000;
703;; ret_code = 1: All the files are on the disk. ;;AN000;
704;; ret_code = 0: All the file are NOT on the disk. ;;AN000;
705;; ;;AN000;
706;; OPERATION: ;;AN000;
707;; ;;AN000;
708;;**************************************************************************** ;;AN000;
709MATCH_DISK_FILES MACRO PATH, FILE_LIST, LIST_TYPE, NUM_FILES, RET_CODE ;;AN000;
710 ;;AN000;
711 LEA DI, PATH ;;AN000;
712 LEA SI, FILE_LIST ;;AN000;
713 MOV AX, LIST_TYPE ;;AN000;
714 MOV CX, NUM_FILES ;;AN000;
715 CALL MATCH_FILES_ROUTINE ;;AN000;
716 MOV RET_CODE, AX ;;AN000;
717 ENDM ;;AN000;
718 ;;AN000;
719INCLUDE MACROS7.INC ;;AN000;