home *** CD-ROM | disk | FTP | other *** search
- page ,132
-
- comment !
- * netbios version of c-tree server
- * foreground version asm lang support
- *
- * This program is the CONFIDENTIAL and PROPRIETARY property
- * of FairCom(R) Corporation. Any unauthorized use, reproduction or
- * transfer of this program is strictly prohibited.
- *
- * Copyright (c) 1987, 1988, 1989 FairCom Corporation
- * (Subject to limited distribution and
- * restricted disclosure only.)
- * *** ALL RIGHTS RESERVED ***
- *
- * 4006 West Broadway
- * Columbia, MO 65203
- *
- *
- * c-tree(R) Version 4.3
- * Release C
- * February 7, 1989 17:30
- *
- !
-
-
- include asm.inc
-
-
- DSEG
-
- extrn __psp:word ;crt addr of program seg prefix
-
- CSEG
-
-
-
- assume ds:nothing
-
- ;--------------------------------------------------------------------
- ;configuration control
- ;--------------------------------------------------------------------
- ;note: the same source module can be used for any C memory module
- ;(with appropiate 'far' modifiers). however it is recommended to
- ;assemble with a define (/D on the masm line) of one of the
- ;following: SMALL or COMPACT or MEDIUM or LARGE
- ;example: masm ctsfg /ml /DCOMPACT;
- ;--------------------------------------------------------------------
-
-
- ;comment out next to use dos default of 20 file max
- FID_TABLE_SZ = 255 ;up to 255 files open
-
-
-
- ;--------------------------------------------------------------------
- ; program segment prefix
- ;--------------------------------------------------------------------
- ;--------------------------------------------------------------------
-
- PSP struc
- pp_int20 dw ? ;+00 exit instruction
- pp_mtop dw ? ; 02 paragraph past end of mem
- pp_4 db ? ; 04
- pp_cpmcall db ? ; 05 long call opcode
- pp_cpmmtop dw ? ; 06 long call oprand adj to look like mtop
- pp_cpmcallseg dw ? ; 08 rest of long call
- pp_i22term dd ? ; 0a exit to parent addr
- pp_i23ctlcp dd ? ; 0e ctl-c trap of parent
- pp_i24cerrp dd ? ; 12 critical err trap of parent
- pp_parent dw ? ; 16 psp of parent
- pp_fidtbl db 20 dup (?) ; 18 file id table
- pp_envseg dw ? ; 2c seg of environment
- pp_spsave dw ? ; 2e sp save while in dos or execing child
- pp_sssave dw ? ; 30 ss save "
- pp_fidtbllen dw ? ; 32 length of fidtbl
- pp_fidtblptr dd ? ; 34 ptr to fidtbl
- pp_shr0 dw ? ; 38 set to ffff (used by share.exe)
- pp_shr1 dw ? ; 3a set to ffff (used by share.exe)
- db 14h dup (?) ; 3c
- pp_call50 dw ? ; 50 old convention dos entry
- pp_call50ret db ? ; 52
- db 09h dup (?) ; 53
- pp_fcb0 db 16 dup (?) ; 5c
- pp_fcb1 db 16 dup (?) ; 6c
- db 4 dup (?) ; 7c
- pp_cmdtail db 128 dup (?) ; 80
- PSP ends
-
-
-
-
-
- ;--------------------------------------------------------------------
- ;replacement file-id table so dos can open more than 20 files
- ;--------------------------------------------------------------------
-
-
- CSEG ;in code segment
-
- ifdef FID_TABLE_SZ
- ifdef DEBUG
- public fid_table
- endif
- fid_table db FID_TABLE_SZ dup (0ffh)
- endif
-
-
-
- ;--------------------------------------------------------------------
- ;misc dos traps
- ;--------------------------------------------------------------------
- ;these are set during server context
- ;i24 (critical err) just causes dos call to fail
- ;i23 (ctl-brk dos) don't let user trap get control
- ;i1b (ctl-brk bios) " " " " " "
- ;
- ;--------------------------------------------------------------------
-
- ;misc default traps for task context
-
- ifdef DEBUG
- public i24_trap,i1b_trap,i23_trap
- endif
-
- i24_trap:
- mov al,3 ;fail the call
- i1b_trap:
- i23_trap:
- iret
-
-
-
-
- ;--------------------------------------------------------------------
- ;fanrf - async netbios command completed notification
- ;--------------------------------------------------------------------
- ;all async ncbs from server have an extra word in front that is set
- ;to 1 by this when command completes.
- ;
- ;--------------------------------------------------------------------
-
- ;es:bx -> ncb that has a word flag in front of it
- public _fanrf
- _fanrf proc far
- mov WO es:[bx-2],1 ;set done flag (xncb.f)
- iret
- _fanrf endp
-
-
-
- ;--------------------------------------------------------------------
- ;fg_init(void)
- ;--------------------------------------------------------------------
- ;
- ;the dos internal handle table is moved to a bigger area so more
- ;files can be opened by the server task.
- ;--------------------------------------------------------------------
-
-
-
- public _fg_init
- _fg_init proc far
- assume ds:DGROUP
- push bp
- mov bp,sp
- push di
- push si
-
- push ds
-
- ifdef FID_TABLE_SZ
- ; set bigger file id table for dos
- mov es,__psp
- lds si,es:[0].pp_fidtblptr
- assume ds:nothing
- mov cx,es:[0].pp_fidtbllen
- cmp cx,FID_TABLE_SZ
- jae iti2
- mov di,OTX fid_table
- mov WO es:[0].pp_fidtblptr,di
- mov WO es:[0].pp_fidtblptr+2,cs
- mov es:[0].pp_fidtbllen,FID_TABLE_SZ
- push cs
- pop es
- rep movsb ;copy already open file ids
- iti2:
- endif
-
- ;set up error traps
-
- push cs
- pop ds
- mov dx,OTX i23_trap
- DOS 2523h
- mov dx,OTX i24_trap
- DOS 2524h
- pop ds
- assume ds:DGROUP
-
-
- ; turn off break checking
-
- mov dl,0
- DOS 3301h
- pop si
- pop di
- pop bp
- ret
- _fg_init endp
- assume ds:nothing
-
-
- END_MOD
- end
-