1 ;;**************************************************************************** ;;AN000;
2 ;; Assembler MACROS for use with SELECT. ;;AN000;
3 ;; File: MACROS6.INC ;;AN000;
4 ;; Latest Change Date: July 27, 1987 ;;AN000;
6 ;; These macros define powerful assembler verbs neccessary for SELECT. ;;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;
11 ;; DB "string_variable",? ;;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;
17 ;;**************************************************************************** ;;AN000;
18 page ;;AN000; ;;AN000;
19 ;;**************************************************************************** ;;AN000;
21 ;; SCAN_PARAMETERS: Scan SELECT command line for parameters. ;;AN000;
23 ;; SYNTAX: SCAN_PARAMETERS mode ;;AN000;
26 ;; PSP command line ;;AN000;
29 ;; mode = Install mode ;;AN000;
30 ;; = 0: Parameter is MENU ;;AN000;
31 ;; = 1: Parameter is FDISK ;;AN000;
32 ;; = 0FFH: Parameter is invalid ;;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;
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;
43 ;;**************************************************************************** ;;AN000;
44 SCAN_PARAMETERS MACRO MODE ;;AN000;
46 CALL SCAN_PARAMETERS_ROUTINE ;;AN000;
49 ;;**************************************************************************** ;;AN000;
51 ;; SCAN_INFO_FILE: Scan SELECT.TMP for parameters. ;;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
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;
62 ;; option_1 = 1 ;;AC033;
65 ;; = 0FFh: Parameter is invalid (not 1, 2, 3) ;;AC033;
66 ;; option_2 = 1 ;;AC033;
68 ;; = 0FFh: Parameter is invalid (not 1, 2) ;;AC033;
69 ;; option_3 = 1 ;;AC033;
71 ;; = 0FFh: Parameter is invalid (not 1, 2) ;;AC033;
72 ;; path = Install path in ASCII-N format ;;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;
81 ;;**************************************************************************** ;;AN000;
82 SCAN_INFO_FILE MACRO OPTION_0, OPTION_1, OPTION_2, OPTION_3, PATH, FILENAME, BUFFER, BUFF_SIZE
84 MOV AX, OFFSET PATH ;;AN000;
86 MOV AX, OFFSET FILENAME ;;AN000;
88 MOV AX, OFFSET BUFFER ;;AN000;
90 MOV AX, BUFF_SIZE ;;AN000;
92 CALL SCAN_INFO_FILE_ROUTINE ;;AN000;
94 MOV OPTION_1, BX ;;AN000;
95 MOV OPTION_2, CX ;;AN000;
96 MOV OPTION_3, DX ;;AN033;SEH return OPTION_3, also
98 ;;**************************************************************************** ;;AN000;
100 ;; COPY_FILES: Copy a list of files from the A diskette to either the B ;;AN000;
101 ;; or C drive. ;;AN000;
103 ;; SYNTAX: COPY_FILES target_disk, file_table, num_files, path ;;AN000;
106 ;; target_disk = 1: Copy the files to the B drive ;;AN000;
107 ;; = 2: Copy the files to the C drive ;;AN000;
109 ;; path = The path where the files are to be copied if the ;;AN000;
110 ;; destination is the hard disk. ;;AN000;
112 ;; file_table = A table listing the files to copy. It is of the ;;AN000;
113 ;; following format. ;;AN000;
115 ;; db filename ;;AN000;
117 ;; - The filename must be padded out to 12 characters. ;;AN000;
119 ;; num_files = The number of files in the list. ;;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;
128 ;;**************************************************************************** ;;AN000;
129 COPY_FILES MACRO DEST, FILE_TABLE, NUM_FILES ;;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
139 COPY_FILES2 MACRO DEST, FILE_TABLE, NUM_FILES, PATH ;;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
150 ;;**************************************************************************** ;;AN000;
152 ;; INSTALL_FILES: Install the files from the original diskettes to the ;;AN000;
153 ;; startup and the operations diskette. ;;AN000;
155 ;; SYNTAX: INSTALL_FILES source_disk, target_disk ;;AN000;
158 ;; source_disk = 1: Read the files from the first diskette ;;AN000;
159 ;; = 2: Read the files from the second diskette ;;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;
168 ;; OPERATION: ;;AN000;
170 ;;**************************************************************************** ;;AN000;
171 INSTALL_FILES MACRO SOURCE_DISK, TARGET_DISK ;;AN000;
173 COPY_FILES SOURCE_DISK, TARGET_DISK, S_INSTALL_PATH, DOS_FILES, NUM_DOS_FILES ;;AN000;
175 ;;**************************************************************************** ;;AN000;
177 ;; GET_PRINTER_TITLES: Read the printer profile file and load the printer ;;AN000;
178 ;; names into a table. ;;AN000;
180 ;; SYNTAX: GET_PRINTER_TITLES filename ;;AN000;
183 ;; filename = A ASCII-N string containing the name of the file containing ;;AN000;
184 ;; the printer profile. ;;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;
198 ;; Error number Explaination. ;;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;
204 ;; 2 There was an error opening the printer profile file. ;;AN000;
205 ;; AX contains the DOS error code. ;;AN000;
207 ;; 3 There was an error reading the printer profile file. ;;AN000;
208 ;; AX contains the DOS error code. ;;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;
214 ;; 5 A line in the printer profile file was found to ;;AN000;
215 ;; be longer then allowed in the buffer. ;;AN000;
217 ;; 6 There was an error find a printer name in the file ;;AN000;
219 ;; 7 There was an error updating the file pointer ;;AN000;
221 ;; 8 There are more then 255 printer definitions in the ;;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;
228 ;; 10 There was an error allocating the memory needed for ;;AN000;
229 ;; the data. ;;AN000;
232 ;; OPERATION: ;;AN000;
234 ;;**************************************************************************** ;;AN000;
235 GET_PRINTER_TITLES MACRO FILENAME ;;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;
240 ;;**************************************************************************** ;;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;
245 ;; SYNTAX: GET_PRINTER_INFO printer_num ;;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;
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;
262 ;; If CY = 1, There were errors encountered. ;;AN000;
263 ;; BX = An error code indicating the type of error that occured. ;;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;
272 ;; If the error was a result of a DOS function, then ;;AN000;
273 ;; on return, AX will contain the DOS error code. ;;AN000;
275 ;; OPERATION: ;;AN000;
277 ;;**************************************************************************** ;;AN000;
278 GET_PRINTER_INFO MACRO VAR_PRT ;;AN000;
280 MOV AX, VAR_PRT ;;AN000;
281 CALL GET_PRINTER_INFO_ROUTINE ;;AN000;
284 ;;**************************************************************************** ;;AN000;
286 ;; RELEASE_PRINTER_INFO: Close the printer profile file and free the ;;AN000;
287 ;; allocated memory. ;;AN000;
289 ;; SYNTAX: RELEASE_PRINTER_INFO ;;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;
299 ;; OPERATION: Closes the printer profile file and deallocted memory. ;;AN000;
301 ;;**************************************************************************** ;;AN000;
302 RELEASE_PRINTER_INFO MACRO ;;AN000;
304 CALL RELEASE_PRINTER_INFO_ROUTINE ;;AN000;
306 ;;**************************************************************************** ;;AN000;
308 ;; GET_PRINTER_PARAMS: Get parameters for specified printer. ;;AN000;
310 ;; SYNTAX: GET_PRINTER_PARAMS var_prt, var_port, var_status ;;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;
327 ;; var_status = 1: Printer information is valid ;;AN000;
328 ;; = 0: Printer not valid: default values returned ;;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;
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;
347 ;;**************************************************************************** ;;AN000;
348 GET_PRINTER_PARAMS MACRO VAR_PRT, VAR_PORT, VAR_STATUS ;;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;
355 ;;**************************************************************************** ;;AN000;
357 ;; SAVE_PRINTER_PARAMS: Save the printer information in the printer structures ;;AN000;
359 ;; SYNTAX: SAVE_PRINTER_PARAMS var_prt ;;AN000;
362 ;; var_prt = The printer number. ;;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;
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;
382 ;;**************************************************************************** ;;AN000;
383 SAVE_PRINTER_PARAMS MACRO VAR_PRT ;;AN000;
385 MOV AX, VAR_PRT ;;AN000;
386 CALL SAVE_PRINTER_PARAMS_ROUTINE ;;AN000;
388 ;;**************************************************************************** ;;AN000;
390 ;; CHANGE_AUTOEXEC: Search for the SELECT command in the autoexec.bat and ;;AN000;
391 ;; change the parameters for that line. ;;AN000;
393 ;; SYNTAX: CHANGE_AUTOEXEC FILENAME, APPEND_STRING ;;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;
405 ;; OPERATION: ;;AN000;
407 ;;**************************************************************************** ;;AN000;
408 CHANGE_AUTOEXEC MACRO FILENAME, APPEND_STRING ;;AN000;
410 MOV DI, OFFSET FILENAME ;;AN000;
411 MOV SI, OFFSET APPEND_STRING ;;AN000;
412 CALL CHANGE_AUTOEXEC_ROUTINE ;;AN000;
415 ;;**************************************************************************** ;;AN000;
417 ;; LOAD_MESSAGES: Load the messages and initialize the message retriever. ;;AN000;
419 ;; SYNTAX: LOAD_MESSAGES ;;AN000;
425 ;; If CY = 1, there was an error loading the messages. ;;AN000;
426 ;; If CY = 0, there were no errors. ;;AN000;
428 ;; OPERATION: ;;AN000;
430 ;;**************************************************************************** ;;AN000;
431 LOAD_MESSAGES MACRO ;;AN000;
433 CALL SYSLOADMSG ;;AN000;
435 ;;**************************************************************************** ;;AN000;
437 ;; DISPLAY_MESSAGE: Call the message retriever to display a message. ;;AN000;
439 ;; SYNTAX: DISPLAY_MESSAGE msg_number ;;AN000;
442 ;; msg_number = The number of the message to be displayed. (16 bit value) ;;AN000;
445 ;; If CY = 1, there was an error displaying the message. ;;AN000;
446 ;; If CY = 0, there were no errors. ;;AN000;
448 ;; OPERATION: ;;AN000;
450 ;;**************************************************************************** ;;AN000;
451 DISPLAY_MESSAGE MACRO MSG_NUMBER ;;AN000;
453 MOV AX, MSG_NUMBER ;;AN000;
454 CALL DISPLAY_MESSAGE_ROUTINE ;;AN000;
456 ;;**************************************************************************** ;;AN000;
458 ;; CHECK_DOS_PATH: Check to see if a path for the SET PATH command is valid ;;AN000;
460 ;; SYNTAX: CHECK_DOS_PATH path_str ;;AN000;
463 ;; path_str - An ASCII-N string containing the path to check. ;;AN000;
466 ;; If CY = 0, the path is valid. ;;AN000;
467 ;; If CY = 1, The path is NOT valid: ;;AN000;
469 ;; OPERATION: ;;AN000;
471 ;;**************************************************************************** ;;AN000;
472 CHECK_DOS_PATH MACRO PATH_STR ;;AN000;
474 LEA SI, PATH_STR ;;AN000;
475 CALL CHECK_DOS_PATH_ROUTINE ;;AN000;
477 ;;**************************************************************************** ;;AN000;
479 ;; CHECK_PATH: Check to see if a path is valid. ;;AN000;
481 ;; SYNTAX: CHECK_PATH path_str, drive, root ;;AN000;
484 ;; path_str - An ASCII-N string containing the path to check. ;;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;
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;
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;
504 ;; OPERATION: ;;AN000;
506 ;;**************************************************************************** ;;AN000;
507 CHECK_PATH MACRO PATH_STR, DRIVE, ROOT ;;AN000;
509 LEA SI, PATH_STR ;;AN000;
511 CALL POS_ZERO ;;AN000;
512 MOV CX, [SI] ;;AN000;
514 MOV AL, DRIVE ;;AN000;
515 MOV AH, ROOT ;;AN000;
516 CALL CHECK_VALID_PATH ;;AN000;
518 ;;**************************************************************************** ;;AN000;
520 ;; GET_NUMBER_PORTS: Get the number of parallel and serial ports attached ;;AN000;
521 ;; to the computer. ;;AN000;
523 ;; SYNTAX: GET_NUMBER_PORTS parallel, serial ;;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;
532 ;; OPERATION: The macro performs a call to interrupt 11H to determine ;;AN000;
533 ;; the number of ports available. ;;AN000;
535 ;;**************************************************************************** ;;AN000;
536 GET_NUMBER_PORTS MACRO PARALLEL, SERIAL ;;AN000;
538 INT 11H ;; Determine equipment attached ;;AN000;
539 SHR AH, 1 ;; Put the number of serial ports in L.S. Bits ;;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;
547 MOV PARALLEL, BX ;; Store ;;AN000;
548 AND PARALLEL, 0000000000000011B ;; Mask off the unwanted infromation ;;AN000;
550 ;;**************************************************************************** ;;AN000;
552 ;; CHANGE_ATTRIBUTE: Change the attributes on a group of file to be hidden ;;AN000;
555 ;; SYNTAX: CHANGE_ATTRIBUTE list_ptr, num_files ;;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;
565 ;; If CY = 1, there was an error encountered. ;;AN000;
566 ;; If CY = 0, there were no errors. ;;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;
572 ;;**************************************************************************** ;;AN000;
573 CHANGE_ATTRIBUTE MACRO LIST_PTR, NUM_FILES ;;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;
580 ;;**************************************************************************** ;;AN000;
582 ;; RESTORE_ATTRIBUTE: Restore the original attributes on a group of file. ;;AN000;
584 ;; SYNTAX: RESTORE_ATTRIBUTE list_ptr, num_files ;;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;
594 ;; If CY = 1, there was an error encountered. ;;AN000;
595 ;; If CY = 0, there were no errors. ;;AN000;
597 ;; OPERATION: This macros restores the attribute previously stored for the ;;AN000;
598 ;; listed files. ;;AN000;
600 ;;**************************************************************************** ;;AN000;
601 RESTORE_ATTRIBUTE MACRO LIST_PTR, NUM_FILES ;;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;
608 ;;**************************************************************************** ;;AN000;
610 ;; COMPARE_STRINGS: Compare two strings. ;;AN000;
612 ;; SYNTAX: COMPARE_STRINGS string_1, string_2 ;;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;
619 ;; If CY = 1, the strings do no compare. ;;AN000;
620 ;; If CY = 0, the strings are the same. ;;AN000;
622 ;; OPERATION: ;;AN000;
624 ;;**************************************************************************** ;;AN000;
625 COMPARE_STRINGS MACRO STRING_1, STRING_2 ;;AN000;
627 LEA SI, STRING_1 ;;AN000;
628 LEA DI, STRING_2 ;;AN000;
629 CALL COMPARE_ROUTINE ;;AN000;
631 ;;**************************************************************************** ;;AN000;
633 ;; CHECK_WRITE_PROTECT Determine if the diskette in drive A/B is write ;;AC000;JW
634 ;; protected. ;;AN000;
636 ;; SYNTAX: CHECK_WRITE_PROTECT RET_CODE ;;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
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;
648 ;; OPERATION: ;;AN000;
650 ;;**************************************************************************** ;;AN000;
651 CHECK_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;
656 ;;**************************************************************************** ;;AN000;
658 ;; GET_FREE_SPACE Determine the free disk space on a diskette. ;;AN000;
660 ;; SYNTAX: GET_FREE_SPACE drive, space ;;AN000;
663 ;; drive = 1: Examine diskette in drive A ;;AN000;
664 ;; = 2: Examine diskette in drive B ;;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;
671 ;; OPERATION: ;;AN000;
673 ;;**************************************************************************** ;;AN000;
674 GET_FREE_SPACE MACRO DRIVE, SPACE ;;AN000;
676 MOV DL, DRIVE ;;AN000;
682 MOV WORD PTR SPACE[0], AX ;;AN000;
683 MOV WORD PTR SPACE[2], DX ;;AN000;
686 ;;**************************************************************************** ;;AN000;
688 ;; MATCH_DISK_FILES Determine if a list of file exist on a disk. ;;AN000;
690 ;; SYNTAX: GET_FREE_SPACE path, file_list, list_type, num_files, ret_code ;;AN000;
693 ;; path = ASCII-N string containing the drive, and path of where to ;;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;
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;
706 ;; OPERATION: ;;AN000;
708 ;;**************************************************************************** ;;AN000;
709 MATCH_DISK_FILES MACRO PATH, FILE_LIST, LIST_TYPE, NUM_FILES, RET_CODE ;;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;
719 INCLUDE MACROS7.INC ;;AN000;