     1                                  ;	SCCSID = @(#)dup.asm	1.1 85/04/10
     2                                  ;	SCCSID = @(#)dup.asm	1.1 85/04/10
     3                                  ;TITLE	DOS_DUP - Internal SFT DUP (for network SFTs)
     4                                  ;NAME	DOS_DUP
     5                                  ; Low level DUP routine for use by EXEC when creating a new process. Exports
     6                                  ;   the DUP to the server machine and increments the SFT ref count
     7                                  ;
     8                                  ; DOS_DUP
     9                                  ;
    10                                  ;   Modification history:
    11                                  ;
    12                                  ;	Created: ARR 30 March 1983
    13                                  ;
    14                                  
    15                                  ;
    16                                  ; get the appropriate segment definitions
    17                                  ;
    18                                  [list -]
    18          ******************       warning: redefining multi-line macro `struc' [-w+pp-macro-redef-multi]
    14                              <4> [list -]
    14                              <3> [list -]
     3                              <2> 
     4                              <2> addsection DOSSTART, align=16 PUBLIC class=DOSSTART
     5                              <2> ; (no prior section) ; DOSSTART		ENDS
     6                              <2> 
     7                              <2> addsection DOSSTARTJUMP, align=1 PUBLIC class=START
     8                              <2> ; (no prior section) ; DOSSTARTJUMP		ENDS
     9                              <2> 
    10                              <2> addsection CONSTANTS, align=2 PUBLIC class=CONST
    11                              <2> ; (no prior section) ; CONSTANTS	ENDS
    12                              <2> 
    13                              <2> addsection DATA, align=2 PUBLIC class=DATA
    14                              <2> ; (no prior section) ; DATA		ENDS
    15                              <2> 
    16                              <2> addsection TABLE, align=2 PUBLIC class=TABLE
    17                              <2> ; (no prior section) ; TABLE		ENDS
    18                              <2> 
    19                              <2> addsection DOSDATATABLE, align=2 PUBLIC class=DOSDATACODE
    20                              <2> ; (no prior section) ; DOSDATATABLE		ENDS
    21                              <2> 
    22                              <2> addsection DOSDATACODE, align=1 PUBLIC class=DOSDATACODE
    23                              <2> ; (no prior section) ; DOSDATACODE		ENDS
    24                              <2> 
    25                              <2> addsection DOSBIODATA, align=2 PUBLIC class=DOSBIODATA
    26                              <2> 
    27                              <2> addsection LAST, align=16 PUBLIC class=LAST
    28                              <2> ; (no prior section) ; LAST		ENDS
    29                              <2> 
    30                              <2> group DOSGROUP DOSSTART DOSSTARTJUMP CONSTANTS DATA TABLE DOSDATATABLE DOSDATACODE DOSBIODATA LAST
     8                              <1> 
     9                              <1> %include "dcodeseg.nas"
     1                              <2> 
     2                              <2> %ifndef DCODESEGNAS
     3                              <2> %assign DCODESEGNAS 1
     4                              <2> 
     5                              <2> section DOSCODETABLE align=2 PUBLIC class=DOSCODE
     6                              <2> ; (no prior section) ; DOSCODETABLE		ENDS
     7                              <2> section DOSCODECODE align=1 PUBLIC class=DOSCODE
     8                              <2> ; (no prior section) ; DOSCODECODE		ENDS
     9                              <2> section DOSBIOCODE align=2 PUBLIC class=DOSCODE
    10                              <2> section BIOCODE	align=2 PUBLIC class=DOSCODE
    11                              <2> 
    12                              <2> %ifnidni DOSENTRYGROUP, DOSCODEGROUP
    13                              <2>  group DOSCODEGROUP DOSCODETABLE DOSCODECODE DOSBIOCODE BIOCODE
    14                              <2> %endif
    15                              <2> 
    16                              <2> %endif
    10                              <1> 
    11                              <1> section LAST
    12                              <1> ; (no prior section) ; LAST		ENDS
    20                                  
    21                                  [list +]
    22                                  section DOSCODECODE
    23                                  [list -]
    23          ******************       warning: out: ... for DOS Version 4.00 ... [-w+user]
    23          ******************       warning: out: BPB.INC... [-w+user]
    23          ******************       warning: out: ... CLONE version build switch on ... [-w+user]
    23          ******************       warning: out: DEVSYM.INC... [-w+user]
    30                                  
    31                                  	i_need	THISSFT,DWORD
    32                                  
    33                                   assume nocheck, ss:DOSGROUP
    34                                  
    35                                  BREAK <DOS_DUP -- DUP SFT across network>
    36                                  
    37                                  ; Inputs:
    38                                  ;	[THISSFT] set to the SFT for the file being DUPed
    39                                  ;		(a non net SFT is OK, in this case the ref
    40                                  ;		 count is simply incremented)
    41                                  ; Function:
    42                                  ;	Signal to the devices that alogical open is occurring
    43                                  ; Returns:
    44                                  ;	ES:DI point to SFT
    45                                  ;    Carry clear
    46                                  ;	SFT ref_count is incremented
    47                                  ; Registers modified: None.
    48                                  
    49                                  	procedure   DOS_DUP,NEAR
    49          ******************       warning: proc DOS_DUP... [-w+user]
    50                                  	ASSUME	ES:NOTHING,SS:NOTHING
    51                                  
    52                                  extern doscode_getdosdata
    53                                  
    54                                  ThisSFT equ THISSFT	; NASM port label
    55 00000000 97                      	xchg ax, di
    56 00000001 E8(0000)                	call doscode_getdosdata
    57 00000004 8EC0                    	mov es, ax
    58                                   assume es:DOSGROUP
    59 00000006 97                      	xchg ax, di
    60 00000007 26C43E[0000]            	LES	DI,[es:ThisSFT]
    61                                  	Entry	Dos_Dup_Direct
    62                                  	Assert	ISSFT,<ES,DI>,"DOSDup"
    63 0000000C E8(0000)                	invoke	IsSFTNet
    64 0000000F 7503                    	JNZ	DO_INC
    65 00000011 E8(0000)                	invoke	DEV_OPEN_SFT
    66                                  DO_INC:
    67                                  	Assert	ISSFT,<ES,DI>,"DOSDup/DoInc"
    68 00000014 26FF05                  	INC	word [ES:DI + sf_ref_count]	; Clears carry (if this ever wraps
    69                                  					;   we're in big trouble anyway)
    70 00000017 C3                      	return
    71                                  
    72                                  EndProc DOS_DUP
    73                                  
    74                                      END
