2 ; SCCSID = @(#)copy.asm 1.1 85/05/14
3 ; SCCSID = @(#)copy.asm 1.1 85/05/14
4 TITLE COMMAND COPY routines
.
8 ; 11/01/83 EE Added a few lines at the end of SCANSRC2 to get multiple
9 ; file concatenations (eg copy a.*+b.*+c.*) to work properly.
10 ; 11/02/83 EE Commented out the code in CPARSE which added drive designators
11 ; to tokens which begin with path characters so that PARSELINE
12 ; will work correctly.
13 ; 11/04/83 EE Commented out the code in CPARSE that considered paren's to be
14 ; individual tokens. That distinction is no longer needed for
15 ; FOR loop processing.
16 ; 11/17/83 EE CPARSE upper case conversion is now flag dependent. Flag is
17 ; 1 when Cparse is called from COPY.
18 ; 11/17/83 EE Took out the comment chars around code described in 11/04/83
19 ; mod. It now is conditional on flag like previous mod.
20 ; 11/21/83 NP Added printf
21 ; 12/09/83 EE CPARSE changed to use CPYFLAG to determine when a colon should
22 ; be added to a token.
23 ; 05/30/84 MZ Initialize all copy variables. Fix confusion with destclosed
24 ; NOTE: DestHand is the destination handle. There are two
25 ; special values: -1 meaning destination was never opened and
26 ; 0 which means that the destination has been openned and
28 ; 06/01/84 MZ Above reasoning totally specious. Returned things to normal
29 ; 06/06/86 EG Change to fix problem of source switches /a and /b getting
30 ; lost on large and multiple file (wildcard) copies.
31 ; 06/09/86 EG Change to use xnametrans call to verify that source and
32 ; destination are not equal.
45 DATARES
SEGMENT PUBLIC BYTE ;AC000;
47 EXTRN RSRC_XA_SEG
:WORD ;AN030;
50 TRANDATA
SEGMENT PUBLIC BYTE ;AC000;
53 EXTRN Extend_buf_ptr
:word ;AN000;
54 EXTRN Extend_buf_sub
:byte ;AN000;
55 EXTRN file_name_ptr
:word
56 EXTRN INBDEV_ptr
:word ;AC000;
57 EXTRN msg_disp_class
:byte ;AN000;
61 TRANSPACE
SEGMENT PUBLIC BYTE ;AC000;
70 EXTRN concat_xa
:byte ;AN000;
71 EXTRN copy_num
:word ;AC000;
74 EXTRN cpyflag
:byte ;AC000;
88 EXTRN expand_star
:byte
95 EXTRN msg_flag
:byte ;AN022;
99 EXTRN one_char_val
:byte ;AN000;
100 EXTRN parse_last
:word ;AN018;
102 EXTRN plus_comma
:byte
107 EXTRN src_xa_size
:word ;AN000;
108 EXTRN src_xa_seg
:word ;AN000;
119 EXTRN string_ptr_2
:word
124 EXTRN xa_cp_out
:byte ;AN030;
125 EXTRN xa_list_attr
:word ;AC030;
129 ; ******************************************
133 TRANCODE
SEGMENT PUBLIC BYTE
141 ASSUME
CS:TRANGROUP
,DS:TRANGROUP
,ES:TRANGROUP
,SS:NOTHING
143 assume
ds:trangroup
,es:trangroup
146 ; First order of buisness is to find out about the destination
148 ; initialize all internal variables
173 mov xa_list_attr
,ax ;AN030; initialize code page to none
178 mov msg_flag
,al ;AN022;
179 mov [ALLSWITCH
],AX ; no switches
180 mov [ARGC
],al ; no arguments
181 mov [PLUS
],al ; no concatenation
182 mov [BINARY],al ; Binary not specifically specified
183 mov [ASCII
],al ; ASCII not specifically specified
184 mov [FILECNT
],ax ; No files yet
185 mov [WRITTEN
],ax ; Nothing written yet
186 mov [CONCAT
],al ; No concatenation
187 mov [MELCOPY
],al ; Not a Mel Hallerman copy
188 mov [concat_xa
],al ;AN000; initialize flag for concatenation XA
189 mov MelStart
,ax ; Not a Mel Hallerman copy
190 mov word ptr [SCANBUF
],ax ; Init buffer
191 mov word ptr [DESTBUF
],ax ; Init buffer
192 mov word ptr [SRCBUF
],ax ; Init buffer
193 mov word ptr [SDIRBUF
],ax ; Init buffer
194 mov word ptr [DIRBUF
],ax ; Init buffer
195 mov word ptr [DESTFCB
],ax ; Init buffer
196 mov objcnt
,al ; Init command line object count
198 mov DestHand
,AX ; destination has never been opened
199 mov [FRSTSRCH
],al ; First search call
200 mov [FIRSTDEST
],al ; First time
201 mov [DESTISDIR
],al ; Don't know about dest
202 mov src_xa_seg
,ax ;AN000; initialize attribute segment to -1
204 mov bl,plus_chr
; include '+' as a delimiter
205 inc byte ptr [expand_star
] ; want to include * expansion in cparse
206 mov cpyflag
,1 ; Turn "CPARSE called from COPY flag" on
209 xor bp,bp ; no switches
210 mov di,offset trangroup
:SCANBUF
211 mov parse_last
,si ;AN018; save start of parsed string
215 test bh,80H
; A '+' argument?
222 test bp,SwitchV
;AN038; Verify requested?
223 jz not_slashv
;AN038; No - set the switch
224 test [allswitch
],SwitchV
;AN038; Verify already entered?
225 jz not_slashv
;AN038; No - set the switch
226 ;AD018; or [allswitch],FBadSwitch ;AN038; Set up bad switch
227 or BP,FBadSwitch
;AN018; Set up bad switch
230 or [DESTSWITCH
],BP ; Yes, assume destination
231 or [ALLSWITCH
],BP ; keep tabs on all switches
233 test BP,NOT SwitchCopy
;AN018; Bad switch?
234 jz NOT_BAD_SWITCH
;AN018; Switches are okay
235 popf ;AN018; fix up stack
236 mov ax,BadSwt_ptr
;AN018; get "Invalid switch" message number
237 invoke Setup_parse_error_msg
;AN018; setup to print the message
238 jmp CERROR
;AC018; exit
240 NOT_BAD_SWITCH: ;AN018; switch okay
241 POPF ; get flags back
242 jc CHECKDONE
; Hit CR?
246 POPF ; get flags back
247 jc CHECKDONE
; Hit CR?
249 jnz GOTPLUS
; Yes, not a separate arg
250 inc [ARGC
] ; found a real arg
254 mov SI,offset trangroup
:SCANBUF
; Adjust to copy
256 mov DI,offset trangroup
:DESTBUF
259 mov [DESTSIZ
],cl ; Save its size
260 inc cx ; Include the nul
261 rep movsb ; Save potential destination
262 mov [DESTINFO
],bh ; Save info about it
263 mov [DESTSWITCH
],0 ; reset switches
265 jmp DESTSCAN
;AC018; keep going
268 cmp plus
,1 ; If a statement like "copy file+" is
269 jnz cdcont
; entered, complain about it.
274 mov dx,offset trangroup
:overwr_ptr
278 mov [CONCAT
],al ; PLUS -> Concatination
281 mov [INEXACT
],al ; CONCAT -> inexact copy
283 or al,al ; Good number of args?
284 jnz TRY_TOO_MANY
;AC000; there are args, see if too many
285 MOV DX,OFFSET TranGroup
:Extend_Buf_ptr
;AC000; get extended message pointer
286 mov Extend_Buf_ptr
,LessArgs_ptr
;AN000; get "Required parameters missing" message number
287 jmp short cerror_parsej
;AN000; exit
292 MOV DX,OFFSET TranGroup
:Extend_Buf_ptr
;AC000; get extended message pointer
293 mov Extend_Buf_ptr
,MoreArgs_ptr
;AN000; get "Too many parameters" message number
296 mov msg_disp_class
,parse_msg_class
;AN000; set up parse error msg class
298 jmp CERROR
; no, too many
301 mov bp,offset trangroup
:DESTVARS
304 mov al,[CURDRV
] ; Dest is default drive:*.*
308 mov di,offset trangroup
:DESTBUF
310 mov [DESTSWITCH
],0 ; no switches on dest
311 mov [bp.INFO
],2 ; Flag dest is ambig
312 mov [bp.ISDIR
],0 ; Know destination specs file
319 jnz NOTSHORTDEST
; Two char file name
320 or [bp.INFO
],2 ; Know dest is d:
321 mov di,offset trangroup
:DESTBUF
+ 2
322 mov [bp.ISDIR
],0 ; Know destination specs file
328 mov dx,offset trangroup
:BADCD_ptr
330 cmp byte ptr [DI-2],al
331 jnz CERROR4J
; Trailing '/' error
332 mov [bp.ISDIR
],2 ; Know destination is d:/
336 ;AD018; mov ax,[ALLSWITCH]
337 ;AD018; test ax,NOT SwitchCopy
338 ;AD018; jz NOT_BAD_SWITCH ;AN000; Switches are okay
339 ;AD018; MOV DX,OFFSET TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
340 ;AD018; mov Extend_Buf_ptr,BadSwt_ptr ;AN000; get "Invalid switch" message number
341 ;AD018; jmp short CERROR_PARSEJ ;AC000; Switch specified which is not known
343 ; Now know most of the information needed about the destination
345 ;AD018; NOT_BAD_SWITCH:
347 mov ax, [allswitch
] ; Which switches were requested? Hmmm?
349 TEST AX,SwitchV
; Verify requested?
351 MOV AH,GET_VERIFY_ON_WRITE
352 INT int_command
; Get current setting
357 MOV [VERVAL
],AX ; Save current setting
360 MOV AX,(SET_VERIFY_ON_WRITE
SHL 8) OR 1 ; Set verify
363 xor bp,bp ; no switches
365 mov bl,plus_chr
; include '+' as a delimiter
367 mov di,offset trangroup
:SCANBUF
368 invoke CPARSE
; Parse first source name
370 jnz SCANFSRC
; Yes, try again
371 or [DESTSWITCH
],bp ; Include copy wide switches on dest
373 jnz NOSETCASC
; Binary explicit
375 JZ NOSETCASC
; Not Concat
376 mov [ASCII
],SwitchA
; Concat -> ASCII copy if no B switch
377 mov [concat_xa
],do_xa
;AN000; set up to do XA only on first file
387 call deallocate_src_xa
;AN030; deallocate xa segment
388 invoke free_tpa
;AN000; Make sure work area
389 invoke alloc_tpa
;AN000; is reset properly
390 MOV DX,OFFSET TRANGROUP
:COPIED_ptr
394 JMP TCOMMAND
; Stack could be messed up
398 jnz NEXTSRC
; If in concat mode, ignore error
399 mov msg_disp_class
,ext_msg_class
;AN000; set up extended error msg class
400 mov dx,offset TranGroup
:Extend_Buf_ptr
;AC000; get extended message pointer
401 mov Extend_Buf_ptr
,error_file_not_found
;AN000; get message number in control block
402 mov string_ptr_2
,offset trangroup
:srcbuf
;AC046; get address of failed string
403 mov Extend_buf_sub
,one_subst
;AC046; put number of subst in control block
409 jnz LEAVECFLAG
; Leave CFLAG if concatination
412 mov [CFLAG
],al ; Flag destination not created
413 mov [NXTADD
],ax ; Zero out buffer
416 mov [SRCPT
],SI ; remember where we are
417 mov di,offset trangroup
:USERDIR1
418 mov bp,offset trangroup
:SRCVARS
419 invoke BUILDPATH
; Figure out everything about the source
420 mov si,[SRCTAIL
] ; Create the search FCB
429 xor bp,bp ; no switches
431 mov bl,plus_chr
; include '+' as a delimiter
433 mov di,offset trangroup
:SCANBUF
434 invoke CPARSE
; Parse first source name
435 JC EndCopyJ2
; if error, then end (trailing + case)
437 jz ENDCOPYJ2
; If no '+' we're done
439 jnz SCANSRC
; Yes, try again
441 cmp comma
,1 ;g was +,, found last time?
442 jnz nostamp
;g no - try for a file
443 mov plus_comma
,1 ;g yes - set flag
444 jmp srcnonexist
;g we know we won't find it
446 mov plus_comma
,0 ;g reset +,, flag
449 mov ax,PARSE_FILE_DESCRIPTOR
SHL 8
451 CMP BYTE PTR [SI],0 ; parse everything?
452 JNZ SrchDone
; no, error, simulate no more search
453 mov ax,word ptr [SRCBUF
] ; Get drive
461 mov ah,DIR_SEARCH_FIRST
464 pushf ; Save result of search
465 invoke RESTUDIR1
; Restore users dir
468 jmp SRCNONEXIST
; Failed
476 mov di,OFFSET TRANGROUP
:SDIRBUF
477 mov si,OFFSET TRANGROUP
:DIRBUF
478 rep movsb ; Save very first source name
481 mov [NOWRITE
],al ; Turn off NOWRITE
483 mov si,offset trangroup
:DIRBUF
+ 1
484 invoke FCB_TO_ASCZ
; SRCBUF has complete name
487 jnz SHOWCPNAM
; Show name if concat
488 test [SRCINFO
],2 ; Show name if multi
491 mov dx,offset trangroup
:file_name_ptr
497 jnz NODCLOSE
; If concat, do not close
498 call CLOSEDEST
; else close current destination
499 jc NODCLOSE
; Concat flag got set, close didn't really happen
500 mov [CFLAG
],0 ; Flag destination not created
502 cmp [CONCAT
],0 ; Check CONCAT again
504 invoke FLSHFIL
; Flush output between source files on
505 ; CONCAT so LOSTERR stuff works
512 call SEARCHNEXT
; Try next match
513 jnz NEXTSRCJ
; Finished with this source spec
514 mov [DESTCLOSED
],0 ; Not created or concat ->...
515 jmp NEXTAMBIG
; Do next ambig
528 mov di,OFFSET TRANGROUP
:SCANBUF
531 jz NEXTMEL
; Go back to start
536 mov di,OFFSET TRANGROUP
:DESTFCB2
537 mov ax,PARSE_FILE_DESCRIPTOR
SHL 8
539 mov bx,OFFSET TRANGROUP
:SDIRBUF
+ 1
540 mov si,OFFSET TRANGROUP
:DESTFCB2
+ 1
543 cmp [CONCAT
],0 ; Are we concatenating?
544 jz meldoj
; No, continue.
546 ; Yes, turn off nowrite because this part of the code is only reached after
547 ; the first file has been dealt with.
571 MOV AH,DIR_SEARCH_NEXT
573 JNZ SEARCH
; Do search-next if ambig
574 OR AH,AH ; Reset zero flag
579 MOV DX,OFFSET TRANGROUP
:DIRBUF
580 INT int_command
; Put result of search in DIRBUF
581 POP AX ; Restore search first/next command
583 INT int_command
; Do the search
588 mov si,offset trangroup
:SRCBUF
;g do name translate of source
589 mov di,offset trangroup
:SRCXNAME
;g save for name comparison
593 mov [RDEOF
],0 ; No EOF yet
595 MOV AX,EXTOPEN
SHL 8 ;AC000; open the file
596 mov bx,read_open_mode
;AN000; get open mode for COPY
597 xor cx,cx ;AN000; no special files
598 mov dx,read_open_flag
;AN000; set up open flags
599 mov di,-1 ;AN030; no parameter list
604 ; Bogosity: IBM wants us to issue Access denied in this case. THey asked
607 jmp error_on_source
;AC022; clean up and exit
610 mov bx,ax ; Save handle
611 mov [SRCHAND
],bx ; Save handle
612 mov ax,(FILE_TIMES
SHL 8)
614 jc src_cp_error
;AN022; If error, exit
615 mov [CPDATE
],dx ; Save DATE
616 mov [CPTIME
],cx ; Save TIME
618 mov cx,xa_list_attr
;AN000; get old code page in cx
619 push cx ;AN000; save old attribute
620 mov xa_list_attr
,0 ;AN000; initialize code page
622 mov ax,(file_times
SHL 8)+get_XA
;AC030; get extended attribute size
623 mov si,-1 ;AN030; no querylist
624 xor cx,cx ;AN030; indicate we want size
625 int int_command
;AC000;
626 jc src_cp_error
;AN022; If error, exit
627 mov src_xa_size
,cx ;AN000; save size
628 cmp cx,0 ;AN000; are there any?
629 pop cx ;AN000; get old attribute
630 jz no_cp_get
;AN030; no - don't get attributes
632 push cx ;AN030; save old code page
633 invoke get_file_code_page_tag
;AN000; get file's code page
634 pop cx ;AN030 retrieve old code page
635 jnc no_cp_get
;AN000; no error - continue
636 src_cp_error: ;AN022;
637 jmp error_on_source
;AC022; and exit
640 cmp [concat
],0 ;AN000; are we doing concatenation
641 jz get_src_xa
;AN000; no get source extended attrib
642 cmp [concat_xa
],do_xa
;AN000; is this the first file?
643 jz get_src_xa
;AN000; yes - get extended attributes
644 cmp cx,xa_list_attr
;AN000; no - see if code pages match
645 jz no_copy_xa_jmp
;AN000; code pages match - continue
646 mov xa_list_attr
,inv_cp_tag
;AN000; set invalid code page tag
647 no_copy_xa_jmp: ;AC022;
648 jmp no_copy_xa
;AN000; don't get extended attributes
651 call deallocate_src_xa
;AN030; deallocate any existing XA segment
652 cmp src_xa_size
,0 ;AN000; are there any extended attributes?
653 jz no_copy_xa_jmp
;AC022; nothing there - don't allocate memory
654 push bx ;AN000; save handle
655 invoke free_tpa
;AN000; need to make free memory, first
656 mov bx,src_xa_size
;AN000; get bytes (size of XA) into bx
657 mov cl,4 ;AN000; divide bytes by 16 to convert
658 shr bx,cl ;AN000; to paragraphs
659 inc bx ;AN000; round up
660 mov ax,(alloc
SHL 8) ;AN000; allocate memory for XA
661 int int_command
;AN000;
662 pushf ;AN000; save flags
663 mov [src_xa_seg
], AX ;AN000; save new segment
664 push ds ;AN030; get resident segment
665 mov ds,[resseg
] ;AN030; and save copy of xa
666 assume
ds:resgroup
;AN030; segment in resident
667 mov [rsrc_xa_seg
],ax ;AN030; in case user breaks
668 pop ds ;AN030; out or has critical
669 assume
ds:trangroup
;AN030; error
670 invoke alloc_tpa
;AN000; reallocate the work area
671 popf ;AN000; restore flags
672 pop bx ;AN000; restore handle
673 jnc Alloc_for_xa_okay
;AN000; no carry - everything okay
674 call closesrc
;AN000; close the source file
675 mov msg_disp_class
,ext_msg_class
;AN000; set up extended error msg class
676 mov dx,offset TranGroup
:Extend_Buf_ptr
;AC000; get extended message pointer
677 mov Extend_Buf_ptr
,error_not_enough_memory
;AN000; get message number in control block
678 jmp cerror
;AN000; exit
682 mov ax,(file_times
SHL 8)+get_XA
;AN000; get extended attributes
683 push es ;AN000; save es
684 mov es,[src_xa_seg
] ;AN000; get segment for XA list
685 xor di,di ;AN000; offset of return list
686 mov si,-1 ;AN030; get all attributes
687 mov cx,[src_xa_size
] ;AN000; get size of list
688 int int_command
;AN000; get all the attributes
689 pop es ;AN000; restore es
690 jnc no_copy_xa
;AC022; no error - continue
692 error_on_source: ;AN022; we have a BAD error
693 invoke set_ext_error_msg
;AN022; set up the error message
694 mov string_ptr_2
,offset trangroup
:srcbuf
;AN022; get address of failed string
695 mov Extend_buf_sub
,one_subst
;AN022; put number of subst in control block
696 invoke std_Eprintf
;AN022; print it
697 cmp [srchand
],0 ;AN022; did we open the file?
698 jz no_close_src
;AN022; no - don't close
699 call closesrc
;AN022; clean up
700 no_close_src: ;AN022;
701 cmp [cflag
],0 ;AN022; was destination created?
702 jz endcopyj3
;AN022; no - just cleanup and exit
703 jmp endcopy
;AN022; clean up concatenation and exit
707 mov bx,[srchand
] ;AN022; get handle back
709 INT int_command
; Get device stuff
711 mov [SRCISDEV
],dl ; Set source info
712 jz COPYLP
; Source not a device
714 jz COPYLP
; ASCII device OK
715 mov dx,offset trangroup
:INBDEV_ptr
; Cannot do binary input
722 sub cx,dx ; Compute available space
726 JNZ CLOSESRC
; Give up
736 jc error_on_source
;AC022; Give up if error
737 mov cx,ax ; Get count
738 jcxz CLOSESRC
; No more to read
740 jnz NOTESTA
; Is a device, ASCII mode
749 REPNE SCASB ; Scan for EOF
760 CMP CX,[BYTCNT
] ; Is buffer full?
761 JB TESTDEV
; If not, we may have found EOF
764 JNZ CLOSESRC
; Give up
769 JZ CLOSESRC
; If file then EOF
771 JZ COPYLP
; On device, go till ^Z
779 ; We are called to close the destination. We need to note whether or not
780 ; there is any internal data left to be flushed out.
784 retnz
; Don't double close
785 MOV AL,BYTE PTR [DESTSWITCH
]
786 invoke SETASC
; Check for B or A switch on destination
789 CMP BX,[BYTCNT
] ; Is memory full?
791 invoke TRYFLUSH
; Make room for one lousy byte
793 CONCHNG: ; Concat flag changed on us
801 MOV WORD PTR [BX],1
AH ; Add End-of-file mark (Ctrl-Z)
804 MOV [NOWRITE
],0 ; Make sure our ^Z gets written
809 JZ FORGETITJ
; WRITTEN = 0 NXTADD = 1 (the ^Z)
815 jnz no_forget
;AC000; Wrote something
816 jmp FORGETIT
;AC000; Never wrote nothing
821 CMP [INEXACT
],0 ; Copy not exact?
822 JZ DODCLOSE
; If no, copy date & time
826 SHL CL,1 ; Left justify min in CL
829 SHL CX,1 ; hours to high 5 bits, min to 5-10
830 SHR DH,1 ; Divide seconds by 2 (now 5 bits)
831 OR CL,DH ; And stick into low 5 bits of CX
832 PUSH CX ; Save packed time
837 SHL CX,1 ; Year to high 7 bits
838 SHL DH,1 ; Month to high 3 bits
842 SHL DH,1 ; Most sig bit of month in carry
843 ADC CH,0 ; Put that bit next to year
844 OR DL,DH ; Or low three of month into day
845 MOV DH,CH ; Get year and high bit of month
846 POP CX ; Get time back
850 MOV AX,(FILE_TIMES
SHL 8) OR 1
851 INT int_command
; Set date and time
852 jc xa_cleanup_err
;AN022; handle error
854 mov ax,(file_times
SHL 8)+set_XA
;AN000; set code page
855 mov di,offset trangroup
:xa_cp_out
;AC030; offset of attr list
856 int int_command
;AN000;
857 jc xa_cleanup_err
;AN030; exit if error
860 ; See if the destination has *anything* in it. If not, just close and delete
864 mov ax,(lseek
shl 8) + 2 ; seek to EOF
873 mov ax,(IOCTL
SHL 8) + 0 ; get the destination attributes
875 push dx ; save them away
879 jnc close_cont
;AN022; handle error on close
880 popf ;AN022; get the flags back
881 xa_cleanup_err: ;AN022;
882 call cleanuperr
;AN022; attempt to delete the target
883 call DestDelete
;AN022; attempt to delete the target
884 jmp short fileclosed
;AN022; close the file
885 close_cont: ;AN022; no error - continue
888 test dx,80h
; is the destination a device?
889 jnz CloseDone
; yes, copy succeeded
903 CALL DODCLOSE
; Close the dest
905 MOV [FILECNT
],0 ; No files transferred
909 MOV DX,OFFSET TRANGROUP
:DESTBUF
911 INT int_command
; And delete it
918 mov SI,offset trangroup
:SCANBUF
; Adjust to copy
920 mov DI,offset trangroup
:SRCBUF
923 mov [SRCSIZ
],cl ; Save its size
924 inc cx ; Include the nul
925 rep movsb ; Save this source
926 mov [SRCINFO
],bh ; Save info about it
928 mov ax,bp ; Switches so far
929 invoke SETASC
; Set A,B switches accordingly
930 invoke SWITCH
; Get any more switches on this arg
937 ;****************************************************************
939 ;* ROUTINE: Cleanuperr
941 ;* FUNCTION: Issues extended error message for destination
942 ;* if not alreay issued
944 ;* INPUT: return from INT 21
948 ;****************************************************************
950 cleanuperr proc
near ;AN022;
952 cmp msg_flag
,0 ;AN022; have we already issued a message?
953 jnz cleanuperr_cont
;AN022; yes - don't issue duplicate error
954 invoke set_ext_error_msg
;AN022; set up error message
955 mov string_ptr_2
,offset trangroup
:destbuf
;AN022; get address of failed string
956 mov Extend_buf_sub
,one_subst
;AN022; put number of subst in control block
957 invoke std_eprintf
;AN022; issue the error message
958 cleanuperr_cont: ;AN022;
960 ret ;AN022; return to caller
961 cleanuperr endp
;AN022;
963 ;****************************************************************
965 ;* ROUTINE: Deallocate_Src_XA
967 ;* FUNCTION: Deallocates source extended attribute segment
968 ;* and resets both resident and transient variables.
975 ;****************************************************************
977 Deallocate_Src_XA proc
near ;AN030;
979 cmp [src_xa_seg
],no_xa_seg
;AN030; has any XA segment been allocated
980 jz no_src_xa
;AN030; no - continue
982 mov es,src_xa_seg
;AN030; yes - free it
983 mov ax,(Dealloc
SHL 8) ;AN030; Deallocate memory call
984 int int_command
;AN030;
986 mov [src_xa_seg
],no_xa_seg
;AN030; reset to no segment
987 push ds ;AN030; reinitialize resident
988 mov ds,[resseg
] ;AN030; copy of xa segment
989 assume
ds:resgroup
;AN030;
990 mov [rsrc_xa_seg
],no_xa_seg
;AN030; reset to no segment
992 assume
ds:trangroup
;AN030;
995 ret ;AN030; return to caller
996 Deallocate_Src_XA endp
;AN030;