]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/PRINT/PRINT_T.ASM
2 TITLE
4.00 PRINT TRANSIENT
6 SaveReg
MACRO reglist
;; push those registers
12 RestoreReg
MACRO reglist
;; pop those registers
18 BREAK <Transient Portion
>
19 ;******************* START OF SPECIFICATIONS ***********************************
21 ; MODULE NAME: PRINT_T.SAL
23 ; DESCRIPTIVE NAME: TRANSIENT - Print Initialization and Instalation
24 ; Routine. DOS PRINT program for background printing
25 ; of text files to the list device - Transient Portion.
27 ; FUNCTION: - Call the DOS PARSE Service Routines to process the command
28 ; line. Search for valid input:
29 ; - filenames (may be more than one
30 ; - switches: /D:device
31 ; /B:buffsize 512 to 16k - 512 default
32 ; /Q:quesiz 4 to 32 - 10 default
33 ; /S:timeslice 1 to 255 - 8 default
34 ; /U:busytick 1 to 255 - 1 default
35 ; /M:maxtick 1 to 255 - 2 default
39 ; - Install the resident component if not already installed
40 ; - Submit files for printing to the resident component
42 ; INPUT: Parameter string from command line in the PSP
44 ; OUTPUT: All parameters specified are updated. Files are submitted to
45 ; the resident component for printing.
47 ; REGISTERS USED: T.B.D.
50 ; LINKAGE: LINK - TRANSIENT
61 ; CHANGE 03/11/87 - Major restructureing of TRANSIENT - F. G.
64 ;******************* END OF SPECIFICATIONS *************************************
65 ;******************** START - PSEUDOCODE ***************************************
73 ; if no error (if there is - SYSLOADMSG is already set to
74 ; display it - ie DOS ver error
78 ; get all interupt values
80 ; load error message #
85 ; load error message #
91 ; get and set INT 24 handler
92 ; update path character
93 ; Set up for Parse_Input call
95 ; Leave if end of command line
96 ; Leave if error flag set
99 ; set up for Invalid_parm message
101 ; Leave if error flag set
109 ; if valid value and not installed
110 ; move device name to LISTNAME
117 ; if valid value and not installed
125 ; if valid value and not installed
133 ; if valid value and not installed
134 ; update TIMESLICE, SLICECNT
141 ; if valid value and not installed
149 ; if valid value and not installed
182 ; set up for Invalid_parm message
195 ; call DispMsg (display the fatal error)
202 ;==================== END - PSEUDOCODE =========================================
204 CodeR
Segment public para
206 extrn SliceCnt
:BYTE, BusyTick
:BYTE, MaxTick
:BYTE, TimeSlice
:BYTE
207 extrn EndRes
:WORD, BlkSiz
:WORD, QueueLen
:BYTE, PChar
:BYTE
208 extrn ListName
:BYTE, FileQueue
:BYTE, EndQueue
:WORD, Buffer
:WORD
209 extrn EndPtr
:WORD, NxtChr
:WORD, MoveTrans
:FAR, TO_DOS
:FAR
211 extrn MESBAS
:WORD, R_MES_BUFF
:WORD
216 BREAK <Transient
Data>
218 ;----------------------------------------
220 ;----------------------------------------
222 DATA SEGMENT public BYTE
234 dd ? ; pointer to filename
236 ;--- Ints used by print. These ints are loaded here before the
237 ; resident is installed, just in case an error before print
238 ; is installed cases it to be never installed and the ints
239 ; have to be restored.
241 i28vec dd ? ; SOFTINT
250 ;--- Temp stack for use durint int 23 and 24 processing
251 db 278 + 80H dup (?) ; 278 == IBM's ROM requirements
255 ;--- Print installed flag:
256 ; 0 = Not installed yet: process only configuration parameters
257 ; during the command line parse
258 ; 1 = Partially installed: process only print commands AND flag
259 ; configuration parameters as errors AND finish by executing
261 ; 2 = Already installed: process only print commands AND flag
262 ; configuration parameters as errors
263 PInst db 0 ; defaults to not installed
264 CanFlag db 0 ; cancel mode flag (0= no cancel)
265 Ambig db ? ; =1 if a filename is ambigous
266 DevSpec db 0 ; =1 a device was specified with the
267 ; /d option, do not prompt
268 QFullMes db 0 ; =1 queue full message issued already
269 HARDCH DD ? ;Pointer to real INT 24 handler
271 TokBuf DB (MaxFileLen+16) dup(?) ; token buffer for input
273 NulPtr dw ? ; pointer to the nul in NameBuf
274 FNamPtr dw ? ; pointer to name portion of file name
275 NameBuf db (MaxFileLen+16) dup(?) ; full name buffer for file
276 ; plus room for ambigous expansion
278 whichmsg dw (CLASS_C shl 8)+FstMes ; initial message for
281 SearchBuf find_buf <> ; search buffer
283 ;--------------------------------------
285 ;--------------------------------------
287 EOL equ -1 ; Indicator for End-Of-Line
288 NOERROR equ 0 ; Return Indicator for No Errors
290 DEVICE equ 0 ; device
291 BUFFSIZ equ 1 ; buffsiz
292 QUESIZ equ 2 ; quesiz
293 TIME equ 3 ; timeslice
294 BUSYT equ 4 ; busytick
296 TERM equ 6 ; Terminate
300 file_spec equ 5 ; Parse Type for file spec found
302 ;--------------------------------------
303 ; PARSE Control Block
304 ;--------------------------------------
306 ORDINAL DW 0 ; Current Parse ordinal value
307 SCAN_PTR DW 81h ; Current Parse location Pointer
308 MSG_PTR DW 81h ; Last Parse location Pointer
310 ;--------------------------------------
311 ; STRUCTURE TO DEFINE ADDITIONAL
312 ; COMMAND LINE PARAMETERS
313 ;--------------------------------------
315 DW OFFSET DG:PARMSX ; POINTER TO PARMS STRUCTURE
316 DB 0 ; NO DELIMITER LIST FOLLOWS
318 ;--------------------------------------
319 ; STRUCTURE TO DEFINE SYNTAX
320 ;--------------------------------------
322 DB 0,1 ; A POSITIONAL PARAMETER IS VALID
323 DW OFFSET DG:POS1 ; POINTER TO POSITIONAL DEFINITION
324 DB 9 ; THERE ARE 9 TYPES OF SWITCHES
325 DW OFFSET DG:SW1 ; POINTER TO THE /D:device SWITCH DEFINITION AREA
326 DW OFFSET DG:SW2 ; POINTER TO THE /B:buffsiz SWITCH DEFINITION AREA
327 DW OFFSET DG:SW3 ; POINTER TO THE /Q:quesiz SWITCH DEFINITION AREA
328 DW OFFSET DG:SW4 ; POINTER TO THE /S:timeslice SWITCH DEFINITION AREA
329 DW OFFSET DG:SW5 ; POINTER TO THE /U:busytick SWITCH DEFINITION AREA
330 DW OFFSET DG:SW6 ; POINTER TO THE /M:maxval SWITCH DEFINITION AREA
331 DW OFFSET DG:SW7 ; POINTER TO THE /T TERMINATE SWITCH DEFINITION AREA
332 DW OFFSET DG:SW8 ; POINTER TO THE /C CANCEL SWITCH DEFINITION AREA
333 DW OFFSET DG:SW9 ; POINTER TO THE /P PRINT SWITCH DEFINITION AREA
334 DW 0 ; THERE ARE NO KEYWORDS IN PRINT SYNTAX
336 ;--------------------------------------
338 ; NOTE: Do NOT change the layout or size
339 ; of the following entries:
340 ; --- SW1 through SW9 ---
341 ; Their size and position are used
342 ; to calculate an index for a
343 ; DO_CASE (jump table). This is
344 ; possible ONLY if the size of all
345 ; 9 entries are exactly the same,
346 ; congruant, and in this exact
347 ; order. Any changes here MUST be
348 ; matched in the Process_A_Switch
351 ; The following formula is used:
353 ; Index = (offset P_SYN - offset
356 ;--------------------------------------
359 ;--------------------------------------
360 ; STRUCTURE TO DEFINE THE POSITIONAL
361 ; PARAMETER (File Name)
362 ;--------------------------------------
364 DW 0203H ; OPTIONAL, REPEATABLE FILE SPEC
365 DW 0001H ; CAPS BY FILE TABLE
366 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
367 DW OFFSET DG:NOVALS ; NO VALUES LIST REQUIRED
370 ;--------------------------------------
371 ; STRUCTURE TO DEFINE /D:device SWITCH
372 ;--------------------------------------
374 DW 2001H ; MUST BE PRINT OUTPUT DEVICE
375 ; (optional simple string)
376 DW 1h ; Caps by file table
377 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
378 DW OFFSET DG:NOVALS ; VALUE LIST NOT NECESSARY
379 DB 1 ; ONE SWITCH IN FOLLOWING LIST
380 SW_PTR DB "/D
",0 ; /D: INDICATES DEVICE SPECIFIED
383 ;--------------------------------------
384 ; STRUCTURE TO DEFINE /B:buffsiz SWITCH
385 ;--------------------------------------
387 DW 8001H ; MUST BE NUMERIC (optional)
388 DW 0 ; NO FUNCTION FLAGS
389 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
390 DW OFFSET DG:VALUE_BUF ; NEED VALUE LIST FOR buffsiz
391 DB 1 ; ONE SWITCH IN FOLLOWING LIST
392 B_SWITCH DB "/B
",0 ; /B: INDICATES buffsiz REQUESTED
394 ;--------------------------------------
395 ; STRUCTURE TO DEFINE /Q:quesiz SWITCH
396 ;--------------------------------------
398 DW 8001H ; MUST BE NUMERIC (optional)
399 DW 0 ; NO FUNCTION FLAGS
400 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
401 DW OFFSET DG:VALUE_QUE ; NEED VALUE LIST FOR quesiz
402 DB 1 ; ONE SWITCH IN FOLLOWING LIST
403 Q_SWITCH DB "/Q
",0 ; /Q: INDICATES quesiz REQUESTED
405 ;--------------------------------------
406 ; STRUCTURE TO DEFINE /S:timeslice SWITCH
407 ;--------------------------------------
409 DW 8001H ; MUST BE NUMERIC (optional)
410 DW 0 ; NO FUNCTION FLAGS
411 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
412 DW OFFSET DG:VALUE_TIME ; NEED VALUE LIST FOR timeslice
413 DB 1 ; ONE SWITCH IN FOLLOWING LIST
414 S_SWITCH DB "/S
",0 ; /S: INDICATES timeslice REQUESTED
416 ;--------------------------------------
417 ; STRUCTURE TO DEFINE /U:busytick SWITCH
418 ;--------------------------------------
420 DW 8001H ; MUST BE NUMERIC (optional)
421 DW 0 ; NO FUNCTION FLAGS
422 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
423 DW OFFSET DG:VALUE_BUSY ; NEED VALUE LIST FOR busytick
424 DB 1 ; ONE SWITCH IN FOLLOWING LIST
425 U_SWITCH DB "/U
",0 ; /U: INDICATES busytick REQUESTED
427 ;--------------------------------------
428 ; STRUCTURE TO DEFINE /M:maxtick SWITCH
429 ;--------------------------------------
431 DW 8001H ; MUST BE NUMERIC (optional)
432 DW 0 ; NO FUNCTION FLAGS
433 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
434 DW OFFSET DG:VALUE_MAXT ; NEED VALUE LIST FOR maxtick
435 DB 1 ; ONE SWITCH IN FOLLOWING LIST
436 M_SWITCH DB "/M
",0 ; /M: INDICATES maxtick REQUESTED
438 ;--------------------------------------
439 ; STRUCTURE TO DEFINE /T Terminate SWITCH
440 ;--------------------------------------
442 DW 8001H ; SWITCH ONLY
443 ; (optional simple string)
444 DW 0 ; NO FUNCTION FLAGS
445 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
446 DW OFFSET DG:NOVALS ; VALUE LIST NOT NECESSARY
447 DB 1 ; ONE SWITCH IN FOLLOWING LIST
448 DB "/T
",0 ; /T: INDICATES Terminate REQUESTED
450 ;--------------------------------------
451 ; STRUCTURE TO DEFINE /C Cancel SWITCH
452 ;--------------------------------------
454 DW 8003H ; SWITCH ONLY
455 ; (optional, repeatable simple string)
456 DW 0 ; NO FUNCTION FLAGS
457 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
458 DW OFFSET DG:NOVALS ; VALUE LIST NOT NECESSARY
459 DB 1 ; ONE SWITCH IN FOLLOWING LIST
460 C_SW_ptr DB "/C
",0 ; /C: INDICATES Cancel REQUESTED
462 ;--------------------------------------
463 ; STRUCTURE TO DEFINE /P Print SWITCH
464 ;--------------------------------------
466 DW 8003H ; SWITCH ONLY
467 ; (optional, repeatable simple string)
468 DW 0 ; NO FUNCTION FLAGS
469 DW OFFSET DG:PARSE_BUFF ; PLACE RESULT IN BUFFER
470 DW OFFSET DG:NOVALS ; VALUE LIST NOT NECESSARY
471 DB 1 ; ONE SWITCH IN FOLLOWING LIST
472 P_SW_ptr DB "/P
",0 ; /P: INDICATES Print REQUESTED
474 ;--------------------------------------
475 ; VALUE LIST FOR FILE NAMES
476 ;--------------------------------------
480 ;--------------------------------------
481 ; VALUE LIST DEFINITION FOR buffsiz
482 ;--------------------------------------
484 DB 1 ; ONE VALUE ALLOWED
485 DB 1 ; ONLY ONE RANGE
486 DB BUFFSIZ ; IDENTIFY IT AS buffsiz
487 ; USER CAN SPECIFY /+512 THROUGH /+16K
488 DD MinBufferLen,MaxBufferLen
490 ;--------------------------------------
491 ; VALUE LIST DEFINITION FOR quesiz
492 ;--------------------------------------
494 DB 1 ; ONE VALUE ALLOWED
495 DB 1 ; ONLY ONE RANGE
496 DB QUESIZ ; IDENTIFY IT AS quesiz
497 ; USER CAN SPECIFY /+4 THROUGH /+32
498 DD MinQueueLen,MaxQueueLen
500 ;--------------------------------------
501 ; VALUE LIST DEFINITION FOR timeslice
502 ;--------------------------------------
503 VALUE_TIME LABEL BYTE
504 DB 1 ; ONE VALUE ALLOWED
505 DB 1 ; ONLY ONE RANGE
506 DB TIME ; IDENTIFY IT AS timeslice
507 ; USER CAN SPECIFY /+1 THROUGH /+255
508 DD MinTimeSlice,MaxTimeSlice
510 ;--------------------------------------
511 ; VALUE LIST DEFINITION FOR busytick
512 ;--------------------------------------
513 VALUE_BUSY LABEL BYTE
514 DB 1 ; ONE VALUE ALLOWED
515 DB 1 ; ONLY ONE RANGE
516 DB BUSYT ; IDENTIFY IT AS busytick
517 ; USER CAN SPECIFY /+1 THROUGH /+255
518 DD MinBusyTick,MaxBusyTick
520 ;--------------------------------------
521 ; VALUE LIST DEFINITION FOR maxtick
522 ;--------------------------------------
523 VALUE_MAXT LABEL BYTE
524 DB 1 ; ONE VALUE ALLOWED
525 DB 1 ; ONLY ONE RANGE
526 DB MAXT ; IDENTIFY IT AS maxtick
527 ; USER CAN SPECIFY /+1 THROUGH /+255
528 DD MinMaxTick,MaxMaxTick
530 ;--------------------------------------
531 ; RETURN BUFFER FOR PARSE INFORMATION
532 ;--------------------------------------
533 PARSE_BUFF LABEL BYTE
534 P_TYPE DB ? ; TYPE RETURNED
535 P_ITEM_TAG DB ? ; SPACE FOR ITEM TAG
536 P_SYN DW ? ; POINTER TO LIST ENTRY
537 P_PTR_L DW ? ; SPACE FOR POINTER / VALUE - LOW
538 P_PTR_H DW ? ; SPACE FOR POINTER / VALUE - HIGH
540 ;----------------------------------------
541 ; SUBLIST for Message call
542 ;----------------------------------------
546 DB sub_size ; size of sublist
548 insert_ptr_off DW 0 ; pointer to insert - offset
549 insert_ptr_seg DW DG ; pointer to insert - segment
550 insert_num DB 0 ; number of insert
551 DB Char_Field_ASCIIZ ; data type flag - ASCII Z string
552 DB MaxFileLen ; maximum field size
553 DB 1 ; minimum field size
554 DB " " ; pad character
556 sub_size equ $ - SUBLIST ; size of sublist
559 OPEN_FILE label dword
561 dw offset DG:NameBuf ; name pointer offset
562 open_seg dw ? ; name pointer segment
566 BREAK <Transient Code>
568 Code Segment public para
571 Code Segment public para
573 public TransRet,TransSize,GoDispMsg
575 extrn SYSLOADMSG:NEAR, SYSGETMSG:NEAR, SYSDISPMSG:NEAR
578 ASSUME CS:DG,DS:nothing,ES:nothing,SS:Stack
583 ;-------------------------------------
585 ;-------------------------------------
588 mov ax,ds:[pdb_environ]
591 ; $if nz ; if pdb_environ != 0 ;AC000;
594 push es ; deallocate memory
603 call SYSLOADMSG ; Initialize the Message Service code ;AN000;
605 ; $if c ; if error ;AC000;
608 mov ah,dh ; set up class for DispMsg
610 ; $else ; else - no error - keep going
620 ; NOTE: es must ALWAYS point to DG
622 mov ax,0100h ; Ask if already installed
626 ; $if z ; if not installed ;AC000;
629 call Load_R_Msg ; ;AC000;
631 ; $if nc ; if no error ;AC000;
634 call Save_Vectors ; ;AC000;
636 ; $endif ; endif - NB: - If carry IS set, ;AC000;
638 ; Load_R_Msg will have loaded the
641 ; $else ; else - we are installed ;AC000;
647 ; $if z ; if PSPRINT conflict ;AC000;
650 mov ax,(CLASS_B shl 8) + CONFLICTMES ; load error message # ;AC000;
652 stc ; set the error flag ;AC000;
658 mov [PInst],2 ; remember print already installed
659 ; and that we only do one pass
660 mov al," " ; invalidate install switches ;AN005;
661 mov SW_PTR,al ; /D ;AN005;
662 mov B_SWITCH,al ; /B ;AN005;
663 mov Q_SWITCH,al ; /Q ;AN005;
664 mov S_SWITCH,al ; /S ;AN005;
665 mov U_SWITCH,al ; /U ;AN005;
666 mov M_SWITCH,al ; /M ;AN005;
667 clc ; reset the error flag ;AC000;
676 ; $if nc,and ; if no errors so far and..............;AC000;
679 call GetHInt ; save current int 24 vector
680 call SetInts ; set int 23 and 24 vectors
681 mov ax,CHAR_OPER shl 8
683 mov [SWITCHAR],dl ; Get user switch character
686 ; $if e ; if "-" ;AC000;
688 mov [PathChar],"/" ; alternate path character
692 ; Set up for Parse_Input call
694 ; $do ; Do_until end of command line ;AC000;
697 ; $leave c ; quit if an error occured ;AC000;
700 call parse_input ; ;AC000;
702 mov [ordinal],cx ; update Parse_C_B ;AC000;
703 mov [scan_ptr],si ; ;AC000;
705 cmp al,EOL ; are we at the end? ;AC000;
707 ; $leave e ; leave if end of line ;AC000;
710 cmp al,noerror ; ;AC000;
712 ; $if ne ; if error ;AC000;
715 mov ah,Parse_error ; set class to Parse error ;AC000;
718 stc ; set the error flag ;AC000;
720 ; $endif ; endif ;AC000;
723 ; $leave c ; leave the loop if error ocurred ;AC000;
726 cmp [p_type],File_Spec ; is it a file spec? ;AC000;
728 ; $if e ; if it is a file spec ;AC000;
731 call Submit_File ; ;AC000;
733 ; $else ; else - we must now have a ;AC000;
741 push cs ; set up for CASE ;AC000;
743 mov ax,[p_syn] ; ;AC000;
744 sub ax,OFFSET DG:SW_PTR ; ;AC000;
745 mov dl,SW_SIZE ; ;AC000;
747 cmp ah,noerror ; ;AC000;
749 mov ax,(CLASS_B shl 8) + invparm ; set message in case of error ;AC000;
751 ; $if e ; if no error in jump calculation ;AC000;
754 call Process_A_Switch ; ;AC000;
760 stc ; set the error flag ;AC000;
762 ; $endif ; endif - no error in jump calculation ;AC000;
765 ; $endif ; endif - name or switch ;AC000:
768 ; $leave c ; leave the loop if error ocurred ;AC000;
771 ; $enddo ; enddo ;AC000;
775 ; $if nc,long ; if no error so far ;AC000;
780 cmp [PInst],0 ; is print already installed?
782 ; $if e ; if not installed ;AC000;
785 call Set_Buffer ; NOTE from now on the TRANSIENT could ;AC000;
786 ; be in a SEGMENT that is different
787 ; than the one set up by the loader!
788 ; *** MOV xx,DG will no longer work ***
789 ; (use PUSH CS , POP xx instead)
791 ; $endif ; endif - installed ;AC000;
794 ; Grab the pointer to the queue and
795 ; lock it down. Remember that since
796 ; there are threads in the background,
797 ; we may get a busy return. We sit
798 ; here in a spin loop until we can
799 ; actually lock the queue.
801 mov ax,0104h ; get status
802 call IntWhileBusy ; on return DS:SI points to queue
805 ;------------------------------------
807 ;------------------------------------
809 cmp dx,ErrCnt1 ; check count
811 ; $if ae ; if count too high ;AC000;
814 mov ax,(CLASS_B shl 8) + CntMes ; printer might be off-line ;AC000;
815 call DispMsg ; ;AC000;
817 ; $endif ; endif - count Too high ;AC000;
820 ; ;------------------------------------
821 ; ; display current queue
822 ; ; ds:si points to print queue
823 ; ; ds:di must point to display
825 ; ; xNameTrans will copy the name into
826 ; ; the name buffer. It will do
827 ; ; any name truncation if needed
828 ; ; (including any DBSC characters)
830 ; ;------------------------------------
831 ; mov di,offset dg:NameBuf ; ;AN009;
832 ; mov ax,(xNameTrans SHL 8) ; check for name translation ;AN009;
833 ; int 21h ; get real path and name ;AN009;
835 ;;;;;;;;;;;;;xxxxxxxxxxxxxxxxx
837 ;;;;;;;;;;;;;xxxxxxxxxxxxxxxxx
839 mov ax,[whichmsg] ; ;AN000;
840 mov [whichmsg],(CLASS_C shl 8) + SecMes ; set up in queue msg ;AC000;
841 cmp byte ptr ds:[si],0 ; is the queue empty?
843 ; $if ne ; if queue not empty ;AC000;
850 call DispMsg ; ;AC000;
852 add si,MaxFileLen ; point to next entry in queue
854 ;;;;;;;;;;;;;xxxxxxxxxxxxxxxxx
856 ;;;;;;;;;;;;;xxxxxxxxxxxxxxxxx
858 ; mov di,offset dg:NameBuf ; ;AN009;
859 ; mov ax,(xNameTrans SHL 8) ; check for name translation ;AN009;
860 ; int 21h ; get real path and name ;AN009;
861 mov ax,[whichmsg] ; ;AC009;
862 cmp byte ptr ds:[si],0 ; end of queue?
867 ; $else ; else - queue is empty ;AC000;
871 mov ax,(CLASS_B shl 8) + NoFils ; ;AC000;
872 call DispMsg ; ;AC000;
874 ; $endif ; endif - queue not empty ;AC000;
877 ;------------------------------------
879 ;------------------------------------
881 mov ax,0105H ; unlock the print queue
882 call IntWhileBusy ; on return DS:SI points to queue
883 cmp [PInst],1 ; are we partially installed ?
885 ; $if e ; if so... complete the process ;AC000;
888 mov ax,CodeR ; close Std Devices
894 mov cx,5 ; StdIN,StdOUT,StdERR,StdAUX,StdPRN
896 ; $do ; Close STD handles before keep process;AC000;
903 ; $enddo loop ; ;AC000;
907 mov dx,[ENDRES] ; install print...
908 mov ax,KEEP_PROCESS shl 8 ; Exit code 0
910 ; $else ; else - ;AC000;
914 mov ax,(EXIT shl 8) ; quit with no error
916 ; $endif ; endif - ;AC000;
919 ; $else ; else - a fatal error occured ;AC000;
923 call DispMsg ; display the error message ;AC000;
924 mov ax,(EXIT shl 8) ; quit with error
927 ; $endif ; erdif - errors ;AC000;
931 int 21h ; either EXIT or KEEP_PROCESS
938 ret ; Must use this method, version may be < 2.00
941 BREAK <Process_A_Switch>
942 ;******************* START OF SPECIFICATIONS ***********************************
944 ; NAME: Process_A_Switch
946 ; FUNCTION: This routine is a DO Case that processes all valid switched for
949 ; INPUT: Jump table offset calculated in the main routine.
951 ; OUTPUT: Proper processing for the switch
953 ; REGISTERS USED: T.B.D.
956 ; LINKAGE: Call from: TRANSIENT
964 ; EXTERNAL Call to: DispMsg Parse_Input GetAbsN
965 ; REFERENCES: IntWhileBusy GetAbsN2
967 ; CHANGE 04/01/87 - make SWITCH processing a PROC - FJG
970 ;******************* END OF SPECIFICATIONS *************************************
971 ;******************** START - PSEUDOCODE ***************************************
973 ; START Process_A_Switch
974 ; END Process_A_Switch
976 ;******************** END - PSEUDOCODE ***************************************
978 Process_A_Switch PROC NEAR
982 jmp cs:JMPTABLE[di] ; ;AC000;
984 JMPTABLE LABEL WORD ; ;AC000;
998 CASE_D: ; Bgncase_/D ;AN000;
1000 cmp [PInst],0 ; ;AC000;
1002 ; $if e,and ; if not installed ;AC000;
1005 ; move device name to LISTNAME
1006 mov bp,[P_PTR_L] ; ;AC000;
1007 mov di,bp ; save start address ;AC000;
1008 mov ax,[P_PTR_H] ; ;AC000;
1013 xor al,al ; find the length of input name ;AN000;
1014 mov cx,9 ; it can not be longer than 8 + : ;AN000;
1016 ASSUME es:DG ; this is a bogus assume to keep the
1018 repne scas NameBuf ; (use NameBuf to tell assembler its ;AN000;
1020 ASSUME es:nothing ; this puts it back right
1022 dec di ; back up to first null ;AN000;
1023 mov ax,di ; pointer to end ;AN000;
1024 sub ax,bp ; subtract start pointer ;AN000;
1025 mov cx,ax ; difference is the length ;AN000;
1026 or cx,cx ; is it non zero? ;AN000;
1028 ; $if ne ; if we have a name ;AN000;
1031 mov si,di ; set DS:SI up to source (Parse Buffer);AN000;
1032 mov ax,es ; set ES:DI up to LISTNAME (in CodeR) ;AN000;
1037 ASSUME DS:nothing,ES:CodeR
1039 mov WORD PTR [LISTNAME],2020h ; Nul out default
1040 mov [LISTNAME+2]," " ;
1041 mov di,OFFSET CodeR:LISTNAME ;
1042 dec si ; back up to last character ;AN004;
1043 cmp BYTE PTR [si],':' ; is there a ':' at the end of the name?
1045 ; $if e ; if it is ;AC000;
1047 dec cx ; Chuck the trailing ':'
1051 cmp cx,8 ; is the name still longer than 8?
1053 ; $if a ; if it is ;AC000;
1055 mov cx,8 ; Limit to 8 chars for device
1060 rep movsb ; move the device name into LISTNAME ;AC000;
1062 mov [DevSpec],1 ; remember that a device was specified
1063 clc ; reset carry ;AC000;
1065 ; $else ; else ;AC000;
1069 stc ; set carry ;AC000;
1071 ; $endif ; endif ;AC000;
1078 mov al," " ; invalidate this switch ;AN005;
1079 mov SW_PTR,al ; /D ;AN005;
1082 JMP CASE_END ; Endcase_/D ;AN000;
1084 CASE_B: ; Bgncase_/B ;AN000;
1090 ; $if e ; if not installed ;AC000;
1093 mov ax,[P_PTR_L] ; get the value ;AC000;
1094 push ds ; update BLKSIZ
1105 clc ; reset carry ;AC000;
1107 ; $else ; else ;AC000;
1111 stc ; set carry ;AC000;
1113 ; $endif ; endif ;AC000;
1116 mov al," " ; invalidate this switch ;AN005;
1117 mov B_SWITCH,al ; /B ;AN005;
1119 JMP CASE_END ; Endcase_/B ;AN000;
1121 CASE_Q: ; Bgncase_/Q ;AN000;
1125 ; $if e ; if not installed ;AC000;
1128 mov ax,[P_PTR_L] ; get the value ;AC000;
1129 push ds ; update BLKSIZ
1140 clc ; reset carry ;AC000;
1142 ; $else ; else ;AC000;
1146 stc ; set carry ;AC000;
1148 ; $endif ; endif ;AC000;
1151 mov al," " ; invalidate this switch ;AN005;
1152 mov Q_SWITCH,al ; /Q ;AN005;
1154 JMP CASE_END ; Endcase_/Q ;AN000;
1156 CASE_S: ; Bgncase_/S ;AN000;
1160 ; $if e ; if not installed ;AC000;
1163 mov ax,[P_PTR_L] ; get the value ;AC000;
1164 push ds ; update TIMESLICE, SLICECNT
1170 mov [TIMESLICE],al ;
1176 clc ; reset carry ;AC000;
1178 ; $else ; else ;AC000;
1182 stc ; set carry ;AC000;
1184 ; $endif ; endif ;AC000;
1187 mov al," " ; invalidate this switch ;AN005;
1188 mov S_SWITCH,al ; /S ;AN005;
1190 JMP CASE_END ; Endcase_/S ;AN000;
1192 CASE_U: ; Bgncase_/U ;AN000;
1196 ; $if e ; if not installed ;AC000;
1199 mov ax,[P_PTR_L] ; get the value ;AC000;
1200 push ds ; update BUSYTICK
1211 clc ; reset carry ;AC000;
1213 ; $else ; else ;AC000;
1217 stc ; set carry ;AC000;
1219 ; $endif ; endif ;AC000;
1222 mov al," " ; invalidate this switch ;AN005;
1223 mov U_SWITCH,al ; /U ;AN005;
1225 JMP CASE_END ; Endcase_/U ;AN000;
1227 CASE_M: ; Bgncase_/M ;AN000;
1231 ; $if e ; if not installed ;AC000;
1234 mov ax,[P_PTR_L] ; get the value ;AC000;
1235 push ds ; update MAXTICK
1246 clc ; reset carry ;AC000;
1248 ; $else ; else ;AC000;
1252 stc ; set carry ;AC000;
1254 ; $endif ; endif ;AC000;
1257 mov al," " ; invalidate this switch ;AN005;
1258 mov M_SWITCH,al ; /M ;AN005;
1260 JMP CASE_END ; Endcase_/M ;AN000;
1262 CASE_T: ; Bgncase_/T ;AN000;
1264 push si ; save parse pointer
1266 cmp [PInst],0 ; has print been installed?
1268 ; $if e ; if not installed ;AC000;
1271 call Set_Buffer ; do it now ;AC000;
1273 ; $endif ; endif ;AC000;
1276 mov ax,0103H ; cancel command
1280 pop si ; restore parse pointer
1282 clc ; reset carry ;AC000;
1284 JMP CASE_END ; Endcase_/T ;AN000;
1286 CASE_C: ; Bgncase_/C ;AN000;
1288 cmp [PInst],0 ; has print been installed?
1290 ; $if ne ; if installed ;AC000;
1293 mov [CanFlag],1 ; set CanFlag
1295 ; $else ; else ;AC000;
1299 call Set_Buffer ; ;AC000;
1301 ; $endif ; endif ;AC000;
1304 clc ; reset carry ;AC000;
1306 JMP CASE_END ; Endcase_/C ;AN000;
1308 CASE_P: ; Bgncase_/P ;AN000;
1310 cmp [PInst],0 ; has print been installed?
1312 ; $if ne ; if installed ;AC000;
1315 mov [CanFlag],0 ; reset CanFlag
1317 ; $else ; else ;AC000;
1321 call Set_Buffer ; ;AC000;
1323 ; $endif ; endif ;AC000;
1326 clc ; reset carry ;AC000;
1330 CASE_END: ; End_case ;AN000;
1332 ; $if c ; if carry set ;AC000;
1335 mov ax,(Parse_error shl 8) + INVPARM ; set up for Invalid_parm message ;AN000:
1337 cmp [PInst],0 ; has print been installed?
1339 ; $if ne ; if installed ;AN005;
1342 call DispMsg ; display the message and keep going ;AN005;
1344 ; $endif ; endif ;AN005;
1347 ; $endif ; endif ;AC000;
1352 Process_A_Switch ENDP
1355 ;******************* START OF SPECIFICATIONS ***********************************
1357 ; NAME: Submit_File - PRINT TRANSIENT to Resident Interface Routine
1359 ; FUNCTION: Resolved ambiguous file names (containing ? and *) and submits
1360 ; the file to the Resident component of PRINT for printing.
1362 ; INPUT: File name in Parse buffer
1366 ; NOTE: This code is primarily old code, but it has been completely
1367 ; restructured and SALUTed.
1369 ; REGISTERS USED: T.B.D.
1372 ; LINKAGE: Call from: TRANSIENT
1380 ; EXTERNAL Call to: DispMsg Parse_Input GetAbsN
1381 ; REFERENCES: IntWhileBusy GetAbsN2
1383 ; CHANGE 04/01/87 - change PaFile to Submit_File - F. G.
1386 ;******************* END OF SPECIFICATIONS *************************************
1387 ;******************** START - PSEUDOCODE ***************************************
1396 ; INPUT: CanFlag and Ambig set appropriately
1410 ; load error message
1413 ; do (until not Ambig)
1429 ; call Absn2 (will set fail if at end)
1450 ;******************** END - PSEUDOCODE ***************************************
1452 Submit_File PROC NEAR
1456 nop ; for production - uncomment this line and comment the next
1460 cmp [PInst],0 ; has print been installed?
1462 ; $if e ; if not ..... ;AC000;
1465 call Set_Buffer ; ... better do it now ;AC000;
1467 ; $endif ; endif - installed ;AC000;
1470 cld ; just in case...
1471 mov [Ambig],0 ; assume not an ambigous file
1473 ;------------------------------------
1474 ; Check for drive specifier
1475 ;------------------------------------
1477 mov si,P_PTR_L ; ;AC000;
1478 mov ax,P_PTR_H ; ;AC000;
1483 mov di,offset dg:NameBuf ; buffer for full file name
1484 cmp byte ptr [si+1],":" ; check if there is a drive designator
1486 ; $if ne ; if no : ;AC000;
1489 mov ah,Get_Default_Drive ; get it...
1491 mov dl,al ; save for later (used in DoPath)
1492 inc dl ; adjust to proper code (A=1,B=2,...)
1493 add al,"A
" ; conver to letter code
1494 stosb ; store letter code
1497 clc ; clear error flag ;AC000;
1499 ; $else ; else - theres a drive ;AC000;
1503 mov al,byte ptr [si] ; get drive letter
1504 sub al,"@
" ; conver to proper code...
1506 ; $if a ; if a valid drive ;AC000;
1509 mov dl,al ; save for later (used in DoPath)
1510 movsb ; move the drive letter
1511 movsb ; move the ":"
1518 mov ax,(CLASS_B shl 8) + InvDrvMes ; set up error message ;AC000;
1519 stc ; set error flag ;AC000;
1524 ; $endif ; endif - : ;AC000;
1528 ;------------------------------------
1529 ; could have CF & message # here
1530 ;------------------------------------
1531 ; $if nc ; if no error so far ;AC000;
1534 ;------------------------------------
1535 ; Check for full path
1536 ;------------------------------------
1538 cmp byte ptr [si],al ; does it start from the root?
1540 ; $if ne ; if not get the current path ;AC000;
1543 stosb ; store path character
1545 mov si,di ; buffer for current directory
1546 mov ah,Current_Dir ; get current directory
1549 ; $if c ; if an error occures ;AC000;
1552 pop si ; clear the stack
1554 mov ax,(CLASS_B shl 8) + InvDrvMes ; set up error message ;AC000;
1556 ; $else ; else - no error so far ;AC000;
1561 ; $do ; find terminating nul ;AC000;
1567 ; $enddo z ; ;AC000;
1570 dec si ; adjust to point to nul
1571 mov ax,di ; save pointer to beg. of path
1572 mov di,si ; here is were the file name goes
1573 pop si ; points to file name
1574 cmp ax,di ; if equal then file is in the root
1576 ; $if ne ; if not, add a path char ;AC000;
1580 stosb ; put path separator before file name
1584 ;------------------------------------
1585 ; Check for valid drive.
1586 ;------------------------------------
1588 ; Done by getting current dir of
1589 ; the drive in question (already in
1590 ; DL) into NameBuf. If no error the
1591 ; valid drive and we throw away the
1592 ; current dir stuf by overwriting it
1593 ; with the filename.
1595 clc ; reset error flag ;AC000;
1600 ; $else ; else - it starts from the root ;AC000;
1603 ; DL has drive number (from DrvFound)
1605 mov si,di ; buffer for current directory
1606 mov ah,Current_Dir ; get current directory
1613 mov ax,(CLASS_B shl 8) + InvDrvMes ; ;AC000;
1621 ; $endif ; endif errors ;AC000;
1624 ;------------------------------------
1625 ; could have CF & message # here
1626 ;------------------------------------
1628 ; $if nc ; if no error so far ;AC000;
1631 mov cx,MaxFileLen ; lets not overflow file name buffer
1632 mov ax,di ; CX := MaxFileLen -
1633 ; long(&NameBuf - &PtrLastchar)
1634 sub ax,offset dg:NameBuf ; size of the filename so far
1635 sub cx,ax ; size left for the filename
1637 ; $if c ; if too long ;AC000;
1640 mov cx,1 ; Set cx to Fall through to FNTooLong
1645 ; WHILE (Length(FileName) <= MaxFileLen)
1646 ; $search ; DO copy in the file name ;AC000;
1653 ; $if e,or ; if its ambigous - *, or...... ;AC000;
1658 ; $if e ; if its ambigous - ?, .......: ;AC000;
1662 mov [Ambig],1 ; ambigous filename found
1664 ; $endif ; endif - ambigous ;AC000;
1667 or al,al ; end of name?
1670 ; $exitif z ; ;AC000;
1677 ; $endloop loop ; ;AC000;
1680 dec di ; the name was too long !
1682 mov ax,(CLASS_C shl 8) + NamTMes ; ;AC000;
1685 ; $endsrch ; we have the full absolute name... ;AC000;
1689 ; $endif ; endif errors ;AC000;
1692 push cs ; restore ds to DG
1697 ;------------------------------------
1698 ; could have CF & message #
1699 ;------------------------------------
1700 ; $if nc,long ; ;AC000;
1706 mov [NulPtr],di ; save pointer to termanting nul
1708 ;------------------------------------
1709 ; check for an option following name
1710 ;------------------------------------
1711 call Parse_Input ; ;AC000;
1713 cmp ax,noerror ; a parse error? ;AC000;
1715 ; $if e ; if no parse error ;AC000;
1719 cmp [P_SYN],offset DG:C_SW_ptr ; is it the cancel switch /C ;AC000;
1721 ; $if e ; if it is ;AC000;
1724 mov [CanFlag],1 ; set cancel flag
1726 ; $else ; else - it is not ;AC000;
1730 cmp [P_SYN],offset DG:P_SW_ptr ; is it the print switch /P ;AC000;
1732 ; $if e ; if it is ;AC000;
1735 mov [CanFlag],0 ; reset cancel flag
1743 ; $if e ; if /C or /P found ;AC000;
1746 mov [ordinal],cx ; ;AC000;
1747 mov [scan_ptr],si ; ;AC000;
1754 ;--------------------------------------
1755 ;------------------------------------
1757 ;------------------------------------
1759 cmp [CanFlag],1 ; are we in cancel mode
1761 ; $if e ; if cancel mode ;AC000;
1763 ;------------------------------------
1764 ; Issue a cancel command
1765 ;------------------------------------
1767 ; NOTE: ds:dx MUST point to NameFuf !!!
1770 mov dx,offset dg:NameBuf ; filename
1779 ; $if ne ; Original Print Code timing jump ;AC000;
1781 ;------------------------------------
1782 ;***** PROCESS CANCEL ERROR
1783 ;------------------------------------
1787 mov ax,(CLASS_C shl 8) + BadCanMes ; ;AC000;
1793 ; $else long ; submit mode active ;AC000;
1797 cmp [Ambig],1 ; is this an ambigous name?
1799 ; $if e,and ; if it is ambigous ;AC000;
1802 ; do another ambigous name
1803 call GetAbsN ; get abs name into NameBuf
1805 ; $if c ; if an error occured ;AC000;
1808 mov ax,(CLASS_C shl 8) + BadNameMes ; ;AC000;
1809 call DispMsg ; call DispMsg ;AN000;
1811 ; $else long ; there is at least 1 name ;AC000;
1815 ; $do ; until all names processed ;AC000;
1818 ; Check if this is a local drive -
1819 ; If it is, convert the filename
1820 ; to its physical name.
1822 lea si,NameBuf ; DS:SI = NameBuf containing name ;AN010;
1823 mov bl,ds:[si] ; get DRIVE ID ;AN010;
1824 sub bl,40h ; convert to a number ;AN010;
1825 ; IOCtl call to see if target drive is local
1826 mov ax,(IOCTL SHL 8) + 9 ;AN010;
1827 INT 21h ; IOCtl + dev_local <4409> ;AN010;
1829 ; $if nc,and ; target drive local and ;AN010;
1832 test dx,1200H ; check if (x & 0x1000) ;AN010;
1833 ; (redirected or shared)
1834 ; $if z,and ; if RC indicates NO network drive ;AN010;
1837 ; Translate the file name into an
1838 ; absolute path name - note that
1839 ; from this point on only SERVER DOS
1840 ; calls will work with this name!
1842 lea di,TokBuf ; DS:DI = output buffer ;AN010;
1843 mov ax,(xNameTrans SHL 8) ; check for name translation ;AN010;
1844 int 21h ; get real path and name ;AN010;
1846 ; $if nc ; if no errors so far ;AN010;
1849 xchg di,si ; switch source and destination ;AN010;
1850 mov cx,((MaxFileLen+16)/2) ; move Max buffer ;AN010;
1852 rep movsw ; move name back into NameBuf ;AN010;
1856 ; set up to open file
1857 xor cx,cx ; zero attribute type ;AC000;
1859 dec di ; no list supplied ;AC001;
1860 mov dx,(ignore_cp shl 8) + (failopen shl 4) + openit ; ;AC001;
1861 mov open_seg,es ; segment fix up for OPEN_FILE ;AC000;
1862 lds si,OPEN_FILE ; ;AC001;
1863 mov bx,open_mode ; set open mode ;AC000;
1864 mov ah,ExtOpen ; open for reading exist. ;AN010;
1865 mov al,ds:[si] ; recover drive ID ;AN010;
1867 call TO_DOS ; make a SERVER DOS call ;AC010;
1869 ; $if c ; if error ;AC000;
1873 SaveReg <SI,DI,BP,ES,DS>
1875 mov ah,GetExtendedError
1879 RestoreReg <DS,ES,BP,DI,SI>
1886 mov bx,ax ; copy handle
1889 clc ; clear error flag ;AC000;
1892 mov dx,offset dg:NameBuf ;
1893 mov word ptr [SubPack+1],dx ; store pointer to name in
1894 mov word ptr [SubPack+3],ds ; submit packet
1895 mov dx,offset dg:SubPack ; DS:DX address of packet
1896 mov ax,0101H ; submit a file to resident
1899 ; $if nc,and ; if successfull, or ;AC000;
1902 cmp ax,error_queue_full
1904 ; $if ne ; if error but queue not full ;AC000;
1907 mov [QFullMes],0 ; queue is not full
1908 clc ; reset the error flag ;AC000;
1910 ; $else ; else - the queue IS full ;AC000;
1914 cmp [QFullMes],1 ; has the message already been issued?
1916 ; $if ne ; if the message has not been posted ;AC000;
1919 mov [QFullMes],1 ; set the 'message posted' flag
1920 mov ax,(CLASS_B shl 8) + FullMes ; load msg # ;AC000;
1921 stc ; display the message ;AC000;
1925 clc ; make sure carry clear
1926 ; $endif ; message processed ;AC000;
1929 ; $endif ; queue errors ;AC000;
1932 ; $endif ; OPENing errors ;AC000;
1935 ; $if c ; if error ;AC000;
1938 call DispMsg ; display the error with this file ;AC000;
1943 ; $leave c ; quit if error in displaying message ;AC000;
1946 cmp [Ambig],1 ; are we processing an ambigous name?
1948 ; $if e ; if Ambiguous ;AC000;
1950 ; call Absn2 (will set fail if at end)
1951 call GetAbsN2 ; get another file name
1957 mov ax,0 ; set fail ;AC000;
1963 ; $enddo c,long ; end do on fail ;AC000;
1969 cmp ax,0 ; is there a message? ;AC000;
1971 ; $if e ; if no message ;AC000;
1974 clc ; reset fail ;AC000;
1976 ; $endif ; no message to display ;AC000;
1979 ; $endif ; any submission errors ;AC000;
1982 ; $endif ; submit or cancel ;AC000;
1985 ; $endif ; any errors so far ;AC000;
1988 ; $if c ; if error ;AC000;
1991 call DispMsg ; display the submit error ;AC000;
1996 ret ; finished submission ;AC000;
2001 ;******************* START OF SPECIFICATIONS ***********************************
2003 ; NAME: Set_Buffer - PRINT Build Resident Buffer routine.
2005 ; FUNCTION: Calculate the buffer size required by the resident component and
2006 ; move the transient portion accordingly
2008 ; NOTE: This code is primarily old code, but it has been partly
2009 ; restructured in order to SALUT it.
2013 ; OUTPUT: Resident Buffer established, and TRANSIENT moved accordingly.
2015 ; REGISTERS USED: T.B.D.
2018 ; LINKAGE: Called from: TRANSIENT
2026 ; EXTERNAL Calls to: DispMsg, Parse_Input
2029 ; CHANGE 03/11/87 - Change SETBUF to Set_Buffer - F. G.
2032 ;******************* END OF SPECIFICATIONS *************************************
2033 ;******************** START - PSEUDOCODE ***************************************
2038 ;******************** END - PSEUDOCODE ***************************************
2040 Set_Buffer PROC NEAR
2045 mov dl,[PathChar] ; transfer PathChar (in PRINT_T)
2049 mov [PChar],dl ; to PChar (in PRINT_R)
2052 ;------------------------------------
2054 ;------------------------------------
2056 cmp [DevSpec],1 ; was it already specified?
2058 ; $if ne,and ; if not specified ........... ;AC000;
2061 lea di,TokBuf ; ES:DI point to TokBuf : ;AC000;
2062 mov [TokBuf],9 ; max of 9 chars :
2063 mov [TokBuf+1],0 ; assume zero in :
2069 assume es:DG ; ;AC000;
2071 mov ax,(CLASS_D shl 8) + prompt ; DispMsg treats 'prompt' as : ;AC000;
2073 call DispMsg ; : ;AC000;
2075 mov ax,(CLASS_B shl 8) + NEXT_LINE ; advance to next line after : ;AC000;
2076 ; "buffered input
" call:
2077 call DispMsg ; : ;AC000;
2083 mov cl,[TokBuf+1] ; check how many read in :
2086 ; $if nz ; if a CR was typed..........: ;AC000;
2090 mov si,offset dg:TokBuf+2
2091 mov di,offset CodeR:ListName
2093 mov dx,si ; get ready to capitalize ;AN007;
2095 mov byte ptr [si],0 ; turn it into an ascii z string ;AN007;
2096 mov ax,(GetExtCntry SHL 8) + Cap_ASCIIZ ; let DOS capitalize the string ;AN007;
2097 INT 21h ; call DOS to do it ;AN007;
2099 cmp byte ptr [si],':'
2101 ; $if e ; if a : ;AC000;
2103 dec cx ; get rid of trailing ':'
2104 ; $endif ; endif - a : ;AC000;
2107 cmp cx,8 ; is it greater than 8 ? ;AN000;
2109 ; $if a ; if greater - force it to 8.: ;AC000;
2123 ;------------------------------------
2125 ;------------------------------------
2131 mov ax,MaxFileLen ; maximum length of a file name
2132 mul [QueueLen] ; AX = result
2133 add ax,offset CodeR:FileQueue
2134 mov [EndQueue],ax ; save pointer to last nul
2136 mov [buffer],ax ; beggining of buffer
2138 ;------------------------------------
2140 ;------------------------------------
2143 mov [ENDPTR],AX ; Set end of buffer pointer
2144 mov [NXTCHR],AX ; Buffer empty
2145 add ax,100h ; allow for header
2146 add ax,16 ; Convert to para
2151 mov [EndRes],ax ; Add size of buffer to term res size
2153 ; Now JUMP into PRINT_R - the resident
2154 jmp MoveTrans ; code to initialize the buffer space
2156 TransRet: ; after moving the transient we come
2158 sti ; Ints were off during initialization
2159 push cs ; CAUTION !!!! from here on in DG is
2160 pop ax ; not the ASSEMBLED DG - its bogus -
2161 mov ds,ax ; after the move! Only PUSH/POP will
2163 mov WORD PTR [insert_ptr_seg],ax ; fix up segment in SUBLIST for msgs! ;AC002;
2164 mov WORD PTR [P_PTR_H],ax ; fix up segment for PARSE ;AC002;
2169 call SYSLOADMSG ; RE-Initialize the Message Services ;AN016;
2170 ; - WARNING!!! the Message retriver
2171 ; keeps track of offset and SEGMENT
2172 ; for extended and parse errors
2173 ; EVEN THOUGH WE ARE NEAR!!! since
2174 ; the location could now have been
2175 ; moved - it must now be reset
2177 ;------------------------------------
2178 ; normalize int handlers for new location of dg
2179 ;------------------------------------
2181 mov ax,(SET_INTERRUPT_VECTOR shl 8) or 23h
2182 mov dx,OFFSET DG:INT_23
2184 mov ax,(SET_INTERRUPT_VECTOR shl 8) or 24h
2185 mov dx,OFFSET DG:INT_24
2188 mov [PInst],1 ; remember we just installed resident part
2190 ret ; finished ;AC000;
2194 BREAK <copy_to_arg_buf>
2195 ;******************* START OF SPECIFICATIONS ***********************************
2197 ; NAME: copy_to_arg_buf
2199 ; FUNCTION: Copies the names of the files in the print queue into NameBuf
2200 ; - one name copied per invocation
2207 ; REGISTERS USED: T.B.D.
2209 ; LINKAGE: Called from:
2212 ; CHANGE 05/20/87 - Header added - F. G.
2215 ;******************* END OF SPECIFICATIONS *************************************
2216 ;******************** START - PSEUDOCODE ***************************************
2218 ; START copy_to_arg_buf
2222 ; END copy_to_arg_buf
2224 ;******************** END - PSEUDOCODE ***************************************
2226 copy_to_arg_buf PROC NEAR
2230 push ax ; must preserve AX (could be message #);AN000;
2231 mov di,offset dg:NameBuf
2239 ; $leave z ; ;AC000;
2249 pop ax ; must preserve AX (could be message #);AN000;
2255 copy_to_arg_buf ENDP
2257 BREAK <IntWhileBusy>
2258 ;******************* START OF SPECIFICATIONS ***********************************
2260 ; NAME: IntWhileBusy
2269 ; REGISTERS USED: T.B.D.
2271 ; LINKAGE: Called from:
2274 ; CHANGE 05/20/87 - Header added - F. G.
2277 ;******************* END OF SPECIFICATIONS *************************************
2278 ;******************** START - PSEUDOCODE ***************************************
2280 ; START IntWhileBusy
2286 ;******************** END - PSEUDOCODE ***************************************
2288 IntWhileBusy PROC NEAR
2290 ; $search complex ; ;AC000;
2296 ; $strtsrch ; ;AC000;
2302 ; $exitif nc ; ;AC000;
2305 add sp,2 ; clear off AX and clear carry
2313 ; $leave nz ; ;AC000;
2316 ; $endloop ; ;AC000;
2320 add sp,2 ; clear off AX
2323 ; $endsrch ; ;AC000;
2331 ;******************* START OF SPECIFICATIONS ***********************************
2335 ; FUNCTION: Return first absolute name from ambigous name
2337 ; INPUT: NameBuf has the ambigous File Name
2339 ; OUTPUT: Carry Set if no files match
2340 ; else NameBuf has the absolute name
2342 ; REGISTERS USED: T.B.D.
2344 ; LINKAGE: Called from:
2347 ; CHANGE 05/20/87 - Header added - F. G.
2350 ;******************* END OF SPECIFICATIONS *************************************
2351 ;******************** START - PSEUDOCODE ***************************************
2359 ;******************** END - PSEUDOCODE ***************************************
2365 mov ah,Set_DMA ; buffer for ffirst / fnext
2366 mov dx,offset dg:SearchBuf
2368 ;------------------------------------
2370 ;------------------------------------
2371 mov dx,offset dg:NameBuf
2372 mov cx,0 ; no attributes
2376 ; $if nc ; if no error ;AC000;
2379 ;------------------------------------
2380 ; Place new name in NameBuf
2381 ;------------------------------------
2391 ; $enddo e ; ;AC000;
2394 cld ; just in case...
2401 ; $endif ; endif -no error ;AC000;
2409 ;******************* START OF SPECIFICATIONS ***********************************
2413 ; FUNCTION: Return next absolute name from ambigous
2419 ; REGISTERS USED: T.B.D.
2421 ; LINKAGE: Called from:
2424 ; CHANGE 05/20/87 - Header added - F. G.
2427 ;******************* END OF SPECIFICATIONS *************************************
2428 ;******************** START - PSEUDOCODE ***************************************
2436 ;******************** END - PSEUDOCODE ***************************************
2440 mov ah,Set_DMA ; buffer for ffirst / fnext
2441 mov dx,offset dg:SearchBuf
2446 ; $if nc ; if no error ;AC000;
2449 call CopyName ; we found one
2452 ; $endif ; endif - no error ;AC000;
2455 mov ax,0 ; signal no message available
2462 ;******************* START OF SPECIFICATIONS ***********************************
2466 ; FUNCTION: Copy name from search buf to NameBuf
2472 ; REGISTERS USED: T.B.D.
2474 ; LINKAGE: Called from:
2477 ; CHANGE 05/20/87 - Header added - F. G.
2480 ;******************* END OF SPECIFICATIONS *************************************
2481 ;******************** START - PSEUDOCODE ***************************************
2489 ;******************** END - PSEUDOCODE ***************************************
2494 mov si,offset dg:SearchBuf.find_buf_pname
2497 ; $do ; until null is found ;AC000;
2500 lodsb ; move the name
2502 or al,al ; nul found?
2504 ; $enddo e ; ;AC000;
2511 BREAK <Save_Vectors>
2512 ;******************* START OF SPECIFICATIONS ***********************************
2514 ; NAME: Save_Vectors
2516 ; FUNCTION: save int vectors in case of error
2522 ; REGISTERS USED: T.B.D.
2524 ; LINKAGE: Called from:
2527 ; CHANGE 05/20/87 - Header added - F. G.
2530 ;******************* END OF SPECIFICATIONS *************************************
2531 ;******************** START - PSEUDOCODE ***************************************
2533 ; START Save_Vectors
2539 ;******************** END - PSEUDOCODE ***************************************
2541 Save_Vectors PROC NEAR
2543 mov ax,(get_interrupt_vector shl 8) or SOFTINT ; (SOFTINT)
2548 mov word ptr [i28vec+2],es
2549 mov word ptr [i28vec],bx
2551 mov ax,(get_interrupt_vector shl 8) or COMINT ; (COMINT)
2553 mov word ptr [i2fvec+2],es
2554 mov word ptr [i2fvec],bx
2556 mov ax,(get_interrupt_vector shl 8) or 13h
2558 mov word ptr [i13vec+2],es
2559 mov word ptr [i13vec],bx
2561 mov ax,(get_interrupt_vector shl 8) or 15h
2563 mov word ptr [i15vec+2],es
2564 mov word ptr [i15vec],bx
2566 mov ax,(get_interrupt_vector shl 8) or 17h
2568 mov word ptr [i17vec+2],es
2569 mov word ptr [i17vec],bx
2571 mov ax,(get_interrupt_vector shl 8) or 14h
2573 mov word ptr [i14vec+2],es
2574 mov word ptr [i14vec],bx
2576 mov ax,(get_interrupt_vector shl 8) or 05h
2578 mov word ptr [i05vec+2],es
2579 mov word ptr [i05vec],bx
2581 mov ax,(get_interrupt_vector shl 8) or INTLOC ; (INTLOC)
2583 mov word ptr [i1cvec+2],es
2584 mov word ptr [i1cvec],bx
2594 ;******************* START OF SPECIFICATIONS ***********************************
2598 ; FUNCTION: Install PRINT Interupt Handler routines
2604 ; REGISTERS USED: T.B.D.
2606 ; LINKAGE: Called from: TRANSIENT,
2609 ; CHANGE 05/20/87 - Header added - F. G.
2612 ;******************* END OF SPECIFICATIONS *************************************
2613 ;******************** START - PSEUDOCODE ***************************************
2621 ;******************** END - PSEUDOCODE ***************************************
2628 mov ax,(GET_INTERRUPT_VECTOR shl 8) OR 24h
2633 mov WORD PTR [HARDCH],bx
2634 mov WORD PTR [HARDCH+2],es
2644 ;******************* START OF SPECIFICATIONS ***********************************
2648 ; FUNCTION: Install PRINT Interupt Handler routines
2654 ; REGISTERS USED: T.B.D.
2657 ; LINKAGE: Called from: TRANSIENT,
2668 ; CHANGE 05/20/87 - Header added - F. G.
2671 ;******************* END OF SPECIFICATIONS *************************************
2672 ;******************** START - PSEUDOCODE ***************************************
2680 ;******************** END - PSEUDOCODE ***************************************
2686 mov AX,(SET_INTERRUPT_VECTOR shl 8) OR 23h
2687 mov DX,OFFSET DG:INT_23
2690 mov ax,(SET_INTERRUPT_VECTOR shl 8) OR 24h
2691 mov dx,OFFSET DG:INT_24
2699 ;******************* START OF SPECIFICATIONS ***********************************
2703 ; FUNCTION: INT 24 handler
2709 ; NOTE: This is coded as a PROC but is never called
2711 ; REGISTERS USED: T.B.D.
2714 ; LINKAGE: INTerupt 24
2722 ; CHANGE 05/20/87 - Header added - F. G.
2725 ;******************* END OF SPECIFICATIONS *************************************
2726 ;******************** START - PSEUDOCODE ***************************************
2734 ;******************** END - PSEUDOCODE ***************************************
2737 INT_24_RETADDR DW OFFSET DG:INT_24_BACK
2739 in_int_23 db 0 ; reentrancy flag
2744 ASSUME ds:nothing,es:nothing,ss:nothing
2748 push [INT_24_RETADDR]
2749 push WORD PTR [HARDCH+2]
2750 push WORD PTR [HARDCH]
2757 ;******************* START OF SPECIFICATIONS ***********************************
2761 ; FUNCTION: INT 24 post processor
2767 ; NOTE: This is NOT a PROC
2769 ; REGISTERS USED: T.B.D.
2772 ; LINKAGE: INTerupt 24
2780 ; CHANGE 05/20/87 - Header added - F. G.
2783 ;******************* END OF SPECIFICATIONS *************************************
2784 ;******************** START - PSEUDOCODE ***************************************
2792 ;******************** END - PSEUDOCODE ***************************************
2798 ; $if z ; if abort ;AC000;
2801 inc [in_int_23] ; no int 23's allowed
2812 mov sp, offset dg:intStk ; setup local int stack
2815 ; $if ne ; if not installed ;AC000;
2820 ; $endif ; endif - not installed ;AC000;
2827 ; $endif ; endif - abort
2833 ;******************* START OF SPECIFICATIONS ***********************************
2837 ; FUNCTION: INT 23 handler
2843 ; NOTE: This is NOT a PROC
2845 ; REGISTERS USED: T.B.D.
2848 ; LINKAGE: INTerupt 23
2856 ; CHANGE 05/20/87 - Header added - F. G.
2859 ;******************* END OF SPECIFICATIONS *************************************
2860 ;******************** START - PSEUDOCODE ***************************************
2868 ;******************** END - PSEUDOCODE ***************************************
2872 ASSUME ds:nothing,es:nothing,ss:nothing
2874 cmp [in_int_23],0 ; check for a re-entrant call
2876 ; $if e ; If its OK ;AC000;
2879 inc [in_int_23] ; make sure no more int 23's
2890 mov sp, offset dg:intStk ; setup local int stack
2893 ; $if ne ; if not installed - undo ;AC000;
2896 call Restore_ints ; ;AC000;
2898 ; $else ; else - dont undo ;AC000;
2903 call IntWhileBusy ; unlock print queue (just in case)
2905 ; $endif ; endif - undo ;AC000;
2912 ; $endif ; endif - its OK ;AC000;
2917 BREAK <Restore_ints>
2918 ;******************* START OF SPECIFICATIONS ***********************************
2920 ; NAME: Restore_ints
2922 ; FUNCTION: Restore all ints used by print to original values
2928 ; REGISTERS USED: T.B.D.
2931 ; LINKAGE: Called from: TRANSIENT,
2942 ; CHANGE 05/20/87 - Header added - F. G.
2945 ;******************* END OF SPECIFICATIONS *************************************
2946 ;******************** START - PSEUDOCODE ***************************************
2948 ; START Restore_ints
2954 ;******************** END - PSEUDOCODE ***************************************
2956 Restore_ints PROC NEAR
2958 ASSUME ds:DG,es:nothing,ss:DG
2961 mov ax,(set_interrupt_vector shl 8) or SOFTINT ; (SOFTINT)
2967 mov ax,(set_interrupt_vector shl 8) or COMINT ; (COMINT)
2973 mov ax,(set_interrupt_vector shl 8) or 13h
2979 mov ax,(set_interrupt_vector shl 8) or 15h
2985 mov ax,(set_interrupt_vector shl 8) or 17h
2991 mov ax,(set_interrupt_vector shl 8) or 14h
2997 mov ax,(set_interrupt_vector shl 8) or 05h
3003 mov ax,(set_interrupt_vector shl 8) or INTLOC ; (INTLOC)
3016 ;******************* START OF SPECIFICATIONS ***********************************
3018 ; NAME: Parse_Input - PRINT Command Line Parser
3020 ; FUNCTION: Call the DOS PARSE Service Routines to process the command
3021 ; line. Search for valid input:
3022 ; - filenames (may be more than one
3023 ; - switches: /D:device
3024 ; /B:buffsize 512 to 16k - 512 default
3025 ; /Q:quesiz 4 to 32 - 10 default
3026 ; /S:timeslice 1 to 255 - 8 default
3027 ; /U:busytick 1 to 255 - 1 default
3028 ; /M:maxtick 1 to 255 - 2 default
3033 ; INPUT: Current Parse parameters in the Parse_C_B
3034 ; [ORDINAL] - CURRENT ORDINAL VALUE
3035 ; [SCAN_PTR] - CURRENT SCAN POINT
3036 ; - DS:[SCAN_PTR] - Pionter to Parse string
3037 ; ES:DI - Pointer to PARMS block
3039 ; OUTPUT: PARSE_BUFF filled in:
3041 ; P_TYPE - TYPE RETURNED
3042 ; P_ITEM_TAG - SPACE FOR ITEM TAG
3043 ; P_SYN - POINTER TO LIST ENTRY
3044 ; P_PTR_L - SPACE FOR POINTER / VALUE - LOW
3045 ; P_PTR_H - SPACE FOR POINTER / VALUE - HIGH
3047 ; REGISTERS USED: T.B.D.
3050 ; LINKAGE: Called from: TRANSIENT, Set_Buffer and Submit_File
3055 ; ERROR CF = 1 If user enters:
3056 ; EXIT: - any invalid parameter or switch
3057 ; - an invalid value for a valid switch
3058 ; AX = Parse error number
3060 ; EXTERNAL - System parse service routines
3063 ; CHANGE 03/11/87 - First release - F. G.
3066 ;******************* END OF SPECIFICATIONS *************************************
3067 ;******************** START - PSEUDOCODE ***************************************
3072 ;******************** END - PSEUDOCODE ***************************************
3074 Parse_Input PROC NEAR
3076 Syntax_Error equ 9 ; Parse syntax error
3077 Parse_EOL equ 0FFh ; Parse End Of Line
3078 ;--------------------------------------
3079 ; Load appropriate registers
3080 ; from the Parse_Control_Block
3081 ;--------------------------------------
3082 ASSUME ds:DG,es:DG,ss:nothing
3084 mov cx,[ORDINAL] ; CURRENT ORDINAL VALUE ;AN000;
3085 mov si,[SCAN_PTR] ; CURRENT SCAN POINT ;AN000;
3086 mov [MSG_PTR],si ; Save start in case of error ;AN000;
3087 lea di,PARMS ; ;AN000;
3088 mov dx,0 ; RESERVED ;AN000;
3090 mov ax,CodeR ; ;AN000;
3091 sub ax,10h ; back up 100h to start of psp ;AN000;
3092 mov ds,ax ; DS:SI = command string in PSP ;AN000;
3094 ;--------------------------------------
3095 ASSUME ds:nothing ; Call the Parse service routines
3096 ;--------------------------------------
3098 ; CX - Ordinal value
3099 ; DX - zero (reserved)
3100 ; DS:SI - Pionter to Parse string
3101 ; ES:DI - Pointer to PARMS block
3103 call SYSPARSE ; PARSE IT! ;AN000;
3109 cmp ax,NOERROR ; no errors? ;AN000;
3111 ; $if e ; if no errors ;AN000;
3114 clc ; WE'ER DONE ;AN000;
3116 ; $else ; else - there was an error ;AN000;
3120 cmp al,Parse_EOL ; error FFh ? ;AN000;
3122 ; $if ne ; if not EOL ;AN000;
3125 cmp al,Syntax_Error ; error 1 to 9 ? ;AN000;
3127 ; $if a ; if parse error ;AN000;
3130 mov al,Syntax_Error ; Parse syntax error
3132 ; $endif ; endif errors ;AN000;
3135 lea bx,Parse_Ret_Code
3138 ; $endif ; endif errors ;AN000;
3141 stc ; SET ERROR FLAG ;AN000;
3143 ; $endif ; endif - no error ;AN000;
3146 ret ; NORMAL RETURN TO CALLER ;AN000;
3148 Parse_Ret_Code label byte
3150 db 0 ; Ret Code 0 - ;AC003;
3151 db 9 ; Ret Code 1 - Too many parameters ;AC003;
3152 db 9 ; Ret Code 2 - Required parameter msg ;AC003;
3153 db 3 ; Ret Code 3 - Invalid switch ;AC003;
3154 db 9 ; Ret Code 4 - Invalid keyword ;AC003;
3155 db 9 ; Ret Code 5 - (reserved) ;AC003;
3156 db 6 ; Ret Code 6 - Parm val out of range ;AC003;
3157 db 9 ; Ret Code 7 - Parameter val not allow ;AC003;
3158 db 9 ; Ret Code 8 - Parm format not correct ;AC003;
3159 db 9 ; Ret Code 9 - Invalid Parameter ;AC003;
3166 ;******************* START OF SPECIFICATIONS ***********************************
3168 ; NAME: DispMsg - PRINT Display Transient Message Routine
3170 ; FUNCTION: Display the transient messages for PRINT
3172 ; INPUT: Al = message number
3173 ; Ah = class - 0 - Message Service class
3174 ; 1 - DOS extended error
3176 ; A - PRINT_R message
3177 ; B - PRINT_T message
3178 ; C - PRINT_T message with insert
3180 ; D - PRINT_T message with input buffer where:
3181 ; ES:DI = input buffer
3182 ; OUTPUT: - Messages output to Output Device
3184 ; REGISTERS USED: CX DX
3187 ; LINKAGE: Call from PRINT_R, TRANSIENT
3195 ; CHANGE 03/11/87 - First release - F. G.
3196 ; LOG: 09/28/87 - move back to tranient - make 'NEAR'
3198 ;******************* END OF SPECIFICATIONS *************************************
3199 ;******************** START - PSEUDOCODE ***************************************
3204 ; reset response (DL)
3205 ; set class to utility (DH)
3207 ; set output handle (BX)
3208 ; if CLASS requires insert
3209 ; load insert required
3211 ; if CLASS requires response
3212 ; flush keystroke buffer
3213 ; load response required (Dir CON in no echo)
3215 ; if CLASS is not Utility
3218 ; call SysDispMsg to display message
3220 ; set class to DOS_error
3228 ;******************** END - PSEUDOCODE ***************************************
3232 ASSUME CS:DG,DS:nothing,ES:nothing,SS:nothing
3236 push cs ; called before and after relocation ;AC002;
3237 pop ds ; - don't use DG ;AC002;
3239 ASSUME CS:DG,DS:DG,ES:nothing,SS:nothing
3241 lea si,SUBLIST ; point to sublist ;AN000;
3242 xor dx,dx ; reset response (DL) ;AN000;
3244 xor cx,cx ; reset insert (CX) ;AN000;
3245 mov bx,STDOUT ; set output handle (BX) ;AC014;
3247 cmp ah,CLASS_C ; is it CLASS C ;AN000;
3249 ; $if e,or ; CLASS C requires insert ;AC012;
3252 cmp ah,DOS_Error ; is it a DOS error? ;AN012;
3254 ; $if e ; DOS requires insert ;AN012;
3258 mov cx,offset DG:NameBuf ; set up insert pointer to NameBuf ;AN005;
3259 mov insert_ptr_off,cx ; ;AN005;
3261 pop [insert_ptr_seg] ; ;AN005;
3262 cmp ah,CLASS_C ; ;AC012;
3263 ; $if e,and ; ;AC012;
3265 cmp al,BadNameMes ; ;AN010;
3268 mov [insert_num],1 ; ;AN005;
3272 mov [insert_num],0 ; ;AN010;
3275 mov cx,1 ; 1 parameter to replace ;AN005;
3280 cmp ah,CLASS_D ; is it CLASS D ;AN000;
3282 ; $if e ; CLASS D requires response ;AN000;
3285 ; flush keystroke buffer?
3286 mov dl,buffered_input ; load response required (INT 21h 0A) ;AN000;
3293 ; $if be ; if Parse or DOS error
3297 mov bx,STDERR ; set output handle (BX) ;AN014;
3302 ; $if e ; if it is a parse error - show them
3305 mov cx,[MSG_PTR] ; set up sublist offset ;AN005;
3306 mov [insert_ptr_off],cx ; ;AN005;
3307 mov cx,CodeR ; set up sublist segment (PSP) ;AN005;
3308 sub cx,10h ; ;AN005;
3309 mov [insert_ptr_seg],cx ; ;AN005;
3310 push si ; save current pointer ;AN005;
3312 mov si,[SCAN_PTR] ; point to end of bad parm ;AN005;
3314 mov BYTE PTR ds:[si],0 ; terminate the parameter ;AN005;
3315 pop ds ; restore current pointer ;AN005;
3317 mov [insert_num],0 ; ;AN005;
3318 mov cx,1 ; 1 parameter to replace ;AN005;
3325 call SysDispMsg ; to display message ;AN002;
3327 ; $if c ; error .................. ;AN000;
3330 mov ah,DOS_error ; load error exit code ;AN000;
3331 stc ; indicate failure ;AN000;
3345 call DispMsg ; This allows long calls form CODER ;AN000;
3352 ;******************* START OF SPECIFICATIONS ***********************************
3354 ; NAME: Load_R_Msg - PRINT Load Resident Message Routine
3356 ; FUNCTION: Load the PRINT resident messages into their
3357 ; current message buffer. Note that PRINT 'pumps' the
3358 ; error text out as part of the data stream. For this reason
3359 ; the message service code is NOT used to display RESIDENT messages.
3361 ; INPUT: Messages in PRINT_RM, and Message Retriver code in PRINT_TM.
3363 ; OUTPUT: Resident messages loaded into the resident message buffer
3364 ; and Message Sevices code initalized
3366 ; NOTE: Messages ERRO through ERR12, ERRMEST through AllCan, FATMES
3367 ; BADDDRVM, GOODMES and BADMES are used in place - whereever
3368 ; the Message retriever points to them. BADDRVM is moved directly behind
3371 ; REGISTERS USED: DS:SI - points to message text
3372 ; (NOT RESTORED) ( AX - message # - not destroyed)
3373 ; ( DH - Class - not destroyed)
3375 ; LINKAGE: Call from TRANSIENT
3381 ; EXIT: AX = error number
3383 ; CHANGE 03/11/87 - First release - F. G.
3384 ; LOG: 09/28/87 - P1175 - all resident messages must be moved
3386 ;******************* END OF SPECIFICATIONS *************************************
3387 ;******************** START - PSEUDOCODE ***************************************
3392 ;******************** END - PSEUDOCODE ***************************************
3394 Load_R_Msg PROC NEAR
3396 ;--------------------------------------
3397 ; Load the Resident Messages
3398 ;--------------------------------------
3399 mov ax,CodeR ; ;AN000;
3402 ASSUME DS:nothing,ES:CodeR
3404 lea di,R_MES_BUFF ; set destination to resident buffer ;AN000;
3405 mov bx,OFFSET CodeR:MESBAS ; use BX as an index to MESBAS (CodeR) ;AN000;
3407 ;--------------------------------------
3408 ; Move messages ERR0 thru ERR12
3409 ;--------------------------------------
3411 mov ax,ERR0 ; message # 19 to start ;AN000;
3412 mov dx,(DOS_error shl 8) ; Class is DOS error ;AN000;
3417 call MoveMes ; LOAD the message ;AN000;
3418 ; $leave c ; leave loop if ERROR ;AN000;
3420 mov byte ptr es:[di],DOLLAR ; append a delimiter
3421 inc di ; move to next message ;AN000;
3422 inc al ; advance message # ;AN000;
3423 cmp al,ERR12 ; are we past ERR12 ? ;AN000;
3425 ; $enddo a ; if not, do it again ;AN000;
3429 ; $if nc ; if no ERROR ;AN000;
3431 ;--------------------------------------
3432 ; Do rocessing for ERRMEST through
3434 ;--------------------------------------
3436 mov ax, errmest ; message # 3 to start ;AN000;
3437 mov dx,(CLASS_Util shl 8) ; Class is Utility ;AN000;
3439 ; $do ; now we are past ERR12 ;AN000;
3442 call MoveMes ; LOAD the message ;AC002;
3443 ; $leave c ; leave loop if ERROR ;AC002;
3445 inc al ; advance message # ;AC002;
3446 cmp al,BADDRVM ; are we past BADDRVM ;AC002;
3448 ; $enddo a ; ;AN000;
3452 ; $endif ; endif - no error ;AN000;
3465 ;--------------------------------------
3466 ; Move the Messages into their
3467 ; final resting place
3468 ;--------------------------------------
3471 mov es:[bx],di ; save the pointer to this message ;AN000;
3472 call SYSGETMSG ; line up the pointer on the message ;AN000;
3473 ; $if nc ; if no error ;AN000;
3475 ; all being well --- WE NOW HAVE---
3476 ; DS:SI - aimed at the message file
3477 ; ES:DI - aimed at the Resident Buffer
3478 ; CX - # of characters
3479 cld ; go ahead ;AN000;
3480 rep movsb ; and copy it! ;AN000;
3481 inc bx ; set up for next pointer ;AN000;
3484 ; $endif ; endif - no error ;AN000;
3499 TransSize LABEL BYTE ; end of transient
3500 ; only because code is para algned