     1                                  %include "nobits.mac"
     1                              <1> %imacro stripparens 2.nolist
     2                              <1> %defstr %%param %2
     3                              <1> %rep 16
     4                              <1>  %substr %%opening %%param 1
     5                              <1>  %ifidn %%opening, '('
     6                              <1>   %substr %%param %%param 2,-1
     7                              <1>  %endif
     8                              <1> %endrep
     9                              <1> %rep 16
    10                              <1>  %strlen %%length %%param
    11                              <1>  %substr %%closing %%param %%length
    12                              <1>  %ifidn %%closing, ')'
    13                              <1>   %substr %%param %%param 1,-2
    14                              <1>  %endif
    15                              <1> %endrep
    16                              <1> %deftok %%token %%param
    17                              <1> %1 %%token
    18                              <1> %endmacro
    19                              <1> 
    20                              <1> %imacro db 1-*.nolist
    21                              <1>  %rep %0
    22                              <1>   %define %%param %1
    23                              <1>   %define %%multi
    24                              <1>   %defstr %%string %%param
    25                              <1>   %strlen %%stringlength %%string
    26                              <1>   %assign %%index 1
    27                              <1>   %rep %%stringlength
    28                              <1>    %substr %%checkblank %%string %%index
    29                              <1>    %ifidni %%checkblank, '"'
    30                              <1>    %elifidni %%checkblank, "'"
    31                              <1>    %else
    32                              <1>     %deftok %%checkblank %%checkblank
    33                              <1>     %ifempty %%checkblank
    34                              <1>      %substr %%dup %%string %%index + 1,4
    35                              <1>      %deftok %%dup %%dup
    36                              <1>      %assign %%isdup 0
    37                              <1>      %ifidni %%dup, dup
    38                              <1>       %assign %%isdup 1
    39                              <1>      %elifidni %%dup, dup(
    40                              <1>       %assign %%isdup 1
    41                              <1>      %endif
    42                              <1>      %if %%isdup
    43                              <1>       %substr %%multi %%string 1, %%index - 1
    44                              <1>       %deftok %%multi %%multi
    45                              <1>       %substr %%string %%string %%index + 5, -1
    46                              <1>       %deftok %%token %%string
    47                              <1>       %undef %%param
    48                              <1>       stripparens %define %%param, %%token
    49                              <1>       %assign %%length 1
    50                              <1>       %ifstr %%param
    51                              <1>        %strlen %%length %%param
    52                              <1>       %endif
    53                              <1>       %rep %%length * %%multi
    54                              <1> 	db ?
    55                              <1>       %endrep
    56                              <1>       %exitrep
    57                              <1>      %endif
    58                              <1>     %endif
    59                              <1>    %endif
    60                              <1>    %assign %%index %%index + 1
    61                              <1>   %endrep
    62                              <1>   %ifempty %%multi
    63                              <1>    %assign %%length 1
    64                              <1>    %ifstr %%param
    65                              <1>     %strlen %%length %%param
    66                              <1>    %endif
    67                              <1>    %rep %%length
    68                              <1> 	db ?
    69                              <1>    %endrep
    70                              <1>   %endif
    71                              <1>   %rotate 1
    72                              <1>  %endrep
    73                              <1> %endmacro
    74                              <1> 
    75                              <1> %imacro dw 1-*.nolist
    76                              <1>  %rep %0
    77                              <1>   %define %%param %1
    78                              <1>   %define %%multi
    79                              <1>   %defstr %%string %%param
    80                              <1>   %strlen %%stringlength %%string
    81                              <1>   %assign %%index 1
    82                              <1>   %rep %%stringlength
    83                              <1>    %substr %%checkblank %%string %%index
    84                              <1>    %ifidni %%checkblank, '"'
    85                              <1>    %elifidni %%checkblank, "'"
    86                              <1>    %else
    87                              <1>     %deftok %%checkblank %%checkblank
    88                              <1>     %ifempty %%checkblank
    89                              <1>      %substr %%dup %%string %%index + 1,4
    90                              <1>      %deftok %%dup %%dup
    91                              <1>      %assign %%isdup 0
    92                              <1>      %ifidni %%dup, dup
    93                              <1>       %assign %%isdup 1
    94                              <1>      %elifidni %%dup, dup(
    95                              <1>       %assign %%isdup 1
    96                              <1>      %endif
    97                              <1>      %if %%isdup
    98                              <1>       %substr %%multi %%string 1, %%index - 1
    99                              <1>       %deftok %%multi %%multi
   100                              <1>       %substr %%string %%string %%index + 5, -1
   101                              <1>       %deftok %%token %%string
   102                              <1>       %undef %%param
   103                              <1>       stripparens %define %%param, %%token
   104                              <1>       %assign %%length 1
   105                              <1>       %ifstr %%param
   106                              <1>        %strlen %%length %%param
   107                              <1>        %assign %%length (%%length + 1) / 2
   108                              <1>       %endif
   109                              <1>       %rep %%length * %%multi
   110                              <1> 	dw ?
   111                              <1>       %endrep
   112                              <1>       %exitrep
   113                              <1>      %endif
   114                              <1>     %endif
   115                              <1>    %endif
   116                              <1>    %assign %%index %%index + 1
   117                              <1>   %endrep
   118                              <1>   %ifempty %%multi
   119                              <1>    %assign %%length 1
   120                              <1>    %ifstr %%param
   121                              <1>     %strlen %%length %%param
   122                              <1>     %assign %%length (%%length + 1) / 2
   123                              <1>    %endif
   124                              <1>    %rep %%length
   125                              <1> 	dw ?
   126                              <1>    %endrep
   127                              <1>   %endif
   128                              <1>   %rotate 1
   129                              <1>  %endrep
   130                              <1> %endmacro
   131                              <1> 
   132                              <1> %imacro dd 1-*.nolist
   133                              <1>  %rep %0
   134                              <1>   %define %%param %1
   135                              <1>   %define %%multi
   136                              <1>   %defstr %%string %%param
   137                              <1>   %strlen %%stringlength %%string
   138                              <1>   %assign %%index 1
   139                              <1>   %rep %%stringlength
   140                              <1>    %substr %%checkblank %%string %%index
   141                              <1>    %ifidni %%checkblank, '"'
   142                              <1>    %elifidni %%checkblank, "'"
   143                              <1>    %else
   144                              <1>     %deftok %%checkblank %%checkblank
   145                              <1>     %ifempty %%checkblank
   146                              <1>      %substr %%dup %%string %%index + 1,4
   147                              <1>      %deftok %%dup %%dup
   148                              <1>      %assign %%isdup 0
   149                              <1>      %ifidni %%dup, dup
   150                              <1>       %assign %%isdup 1
   151                              <1>      %elifidni %%dup, dup(
   152                              <1>       %assign %%isdup 1
   153                              <1>      %endif
   154                              <1>      %if %%isdup
   155                              <1>       %substr %%multi %%string 1, %%index - 1
   156                              <1>       %deftok %%multi %%multi
   157                              <1>       %substr %%string %%string %%index + 5, -1
   158                              <1>       %deftok %%token %%string
   159                              <1>       %undef %%param
   160                              <1>       stripparens %define %%param, %%token
   161                              <1>       %assign %%length 1
   162                              <1>       %ifstr %%param
   163                              <1>        %strlen %%length %%param
   164                              <1>        %assign %%length (%%length + 3) / 4
   165                              <1>       %endif
   166                              <1>       %rep %%length * %%multi
   167                              <1> 	dd ?
   168                              <1>       %endrep
   169                              <1>       %exitrep
   170                              <1>      %endif
   171                              <1>     %endif
   172                              <1>    %endif
   173                              <1>    %assign %%index %%index + 1
   174                              <1>   %endrep
   175                              <1>   %ifempty %%multi
   176                              <1>    %assign %%length 1
   177                              <1>    %ifstr %%param
   178                              <1>     %strlen %%length %%param
   179                              <1>     %assign %%length (%%length + 3) / 4
   180                              <1>    %endif
   181                              <1>    %rep %%length
   182                              <1> 	dd ?
   183                              <1>    %endrep
   184                              <1>   %endif
   185                              <1>   %rotate 1
   186                              <1>  %endrep
   187                              <1> %endmacro
   188                              <1> 
   189                              <1> %unimacro align 1-2+.nolist nop
   190                              <1> %unimacro alignb 1-2+.nolist
   191                              <1> 
   192                              <1> %imacro align 1-2+.nolist
   193                              <1>         sectalign %1
   194                              <1>         resb (((%1) - (($-$$) % (%1))) % (%1))
   195                              <1> %endmacro
   196                              <1> 
   197                              <1> %imacro alignb 1-2+.nolist
   198                              <1>         sectalign %1
   199                              <1>         resb (((%1) - (($-$$) % (%1))) % (%1))
   200                              <1> %endmacro
   201                              <1> 
   202                              <1> %unimacro istruc 1.nolist
   203                              <1> %unimacro at 1-2+.nolist
   204                              <1> %unimacro iend 0.nolist
   205                              <1> 
   206                              <1> %imacro istruc 1.nolist
   207                              <1>     %push
   208                              <1>         %define %$strucname %1
   209                              <1>         %$strucstart:
   210                              <1> %endmacro
   211                              <1> 
   212                              <1> %imacro at 1-2+.nolist
   213                              <1>     %defstr %$member %1
   214                              <1>     %substr %$member1 %$member 1
   215                              <1>     %ifidn %$member1, '.'
   216                              <1>         resb (%$strucname%1-%$strucname)-($-%$strucstart)
   217                              <1>     %else
   218                              <1>         resb (%1-%$strucname)-($-%$strucstart)
   219                              <1>     %endif
   220                              <1>     %2
   221                              <1> %endmacro
   222                              <1> 
   223                              <1> %imacro iend 0.nolist
   224                              <1>         resb %{$strucname}_size-($-%$strucstart)
   225                              <1>     %pop
   226                              <1> %endmacro
     2                                  %define DONOBITS
     3                                  %include "nibdos.nas"
     1                              <1> ;	SCCSID = @(#)nibdos.asm	1.1 85/04/10
     2                              <1> ;TITLE	NIBDOS
     3                              <1> ;NAME	MSDOS_3
     4                              <1> 
     5                              <1> ;=== Push trace listing source: mssw.nas
     6                              <1> %include "mssw.nas" ; NASM included file
     1                              <2> ;	SCCSID = @(#)ibmsw.asm	1.1 85/04/10
     2                              <2> 
     3                              <2> %include "version.mac"
     1                              <3> ; Some modules really want TRUE to be 0FFH.  Best to let them have their way.
     2                              <3> 	TRUE	   EQU	   0FFFFh
     3                              <3> 	TRUEBYTE   EQU     0FFh
     4                              <3> 	FALSE	   EQU	   0
     5                              <3> 
     6                              <3> ;
     7                              <3> ; Use the following switches to control cmacros.inc
     8                              <3> ;
     9                              <3> ?PLM       equ       0
    10                              <3> ?WIN       equ       0
    11                              <3> 
    12                              <3> memS       EQU     1			; Small model
    13                              <3> ;
    14                              <3> ; Use the switches below to produce the standard Microsoft version or the IBM
    15                              <3> ; version of the operating system
    16                              <3> ;
    17                              <3> ; The below chart will indicate how to set the switches to build the various
    18                              <3> ; versions
    19                              <3> ;
    20                              <3> ;                     IBMVER          IBMCOPYRIGHT
    21                              <3> ; --------------------------------------------------------
    22                              <3> ;  IBM Version   |     TRUE              TRUE
    23                              <3> ; --------------------------------------------------------
    24                              <3> ;  MS Version    |     FALSE             FALSE
    25                              <3> ; --------------------------------------------------------
    26                              <3> ;  Clone Version |     TRUE              FALSE
    27                              <3> ;
    28                              <3> IBMVER     EQU     TRUE
    29                              <3> IBMCOPYRIGHT EQU   FALSE
    30                              <3> 
    31                              <3> BUFFERFLAG	EQU	~ IBMCOPYRIGHT
    32                              <3> 
    33                              <3> %ifndef	MSVER	
    34                              <3> MSVER      EQU     ~ IBMVER
    35                              <3> %endif
    36                              <3> IBM	   EQU	   IBMVER
    37                              <3> ;
    38                              <3> ;
    39                              <3> 	%IF IBMVER
    40                              <3> 	    %IF IBMCOPYRIGHT
    41                              <3>               %warning out: ... IBM version build switch on ...
    42                              <3> 	    %ELSE
    43                              <3> 	      %warning out: ... CLONE version build switch on ...
    43          ******************  <3>  warning: out: ... CLONE version build switch on ... [-w+user]
    44                              <3> 	    %ENDIF
    45                              <3> 	%ELSE
    46                              <3> 	    %IFN IBMCOPYRIGHT
    47                              <3> 	      %warning out: ... MS version build switch on ...
    48                              <3> 	    %ELSE
    49                              <3> 	      %warning out: !!!!!!!!!  VERSION SWITCHES SET INCORECTLY  !!!!!!!!!
    50                              <3> 	      %warning out: !!!!!!!!! CHECK SETTINGS IN INC\VERSION.INC !!!!!!!!!
    51                              <3> 	    %ENDIF
    52                              <3> 	%ENDIF   
    53                              <3> ;
    54                              <3> ;
    55                              <3> ;***************************************************************************
    56                              <3> ;*          The following switches are for DBCS or SBCS support            *
    57                              <3> ;*                                                                         *
    58                              <3> ;*                     Set INTERNAT EQU TRUE FOR DBCS                      *
    59                              <3> ;*                     Set INTERNAT EQU FALSE FOR SBCS                     *
    60                              <3> ;*                                                                         *
    61                              <3> ;***************************************************************************
    62                              <3> ;
    63                              <3> IBMJAPVER  EQU	   FALSE		;If TRUE set KANJI true also
    64                              <3> 
    65                              <3> ;
    66                              <3> ; Switch INTERNAT for DBCS support
    67                              <3> ;
    68                              <3> INTERNAT   EQU	   FALSE
    69                              <3> ;
    70                              <3> 	%IF INTERNAT
    71                              <3> %ifndef KANJI
    72                              <3> KANJI	   EQU	   TRUE
    73                              <3> %endif
    74                              <3> IBMJAPAN   EQU	   TRUE
    75                              <3> 	%ELSE
    76                              <3> %ifndef KANJI
    77                              <3> KANJI	   EQU	   FALSE
    78                              <3> %endif
    79                              <3> IBMJAPAN   EQU	   FALSE
    80                              <3> 	%ENDIF
    81                              <3> 
    82                              <3> %ifndef altvect				; avoid jerking off vector.inc
    83                              <3> ALTVECT    EQU	   FALSE		;Switch to build ALTVECT version
    84                              <3> %endif
    85                              <3> 
    86                              <3> ;
    87                              <3> ; Country code switches
    88                              <3> ; The default contry code is assumed as USA.
    89                              <3> ;
    90                              <3> 	%IF INTERNAT
    91                              <3>  KOREA	   EQU	   TRUE
    92                              <3>  JAPAN	   EQU	   FALSE
    93                              <3> 	%ELSE
    94                              <3>  KOREA	   EQU	   FALSE
    95                              <3>  JAPAN	   EQU	   FALSE
    96                              <3> 	%ENDIF
    97                              <3> ;
    98                              <3> 		%IF INTERNAT
    99                              <3> %warning out: Internat(ECS) version build switch on
   100                              <3> 		%ENDIF
     4                              <2> 
     5                              <2> ibmver equ IBMVER	; NASM port equate
     6                              <2> IBM		EQU	ibmver
     7                              <2> WANG		EQU	FALSE
     8                              <2> 
     9                              <2> ; Set this switch to cause DOS to move itself to the end of memory
    10                              <2> HIGHMEM EQU	FALSE
    11                              <2> 
    12                              <2> ; Turn on switch below to allow testing disk code with DEBUG. It sets
    13                              <2> ; up a different stack for disk I/O (functions > 11) than that used for
    14                              <2> ; character I/O which effectively makes the DOS re-entrant.
    15                              <2> 
    16                              <2> 	%IF	IBM
    17                              <2> ESCCH	EQU	0			; character to begin escape seq.
    18                              <2> CANCEL	EQU	27			;Cancel with escape
    19                              <2> TOGLPRN EQU	TRUE			;One key toggles printer echo
    20                              <2> ZEROEXT EQU	TRUE
    21                              <2> 	%ELSE
    22                              <2> ESCCH	EQU	1BH
    23                              <2> CANCEL	EQU	"X"-"@" 		;Cancel with Ctrl-X
    24                              <2> TOGLPRN EQU	FALSE			;Separate keys for printer echo on
    25                              <2> 					;and off
    26                              <2> ZEROEXT EQU	TRUE
    27                              <2> 	%ENDIF
    28                              <2> 
     7                              <1> ;=== Pop trace listing source
     8                              <1> ;=== Push trace listing source: msconst.nas
     9                              <1> %include "msconst.nas" ; NASM included file
     1                              <2> ;	SCCSID = @(#)msconst.asm	1.4 85/09/12
     2                              <2> ;   Revision history
     3                              <2> ;      AN000  version 4.00  Jan. 1988
     4                              <2> ;      AN007  fake version check for IBMCACHE.COM
     5                              <2> %include "entryseg.nas"
     1                              <3> 
     2                              <3> %ifndef ENTRYSEGNAS
     3                              <3> %define ENTRYSEGNAS 1
     4                              <3> 
     5                              <3> %include "lmacros3.mac"
     1                              <4> [list -]
     1          ******************  <4>  warning: redefining multi-line macro `struc' [-w+pp-macro-redef-multi]
    14                              <5> [list -]
    14                              <4> [list -]
     6                              <3> %include "entrysw.mac"
     1                              <4> 
     2                              <4> %ifndef __ENTRYSW_MAC__
     3                              <4>  %assign __ENTRYSW_MAC__ 1
     4                              <4> 
     5                              <4> %assign _DOSCODEHMA		1
     6                              <4> %assign _RELOCATEDOSCODE	0
     7                              <4> 
     8                              <4> 		; Write a label "%1" (only if DOSCODE isn't relocated) and
     9                              <4> 		; "relocated%1" (always).
    10                              <4> 	%imacro relocated 1-2.nolist
    11                              <4> %ifnidni %2, device
    12                              <4>  %ifnidni %2, amis
    13                              <4>   %ifn _RELOCATEDOSCODE
    14                              <4> %1:
    15                              <4> 	global %1
    16                              <4>   %endif
    17                              <4>  %endif
    18                              <4> %endif
    19                              <4> relocated%1:				; always used for local labels
    20                              <4> 	global relocated%1
    21                              <4> 	%endmacro
    22                              <4> 
    23                              <4> %if _RELOCATEDOSCODE
    24                              <4> DOSENTRYADJUSTSEGMENT equ 60h - 26h
    25                              <4> %else
    26                              <4> DOSENTRYADJUSTSEGMENT equ 0
    27                              <4> %endif
    28                              <4> DOSENTRYADJUSTOFFSET equ DOSENTRYADJUSTSEGMENT * 16
    29                              <4> 
    30                              <4> DOSENTRYDEVICEBASE equ 10h
    31                              <4> 
    32                              <4> %endif
     7                              <3> [list -]
    23                              <3>  %define DOSENTRYGROUP DOSCODEGROUP
    24                              <3>  [list -]
    39                              <3> usesection DOSENTRY
    40                              <3> 
    41                              <3> %endif
     6                              <2> ;=== Push trace listing source: mshead.nas
     7                              <2> %include "mshead.nas" ; NASM included file
     1                              <3> ;	SCCSID = @(#)mshead.asm	1.1 85/04/10
     2                              <3> ; TITLE   MSHEAD.ASM -- MS-DOS DEFINITIONS
     3                              <3> ;PAGE
     4                              <3> ; MS-DOS  High-performance operating system for the 8086  version 1.28
     5                              <3> ;	by Microsoft MSDOS development group:
     6                              <3> ;	    TP (Ret.)
     7                              <3> ;	    AR
     8                              <3> ;	    NP (Parenting)
     9                              <3> ;	    MZ
    10                              <3> ;	    CP (BIOS) (ret.)
    11                              <3> 
    12                              <3> ; ****************** Revision History *************************
    13                              <3> ;	   >> EVERY change must noted below!! <<
    14                              <3> ;
    15                              <3> ; 0.34 12/29/80 General release, updating all past customers
    16                              <3> ; 0.42 02/25/81 32-byte directory entries added
    17                              <3> ; 0.56 03/23/81 Variable record and sector sizes
    18                              <3> ; 0.60 03/27/81 Ctrl-C exit changes, including register save on user stack
    19                              <3> ; 0.74 04/15/81 Recognize I/O devices with file names
    20                              <3> ; 0.75 04/17/81 Improve and correct buffer handling
    21                              <3> ; 0.76 04/23/81 Correct directory size when not 2^N entries
    22                              <3> ; 0.80 04/27/81 Add console input without echo, Functions 7 & 8
    23                              <3> ; 1.00 04/28/81 Renumber for general release
    24                              <3> ; 1.01 05/12/81 Fix bug in `STORE'
    25                              <3> ; 1.10 07/21/81 Fatal error trapping, NUL device, hidden files, date & time,
    26                              <3> ;		RENAME fix, general cleanup
    27                              <3> ; 1.11 09/03/81 Don't set CURRENT BLOCK to 0 on open; fix SET FILE SIZE
    28                              <3> ; 1.12 10/09/81 Zero high half of CURRENT BLOCK after all (CP/M programs don't)
    29                              <3> ; 1.13 10/29/81 Fix classic "no write-through" error in buffer handling
    30                              <3> ; 1.20 12/31/81 Add time to FCB; separate FAT from DPT; Kill SMALLDIR; Add
    31                              <3> ;		FLUSH and MAPDEV calls; allow disk mapping in DSKCHG; Lots
    32                              <3> ;		of smaller improvements
    33                              <3> ; 1.21 01/06/82 HIGHMEM switch to run DOS in high memory
    34                              <3> ; 1.22 01/12/82 Add VERIFY system call to enable/disable verify after write
    35                              <3> ; 1.23 02/11/82 Add defaulting to parser; use variable escape character Don't
    36                              <3> ;		zero extent field in IBM version (back to 1.01!)
    37                              <3> ; 1.24 03/01/82 Restore fcn. 27 to 1.0 level; add fcn. 28
    38                              <3> ; 1.25 03/03/82 Put marker (00) at end of directory to speed searches
    39                              <3> ; 1.26 03/03/82 Directory buffers searched as a circular queue, current buffer
    40                              <3> ;		is searched first when possible to minimize I/O
    41                              <3> ;      03/03/82 STORE routine optimized to tack on partial sector tail as
    42                              <3> ;		full sector write when file is growing
    43                              <3> ;      03/09/82 Multiple I/O buffers
    44                              <3> ;      03/29/82 Two bugs:  Delete all case resets search to start at beginning
    45                              <3> ;		of directory (infinite loop possible otherwise), DSKRESET
    46                              <3> ;		must invalidate all buffers (disk and directory).
    47                              <3> ; 1.27 03/31/82 Installable device drivers
    48                              <3> ;		  Function call 47 - Get pointer to device table list
    49                              <3> ;		  Function call 48 - Assign CON AUX LIST
    50                              <3> ;      04/01/82 Spooler interrupt (INT 28) added.
    51                              <3> ; 1.28 04/15/82 DOS retructured to use ASSUMEs and PROC labels around system
    52                              <3> ;		call entries.  Most CS relative references changed to SS
    53                              <3> ;		relative with an eye toward putting a portion of the DOS in
    54                              <3> ;		ROM.  DOS source also broken into header, data and code pieces
    55                              <3> ;      04/15/82 GETDMA and GETVECT calls added as 24 and 32.  These calls
    56                              <3> ;		return the current values.
    57                              <3> ;      04/15/82 INDOS flag implemented for interrupt processing along with
    58                              <3> ;		call to return flag location (call 29)
    59                              <3> ;      04/15/82 Volume ID attribute added
    60                              <3> ;      04/17/82 Changed ABORT return to user to a long ret from a long jump to
    61                              <3> ;		avoid a CS relative reference.
    62                              <3> ;      04/17/82 Put call to STATCHK in dispatcher to catch ^C more often
    63                              <3> ;      04/20/82 Added INT int_upooler into loop ^S wait
    64                              <3> ;      04/22/82 Dynamic disk I/O buffer allocation and call to manage them
    65                              <3> ;		call 49.
    66                              <3> ;      04/23/82 Added GETDSKPTDL as call 50, similar to GETFATPT(DL), returns
    67                              <3> ;		address of DPB
    68                              <3> ;      04/29/82 Mod to WRTDEV to look for ^C or ^S at console input when
    69                              <3> ;		writting to console device via file I/O.  Added a console
    70                              <3> ;		output attribute to devices.
    71                              <3> ;      04/30/82 Call to en/dis able ^C check in dispatcher Call 51
    72                              <3> ;      04/30/82 Code to allow assignment of func 1-12 to disk files as well
    73                              <3> ;		as devices....	pipes, redirection now possible
    74                              <3> ;      04/30/82 Expanded GETLIST call to 2.0 standard
    75                              <3> ;      05/04/82 Change to INT int_fatal_abort callout int HARDERR_DOS.  DOS SS
    76                              <3> ;		(data segment) stashed in ES, INT int_fatal_abort routines must
    77                              <3> ;		preserve ES.  This mod so HARDERR_DOS can be ROMed.
    78                              <3> ; 1.29 06/01/82 Installable block and character devices as per 2.0 spec
    79                              <3> ;      06/04/82 Fixed Bug in CLOSE regarding call to CHKFATWRT.  It got left
    80                              <3> ;		out back about 1.27 or so (oops).  ARR
    81                              <3> ; 1.30 06/07/82 Directory sector buffering added to main DOS buffer queue
    82                              <3> ; 1.40 06/15/82 Tree structured directories.  XENIX Path Parser MKDIR CHDIR
    83                              <3> ;		RMDIR Xenix calls
    84                              <3> ; 1.41 06/13/82 Made GETBUFFR call PLACEBUF
    85                              <3> ; 1.50 06/17/82 FATs cached in buffer pool, get FAT pointer calls disappear
    86                              <3> ;		Frees up lots of memory.
    87                              <3> ; 1.51 06/24/82 BREAKDOWN Revised to do EXACT one sector read/write through
    88                              <3> ;		system buffers
    89                              <3> ; 1.52 06/30/82 OPEN, CLOSE, READ, WRITE, DUP, DUP2, LSEEK implemented
    90                              <3> ; 1.53 07/01/82 OPEN CLOSE mod for Xenix calls, saves and gets remote dir
    91                              <3> ; 1.54 07/11/82 Function calls 1-12 make use of new 2.0 PDB. Init code
    92                              <3> ;		changed to set file handle environment.
    93                              <3> ; 2.00 08/01/82 Number for IBM release
    94                              <3> ;      01/19/83 No environ bug in EXEC
    95                              <3> ;      01/19/83 MS-DOS OEM INT 21 extensions (SET_OEM_HANDLER)
    96                              <3> ;      01/19/83 Performance bug fix in cooked write to NUL
    97                              <3> ;      01/27/83 Growcnt fixed for 32-bits
    98                              <3> ;      01/27/83 Find-first problem after create
    99                              <3> ; 2.01 02/17/83 International DOS
   100                              <3> ; 2.10 03/09/83 Start of NETWORK support
   101                              <3> ;		New Buffer structure
   102                              <3> ;		New Sytem file table structure
   103                              <3> ;		FCB moved to internal representation
   104                              <3> ;		DOS re-organized
   105                              <3> ; 2.11 04/21/83 Continuation of 2.10, preliminary Network
   106                              <3> ;		device interface.
   107                              <3> ; 2.50 09/12/83 More network stuff
   108                              <3> ;
   109                              <3> ; *************************************************************
   110                              <3> 
   111                              <3> [list -]
     3                              <5> 
     4                              <5> addsection DOSSTART, align=16 PUBLIC class=DOSSTART
     5                              <5> ; (no prior section) ; DOSSTART		ENDS
     6                              <5> 
     7                              <5> addsection DOSSTARTJUMP, align=1 PUBLIC class=START
     8                              <5> ; (no prior section) ; DOSSTARTJUMP		ENDS
     9                              <5> 
    10                              <5> addsection CONSTANTS, align=2 PUBLIC class=CONST
    11                              <5> ; (no prior section) ; CONSTANTS	ENDS
    12                              <5> 
    13                              <5> addsection DATA, align=2 PUBLIC class=DATA
    14                              <5> ; (no prior section) ; DATA		ENDS
    15                              <5> 
    16                              <5> addsection TABLE, align=2 PUBLIC class=TABLE
    17                              <5> ; (no prior section) ; TABLE		ENDS
    18                              <5> 
    19                              <5> addsection DOSDATATABLE, align=2 PUBLIC class=DOSDATACODE
    20                              <5> ; (no prior section) ; DOSDATATABLE		ENDS
    21                              <5> 
    22                              <5> addsection DOSDATACODE, align=1 PUBLIC class=DOSDATACODE
    23                              <5> ; (no prior section) ; DOSDATACODE		ENDS
    24                              <5> 
    25                              <5> addsection DOSBIODATA, align=2 PUBLIC class=DOSBIODATA
    26                              <5> 
    27                              <5> addsection LAST, align=16 PUBLIC class=LAST
    28                              <5> ; (no prior section) ; LAST		ENDS
    29                              <5> 
    30                              <5> group DOSGROUP DOSSTART DOSSTARTJUMP CONSTANTS DATA TABLE DOSDATATABLE DOSDATACODE DOSBIODATA LAST
     8                              <4> 
     9                              <4> %include "dcodeseg.nas"
     1                              <5> 
     2                              <5> %ifndef DCODESEGNAS
     3                              <5> %assign DCODESEGNAS 1
     4                              <5> 
     5                              <5> section DOSCODETABLE align=2 PUBLIC class=DOSCODE
     6                              <5> ; (no prior section) ; DOSCODETABLE		ENDS
     7                              <5> section DOSCODECODE align=1 PUBLIC class=DOSCODE
     8                              <5> ; (no prior section) ; DOSCODECODE		ENDS
     9                              <5> section DOSBIOCODE align=2 PUBLIC class=DOSCODE
    10                              <5> section BIOCODE	align=2 PUBLIC class=DOSCODE
    11                              <5> 
    12                              <5> %ifnidni DOSENTRYGROUP, DOSCODEGROUP
    13                              <5>  group DOSCODEGROUP DOSCODETABLE DOSCODECODE DOSBIOCODE BIOCODE
    14                              <5> %endif
    15                              <5> 
    16                              <5> %endif
    10                              <4> 
    11                              <4> section LAST
    12                              <4> ; (no prior section) ; LAST		ENDS
   122                              <3> 
   123                              <3> %include "dossym.mac"
     1                              <4> ;	SCCSID = @(#)dossym.asm 1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)dossym.asm 1.1 85/04/10
     3                              <4> ;	PAGE 80,132
     4                              <4> TRUE	    EQU 0FFFFh
     5                              <4> FALSE	    EQU 0
     6                              <4> 
     7                              <4> Installed   equ TRUE
     8                              <4> %IFNDEF	DEBUG
     9                              <4>     DEBUG	equ FALSE
    10                              <4> %ENDIF
    11                              <4> %IFNDEF	debug
    12                              <4>     debug	equ DEBUG
    13                              <4> %ENDIF
    14                              <4> 
    15                              <4> %if 0
    16                              <4>  DBCS equ FALSE		; for fixmem.pl operation
    17                              <4> %endif
    18                              <4> 
    19                              <4> ; NASM original macros
    20                              <4> 
    21                              <4> %macro DBCS 1.nolist
    22                              <4> %defstr %%string %1
    23                              <4> %substr %%prefix %%string 1,2
    24                              <4> %substr %%suffix %%string 3,-1
    25                              <4> %ifnidni %%prefix, "= "
    26                              <4>  %error Unexpected DBCS prefix
    27                              <4> %endif
    28                              <4> %deftok %%token %%suffix
    29                              <4> %xdefine DBCS %%token
    30                              <4> %endmacro
    31                              <4> 
    32                              <4> %include "DBCS.SW"
     1                              <5> DBCS = FALSE
     2                              <5> 
    33                              <4> %unmacro DBCS 1.nolist
    34                              <4> 
    35                              <4> ; end of NASM original macros
    36                              <4> 
    37                              <4> %include "dosmac.mac"
     1                              <5> ;	SCCSID = @(#)dosmac.asm	1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)dosmac.asm	1.1 85/04/10
     3                              <5> ;
     4                              <5> ; Macro file for MSDOS.
     5                              <5> ;
     6                              <5> 
     7                              <5> %ifndef __DOSMAC_MAC__
     8                              <5>  %assign __DOSMAC_MAC__ 1
     9                              <5> 
    10                              <5> TRUE    EQU 0FFFFh
    11                              <5> FALSE   EQU 0
    12                              <5> 
    13                              <5> 
    14                              <5> ; NASM original macros (comment for fixmem.pl)
    15                              <5> 
    16                              <5> ;SUBTTL BREAK a listing into pages and give new subtitles
    17                              <5> ;PAGE
    18                              <5> %imacro BREAK 0-1+.nolist
    19                              <5> 	;SUBTTL  subtitle
    20                              <5> 	;PAGE
    21                              <5> %endmacro
    22                              <5> ;.xcref  break
    23                              <5> 
    24                              <5> BREAK   <ASMVAR - handle assembly variables once and for all>
    25                              <5> 
    26                              <5> %if 0
    27                              <5> AsmVars Macro   varlist
    28                              <5> IRP     var,<varlist>
    29                              <5> AsmVar  var
    30                              <5> ENDM
    31                              <5> ENDM
    32                              <5> 
    33                              <5> AsmVar  Macro   var
    34                              <5> IFNDEF  var
    35                              <5> var = FALSE
    36                              <5> ENDIF
    37                              <5> ENDM
    38                              <5> %endif
    39                              <5> 
    40                              <5> BREAK <I_NEED: declare a variable external, if necessary, and allocate a size>
    41                              <5> 
    42                              <5> ;
    43                              <5> ; declare a variable external and allocate a size
    44                              <5> ;
    45                              <5> ;AsmVar  InstalledData
    46                              <5> %ifndef InstalledData
    47                              <5>  %define InstalledData 0
    48                              <5> %endif
    49                              <5> 
    50                              <5> %imacro I_NEED 1-2.nolist
    51                              <5> %ifn InstalledData
    52                              <5> 	[section DATA]
    53                              <5>     %IFIDNi   %2, WORD
    54                              <5> 	EXTRN   %1:WORD
    55                              <5>     %ELSE
    56                              <5> 	%IFIDNi   %2, DWORD
    57                              <5> 	EXTRN   %1:DWORD
    58                              <5> 	%ELSE
    59                              <5> 	EXTRN   %1:BYTE
    60                              <5> 	%ENDIF
    61                              <5>     %ENDIF
    62                              <5> 	__SECT__
    63                              <5> %ENDIF
    64                              <5> %endmacro
    65                              <5> 	;.xcref I_need
    66                              <5> 
    67                              <5> ;
    68                              <5> ; call a procedure that may be external.  The call will be short.
    69                              <5> ;
    70                              <5> %imacro invoke 1.nolist
    71                              <5> ;.xcref
    72                              <5> 	EXTRN   %1:NEAR
    73                              <5> ;.cref
    74                              <5> 	CALL    %1
    75                              <5> %endmacro
    76                              <5> ;.xcref  invoke
    77                              <5> 
    78                              <5> ;PAGE
    79                              <5> ;
    80                              <5> ; jump to a label that may be external.  The jump will be near.
    81                              <5> ;
    82                              <5> %imacro transfer 1.nolist
    83                              <5> ;.xcref
    84                              <5> 	EXTRN   %1:NEAR
    85                              <5> ;.cref
    86                              <5> 	JUMP    %1
    87                              <5> %endmacro
    88                              <5> ;.xcref  transfer
    89                              <5> 
    90                              <5> ;
    91                              <5> ; get a short address in a word
    92                              <5> ;
    93                              <5> %imacro short_addr 1.nolist
    94                              <5>     %ifnidn %1, ?
    95                              <5> 	EXTRN   %1:NEAR
    96                              <5> 	DW  OFFSET %1
    97                              <5>     %ELSE
    98                              <5> 	DW  ?
    99                              <5>     %ENDIF
   100                              <5> %endmacro
   101                              <5> ;.xcref  short_addr
   102                              <5> 
   103                              <5> ;
   104                              <5> ; get a long address in a dword
   105                              <5> ;
   106                              <5> %imacro long_addr 1.nolist
   107                              <5> 	EXTRN   %1:NEAR
   108                              <5> 	DD  %1
   109                              <5> %endmacro
   110                              <5> ;.xcref  long_addr
   111                              <5> 
   112                              <5> ;
   113                              <5> ; declare a PROC near or far but PUBLIC nonetheless
   114                              <5> ;
   115                              <5> ;.xcref ?frame
   116                              <5> ;.xcref ?aframe
   117                              <5> ;.xcref ?stackdepth
   118                              <5> ;.xcref ?initstack
   119                              <5> %assign ?frame           0                     ; initial
   120                              <5> %assign ?aframe          0                     ; initial
   121                              <5> %assign ?stackdepth      0                     ; initial stack size
   122                              <5> %assign ?initstack       0                     ; initial stack size
   123                              <5> 
   124                              <5> %imacro procedure 1-2.nolist
   125                              <5> 	%assign ?frame     0
   126                              <5> 	%assign ?aframe    2                   ;; remember the pushed BP
   127                              <5> 	%warning proc %1...
   128                              <5> %1    PROC    %2
   129                              <5> 	PUBLIC  %1
   130                              <5> 	%assign ?initstack     ?stackdepth     ;; beginning of procedure
   131                              <5> %endmacro
   132                              <5> ;.xcref  procedure
   133                              <5> 
   134                              <5> ;
   135                              <5> ; end a procedure and check that stack depth is preserved
   136                              <5> ;
   137                              <5> %imacro EndProc 1-2.nolist
   138                              <5> 	%ifnidni   %2, NoCheck        ;; check the stack size
   139                              <5> 	%if ?initstack != ?stackdepth    ;; is it different?
   140                              <5> 	%warning    ***** Possible stack size error in %1 *****
   141                              <5> 	%endif
   142                              <5> 	%endif
   143                              <5> %1    ENDP
   144                              <5> %endmacro
   145                              <5> ;.xcref  endproc
   146                              <5> ;PAGE
   147                              <5> ;
   148                              <5> ; define a data item to be public and of an appropriate size/type
   149                              <5> ;
   150                              <5> 
   151                              <5> %imacro stripangles 2.nolist
   152                              <5> %defstr %%param %2
   153                              <5> %rep 16
   154                              <5>  %substr %%opening %%param 1
   155                              <5>  %ifidn %%opening, '<'
   156                              <5>   %substr %%param %%param 2,-1
   157                              <5>  %endif
   158                              <5> %endrep
   159                              <5> %rep 16
   160                              <5>  %strlen %%length %%param
   161                              <5>  %substr %%closing %%param %%length
   162                              <5>  %ifidn %%closing, '>'
   163                              <5>   %substr %%param %%param 1,-2
   164                              <5>  %endif
   165                              <5> %endrep
   166                              <5> %deftok %%token %%param
   167                              <5> %1 %%token
   168                              <5> %endmacro
   169                              <5> 
   170                              <5> %imacro I_AM 2-*.nolist
   171                              <5> ;I_AM    MACRO   name,size,init
   172                              <5> %xdefine %%name %1
   173                              <5> ;; declare the type of the object
   174                              <5>     %IFIDNi %2, WORD
   175                              <5> %1    LABEL WORD
   176                              <5> 	%assign I_AM_SIZE      1
   177                              <5> 	%assign I_AM_LEN       2
   178                              <5>     %ELSE
   179                              <5> 	%IFIDNi %2, DWORD
   180                              <5> %1    LABEL DWORD
   181                              <5> 	%assign I_AM_SIZE      2
   182                              <5> 	%assign I_AM_LEN       2
   183                              <5> 	%ELSE
   184                              <5> 	    %IFIDNi %2, BYTE
   185                              <5> %1    LABEL BYTE
   186                              <5> 	%assign I_AM_SIZE      1
   187                              <5> 	%assign I_AM_LEN       1
   188                              <5> 	    %ELSE
   189                              <5> %1    LABEL BYTE
   190                              <5> %undef I_AM_SIZE
   191                              <5> 	stripangles %assign I_AM_SIZE, %2
   192                              <5> 	%assign I_AM_LEN       1
   193                              <5> 	    %ENDIF
   194                              <5> 	%ENDIF
   195                              <5>     %ENDIF
   196                              <5> ;; declare the object public
   197                              <5> 	PUBLIC  %%name
   198                              <5> ;; if no initialize then allocate blank storage
   199                              <5>     %IF %0 == 2
   200                              <5> 	DB  I_AM_SIZE*I_AM_LEN DUP (?)
   201                              <5>     %ELSE
   202                              <5> %ifn InstalledData
   203                              <5>  %rotate 2
   204                              <5>  %rep %0 - 2
   205                              <5> 	    %IF I_AM_LEN == 1
   206                              <5> 		stripangles db, %1
   207                              <5> 	    %ELSE
   208                              <5> 		stripangles dw, %1
   209                              <5> 	    %ENDIF
   210                              <5> 	    %assign I_AM_SIZE I_AM_SIZE - 1
   211                              <5> 	    %rotate 1
   212                              <5>  %endrep
   213                              <5> 	%IF I_AM_SIZE != 0
   214                              <5> 	    %error    ***** initialization of %%name not complete *****
   215                              <5> 	%ENDIF
   216                              <5> %ELSE
   217                              <5> 	DB  I_AM_SIZE*I_AM_LEN DUP (?)
   218                              <5> %ENDIF
   219                              <5>     %ENDIF
   220                              <5> %endmacro
   221                              <5> 
   222                              <5> %imacro I_AM_NOBITS 2-*.nolist
   223                              <5> ;I_AM    MACRO   name,size,init
   224                              <5> %xdefine %%name %1
   225                              <5> ;; declare the type of the object
   226                              <5>     %IFIDNi %2, WORD
   227                              <5> %1    LABEL WORD
   228                              <5> 	%assign I_AM_SIZE      1
   229                              <5> 	%assign I_AM_LEN       2
   230                              <5>     %ELSE
   231                              <5> 	%IFIDNi %2, DWORD
   232                              <5> %1    LABEL DWORD
   233                              <5> 	%assign I_AM_SIZE      2
   234                              <5> 	%assign I_AM_LEN       2
   235                              <5> 	%ELSE
   236                              <5> 	    %IFIDNi %2, BYTE
   237                              <5> %1    LABEL BYTE
   238                              <5> 	%assign I_AM_SIZE      1
   239                              <5> 	%assign I_AM_LEN       1
   240                              <5> 	    %ELSE
   241                              <5> %1    LABEL BYTE
   242                              <5> %undef I_AM_SIZE
   243                              <5> 	stripangles %assign I_AM_SIZE, %2
   244                              <5> 	%assign I_AM_LEN       1
   245                              <5> 	    %ENDIF
   246                              <5> 	%ENDIF
   247                              <5>     %ENDIF
   248                              <5> ;; declare the object public
   249                              <5> 	PUBLIC  %%name
   250                              <5> ;; if no initialize then allocate blank storage
   251                              <5>     %IF %0 == 2
   252                              <5> 	resb  I_AM_SIZE*I_AM_LEN
   253                              <5>     %ELSE
   254                              <5> %ifn InstalledData
   255                              <5>  %rotate 2
   256                              <5>  %rep %0 - 2
   257                              <5> 	    %IF I_AM_LEN == 1
   258                              <5> 		resb 1
   259                              <5> 	    %ELSE
   260                              <5> 		resw 1
   261                              <5> 	    %ENDIF
   262                              <5> 	    %assign I_AM_SIZE I_AM_SIZE - 1
   263                              <5> 	    %rotate 1
   264                              <5>  %endrep
   265                              <5> 	%IF I_AM_SIZE != 0
   266                              <5> 	    %error    ***** initialization of %%name not complete *****
   267                              <5> 	%ENDIF
   268                              <5> %ELSE
   269                              <5> 	resb  I_AM_SIZE*I_AM_LEN
   270                              <5> %ENDIF
   271                              <5>     %ENDIF
   272                              <5> %endmacro
   273                              <5> 
   274                              <5> ;.xcref  I_AM
   275                              <5> ;.xcref  I_AM_SIZE
   276                              <5> ;.xcref  I_AM_LEN
   277                              <5> %assign I_AM_SIZE 0
   278                              <5> %assign I_AM_LEN  0
   279                              <5> 
   280                              <5> ;PAGE
   281                              <5> 
   282                              <5> ;
   283                              <5> ; define an entry in a procedure
   284                              <5> ;
   285                              <5> %imacro entry 1-2.nolist
   286                              <5> %1:
   287                              <5> 	PUBLIC  %1
   288                              <5> %endmacro
   289                              <5> ;.xcref  entry
   290                              <5> 
   291                              <5> BREAK <ERROR - store an error code then jump to a label>
   292                              <5> 
   293                              <5> %imacro error 1.nolist
   294                              <5> ;.xcref
   295                              <5> 	MOV AL, %1
   296                              <5> 	transfer    SYS_RET_ERR
   297                              <5> ;.cref
   298                              <5> %endmacro
   299                              <5> ;.xcref  error
   300                              <5> 
   301                              <5> BREAK <JUMP - real jump that links up shortwise>
   302                              <5> ;
   303                              <5> ; given a label <lbl> either 2 byte jump to another label <lbl>_J
   304                              <5> ; if it is near enough or 3 byte jump to <lbl>
   305                              <5> ;
   306                              <5> 
   307                              <5> %imacro jump 1.nolist
   308                              <5> ;.xcref
   309                              <5> 
   310                              <5>     %ifndef %1_J                       ;; is this the first invocation
   311                              <5> %%a:      JMP %1
   312                              <5>     %ELSE
   313                              <5> 	%IF (%1_J >= $) || ($-%1_J > 126)
   314                              <5> %%a:      JMP %1                         ;; is the jump too far away?
   315                              <5> 	%ELSE
   316                              <5> %%a:      JMP %1_J                      ;; do the short one...
   317                              <5> 	%ENDIF
   318                              <5>     %ENDIF
   319                              <5>     %ixdefine %1_j %%a
   320                              <5> ;.cref
   321                              <5> %endmacro
   322                              <5> ;.xcref  jump
   323                              <5> 
   324                              <5> BREAK <RETURN - return from a function>
   325                              <5> 
   326                              <5> %imacro return 0.nolist
   327                              <5> %%a:
   328                              <5> 	RET
   329                              <5> %xdefine ret_l %%a
   330                              <5> %endmacro
   331                              <5> ;.xcref  return
   332                              <5> 
   333                              <5> BREAK <CONDRET - conditional return>
   334                              <5> 
   335                              <5> %imacro condret 2.nolist
   336                              <5> %assign %%exit 0
   337                              <5>     %ifdef   ret_l                       ;; if ret_l is defined
   338                              <5> 	%if (($ - ret_l) <= 126) && ($ > ret_l)
   339                              <5> 					;;     if ret_l is near enough then
   340                              <5> 	    %%a:  j%1    ret_l           ;;         a: j<CC> to ret_l
   341                              <5> 	    %xdefine ret_%1 %%a                 ;;         define ret_<CC> to be a:
   342                              <5> 	    %assign %%exit 1
   343                              <5> 	%endif
   344                              <5>     %endif
   345                              <5>     %ifn %%exit
   346                              <5>     %ifdef   ret_%1                     ;; if ret_<CC> defined
   347                              <5> 	%if (($ - ret_%1) <= 126) && ($ > ret_%1)
   348                              <5> 					;;     if ret_<CC> is near enough
   349                              <5> 	    %%a:  j%1    ret_%1         ;;         a: j<CC> to ret_<CC>
   350                              <5> 	    %xdefine ret_%1 %%a                 ;;         define ret_<CC> to be a:
   351                              <5> 	    %assign %%exit 1
   352                              <5> 	%endif
   353                              <5>     %endif
   354                              <5>     %endif
   355                              <5>     %ifn %%exit
   356                              <5>     j%2   %%a                           ;; j<NCC> a:
   357                              <5>     return                              ;; return
   358                              <5>     %%a:                                  ;; a:
   359                              <5>     %xdefine ret_%1 ret_l                     ;; define ret_<CC> to be ret_l
   360                              <5>     %endif
   361                              <5> %endmacro
   362                              <5> ;.xcref  condret
   363                              <5> 
   364                              <5> BREAK <RETZ - return if zero, links up shortwise if necessary>
   365                              <5> 
   366                              <5> %imacro retz 0.nolist
   367                              <5>     condret z,nz
   368                              <5> %endmacro
   369                              <5> ;.xcref  retz
   370                              <5> 
   371                              <5> BREAK <RETNZ - return if not zero, links up shortwise if necessary>
   372                              <5> 
   373                              <5> %imacro retnz 0.nolist
   374                              <5>     condret nz,z
   375                              <5> %endmacro
   376                              <5> ;.xcref  retnz
   377                              <5> 
   378                              <5> BREAK <RETC - return if carry set, links up shortwise if necessary>
   379                              <5> 
   380                              <5> %imacro retc 0.nolist
   381                              <5>     condret c,nc
   382                              <5> %endmacro
   383                              <5> ;.xcref  retc
   384                              <5> 
   385                              <5> BREAK <RETNC - return if not carry, links up shortwise if necessary>
   386                              <5> 
   387                              <5> %imacro retnc 0.nolist
   388                              <5>     condret nc,c
   389                              <5> %endmacro
   390                              <5> ;.xcref  retnc
   391                              <5> 
   392                              <5> BREAK <CONTEXT - set the DOS context to a particular register>
   393                              <5> 
   394                              <5> %imacro context 1.nolist
   395                              <5> 	PUSH    SS
   396                              <5> 	stripangles POP, %1
   397                              <5> 	; ASSUME  %1:DOSGROUP
   398                              <5> %endmacro
   399                              <5> ;.xcref  context
   400                              <5> 
   401                              <5> BREAK <SaveReg - save a set of registers>
   402                              <5> 
   403                              <5> %imacro SaveReg 0-*.nolist                 ;; push those registers
   404                              <5>  %rep %0
   405                              <5> 	%assign ?stackdepth ?stackdepth + 1
   406                              <5> 	stripangles push, %1
   407                              <5> 	%rotate 1
   408                              <5>  %endrep
   409                              <5> %endmacro
   410                              <5> ;.xcref  SaveReg
   411                              <5> 
   412                              <5> BREAK <RestoreReg - unsave some registers>
   413                              <5> 
   414                              <5> %imacro RestoreReg 0-*.nolist             ;; pop those registers
   415                              <5>  %rep %0
   416                              <5> 	%assign ?stackdepth ?stackdepth - 1
   417                              <5> 	stripangles pop, %1
   418                              <5> 	%rotate 1
   419                              <5>  %endrep
   420                              <5> %endmacro
   421                              <5> ;.xcref  RestoreReg
   422                              <5> 
   423                              <5> BREAK <Critical section macros>
   424                              <5> 
   425                              <5> %imacro EnterCrit 1.nolist
   426                              <5> 	Invoke  E%1
   427                              <5> %endmacro
   428                              <5> 
   429                              <5> %imacro LeaveCrit 1.nolist
   430                              <5> 	Invoke  L%1
   431                              <5> %endmacro
   432                              <5> 
   433                              <5> Break   <message - display a message>
   434                              <5> 
   435                              <5> ;AsmVars <ShareF,Cargs,Redirector>
   436                              <5> %ifndef ShareF
   437                              <5>  %idefine ShareF 0
   438                              <5> %endif
   439                              <5> %ifndef Cargs
   440                              <5>  %idefine Cargs 0
   441                              <5> %endif
   442                              <5> %ifndef Redirector
   443                              <5>  %idefine Redirector 0
   444                              <5> %endif
   445                              <5> %ifndef debug
   446                              <5>  %idefine debug 0
   447                              <5> %endif
   448                              <5> 
   449                              <5> %if debug
   450                              <5> %imacro fmt 3-*.nolist
   451                              <5> ;fmt     MACRO   typ,lev,fmts,args
   452                              <5> ;local   a,b,c
   453                              <5> 	PUSHF
   454                              <5> %IFNempty %1
   455                              <5> 	TEST    word [BugTyp],%1
   456                              <5> 	JZ      %%c
   457                              <5> 	CMP     word [BugLev],%2
   458                              <5> 	JB      %%c
   459                              <5> %ENDIF
   460                              <5> 	PUSH    AX
   461                              <5> 	PUSH    BP
   462                              <5> 	MOV     BP,SP
   463                              <5> %If (! sharef) && (! redirector)
   464                              <5> 	[section Table]
   465                              <5> %%a:       db      %3,0
   466                              <5> 	__SECT__
   467                              <5> 	MOV     AX,OFFSET %%a wrt DOSGROUP
   468                              <5> %else
   469                              <5> 	jmp     short %%b
   470                              <5> %%a:       db      %3,0
   471                              <5> %if sharef
   472                              <5> %%b:      mov     ax,offset %%a wrt share
   473                              <5> %else
   474                              <5> %%b:      mov     ax,offset %%a wrt netwrk
   475                              <5> %endif
   476                              <5> %endif
   477                              <5> 	PUSH    AX
   478                              <5> %iassign cargs 2
   479                              <5> %rotate 3
   480                              <5> %rep %0 - 3
   481                              <5>  %ifidni ax, %1
   482                              <5> 	MOV     AX,[BP+2]
   483                              <5>  %ELSE
   484                              <5> 	MOV     AX, %1
   485                              <5>  %ENDIF
   486                              <5> 	PUSH    AX
   487                              <5>  %iassign cargs cargs + 2
   488                              <5>  %rotate 1
   489                              <5> %endrep
   490                              <5> 	invoke  PFMT
   491                              <5> 	ADD     SP, Cargs
   492                              <5> 	POP     BP
   493                              <5> 	POP     AX
   494                              <5> %%c:
   495                              <5> 	POPF
   496                              <5> %endmacro
   497                              <5> %else
   498                              <5> %imacro fmt 3-*.nolist
   499                              <5> %endmacro
   500                              <5> %endif
   501                              <5> 
   502                              <5> Break   <DOSAssume - validate assumes>
   503                              <5> 
   504                              <5> ;AsmVar  Debug,$temp
   505                              <5> 
   506                              <5> %imacro detectstripangles 4.nolist
   507                              <5> %defstr %%param %4
   508                              <5> %assign ?%2 0
   509                              <5> %assign ?%3 0
   510                              <5> %rep 16
   511                              <5>  %substr %%opening %%param 1
   512                              <5>  %ifidn %%opening, '<'
   513                              <5>   %substr %%param %%param 2,-1
   514                              <5>   %assign ?%2 ?%2 + 1
   515                              <5>  %endif
   516                              <5> %endrep
   517                              <5> %rep 16
   518                              <5>  %strlen %%length %%param
   519                              <5>  %substr %%closing %%param %%length
   520                              <5>  %ifidn %%closing, '>'
   521                              <5>   %substr %%param %%param 1,-2
   522                              <5>   %assign ?%3 ?%3 + 1
   523                              <5>  %endif
   524                              <5> %endrep
   525                              <5> %deftok %%token %%param
   526                              <5> %define ?%1 %%token
   527                              <5> %endmacro
   528                              <5> 
   529                              <5> 
   530                              <5> %IF debug
   531                              <5> %imacro DOSAssume 3-*.nolist
   532                              <5> ;DOSAssume   Macro   reg,reglist,message
   533                              <5>  %ifidni %1, CS
   534                              <5>   %assign %%temp 1
   535                              <5>  %else
   536                              <5>   %ifidni %1, SS
   537                              <5>    %assign %%temp 0
   538                              <5>   %else
   539                              <5>    %error ***** Invalid DOS register %1 in DOSAssume *****
   540                              <5>   %endif
   541                              <5>  %endif
   542                              <5>  %rotate 1
   543                              <5>  %assign %%level 0
   544                              <5>  %assign %%amount %0 - 1
   545                              <5>  %rep 16
   546                              <5>   detectstripangles %%token, %%opening, %%closing, %1
   547                              <5>   %assign %%level %%level + ? %+ %%opening
   548                              <5>   %assign %%level %%level - ? %+ %%closing
   549                              <5>   %ifidni ? %+ %%token, DS
   550                              <5>    %assign %%temp %%temp | 2
   551                              <5>   %else
   552                              <5>    %ifidni ? %+ %%token, ES
   553                              <5>     %assign %%temp %%temp | 4
   554                              <5>    %else
   555                              <5>     %error ***** Invalid register reg in DOSAssume *****
   556                              <5>    %endif
   557                              <5>   %endif
   558                              <5>   %assign %%amount %%amount - 1
   559                              <5>   %rotate 1
   560                              <5>   %if %%level <= 0
   561                              <5>    %exitrep
   562                              <5>   %endif
   563                              <5>  %endrep
   564                              <5> 
   565                              <5> 	PUSH    AX
   566                              <5> 	MOV     AX, %%temp
   567                              <5> 	PUSH    AX
   568                              <5> %IF SHAREF
   569                              <5> 	MOV     AX,OFFSET %%a
   570                              <5> %ELSE
   571                              <5> 	MOV     AX,OFFSET %%a wrt DOSGroup
   572                              <5> %ENDIF
   573                              <5> 	PUSH    AX
   574                              <5> 	Invoke  SegCheck
   575                              <5> 	POP     AX
   576                              <5> %IFN SHAREF
   577                              <5> 	[section Table]
   578                              <5> %ELSE
   579                              <5> 	JMP     SHORT %%b
   580                              <5> %ENDIF
   581                              <5> %%a:
   582                              <5>  %rep %%amount
   583                              <5>         DB      %1
   584                              <5>   %rotate 1
   585                              <5>  %endrep
   586                              <5> 	db 0
   587                              <5> %IFN SHAREF
   588                              <5> 	__SECT__
   589                              <5> %ELSE
   590                              <5> %%b:
   591                              <5> %ENDIF
   592                              <5> ;IRP r,<reglist>
   593                              <5> ;    ASSUME  r:DOSGroup
   594                              <5> ;ENDM
   595                              <5> %endmacro
   596                              <5> %ELSE
   597                              <5> %imacro DOSAssume 3-*.nolist
   598                              <5> ;DOSAssume   Macro   reg,reglist,message
   599                              <5> ;IRP r,<reglist>
   600                              <5> ;    ASSUME  r:DOSGroup
   601                              <5> ;ENDM
   602                              <5> %endmacro
   603                              <5> %ENDIF
   604                              <5> 
   605                              <5> BREAK   <ASSERT - make assertions about registers>
   606                              <5> 
   607                              <5> %if 0
   608                              <5> ;IF DEBUG
   609                              <5> Assert  MACRO   kind, objs, message
   610                              <5> 	LOCAL   a,b
   611                              <5>     IFIDN   <kind>,<Z>
   612                              <5> 	CMP     objs,0
   613                              <5> 	JZ      a
   614                              <5> 	fmt <>,<>,<message>
   615                              <5> a:
   616                              <5>     ELSE
   617                              <5> 	IFIDN   <kind>,<NZ>
   618                              <5> 	CMP     objs,0
   619                              <5> 	JNZ     a
   620                              <5> 	fmt <>,<>,<message>
   621                              <5> a:
   622                              <5> 	ELSE
   623                              <5>     PUSH    AX
   624                              <5> 	    IRP obj,<objs>
   625                              <5> 	PUSH    obj
   626                              <5> 	    ENDM
   627                              <5> 	    IF SHAREF
   628                              <5>     MOV     AX,OFFSET b
   629                              <5> 	    ELSE
   630                              <5>     MOV     AX,OFFSET DOSGroup:b
   631                              <5> 	    ENDIF
   632                              <5>     PUSH    AX
   633                              <5> 	    IFIDN   <kind>,<ISBUF>
   634                              <5> 	Invoke  BUFCheck
   635                              <5> 	    ENDIF
   636                              <5> 	    IFIDN   <kind>,<ISSFT>
   637                              <5> 	Invoke  SFTCheck
   638                              <5> 	    ENDIF
   639                              <5> 	    IFIDN   <kind>,<ISDPB>
   640                              <5> 	Invoke  DPBCheck
   641                              <5> 	    ENDIF
   642                              <5>     POP     AX
   643                              <5> 	    IF SHAREF
   644                              <5>     JMP SHORT a
   645                              <5> b   DB  Message,0
   646                              <5> a:
   647                              <5> 	    ELSE
   648                              <5> Table   segment
   649                              <5> b   db  Message,0
   650                              <5> Table   ends
   651                              <5> 	    ENDIF
   652                              <5> 	ENDIF
   653                              <5>     ENDIF
   654                              <5> ENDM
   655                              <5> %ELSE
   656                              <5> %imacro Assert 0-*.nolist
   657                              <5> %endmacro
   658                              <5> %ENDIF
   659                              <5> 
   660                              <5> %ifndef Installed
   661                              <5>  %idefine Installed 1
   662                              <5> %endif
   663                              <5> 
   664                              <5> Break   <CallInstall - hook to installable pieces>
   665                              <5> 
   666                              <5> %imacro CallInstall 3-*.nolist
   667                              <5> ;CallInstall MACRO   name,mpx,fn,save,restore
   668                              <5> %define %%name %1
   669                              <5> %assign %%mpx %2
   670                              <5> %assign %%fn %3
   671                              <5> %IF Installed
   672                              <5>  %rotate 3
   673                              <5>  %assign %%level 0
   674                              <5>  %assign %%amountsaved 0
   675                              <5>  %rep %0 - 3
   676                              <5>   %ifnempty %1
   677                              <5>    detectstripangles %%token, %%opening, %%closing, %1
   678                              <5>    %assign %%level %%level + ? %+ %%opening
   679                              <5>    %assign %%level %%level - ? %+ %%closing
   680                              <5>    SaveReg ? %+ %%token
   681                              <5>   %endif
   682                              <5>   %assign %%amountsaved %%amountsaved + 1
   683                              <5>   %rotate 1
   684                              <5>   %if %%level <= 0
   685                              <5>    %exitrep
   686                              <5>   %endif
   687                              <5>  %endrep
   688                              <5> 	MOV     AX,(%%mpx << 8) + %%fn
   689                              <5> 	INT     2Fh
   690                              <5>  %assign %%level 0
   691                              <5>  %assign %%amountrestored 0
   692                              <5>  %rep %0 - 3 - %%amountsaved
   693                              <5>   %ifnempty %1
   694                              <5>    detectstripangles %%token, %%opening, %%closing, %1
   695                              <5>    %assign %%level %%level + ? %+ %%opening
   696                              <5>    %assign %%level %%level - ? %+ %%closing
   697                              <5>    RestoreReg ? %+ %%token
   698                              <5>   %endif
   699                              <5>   %assign %%amountrestored %%amountrestored + 1
   700                              <5>   %rotate 1
   701                              <5>   %if %%level <= 0
   702                              <5>    %exitrep
   703                              <5>   %endif
   704                              <5>  %endrep
   705                              <5>  %if %%level > 0 || %0 != 3 + %%amountsaved + %%amountrestored
   706                              <5>   %error Wrong amount saved or restored
   707                              <5>  %endif
   708                              <5> %ELSE
   709                              <5> 	Invoke  %%name
   710                              <5> %ENDIF
   711                              <5> %endmacro
   712                              <5> 
   713                              <5> Break   <Stack frame manipulators>
   714                              <5> 
   715                              <5> %imacro localvar 2.nolist
   716                              <5> %ifidni %2, BYTE
   717                              <5>  %assign ?frame ?frame + 1
   718                              <5>  %assign %%a ?frame
   719                              <5>  labelsize %1, byte, bp - %%a
   720                              <5> %else
   721                              <5>  %ifidni %2, WORD
   722                              <5>   %assign ?frame ?frame + 2
   723                              <5>   %assign %%a ?frame
   724                              <5>   labelsize %1, word, bp - %%a
   725                              <5>  %else
   726                              <5>   %ifidni %2, DWORD
   727                              <5>    %assign ?frame ?frame + 4
   728                              <5>    %assign %%a ?frame
   729                              <5>    labelsize %1 %+ l, word, bp - %%a
   730                              <5>    labelsize %1 %+ h, word, bp - %%a + 2
   731                              <5>    labelsize %1, dword, bp - %%a
   732                              <5>   %else
   733                              <5>    %assign ?frame ?frame + %2
   734                              <5>    %assign %%a ?frame
   735                              <5>    labelsize %1, byte, bp - %%a
   736                              <5>   %endif
   737                              <5>  %endif
   738                              <5> %endif
   739                              <5> %endmacro
   740                              <5> 
   741                              <5> %imacro enter 0.nolist
   742                              <5> 	push    bp
   743                              <5> 	mov     bp,sp
   744                              <5> 	sub     sp,?frame
   745                              <5> %endmacro
   746                              <5> 
   747                              <5> %imacro leave 0.nolist
   748                              <5> 	mov     sp,bp
   749                              <5> 	pop     bp
   750                              <5> %endmacro
   751                              <5> 
   752                              <5> 
   753                              <5> %imacro argvar 2.nolist
   754                              <5> %ifidni %2, BYTE
   755                              <5>  %assign %%a ?aframe
   756                              <5>  %assign ?aframe ?aframe + 1
   757                              <5>  labelsize %1, byte, bp + %%a
   758                              <5> %else
   759                              <5>  %ifidni %2, WORD
   760                              <5>   %assign %%a ?aframe
   761                              <5>   %assign ?aframe ?aframe + 2
   762                              <5>   labelsize %1, word, bp + %%a
   763                              <5>  %else
   764                              <5>   %ifidni %2, DWORD
   765                              <5>    %assign %%a ?aframe
   766                              <5>    %assign ?aframe ?aframe + 4
   767                              <5>    labelsize %1 %+ l, word, bp + %%a
   768                              <5>    labelsize %1 %+ h, word, bp + %%a + 2
   769                              <5>    labelsize %1, dword, bp + %%a
   770                              <5>   %else
   771                              <5>    %assign %%a ?aframe
   772                              <5>    %assign ?aframe ?aframe + %2
   773                              <5>    labelsize %1, byte, bp + %%a
   774                              <5>   %endif
   775                              <5>  %endif
   776                              <5> %endif
   777                              <5> %endmacro
   778                              <5> 
   779                              <5> BREAK   <errnz - generate compilation errors>
   780                              <5> 
   781                              <5> %imacro errnz 1.nolist
   782                              <5> detectstripangles %%token, %%opening, %%closing, %1
   783                              <5> %if ? %+ %%token
   784                              <5>     %error %1 <> 0
   785                              <5> %endif
   786                              <5> %endmacro
   787                              <5> 
   788                              <5> %endif
    38                              <4> 
    39                              <4> %include "versiona.mac"
     1                              <5> 
     2                              <5> major_version	    equ     4	    ;Major DOS version
     3                              <5> minor_version	    equ     00	    ;Minor DOS Version
     4                              <5> 
     5                              <5> MINOR_VERSION equ minor_version	; NASM port equate
     6                              <5> MAJOR_VERSION equ major_version	; NASM port equate
     7                              <5> expected_version    equ     (MINOR_VERSION << 8)+MAJOR_VERSION
     8                              <5> 
     9                              <5> alt_major_version    equ     5	    ;Major DOS version
    10                              <5> alt_minor_version    equ     26	    ;Minor DOS Version
    11                              <5> 
    12                              <5> alt_expected_version    equ     (alt_minor_version << 8) + alt_major_version
    13                              <5> 
    14                              <5> new_major_version    equ     5	    ;Major DOS version
    15                              <5> new_minor_version    equ     38	    ;Minor DOS Version
    16                              <5> new_expected_version    equ     (new_minor_version << 8) + new_major_version
    17                              <5> 
    18                              <5>        %warning out: ... for DOS Version 4.00 ...
    18          ******************  <5>  warning: out: ... for DOS Version 4.00 ... [-w+user]
    19                              <5> 
    20                              <5>        ;******************************
    21                              <5>        ;Each assembler program should:
    22                              <5>        ;  mov ah,030h			;DOS Get Version function
    23                              <5>        ;  int 021h			;Version ret. in AX,minor version first
    24                              <5>        ;  cmp ax,expected_version	;ALL utilities should check for an
    25                              <5>        ;  jne error_handler		; EXACT version match.
    26                              <5>        ;******************************
    27                              <5> 
    40                              <4> 
    41                              <4> BREAK <Control character definitions>
    42                              <4> 
    43                              <4> c_DEL	    EQU     7Fh 		;    ASCII rubout or delete previous char
    44                              <4> c_BS	    EQU     08h 		; ^H ASCII backspace
    45                              <4> c_CR	    EQU     0Dh 		; ^M ASCII carriage return
    46                              <4> c_LF	    EQU     0Ah 		; ^J ASCII linefeed
    47                              <4> c_ETB	    EQU     17h 		; ^W ASCII end of transmission
    48                              <4> c_NAK	    EQU     15h 		; ^U ASCII negative acknowledge
    49                              <4> c_ETX	    EQU     03h 		; ^C ASCII end of text
    50                              <4> c_HT	    EQU     09h 		; ^I ASCII tab
    51                              <4> 
    52                              <4> BREAK <Read This and Weep>
    53                              <4> 
    54                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    55                              <4> ;									   ;
    56                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    57                              <4> ;									   ;
    58                              <4> ; Certain structures, constants and system  calls  below  are  private	to ;
    59                              <4> ; the DOS  and	are  extremely	version-dependent.  They may change at any ;
    60                              <4> ; time at  the	implementors'  whim.   As  a  result,  they  must  not  be ;
    61                              <4> ; documented to  the  general  public.	 If  an  extreme case arises, they ;
    62                              <4> ; must be documented with this warning. 				   ;
    63                              <4> ;									   ;
    64                              <4> ; Those structures and constants that are subject to  the  above  will	be ;
    65                              <4> ; marked and bracketed with the flag:					   ;
    66                              <4> ;									   ;
    67                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    68                              <4> ;									   ;
    69                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    70                              <4> 
    71                              <4> %include "bpb.mac"
     1                              <5> 	%warning out: BPB.INC...
     1          ******************  <5>  warning: out: BPB.INC... [-w+user]
     2                              <5> ;	SCCSID = @(#)BPB.ASM	1.1 85/04/29
     3                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     4                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     5                              <5> ;									   ;
     6                              <5> 
     7                              <5> ; BIOS PARAMETER BLOCK DEFINITION
     8                              <5> ; THIS STRUCTURE IS USED TO BUILD A FULL DPB
     9                              <5> 
    10                              <5> BPBLOCK STRUC
    11 00000000 ????                <5> BPSECSZ DW	?			; SIZE IN BYTES OF PHYSICAL SECTOR
    12 00000002 ??                  <5> BPCLUS	DB	?			; SECTORS/ALLOC UNIT
    13 00000003 ????                <5> BPRES	DW	?			; NUMBER OF RESERVED SECTORS
    14 00000005 ??                  <5> BPFTCNT DB	?			; NUMBER OF FATS
    15 00000006 ????                <5> BPDRCNT DW	?			; NUMBER OF DIRECTORY ENTRIES
    16 00000008 ????                <5> BPSCCNT DW	?			; TOTAL NUMBER OF SECTORS
    17 0000000A ??                  <5> BPMEDIA DB	?			; MEDIA DESCRIPTOR BYTE
    18 0000000B ????                <5> BPFTSEC DW	?			; NUMBER OF SECTORS TAKEN UP BY ONE FAT
    19                              <5> BPBLOCK ENDS
    20                              <5> 
    21                              <5> A_BPB			STRUC
    22 00000000 ????                <5> BPB_BYTESPERSECTOR	DW	?
    23 00000002 ??                  <5> BPB_SECTORSPERCLUSTER	DB	?
    24 00000003 ????                <5> BPB_RESERVEDSECTORS	DW	?
    25 00000005 ??                  <5> BPB_NUMBEROFFATS	DB	?
    26 00000006 ????                <5> BPB_ROOTENTRIES 	DW	?
    27 00000008 ????                <5> BPB_TOTALSECTORS	DW	?
    28 0000000A ??                  <5> BPB_MEDIADESCRIPTOR	DB	?
    29 0000000B ????                <5> BPB_SECTORSPERFAT	DW	?
    30 0000000D ????                <5> BPB_SECTORSPERTRACK	DW	?
    31 0000000F ????                <5> BPB_HEADS		DW	?
    32 00000011 ????                <5> BPB_HIDDENSECTORS	DW	?
    33 00000013 ????                <5> 			DW	?
    34 00000015 ????                <5> BPB_BIGTOTALSECTORS	DW	?
    35 00000017 ????                <5> 			DW	?
    36 00000019 ????????????        <5> 			DB	6 DUP(?)
    37                              <5> A_BPB			ENDS
    38                              <5> ;									   ;
    39                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    40                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    72                              <4> 
    73                              <4> %include "buffer.mac"
     1                              <5> %include "buf2sw.mac"
     1                              <6> %define BUF2 1
     2                              <5> 
     3                              <5> ;	SCCSID = @(#)buffer.asm 1.1 85/04/09
     4                              <5> BREAK <Disk I/O Buffer Header>
     5                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     6                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     7                              <5> ;									   ;
     8                              <5> 
     9                              <5> %ifdef BUF2
    10                              <5> 
    11                              <5> ; Field definition for I/O buffer information
    12                              <5> 
    13                              <5> BUFFINFO        STRUC
    14 00000000 ????????            <5> NEXTBUF         DD      ?       ; Pointer to next buffer in list
    15                              <5> ; The next two items are often refed as a word
    16                              <5> buf_ID:
    17 00000004 ??                  <5> BUFDRV          DB      ?       ; Logical drive # assoc with buffer FF = free
    18                              <5> buf_flags:
    19 00000005 ??                  <5> BUFDATAFLAG	db	?
    20 00000006 ??                  <5> BUFPRI          DB      ?       ; Buffer selection priority (see EQUs below)
    21 00000007 ??                  <5> 	alignb 2
    22                              <5> buf_sector:
    23 00000008 ????????            <5> BUFSECNO        dd      ?       ; Sector number of buffer
    24                              <5> 	alignb 2
    25 0000000C ????????            <5> BUFDRVDP        DD      ?       ; Pointer to drive parameters
    26                              <5> BUFFINFO        ENDS
    27                              <5> 
    28                              <5> BUFINSIZ        EQU     BUFFINFO_struc_size
    29                              <5>                                 ; Size of structure in bytes
    30                              <5> BUFINSIZE equ BUFINSIZ
    31                              <5> 
    32                              <5> FREEPRI EQU     0
    33                              <5> LBRPRI  EQU     2               ; Last byte of buffer read
    34                              <5> LBWPRI  EQU     4               ; Last byte written
    35                              <5> RPRI    EQU     6               ; Read but not last byte
    36                              <5> WPRI    EQU     8               ; Written but not last byte
    37                              <5> DIRPRI  EQU     15              ; Directory Sector
    38                              <5> FATPRI  EQU     30              ; FAT sector
    39                              <5> 
    40                              <5> buf_dirty	EQU	01000000B
    41                              <5> buf_isDATA	EQU	00001000B
    42                              <5> buf_isDIR	EQU	00000100B
    43                              <5> buf_isFAT	EQU	00000010B
    44                              <5> buf_type_0	EQU	11110001B	; AND sets type to "none"
    45                              <5> 
    46                              <5> %else
    47                              <5> 
    48                              <5> ; Field definition for I/O buffer information
    49                              <5> 
    50                              <5> BUFFINFO	STRUC
    51                              <5> buf_next	DW	?		; Pointer to next buffer in list
    52                              <5> buf_prev	DW	?		; Pointer to prev buffer in list
    53                              <5> buf_ID		DB	?		; Drive of buffer (bit 7 = 0)
    54                              <5> 					; SFT table index (bit 7 = 1)
    55                              <5> 					; = FFH if buffer free
    56                              <5> buf_flags	DB	?		; Bit 7 = 1 if Remote file buffer
    57                              <5> 					;	= 0 if Local device buffer
    58                              <5> 					; Bit 6 = 1 if buffer dirty
    59                              <5> 					; Bit 5 = Reserved
    60                              <5> 					; Bit 4 = Search bit (bit 7 = 1)
    61                              <5> 					; Bit 3 = 1 if buffer is DATA
    62                              <5> 					; Bit 2 = 1 if buffer is DIR
    63                              <5> 					; Bit 1 = 1 if buffer is FAT
    64                              <5> 					; Bit 0 = Reserved
    65                              <5> buf_sector	DD	?		; Sector number of buffer (bit 7 = 0)
    66                              <5> ; The next two items are often refed as a word (bit 7 = 0)
    67                              <5> buf_wrtcnt	DB	?		; For FAT sectors, # times sector written out
    68                              <5> buf_wrtcntinc	DW	?		; "   "     "   , # sectors between each write
    69                              <5> buf_DPB 	DD	?		; Pointer to drive parameters
    70                              <5> buf_fill	DW	?		; How full buffer is (bit 7 = 1)
    71                              <5> buf_reserved	DB	?		; make DWORD boundary for 386
    72                              <5> BUFFINFO	ENDS
    73                              <5> 
    74                              <5> labelsize buf_offset, dword, buf_sector
    75                              <5> 					;For bit 7 = 1, this is the byte
    76                              <5> 					;offset of the start of the buffer in
    77                              <5> 					;the file pointed to by buf_ID.  Thus
    78                              <5> 					;the buffer starts at location
    79                              <5> 					;buf_offset in the file and contains
    80                              <5> 					;buf_fill bytes.
    81                              <5> 
    82                              <5> BUFINSIZ	EQU	BUFFINFO_struc_size
    83                              <5> 					; Size of structure in bytes
    84                              <5> 
    85                              <5> buf_Free	EQU	0FFh		; buf_id of free buffer
    86                              <5> 
    87                              <5> ;Flag byte masks
    88                              <5> buf_isnet	EQU	10000000B
    89                              <5> buf_dirty	EQU	01000000B
    90                              <5> 
    91                              <5> buf_isDATA	EQU	00001000B
    92                              <5> buf_isDIR	EQU	00000100B
    93                              <5> buf_isFAT	EQU	00000010B
    94                              <5> buf_type_0	EQU	11110001B	; AND sets type to "none"
    95                              <5> 
    96                              <5> buf_NetID	EQU	BUFINSIZ
    97                              <5> 
    98                              <5> ;
    99                              <5> ; Buffer Hash Entry Structure
   100                              <5> 
   101                              <5> BUFFER_HASH_ENTRY	STRUC		; DOS 4.00
   102                              <5> EMS_PAGE_NUM	DW	?		; logical page number for EMS handle
   103                              <5> BUFFER_BUCKET	DD	 ?		; pointer to buffers
   104                              <5> DIRTY_COUNT	DB	 ?		; number of dirty buffers
   105                              <5> BUFFER_RESERVED DB	 ?		; reserved
   106                              <5> BUFFER_HASH_ENTRY	ENDS
   107                              <5> 
   108                              <5> MaxBuffinBucket EQU	15		; Max number of buffers per bucket
   109                              <5> MaxBucketinPage EQU	 2		; Max number of buckets per 16kb page
   110                              <5> 
   111                              <5> %endif
   112                              <5> 
   113                              <5> ;									   ;
   114                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   115                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    74                              <4> 
    75                              <4> BREAK <User stack inside of system call and SysVars>
    76                              <4> ; Location of user registers relative user stack pointer
    77                              <4> 
    78                              <4> user_environ	STRUC
    79 00000000 ????                <4> user_AX     DW	    ?
    80 00000002 ????                <4> user_BX     DW	    ?
    81 00000004 ????                <4> user_CX     DW	    ?
    82 00000006 ????                <4> user_DX     DW	    ?
    83 00000008 ????                <4> user_SI     DW	    ?
    84 0000000A ????                <4> user_DI     DW	    ?
    85 0000000C ????                <4> user_BP     DW	    ?
    86 0000000E ????                <4> user_DS     DW	    ?
    87 00000010 ????                <4> user_ES     DW	    ?
    88 00000012 ????                <4> user_IP     DW	    ?
    89 00000014 ????                <4> user_CS     DW	    ?
    90 00000016 ????                <4> user_F	    DW	    ?
    91                              <4> user_environ	ENDS
    92                              <4> 
    93                              <4> %include "sysvar.mac"
     1                              <5> ;	SCCSID = @(#)sysvar.asm 1.1 85/04/10
     2                              <5> %include "version.mac"
     1                              <6> ; Some modules really want TRUE to be 0FFH.  Best to let them have their way.
     2                              <6> 	TRUE	   EQU	   0FFFFh
     3                              <6> 	TRUEBYTE   EQU     0FFh
     4                              <6> 	FALSE	   EQU	   0
     5                              <6> 
     6                              <6> ;
     7                              <6> ; Use the following switches to control cmacros.inc
     8                              <6> ;
     9                              <6> ?PLM       equ       0
    10                              <6> ?WIN       equ       0
    11                              <6> 
    12                              <6> memS       EQU     1			; Small model
    13                              <6> ;
    14                              <6> ; Use the switches below to produce the standard Microsoft version or the IBM
    15                              <6> ; version of the operating system
    16                              <6> ;
    17                              <6> ; The below chart will indicate how to set the switches to build the various
    18                              <6> ; versions
    19                              <6> ;
    20                              <6> ;                     IBMVER          IBMCOPYRIGHT
    21                              <6> ; --------------------------------------------------------
    22                              <6> ;  IBM Version   |     TRUE              TRUE
    23                              <6> ; --------------------------------------------------------
    24                              <6> ;  MS Version    |     FALSE             FALSE
    25                              <6> ; --------------------------------------------------------
    26                              <6> ;  Clone Version |     TRUE              FALSE
    27                              <6> ;
    28                              <6> IBMVER     EQU     TRUE
    29                              <6> IBMCOPYRIGHT EQU   FALSE
    30                              <6> 
    31                              <6> BUFFERFLAG	EQU	~ IBMCOPYRIGHT
    32                              <6> 
    33                              <6> %ifndef	MSVER	
    34                              <6> MSVER      EQU     ~ IBMVER
    35                              <6> %endif
    36                              <6> IBM	   EQU	   IBMVER
    37                              <6> ;
    38                              <6> ;
    39                              <6> 	%IF IBMVER
    40                              <6> 	    %IF IBMCOPYRIGHT
    41                              <6>               %warning out: ... IBM version build switch on ...
    42                              <6> 	    %ELSE
    43                              <6> 	      %warning out: ... CLONE version build switch on ...
    43          ******************  <6>  warning: out: ... CLONE version build switch on ... [-w+user]
    44                              <6> 	    %ENDIF
    45                              <6> 	%ELSE
    46                              <6> 	    %IFN IBMCOPYRIGHT
    47                              <6> 	      %warning out: ... MS version build switch on ...
    48                              <6> 	    %ELSE
    49                              <6> 	      %warning out: !!!!!!!!!  VERSION SWITCHES SET INCORECTLY  !!!!!!!!!
    50                              <6> 	      %warning out: !!!!!!!!! CHECK SETTINGS IN INC\VERSION.INC !!!!!!!!!
    51                              <6> 	    %ENDIF
    52                              <6> 	%ENDIF   
    53                              <6> ;
    54                              <6> ;
    55                              <6> ;***************************************************************************
    56                              <6> ;*          The following switches are for DBCS or SBCS support            *
    57                              <6> ;*                                                                         *
    58                              <6> ;*                     Set INTERNAT EQU TRUE FOR DBCS                      *
    59                              <6> ;*                     Set INTERNAT EQU FALSE FOR SBCS                     *
    60                              <6> ;*                                                                         *
    61                              <6> ;***************************************************************************
    62                              <6> ;
    63                              <6> IBMJAPVER  EQU	   FALSE		;If TRUE set KANJI true also
    64                              <6> 
    65                              <6> ;
    66                              <6> ; Switch INTERNAT for DBCS support
    67                              <6> ;
    68                              <6> INTERNAT   EQU	   FALSE
    69                              <6> ;
    70                              <6> 	%IF INTERNAT
    71                              <6> %ifndef KANJI
    72                              <6> KANJI	   EQU	   TRUE
    73                              <6> %endif
    74                              <6> IBMJAPAN   EQU	   TRUE
    75                              <6> 	%ELSE
    76                              <6> %ifndef KANJI
    77                              <6> KANJI	   EQU	   FALSE
    78                              <6> %endif
    79                              <6> IBMJAPAN   EQU	   FALSE
    80                              <6> 	%ENDIF
    81                              <6> 
    82                              <6> %ifndef altvect				; avoid jerking off vector.inc
    83                              <6> ALTVECT    EQU	   FALSE		;Switch to build ALTVECT version
    84                              <6> %endif
    85                              <6> 
    86                              <6> ;
    87                              <6> ; Country code switches
    88                              <6> ; The default contry code is assumed as USA.
    89                              <6> ;
    90                              <6> 	%IF INTERNAT
    91                              <6>  KOREA	   EQU	   TRUE
    92                              <6>  JAPAN	   EQU	   FALSE
    93                              <6> 	%ELSE
    94                              <6>  KOREA	   EQU	   FALSE
    95                              <6>  JAPAN	   EQU	   FALSE
    96                              <6> 	%ENDIF
    97                              <6> ;
    98                              <6> 		%IF INTERNAT
    99                              <6> %warning out: Internat(ECS) version build switch on
   100                              <6> 		%ENDIF
     3                              <5> 
     4                              <5> SysInitVars STRUC
     5 00000000 ????????            <5> SYSI_DPB	    DD	    ?		; DPB chain
     6 00000004 ????????            <5> SYSI_SFT	    DD	    ?		; SFT chain
     7 00000008 ????????            <5> SYSI_CLOCK	    DD	    ?		; CLOCK device
     8 0000000C ????????            <5> SYSI_CON	    DD	    ?		; CON device
     9 00000010 ????                <5> SYSI_MAXSEC	    DW	    ?		; maximum sector size
    10 00000012 ????????            <5> SYSI_BUF	    DD	    ?		; points to Hashinitvar
    11 00000016 ????????            <5> SYSI_CDS	    DD	    ?		; CDS list
    12 0000001A ????????            <5> SYSI_FCB	    DD	    ?		; FCB chain
    13 0000001E ????                <5> SYSI_Keep	    DW	    ?		; keep count
    14 00000020 ??                  <5> SYSI_NUMIO	    DB	    ?		; Number of block devices
    15 00000021 ??                  <5> SYSI_NCDS	    DB	    ?		; number of CDS's
    16 00000022 ????????            <5> SYSI_DEV	    DD	    ?		; device list
    17 00000026 ????                <5> SYSI_ATTR	    DW	    ?		; null device attribute word
    18 00000028 ????                <5> SYSI_STRAT	    DW	    ?		; null device strategy entry point
    19 0000002A ????                <5> SYSI_INTER	    DW	    ?		; null device interrupt entry point
    20 0000002C ????????????????    <5> SYSI_NAME	    DB	 8 DUP(?)	; null device name
    21 00000034 ??                  <5> SYSI_SPLICE	    DB	    ?		; TRUE -> splicees being done
    22 00000035 ????                <5> SYSI_IBMDOS_SIZE    DW	    ?		; DOS size in paragraphs
    23 00000037 ????????            <5> SYSI_IFS_DOSCALL@   DD	    ?		; IFS DOS service rountine entry
    24 0000003B ????????            <5> SYSI_IFS	    DD	    ?		; IFS header chain
    25 0000003F ????????            <5> SYSI_BUFFERS	    DW	    ?,? 	; BUFFERS= values (m,n)
    26 00000043 ??                  <5> SYSI_BOOT_DRIVE     DB	    ?		; boot drive A=1 B=2,..
    27 00000044 ??                  <5> SYSI_DWMOVE	    DB	    ?		; 1 if 386 machine
    28 00000045 ????                <5> SYSI_EXT_MEM	    DW	    ?		; Extended memory size in KB.
    29                              <5> SysInitVars ENDS
    30                              <5> 
    31                              <5> ;This is added for more information exchage between DOS, BIOS.
    32                              <5> ;DOS will give the pointer to SysInitTable in ES:DI. - J.K. 5/29/86
    33                              <5> SysInitVars_Ext struc
    34 00000000 ????????            <5> SYSI_InitVars		DD	?	; Points to the above structure.
    35 00000004 ????????            <5> SYSI_Country_Tab	DD	?	; DOS_Country_cdpg_info
    36                              <5> SysInitVars_Ext ends
    37                              <5> 
    38                              <5> ;The SYSI_BUF of SysInitVars points to the follwong structure
    39                              <5> EMS_MAP_BUFF_SIZE      EQU	12	; EMS map buffer size
    40                              <5> 
    41                              <5> Buffinfo    STRUC
    42 00000000 ????????            <5> Hash_ptr	 DD	 ?		     ; pointer to Hash table
    43 00000004 ????                <5> Hash_count	 DW	 ?		     ; number of Hash entries
    44 00000006 ????????            <5> Cache_ptr	 DD	 ?		     ; pointer to secondary cache
    45 0000000A ????                <5> Cache_count	 DW	 ?		     ; number of secondary cache entries
    46                              <5> 
    47                              <5> %IF	BUFFERFLAG
    48                              <5> 
    49 0000000C ??                  <5> EMS_SAFE_FLAG	DB	?
    50 0000000D ????????            <5> EMS_LAST_PAGE	DW	?, ?
    51 00000011 ????????            <5> EMS_FIRST_PAGE	DW	?, ?
    52 00000015 ????                <5> EMS_NPA640	DW	?
    53                              <5> 
    54                              <5> %ENDIF
    55                              <5> 
    56 00000017 ??                  <5> EMS_mode	 DB	 ?		     ; no EMS = -1
    57 00000018 ????                <5> EMS_handle	 DW	 ?		     ; EMS handle for buffers
    58 0000001A ????                <5> EMS_PageFrame_Number	DW   ?		     ; EMS page frame number
    59 0000001C ????                <5> EMS_Seg_Cnt	 DW	 ?		     ; EMS segment count
    60 0000001E ????                <5> EMS_Page_Frame	 DW	 ?		     ; EMS page frame segment address
    61 00000020 ????                <5> EMS_reserved	 DW	 ?		     ; EMS segment count
    62                              <5> 
    63                              <5> %IF	BUFFERFLAG
    64 00000022 ??                  <5> EMS_Map_Buff	 DB	 ?  ; map buffer
    65                              <5> %ELSE
    66                              <5> EMS_Map_Buff	DB	12 dup(?)
    67                              <5> %ENDIF
    68                              <5> 
    69                              <5> Buffinfo    ENDS
    70                              <5> 
    71                              <5> 
    72                              <5> 
    73                              <5> 
    74                              <5> 
    75                              <5> 
    76                              <5> 
    77                              <5> 
    94                              <4> 
    95                              <4> %include "vector.mac"
     1                              <5> ;	SCCSID = @(#)vector.asm	1.1 85/04/10
     2                              <5> BREAK <interrupt definitions>
     3                              <5> 
     4                              <5> ;Asmvar	AltVect
     5                              <5> %ifndef AltVect
     6                              <5>  %iassign AltVect 0
     7                              <5> %endif
     8                              <5> 
     9                              <5> INTTAB		EQU	20H
    10                              <5> inttab equ INTTAB	; NASM port equate
    11                              <5> INTBASE 	EQU	4 * inttab
    12                              <5> ENTRYPOINT	EQU	INTBASE+40H
    13                              <5> 
    14                              <5> 	%IF	ALTVECT
    15                              <5> ALTTAB	EQU	0F0H
    16                              <5> ALTBASE EQU	4 * ALTTAB
    17                              <5> 	%ENDIF
    18                              <5> 
    19                              <5> ;
    20                              <5> ; interrupt assignments
    21                              <5> ;
    22                              <5> 	%IFN ALTVECT
    23                              <5> int_abort	    EQU     INTTAB	; abort process
    24                              <5> int_command	    EQU     int_abort+1 ; call MSDOS
    25                              <5> int_terminate	    EQU     int_abort+2 ; int to terminate address
    26                              <5> int_ctrl_c	    EQU     int_abort+3 ; ^c trapper
    27                              <5> int_fatal_abort     EQU     int_abort+4 ; hard disk error
    28                              <5> int_disk_read	    EQU     int_abort+5 ; logical sector disk read
    29                              <5> int_disk_write	    EQU     int_abort+6 ; logical sector disk write
    30                              <5> int_keep_process    EQU     int_abort+7 ; terminate program and stay
    31                              <5> 					; resident
    32                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    33                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    34                              <5> ;									   ;
    35                              <5> int_spooler	    EQU     int_abort+8 ; spooler call
    36                              <5> int_fastcon	    EQU     int_abort+9 ; fast CON interrupt
    37                              <5> int_IBM 	    EQU     int_abort+10; critical section maintenance
    38                              <5> ;									   ;
    39                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    40                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    41                              <5> 	%ELSE
    42                              <5> int_abort	    EQU     INTTAB	; abort process
    43                              <5> int_command	    EQU     int_abort+1 ; call MSDOS
    44                              <5> int_terminate	    EQU     ALTTAB	; int to terminate address
    45                              <5> int_ctrl_c	    EQU     int_terminate+1 ; ^c trapper
    46                              <5> int_fatal_abort     EQU     int_terminate+2 ; hard disk error
    47                              <5> int_disk_read	    EQU     int_abort+5 ; logical sector disk read
    48                              <5> int_disk_write	    EQU     int_abort+6 ; logical sector disk write
    49                              <5> int_keep_process    EQU     int_abort+7 ; terminate program and stay resident
    50                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    51                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    52                              <5> ;									   ;
    53                              <5> int_spooler	    EQU     int_terminate+3 ; spooler call
    54                              <5> int_fastcon	    EQU     int_abort+9 ; fast CON interrupt
    55                              <5> ;									   ;
    56                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    57                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    58                              <5> 	%ENDIF
    59                              <5> 
    60                              <5> addr_int_abort		EQU    4 * int_abort
    61                              <5> addr_int_command	EQU    4 * int_command
    62                              <5> addr_int_terminate	EQU    4 * int_terminate
    63                              <5> addr_int_ctrl_c 	EQU    4 * int_ctrl_c
    64                              <5> addr_int_fatal_abort	EQU    4 * int_fatal_abort
    65                              <5> addr_int_disk_read	EQU    4 * int_disk_read
    66                              <5> addr_int_disk_write	EQU    4 * int_disk_write
    67                              <5> addr_int_keep_process	EQU    4 * int_keep_process
    68                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    69                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    70                              <5> ;									   ;
    71                              <5> addr_int_spooler	EQU    4 * int_spooler
    72                              <5> addr_int_fastcon	EQU    4 * int_fastcon
    73                              <5> addr_int_IBM		EQU    4 * int_IBM
    74                              <5> ;									   ;
    75                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    76                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    96                              <4> 
    97                              <4> %include "mult.mac"
     1                              <5> ;	SCCSID = @(#)mult.asm	1.2 85/04/12
     2                              <5> Break <Critical section and Multiplex channels>
     3                              <5> 
     4                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <5> ;									   ;
     7                              <5> ; Critical section definitions
     8                              <5> ;
     9                              <5> ; These below are subject to leave-all sections
    10                              <5> critDisk    EQU     1			; Disk I/O critical section
    11                              <5> critDevice  EQU     2			; Device I/O critical section
    12                              <5> critShare   EQU     1			; Sharer I/O critical section
    13                              <5> critMem     EQU     1			; memory maintenance critical section
    14                              <5> critNet     EQU     5			; network critical section
    15                              <5> critSFT     EQU     1			; sft table allocation
    16                              <5> critIFS     EQU     6			; ifsfunc critical section
    17                              <5> ; These below are not subject to leave-all sections
    18                              <5> critASSIGN  EQU     8			; Assign has munged a system call
    19                              <5> ;									   ;
    20                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    21                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    22                              <5> 
    23                              <5> ;
    24                              <5> ; The current set of defined multiplex channels is (* means documented):
    25                              <5> ;
    26                              <5> ;   Channel(h)	Issuer		Receiver    Function
    27                              <5> ;      00	server		PSPRINT     print job control
    28                              <5> ;     *01	print/apps	PRINT	    Queueing of files
    29                              <5> ;      02	BIOS		REDIR	    signal open/close of printers
    30                              <5> ;
    31                              <5> ;      05	command 	REDIR	    obtain text of net int 24 message
    32                              <5> ;     *06	server/assign	ASSIGN	    Install check
    33                              <5> ;
    34                              <5> ;      08	external driver IBMBIO	    interface to internal routines
    35                              <5> ;
    36                              <5> ;      10	sharer/server	Sharer	    install check
    37                              <5> ;      11	DOS/server	Redir	    install check/redirection funcs
    38                              <5> ;      12	sharer/redir	DOS	    dos functions and structure maint
    39                              <5> ;      13	MSNET		MSNET	    movement of NCBs
    40                              <5> ;      13	external driver IBMBIO	    Reset_Int_13, allows installation
    41                              <5> ;					    of alternative INT_13 drivers after
    42                              <5> ;					    boot_up
    43                              <5> ;      14 (IBM) DOS		NLSFUNC     down load NLS country info,DOS 3.3
    44                              <5> ;      14 (MS)	APPS		POPUP	    MSDOS 4 popup screen functions
    45                              <5> ;      15	APPS		MSCDEX	    CD-ROM extensions interface
    46                              <5> ;      16	WIN386		WIN386	    Windows communications
    47                              <5> ;      17	Clipboard	WINDOWS     Clipboard interface
    48                              <5> ;     *18	Applications	MS-Manger   Toggle interface to manager
    49                              <5> ;      19	Shell
    50                              <5> ;      1A	Ansi.sys
    51                              <5> ;      1B	Fastopen,Vdisk	 IBMBIO     EMS INT 67H stub handler
    52                              <5> ;
    53                              <5> ;      AC	Graphics
    54                              <5> ;      AD	NLS (toronto)
    55                              <5> ;      AE
    56                              <5> ;      AF	Mode
    57                              <5> ;      B0	GRAFTABL	GRAFTABL
    58                              <5> ;
    59                              <5> 
    60                              <5> 
    61                              <5> ;MUX 00-3F reserverd for IBM
    62                              <5> ;MUX 80-BF reserverd for IBM
    63                              <5> ;MUX 40-7F reserved for Microsoft
    64                              <5> ;MUX C0-FF users
    65                              <5> 
    66                              <5> 
    67                              <5> 
    68                              <5> MultSHARE   EQU     10h 		; sharer
    69                              <5>     ;	1   MFT_enter
    70                              <5>     ;	2   MFTClose
    71                              <5>     ;	3   MFTclU
    72                              <5>     ;	4   MFTCloseP
    73                              <5>     ;	5   MFTCloN
    74                              <5>     ;	6   set_block
    75                              <5>     ;	7   clr_block
    76                              <5>     ;	8   chk_block
    77                              <5>     ;	9   MFT_get
    78                              <5>     ;	10  ShSave
    79                              <5>     ;	11  ShChk
    80                              <5>     ;	12  ShCol
    81                              <5>     ;	13  ShCloseFile
    82                              <5> 
    83                              <5> MultNET     EQU     11h 		; Network support
    84                              <5> MultIFS     EQU     11h 		; Network support
    85                              <5>     ;	1   IFS_RMDIR
    86                              <5>     ;	2   IFS_SEQ_RMDIR
    87                              <5>     ;	3   IFS_MKDIR
    88                              <5>     ;	4   IFS_SEQ_MKDIR
    89                              <5>     ;	5   IFS_CHDIR
    90                              <5>     ;	6   IFS_CLOSE
    91                              <5>     ;	7   IFS_COMMIT
    92                              <5>     ;	8   IFS_READ
    93                              <5>     ;	9   IFS_WRITE
    94                              <5>     ;	10  IFS_LOCK
    95                              <5>     ;	11  IFS_UNLOCK
    96                              <5>     ;	12  IFS_DISK_INFO
    97                              <5>     ;	13  IFS_SET_FILE_ATTRIBUTE
    98                              <5>     ;	14  IFS_SEQ_SET_FILE_ATTRIBUTE
    99                              <5>     ;	15  IFS_GET_FILE_INFO
   100                              <5>     ;	16  IFS_SEQ_GET_FILE_INFO
   101                              <5>     ;	17  IFS_RENAME
   102                              <5>     ;	18  IFS_SEQ_RENAME
   103                              <5>     ;	19  IFS_DELETE
   104                              <5>     ;	20  IFS_SEQ_DELETE
   105                              <5>     ;	21  IFS_OPEN
   106                              <5>     ;	22  IFS_SEQ_OPEN
   107                              <5>     ;	23  IFS_CREATE
   108                              <5>     ;	24  IFS_SEQ_CREATE
   109                              <5>     ;	25  IFS_SEQ_SEARCH_FIRST
   110                              <5>     ;	26  IFS_SEQ_SEARCH_NEXT
   111                              <5>     ;	27  IFS_SEARCH_FIRST
   112                              <5>     ;	28  IFS_SEARCH_NEXT
   113                              <5>     ;	29  IFS_ABORT
   114                              <5>     ;	30  IFS_ASSOPER
   115                              <5>     ;	31  Printer_SET_STRING
   116                              <5>     ;	32  IFSFlushBuf
   117                              <5>     ;	33  IFSBufWrite
   118                              <5>     ;	34  IFSResetEnvironment
   119                              <5>     ;	35  IFSSpoolCheck
   120                              <5>     ;	36  IFSSpoolClose
   121                              <5> 
   122                              <5> MultDOS     EQU     12h 		; DOS call back
   123                              <5>     ;	1   DOS_CLOSE
   124                              <5>     ;	2   RECSET
   125                              <5>     ;	3   Get DOSGROUP
   126                              <5>     ;	4   PATHCHRCMP
   127                              <5>     ;	5   OUT
   128                              <5>     ;	6   NET_I24_ENTRY
   129                              <5>     ;	7   PLACEBUF
   130                              <5>     ;	8   FREE_SFT
   131                              <5>     ;	9   BUFWRITE
   132                              <5>     ;	10  SHARE_VIOLATION
   133                              <5>     ;	11  SHARE_ERROR
   134                              <5>     ;	12  SET_SFT_MODE
   135                              <5>     ;	13  DATE16
   136                              <5>     ;	14  SETVISIT
   137                              <5>     ;	15  SCANPLACE
   138                              <5>     ;	16  SKIPVISIT
   139                              <5>     ;	17  StrCpy
   140                              <5>     ;	18  StrLen
   141                              <5>     ;	19  Ucase
   142                              <5>     ;	20  POINTCOMP
   143                              <5>     ;	21  CHECKFLUSH
   144                              <5>     ;	22  SFFromSFN
   145                              <5>     ;	23  GetCDSFromDrv
   146                              <5>     ;	24  Get_User_Stack
   147                              <5>     ;	25  GetThisDrv
   148                              <5>     ;	26  DriveFromText
   149                              <5>     ;	27  SETYEAR
   150                              <5>     ;	28  DSUM
   151                              <5>     ;	29  DSLIDE
   152                              <5>     ;	30  StrCmp
   153                              <5>     ;	31  initcds
   154                              <5>     ;	32  pjfnfromhandle
   155                              <5>     ;	33  $NameTrans
   156                              <5>     ;	34  CAL_LK
   157                              <5>     ;	35  DEVNAME
   158                              <5>     ;	36  Idle
   159                              <5>     ;	37  DStrLen
   160                              <5>     ;	38  NLS_OPEN	  DOS 3.3
   161                              <5>     ;	39  $CLOSE	  DOS 3.3
   162                              <5>     ;	40  NLS_LSEEK	  DOS 3.3
   163                              <5>     ;	41  $READ	  DOS 3.3
   164                              <5>     ;	42  FastInit	  DOS 4.0
   165                              <5>     ;	43  NLS_IOCTL	  DOS 3.3
   166                              <5>     ;	44  GetDevList	  DOS 3.3
   167                              <5>     ;	45  NLS_GETEXT	  DOS 3.3
   168                              <5>     ;	46  MSG_RETRIEVAL DOS 4.0
   169                              <5>     ;	47  FAKE_VERSION  DOS 4.0
   170                              <5>     ;
   171                              <5> NLSFUNC     EQU     14h 		; NLSFUNC CALL , DOS 3.3
   172                              <5>     ;	0   NLSInstall
   173                              <5>     ;	1   ChgCodePage
   174                              <5>     ;	2   GetExtInfo
   175                              <5>     ;	3   SetCodePage
   176                              <5>     ;	4   GetCntry
   177                              <5>     ;
   178                              <5> ;FASTOPEN is not chained through INT 2F   ; DOS 3.3 F.C.
   179                              <5> ;	  it calls Multdos 42 to set up an entry routine address
   180                              <5>     ;	0   Install status  (reserved)
   181                              <5>     ;	1   Lookup
   182                              <5>     ;	2   Insert
   183                              <5>     ;	3   Delete
   184                              <5>     ;	4   Purge	    (reserved)
    98                              <4> 
    99                              <4> BREAK <Disk map>
   100                              <4> ;  MSDOS partitions the disk into 4 sections:
   101                              <4> ;
   102                              <4> ;  phys sector 0:   +-------------------+
   103                              <4> ;	|	    | boot/reserved	|
   104                              <4> ;	|	    +-------------------+
   105                              <4> ;	|	    |  File allocation	|
   106                              <4> ;	v	    |	   table(s)	|
   107                              <4> ;		    |  (multiple copies |
   108                              <4> ;		    |	  are kept)	|
   109                              <4> ;		    +-------------------+
   110                              <4> ;		    |	  Directory	|
   111                              <4> ;		    +-------------------+
   112                              <4> ;		    |	  File space	|
   113                              <4> ;		    +-------------------+
   114                              <4> ;		    |	Unaddressable	|
   115                              <4> ;		    |  (to end of disk) |
   116                              <4> ;		    +-------------------+
   117                              <4> ;
   118                              <4> ; All partition boundaries are sector boundaries.  The size of the FAT is
   119                              <4> ; adjusted to maximize the file space addressable.
   120                              <4> 
   121                              <4> %include "dirent.mac"
     1                              <5> ;	SCCSID = @(#)dirent.asm 1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)dirent.asm 1.1 85/04/10
     3                              <5> Break <Directory entry>
     4                              <5> 
     5                              <5> ;
     6                              <5> ;	+---------------------------+
     7                              <5> ;	|  (12 BYTE) filename/ext   |	    0	    0
     8                              <5> ;	+---------------------------+
     9                              <5> ;	|     (BYTE) attributes     |	    11	    B
    10                              <5> ;	+---------------------------+
    11                              <5> ;	|    (10 BYTE) reserved     |	    12	    C
    12                              <5> ;	+---------------------------+
    13                              <5> ;	| (WORD) time of last write |	    22	    16
    14                              <5> ;	+---------------------------+
    15                              <5> ;	| (WORD) date of last write |	    24	    18
    16                              <5> ;	+---------------------------+
    17                              <5> ;	|   (WORD) First cluster    |	    26	    1A
    18                              <5> ;	+---------------------------+
    19                              <5> ;	|     (DWORD) file size     |	    28	    1C
    20                              <5> ;	+---------------------------+
    21                              <5> ;
    22                              <5> ;   First byte of filename  = E5 -> free directory entry
    23                              <5> ;			    = 00 -> end of allocated directory
    24                              <5> ;   Time:   Bits 0-4=seconds/2, bits 5-10=minute, 11-15=hour
    25                              <5> ;   Date:   Bits 0-4=day, bits 5-8=month, bits 9-15=year-1980
    26                              <5> ;
    27                              <5> 
    28                              <5> dir_entry   STRUC
    29 00000000 ??????????????????- <5> dir_name    DB	    11 DUP (?)		; file name
    29 00000009 ????                <5>
    30 0000000B ??                  <5> dir_attr    DB	    ?			; attribute bits
    31 0000000C ????                <5> dir_codepg  dw	    ?			; code page DOS 4.00
    32 0000000E ????                <5> dir_extcluster dw   ?			; extended attribute starting cluster
    33 00000010 ??                  <5> dir_attr2   db	    ?			; reserved
    34 00000011 ??????????          <5> dir_pad     DB	    5  DUP (?)		; reserved for expansion
    35 00000016 ????                <5> dir_time    DW	    ?			; time of last write
    36 00000018 ????                <5> dir_date    DW	    ?			; date of last write
    37 0000001A ????                <5> dir_first   DW	    ?			; first allocation unit of file
    38 0000001C ????                <5> dir_size_l  DW	    ?			; low 16 bits of file size
    39 0000001E ????                <5> dir_size_h  DW	    ?			; high 16 bits of file size
    40                              <5> dir_entry   ENDS
    41                              <5> 
    42                              <5> attr_read_only	    EQU      1h
    43                              <5> attr_hidden	    EQU      2h
    44                              <5> attr_system	    EQU      4h
    45                              <5> attr_volume_id	    EQU      8h
    46                              <5> attr_directory	    EQU     10h
    47                              <5> attr_archive	    EQU     20h
    48                              <5> attr_device	    EQU     40h 	; This is a VERY special bit.
    49                              <5> 					;   NO directory entry on a disk EVER
    50                              <5> 					;   has this bit set. It is set non-zero
    51                              <5> 					;   when a device is found by GETPATH
    52                              <5> 
    53                              <5> attr_all	    EQU     attr_hidden+attr_system+attr_directory
    54                              <5> 					; OR of hard attributes for FINDENTRY
    55                              <5> 
    56                              <5> attr_ignore	    EQU     attr_read_only+attr_archive+attr_device
    57                              <5> 					; ignore this(ese) attribute(s) during
    58                              <5> 					; search first/next
    59                              <5> 
    60                              <5> attr_changeable     EQU     attr_read_only+attr_hidden+attr_system+attr_archive
    61                              <5> 					; changeable via CHMOD
   122                              <4> 
   123                              <4> BREAK <File allocation Table information>
   124                              <4> ;
   125                              <4> ; The File Allocation Table uses a 12-bit entry for each allocation unit on
   126                              <4> ; the disk.  These entries are packed, two for every three bytes.  The contents
   127                              <4> ; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
   128                              <4> ; to the base address of the Allocation Table; 3) fetching the 16-bit word
   129                              <4> ; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
   130                              <4> ; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex).  Entry
   131                              <4> ; number zero is used as an end-of-file trap in the OS and is passed to the
   132                              <4> ; BIOS to help determine disk format.  Entry 1 is reserved for future use.
   133                              <4> ; The first available allocation unit is assigned entry number two, and even
   134                              <4> ; though it is the first, is called cluster 2.	Entries greater than 0FF8H
   135                              <4> ; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero
   136                              <4> ; are unallocated.  Otherwise, the contents of a FAT entry is the number of
   137                              <4> ; the next cluster in the file.
   138                              <4> ;
   139                              <4> ; Clusters with bad sectors are tagged with FF7H.  Any non-zero number would
   140                              <4> ; do because these clusters show as allocated, but are not part of any
   141                              <4> ; allocation chain and thus will never be allocated to a file.	A particular
   142                              <4> ; number is selected so that disk checking programs know what to do (ie.  a
   143                              <4> ; cluster with entry FF7H which is not in a chain is not an error).
   144                              <4> 
   145                              <4> %include "dpb.mac"
     1                              <5> ;	SCCSID = @(#)dpb.asm	1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)dpb.asm	1.1 85/04/10
     3                              <5> BREAK <DPB structure>
     4                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <5> ;									   ;
     7                              <5> dpb	STRUC
     8 00000000 ??                  <5> dpb_drive	    DB	    ?		; Logical drive # assoc with DPB (A=0,B=1,...)
     9 00000001 ??                  <5> dpb_UNIT	    DB	    ?		; Driver unit number of DPB
    10 00000002 ????                <5> dpb_sector_size     DW	    ?		; Size of physical sector in bytes
    11 00000004 ??                  <5> dpb_cluster_mask    DB	    ?		; Sectors/cluster - 1
    12 00000005 ??                  <5> dpb_cluster_shift   DB	    ?		; Log2 of sectors/cluster
    13 00000006 ????                <5> dpb_first_FAT	    DW	    ?		; Starting record of FATs
    14 00000008 ??                  <5> dpb_FAT_count	    DB	    ?		; Number of FATs for this drive
    15 00000009 ????                <5> dpb_root_entries    DW	    ?		; Number of directory entries
    16 0000000B ????                <5> dpb_first_sector    DW	    ?		; First sector of first cluster
    17 0000000D ????                <5> dpb_max_cluster     DW	    ?		; Number of clusters on drive + 1
    18 0000000F ????                <5> dpb_FAT_size	    DW	    ?		;;Number of records occupied by FAT
    19 00000011 ????                <5> dpb_dir_sector	    DW	    ?		; Starting record of directory
    20 00000013 ????????            <5> dpb_driver_addr     DD	    ?		; Pointer to driver
    21 00000017 ??                  <5> dpb_media	    DB	    ?		; Media byte
    22 00000018 ??                  <5> dpb_first_access    DB	    ?		; This is initialized to -1 to force a media
    23                              <5> 					; check the first time this DPB is used
    24 00000019 ????????            <5> dpb_next_dpb	    DD	    ?		; Pointer to next Drive parameter block
    25 0000001D ????                <5> dpb_next_free	    DW	    ?		; Cluster # of last allocated cluster
    26 0000001F ????                <5> dpb_free_cnt	    DW	    ?		; Count of free clusters, -1 if unknown
    27                              <5> dpb	ENDS
    28                              <5> 
    29                              <5> DPBSIZ	EQU	dpb_struc_size		; Size of the structure in bytes
    30                              <5> 
    31                              <5> DSKSIZ	equ	dpb_max_cluster 	; Size of disk (temp used during init only)
    32                              <5> ;									   ;
    33                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    34                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   146                              <4> 
   147                              <4> %include "curdir.mac"
     1                              <5> ;	SCCSID = @(#)curdir.asm 1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)curdir.asm 1.1 85/04/10
     3                              <5> BREAK <Current directory list structure>
     4                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <5> ;									   ;
     7                              <5> ; CDS items are used bu the internal routines to store cluster numbers and ;
     8                              <5> ; network identifiers for each logical name.  The ID field is used dually, ;
     9                              <5> ; both as net ID and for a cluster number for local devices.  In the case  ;
    10                              <5> ; of local devices, the cluster number will be -1 if there is a potential  ;
    11                              <5> ; of the disk being changed or if the path must be recracked.  The END	   ;
    12                              <5> ; field is the location of the end of the definition.  No .. is allowed    ;
    13                              <5> ; past this point							   ;
    14                              <5> 
    15                              <5> DIRSTRLEN	EQU	64+3		; Max length in bytes of directory strings
    16                              <5> TEMPLEN 	EQU	DIRSTRLEN*2
    17                              <5> 
    18                              <5> curdir_list	STRUC
    19 00000000 ??????????????????- <5> curdir_text	DB	DIRSTRLEN DUP (?)   ; text of assignment and curdir
    19 00000009 ??????????????????- <5>
    19 00000012 ??????????????????- <5>
    19 0000001B ??????????????????- <5>
    19 00000024 ??????????????????- <5>
    19 0000002D ??????????????????- <5>
    19 00000036 ??????????????????- <5>
    19 0000003F ????????            <5>
    20 00000043 ????                <5> curdir_flags	DW	?		; various flags
    21 00000045 ????????            <5> curdir_devptr	DD	?		; local pointer to DPB or net device
    22 00000049 ????                <5> curdir_ID	DW	?		; cluster of current dir (net ID)
    23 0000004B ????                <5> 		DW	?
    24 0000004D ????                <5> curdir_user_word DW	?
    25 0000004F ????                <5> curdir_end	DW	?		; end of assignment
    26 00000051 ??                  <5> curdir_type	DB	?		; IFS drive (2=ifs, 4=netuse)
    27 00000052 ????????            <5> curdir_ifs_hdr	DD	?		; Ptr to File System Header
    28 00000056 ????                <5> curdir_fsda	DB	2 DUP (?)	; File System Dependent Data Area
    29                              <5> curdir_list	ENDS
    30                              <5> 
    31                              <5> curdirLen	EQU	curdir_list_struc_size	; Needed for screwed up
    32                              <5> 						; ASM87 which doesn't allow
    33                              <5> 						; Size directive as a macro
    34                              <5> 						; argument
    35                              <5> labelsize curdir_netID, dword, curdir_ID
    36                              <5> 
    37                              <5> ;Flag word masks
    38                              <5> curdir_isnet	EQU	1000000000000000B
    39                              <5> curdir_isifs	EQU	1000000000000000B	; DOS 4.00
    40                              <5> curdir_inuse	EQU	0100000000000000B
    41                              <5> curdir_splice	EQU	0010000000000000B
    42                              <5> curdir_local	EQU	0001000000000000B
    43                              <5> ;									   ;
    44                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    45                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   148                              <4> 
   149                              <4> %include "cpmfcb.mac"
     1                              <5> ;       SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
     2                              <5> ;       SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
     3                              <5> ;BREAK <File Control Block definition>
     4                              <5> 
     5                              <5> ;
     6                              <5> ; Field definition for FCBs
     7                              <5> ; The FCB has the following structure:
     8                              <5> ;
     9                              <5> ;       +---------------------------+
    10                              <5> ;       |   Drive indicator(byte)   |
    11                              <5> ;       +---------------------------+
    12                              <5> ;       |    Filename (8 chars)     |
    13                              <5> ;       +---------------------------+
    14                              <5> ;       |    Extension (3 chars)    |
    15                              <5> ;       +---------------------------+
    16                              <5> ;       |   Current Extent(word)    |
    17                              <5> ;       +---------------------------+
    18                              <5> ;       |    Record size (word)     |
    19                              <5> ;       +---------------------------+
    20                              <5> ;       |    File Size (2 words)    |
    21                              <5> ;       +---------------------------+
    22                              <5> ;       |       Date of write       |
    23                              <5> ;       +---------------------------+
    24                              <5> ;       |       Time of write       |
    25                              <5> ;       +---------------------------+
    26                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    27                              <5> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    28                              <5> ;                                                                          ;
    29                              <5> ;       +---------------------------+
    30                              <5> ;       |   8 bytes reserved        |
    31                              <5> ;       +---------------------------+
    32                              <5> ;                                                                          ;
    33                              <5> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    34                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    35                              <5> ;       |    next record number     |
    36                              <5> ;       +---------------------------+
    37                              <5> ;       |   random record number    |
    38                              <5> ;       +---------------------------+
    39                              <5> ;
    40                              <5> 
    41                              <5> sys_fcb     STRUC
    42 00000000 ??                  <5> fcb_drive   DB      ?
    43 00000001 ????????????????    <5> fcb_name    DB      8 DUP (?)
    44 00000009 ??????              <5> fcb_ext     DB      3 DUP (?)
    45 0000000C ????                <5> fcb_EXTENT  DW      ?
    46 0000000E ????                <5> fcb_RECSIZ  DW      ?                   ; Size of record (user settable)
    47 00000010 ????                <5> fcb_FILSIZ  DW      ?                   ; Size of file in bytes; used with the
    48                              <5>                                         ; following word
    49 00000012 ????                <5> fcb_DRVBP   DW      ?                   ; BP for SEARCH FIRST and SEARCH NEXT
    50 00000014 ????                <5> fcb_FDATE   DW      ?                   ; Date of last writing
    51 00000016 ????                <5> fcb_FTIME   DW      ?                   ; Time of last writing
    52                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    53                              <5> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    54                              <5> ;                                                                          ;
    55 00000018 ????????????????    <5> fcb_reserved DB      8 DUP (?)           ; RESERVED
    56                              <5> ;                                                                          ;
    57                              <5> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    58                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    59 00000020 ??                  <5> fcb_NR      DB      ?                   ; Next record
    60 00000021 ????????            <5> fcb_RR      DB      4 DUP (?)           ; Random record
    61                              <5> sys_fcb     ENDS
    62                              <5> 
    63                              <5> FILDIRENT       equ fcb_FILSIZ            ; Used only by SEARCH FIRST and SEARCH
    64                              <5>                                         ; NEXT
    65                              <5> 
    66                              <5> labelsize fcb_sfn, byte, fcb_reserved
    67                              <5> 
    68                              <5> ; Note that fcb_net_handle, fcb_nsl_drive, fcb_nsld_drive and fcb_l_drive
    69                              <5> ; all must point to the same byte.  Otherwise, the FCBRegen will fail.
    70                              <5> ; NOTE about this byte (fcb_nsl_drive)
    71                              <5> ;   The high two bits of this byte are used as follows to indicate the FCB type
    72                              <5> ;       00 means a local file or device with sharing loaded
    73                              <5> ;       10 means a remote (network) file
    74                              <5> ;       01 means a local file with no sharing loaded
    75                              <5> ;       11 means a local device with no sharing loaded
    76                              <5> 
    77                              <5> ;
    78                              <5> ; Network FCB
    79                              <5> ;
    80                              <5> labelsize fcb_net_drive, byte, fcb_reserved+1
    81                              <5> labelsize fcb_net_handle, word, fcb_reserved+2
    82                              <5> labelsize fcb_netID, dword, fcb_reserved+4
    83                              <5> 
    84                              <5> ;
    85                              <5> ; No sharing local file FCB
    86                              <5> ;
    87                              <5> labelsize fcb_nsl_drive, byte, fcb_reserved+1
    88                              <5> labelsize fcb_nsl_bits, byte, fcb_reserved+2
    89                              <5> labelsize fcb_nsl_firclus, word, fcb_reserved+3
    90                              <5> labelsize fcb_nsl_dirsec, word, fcb_reserved+5
    91                              <5> labelsize fcb_nsl_dirpos, byte, fcb_reserved+7
    92                              <5> 
    93                              <5> ;
    94                              <5> ; No sharing local device FCB
    95                              <5> ;
    96                              <5> labelsize fcb_nsld_drive, byte, fcb_reserved+1
    97                              <5> labelsize fcb_nsld_drvptr, dword, fcb_reserved+2
    98                              <5> 
    99                              <5> ;
   100                              <5> ; Sharing local FCB
   101                              <5> ;
   102                              <5> labelsize fcb_l_drive, byte, fcb_reserved+1
   103                              <5> labelsize fcb_l_firclus, word, fcb_reserved+2
   104                              <5> labelsize fcb_l_mfs, word, fcb_reserved+4
   105                              <5> labelsize fcb_l_attr, byte, fcb_reserved+6
   106                              <5> 
   107                              <5> ;
   108                              <5> ; Bogusness:  the four cases are:
   109                              <5> ;
   110                              <5> ;   local file      00
   111                              <5> ;   local device    40
   112                              <5> ;   local sharing   C0
   113                              <5> ;   network         80
   114                              <5> ;
   115                              <5> ; Since sharing and network collide, we cannot use a test instruction for
   116                              <5> ; deciding whether a network or a share check in involved
   117                              <5> ;
   118                              <5> FCBDEVICE   EQU 040h
   119                              <5> FCBNETWORK  EQU 080h
   120                              <5> FCBSHARE    EQU 0C0h
   121                              <5> 
   122                              <5> ; FCBSPECIAL must be able to mask off both net and share
   123                              <5> FCBSPECIAL  EQU 080h
   124                              <5> FCBMASK     EQU 0C0h
   150                              <4> 
   151                              <4> %include "find.mac"
     1                              <5> ;	SCCSID = @(#)find.asm	1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)find.asm	1.1 85/04/10
     3                              <5> Break	<find first/next buffer>
     4                              <5> 
     5                              <5> find_buf    STRUC
     6                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     7                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     8                              <5> ;									   ;
     9 00000000 ??                  <5> find_buf_drive	    DB	?		; drive of search
    10 00000001 ??????????????????- <5> find_buf_name	    DB	11 DUP (?)	; formatted name
    10 0000000A ????                <5>
    11 0000000C ??                  <5> find_buf_sattr	    DB	?		; attribute of search
    12 0000000D ????                <5> find_buf_LastEnt    DW	?		; LastEnt
    13 0000000F ????                <5> find_buf_DirStart   DW	?		; DirStart
    14 00000011 ????????            <5> find_buf_NetID	    DB	4 DUP (?)	; Reserved for NET
    15                              <5> ;									   ;
    16                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    17                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    18                              <5> 
    19 00000015 ??                  <5> find_buf_attr	    DB	?		; attribute found
    20 00000016 ????                <5> find_buf_time	    DW	?		; time
    21 00000018 ????                <5> find_buf_date	    DW	?		; date
    22 0000001A ????                <5> find_buf_size_l     DW	?		; low(size)
    23 0000001C ????                <5> find_buf_size_h     DW	?		; high(size)
    24 0000001E ??????????????????- <5> find_buf_pname	    DB	13 DUP (?)	; packed name
    24 00000027 ????????            <5>
    25                              <5> find_buf    ENDS
   152                              <4> 
   153                              <4> %include "pdb.mac"
     1                              <5> ;	SCCSID = @(#)pdb.asm	1.1 85/04/10
     2                              <5> BREAK <Process data block>
     3                              <5> 
     4                              <5> ;
     5                              <5> ; Process data block (otherwise known as program header)
     6                              <5> ;
     7                              <5> 
     8                              <5> FilPerProc	    EQU     20
     9                              <5> 
    10                              <5> Process_data_block  STRUC
    11 00000000 ????                <5> PDB_Exit_Call	    DW	    ?		; INT int_abort system terminate
    12 00000002 ????                <5> PDB_block_len	    DW	    ?		; size of execution block
    13 00000004 ??                  <5> 		    DB	    ?
    14 00000005 ??????????          <5> PDB_CPM_Call	    DB	5 DUP (?)	; ancient call to system
    15 0000000A ????????            <5> PDB_Exit	    DD	    ?		; pointer to exit routine
    16 0000000E ????????            <5> PDB_Ctrl_C	    DD	    ?		; pointer to ^C routine
    17 00000012 ????????            <5> PDB_Fatal_abort     DD	    ?		; pointer to fatal error
    18                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    19                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    20                              <5> ;									   ;
    21 00000016 ????                <5> PDB_Parent_PID	    DW	    ?		; PID of parent (terminate PID)
    22 00000018 ??????????????????- <5> PDB_JFN_Table	    DB	FilPerProc DUP (?)
    22 00000021 ??????????????????- <5>
    22 0000002A ????                <5>
    23                              <5> 					; indices into system table
    24                              <5> ;									   ;
    25                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    26                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    27 0000002C ????                <5> PDB_environ	    DW	    ?		; seg addr of environment
    28                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    29                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    30                              <5> ;									   ;
    31 0000002E ????????            <5> PDB_User_stack	    DD	    ?		; stack of self during system calls
    32 00000032 ????                <5> PDB_JFN_Length	    DW	    ?		; number of handles allowed
    33 00000034 ????????            <5> PDB_JFN_Pointer     DD	    ?		; pointer to JFN table
    34 00000038 ????????            <5> PDB_Next_PDB	    DD	    ?		; pointer to nested PDB's
    35 0000003C ??????????????????- <5> PDB_PAD1	    DB	    14h DUP (?)
    35 00000045 ??????????????????- <5>
    35 0000004E ????                <5>
    36                              <5> ;									   ;
    37                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    38                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    39 00000050 ??????????          <5> PDB_Call_system     DB	    5 DUP (?)	; portable method of system call
    40                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    41                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    42                              <5> ;									   ;
    43 00000055 ??????????????      <5> PDB_PAD2	    DB	    7h DUP (?)
    44                              <5> ;									   ;
    45                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    46                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    47                              <5> Process_data_block  ENDS
    48                              <5> 
    49                              <5> labelsize PDB_InterCon, byte, PDB_PAD1	; 2/12/KK
    50                              <5> labelsize PDB_Append, byte, PDB_PAD1+1	; 2/12/KK
   154                              <4> 
   155                              <4> %include "exe.mac"
     1                              <5> ;	SCCSID = @(#)exe.asm	1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)exe.asm	1.1 85/04/10
     3                              <5> BREAK <EXEC and EXE file structures>
     4                              <5> ;
     5                              <5> ; EXEC arg block - load/go program
     6                              <5> ;
     7                              <5> 
     8                              <5> ;
     9                              <5> ; The following get used as arguments to the EXEC system call.	They indicate
    10                              <5> ; whether or not the program is executed or whether or not a program header
    11                              <5> ; gets created.
    12                              <5> ;
    13                              <5> exec_func_no_execute	EQU 1		; no execute bit
    14                              <5> exec_func_overlay	EQU 2		; overlay bit
    15                              <5> 
    16                              <5> Exec0		STRUC
    17 00000000 ????                <5> Exec0_environ	DW	?		; seg addr of environment
    18 00000002 ????????            <5> Exec0_com_line	DD	?		; pointer to asciz command line
    19 00000006 ????????            <5> Exec0_5C_FCB	DD	?		; default fcb at 5C
    20 0000000A ????????            <5> Exec0_6C_FCB	DD	?		; default fcb at 6C
    21                              <5> Exec0		ENDS
    22                              <5> 
    23                              <5> Exec1		STRUC
    24 00000000 ????                <5> Exec1_environ	DW	?		; seg addr of environment
    25 00000002 ????????            <5> Exec1_com_line	DD	?		; pointer to asciz command line
    26 00000006 ????????            <5> Exec1_5C_FCB	DD	?		; default fcb at 5C
    27 0000000A ????????            <5> Exec1_6C_FCB	DD	?		; default fcb at 6C
    28 0000000E ????                <5> Exec1_SP	DW	?		; stack pointer of program
    29 00000010 ????                <5> Exec1_SS	DW	?		; stack seg register of program
    30 00000012 ????                <5> Exec1_IP	DW	?		; entry point IP
    31 00000014 ????                <5> Exec1_CS	DW	?		; entry point CS
    32                              <5> Exec1		ENDS
    33                              <5> 
    34                              <5> Exec3		STRUC
    35 00000000 ????                <5> Exec3_load_addr DW	?		; seg address of load point
    36 00000002 ????                <5> Exec3_reloc_fac DW	?		; relocation factor
    37                              <5> Exec3		ENDS
    38                              <5> 
    39                              <5> ;
    40                              <5> ; Exit codes in upper byte
    41                              <5> ;
    42                              <5> Exit_terminate	    EQU     0
    43                              <5> Exit_abort	    EQU     0
    44                              <5> Exit_Ctrl_C	    EQU     1
    45                              <5> Exit_Hard_Error     EQU     2
    46                              <5> Exit_Keep_process   EQU     3
    47                              <5> 
    48                              <5> ;
    49                              <5> ; EXE file header
    50                              <5> ;
    51                              <5> 
    52                              <5> EXE_file    STRUC
    53 00000000 ????                <5> exe_signature	DW  ?			; must contain 4D5A  (yay zibo!)
    54 00000002 ????                <5> exe_len_mod_512 DW  ?			; low 9 bits of length
    55 00000004 ????                <5> exe_pages	DW  ?			; number of 512b pages in file
    56 00000006 ????                <5> exe_rle_count	DW  ?			; count of reloc entries
    57 00000008 ????                <5> exe_par_dir	DW  ?			; number of paragraphs before image
    58 0000000A ????                <5> exe_min_BSS	DW  ?			; minimum number of para of BSS
    59 0000000C ????                <5> exe_max_BSS	DW  ?			; max number of para of BSS
    60 0000000E ????                <5> exe_SS		DW  ?			; stack of image
    61 00000010 ????                <5> exe_SP		DW  ?			; SP of image
    62 00000012 ????                <5> exe_chksum	DW  ?			; checksum  of file (ignored)
    63 00000014 ????                <5> exe_IP		DW  ?			; IP of entry
    64 00000016 ????                <5> exe_CS		DW  ?			; CS of entry
    65 00000018 ????                <5> exe_rle_table	DW  ?			; byte offset of reloc table
    66 0000001A ????                <5> exe_iov 	DW  ?			; overlay number (0 for root)
    67 0000001C ????????            <5> exe_sym_tab	DD  ?			; offset of symbol table in file
    68                              <5> EXE_file    ENDS
    69                              <5> 
    70                              <5> exe_valid_signature	EQU 5A4Dh
    71                              <5> exe_valid_old_signature EQU 4D5Ah
    72                              <5> 
    73                              <5> symbol_entry	STRUC
    74 00000000 ????????            <5> sym_value	DD  ?
    75 00000004 ????                <5> sym_type	DW  ?
    76 00000006 ??                  <5> sym_len 	DB  ?
    77 00000007 ??????????????????- <5> sym_name	DB  255 dup (?)
    77 00000010 ??????????????????- <5>
    77 00000019 ??????????????????- <5>
    77 00000022 ??????????????????- <5>
    77 0000002B ??????????????????- <5>
    77 00000034 ??????????????????- <5>
    77 0000003D ??????????????????- <5>
    77 00000046 ??????????????????- <5>
    77 0000004F ??????????????????- <5>
    77 00000058 ??????????????????- <5>
    77 00000061 ??????????????????- <5>
    77 0000006A ??????????????????- <5>
    77 00000073 ??????????????????- <5>
    77 0000007C ??????????????????- <5>
    77 00000085 ??????????????????- <5>
    77 0000008E ??????????????????- <5>
    77 00000097 ??????????????????- <5>
    77 000000A0 ??????????????????- <5>
    77 000000A9 ??????????????????- <5>
    77 000000B2 ??????????????????- <5>
    77 000000BB ??????????????????- <5>
    77 000000C4 ??????????????????- <5>
    77 000000CD ??????????????????- <5>
    77 000000D6 ??????????????????- <5>
    77 000000DF ??????????????????- <5>
    77 000000E8 ??????????????????- <5>
    77 000000F1 ??????????????????- <5>
    77 000000FA ??????????????????- <5>
    77 00000103 ??????              <5>
    78                              <5> symbol_entry	ENDS
   156                              <4> 
   157                              <4> %include "sf.mac"
     1                              <5> ;	SCCSID = @(#)sf.asm	1.1 85/04/10
     2                              <5> BREAK <Internal system file table format>
     3                              <5> ;
     4                              <5> ;   AN000   version 4.00   Jan. 1988
     5                              <5> ;   AN003   PTM 3680 --  make NAME offset the same as before (<=3.30)
     6                              <5> ;   AN009   PTM 3839	 reorder SFT for MS WINDOWS
     7                              <5> 
     8                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     9                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    10                              <5> ;									   ;
    11                              <5> ;
    12                              <5> ; system file table
    13                              <5> ;
    14                              <5> 
    15                              <5> SF		STRUC
    16 00000000 ????????            <5> SFLink		DD	?
    17 00000004 ????                <5> SFCount 	DW	?		; number of entries
    18 00000006 ????                <5> SFTable 	DW	?		; beginning of array of the following
    19                              <5> SF		ENDS
    20                              <5> 
    21                              <5> ;
    22                              <5> ; system file table entry
    23                              <5> ;
    24                              <5> 
    25                              <5> sf_entry	STRUC
    26 00000000 ????                <5> sf_ref_count	DW	?		; number of processes sharing entry
    27                              <5> 					;   if FCB then ref count
    28 00000002 ????                <5> sf_mode 	DW	?		; mode of access or high bit on if FCB
    29 00000004 ??                  <5> sf_attr 	DB	?		; attribute of file
    30 00000005 ????                <5> sf_flags	DW	?		;Bits 8-15
    31                              <5> 					; Bit 15 = 1 if remote file
    32                              <5> 					;	 = 0 if local file or device
    33                              <5> 					; Bit 14 = 1 if date/time is not to be
    34                              <5> 					;   set from clock at CLOSE.  Set by
    35                              <5> 					;   FILETIMES and FCB_CLOSE.  Reset by
    36                              <5> 					;   other reseters of the dirty bit
    37                              <5> 					;   (WRITE)
    38                              <5> 					; Bit 13 = Pipe bit (reserved)
    39                              <5> 					;
    40                              <5> 					; Bits 0-7 (old FCB_devid bits)
    41                              <5> 					; If remote file or local file, bit
    42                              <5> 					; 6=0 if dirty Device ID number, bits
    43                              <5> 					; 0-5 if local file.
    44                              <5> 					; bit 7=0 for local file, bit 7
    45                              <5> 					;      =1 for local I/O device
    46                              <5> 					; If local I/O device, bit 6=0 if EOF (input)
    47                              <5> 					;		Bit 5=1 if Raw mode
    48                              <5> 					;		Bit 0=1 if console input device
    49                              <5> 					;		Bit 1=1 if console output device
    50                              <5> 					;		Bit 2=1 if null device
    51                              <5> 					;		Bit 3=1 if clock device
    52 00000007 ????????            <5> sf_devptr	DD	?		; Points to DPB if local file, points
    53                              <5> 					; to device header if local device,
    54                              <5> 					; points to net device header if
    55                              <5> 					; remote
    56 0000000B ????                <5> sf_firclus	DW	?		; First cluster of file (bit 15 = 0)
    57 0000000D ????                <5> sf_time 	DW	?		; Time associated with file
    58 0000000F ????                <5> sf_date 	DW	?		; Date associated with file
    59 00000011 ????????            <5> sf_size 	DD	?		; Size associated with file
    60 00000015 ????????            <5> sf_position	DD	?		; Read/Write pointer or LRU count for FCBs
    61                              <5> ;
    62                              <5> ; Starting here, the next 7 bytes may be used by the file system to store an
    63                              <5> ; ID
    64                              <5> ;
    65 00000019 ????                <5> sf_cluspos	DW	?		; Position of last cluster accessed
    66 0000001B ????????            <5> sf_dirsec	DD	?		; Sector number of directory sector for
    67                              <5> 					; for this file
    68 0000001F ??                  <5> sf_dirpos	DB	?		; Offset of this entry in the above
    69                              <5> ;
    70                              <5> ; End of 7 bytes of file-system specific info.
    71                              <5> ;
    72 00000020 ??????????????????- <5> sf_name 	DB	11 DUP (?)	; 11 character name that is in the
    72 00000029 ????                <5>
    73                              <5> 					; directory entry.  This is used by
    74                              <5> 					; close to detect file deleted and
    75                              <5> 					; disk changed errors.
    76                              <5> 
    77                              <5> ; SHARING INFO
    78 0000002B ????????            <5> sf_chain	DD	?		; link to next SF
    79 0000002F ????                <5> sf_UID		DW	?
    80 00000031 ????                <5> sf_PID		DW	?
    81 00000033 ????                <5> sf_MFT		DW	?
    82 00000035 ????                <5> sf_lstclus	DW	?		;AN009; Last cluster accessed
    83 00000037 ????????            <5> sf_IFS_HDR	DD	?
    84                              <5> sf_entry	ENDS
    85                              <5> 
    86                              <5> labelsize sf_fsda, byte, sf_cluspos	     ;DOS 4.00
    87                              <5> labelsize sf_serial_ID, word, sf_firclus	     ;DOS 4.00
    88                              <5> labelsize sf_netid, byte, sf_cluspos
    89                              <5> labelsize sf_OpenAge, word, sf_position+2
    90                              <5> labelsize sf_LRU, word, sf_position
    91                              <5> 
    92                              <5> sf_default_number   EQU     5h
    93                              <5> 
    94                              <5> ;
    95                              <5> ; Note that we need to mark an SFT as being busy for OPEN/CREATE.  This is
    96                              <5> ; because an INT 24 may prevent us from 'freeing' it.  We mark this as such
    97                              <5> ; by placing a -1 in the ref_count field.
    98                              <5> ;
    99                              <5> 
   100                              <5> sf_busy EQU -1
   101                              <5> 
   102                              <5> 
   103                              <5> ; mode mask for FCB detection
   104                              <5> sf_isfcb		EQU	1000000000000000B
   105                              <5> 
   106                              <5> ; Flag word masks
   107                              <5> sf_isnet		EQU	1000000000000000B
   108                              <5> sf_close_nodate 	EQU	0100000000000000B
   109                              <5> sf_pipe 		EQU	0010000000000000B
   110                              <5> sf_no_inherit		EQU	0001000000000000B
   111                              <5> sf_net_spool		EQU	0000100000000000B
   112                              <5> Handle_Fail_I24 	EQU	0000000100000000B  ;BIT 8 - DISK FULL I24 ERROR
   113                              <5> 
   114                              <5> ; Local file/device flag masks
   115                              <5> devid_file_clean	EQU	40h	; true if file and not written
   116                              <5> devid_file_mask_drive	EQU	3Fh	; mask for drive number
   117                              <5> 
   118                              <5> devid_device		EQU	80h	; true if a device
   119                              <5> devid_device_EOF	EQU	40h	; true if end of file reached
   120                              <5> devid_device_raw	EQU	20h	; true if in raw mode
   121                              <5> devid_device_special	EQU	10h	; true if special device
   122                              <5> devid_device_clock	EQU	08h	; true if clock device
   123                              <5> devid_device_null	EQU	04h	; true if null device
   124                              <5> devid_device_con_out	EQU	02h	; true if console output
   125                              <5> devid_device_con_in	EQU	01h	; true if consle input
   126                              <5> ;									   ;
   127                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   128                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   129                              <5> 
   130                              <5> ;
   131                              <5> ; structure of devid field as returned by IOCTL is:
   132                              <5> ;
   133                              <5> ;	BIT	7   6	5   4	3   2	1   0
   134                              <5> ;	      |---|---|---|---|---|---|---|---|
   135                              <5> ;	      | I | E | R | S | I | I | I | I |
   136                              <5> ;	      | S | O | A | P | S | S | S | S |
   137                              <5> ;	      | D | F | W | E | C | N | C | C |
   138                              <5> ;	      | E |   |   | C | L | U | O | I |
   139                              <5> ;	      | V |   |   | L | K | L | T | N |
   140                              <5> ;	      |---|---|---|---|---|---|---|---|
   141                              <5> ;	ISDEV = 1 if this channel is a device
   142                              <5> ;	      = 0 if this channel is a disk file
   143                              <5> ;
   144                              <5> ;	If ISDEV = 1
   145                              <5> ;
   146                              <5> ;	      EOF = 0 if End Of File on input
   147                              <5> ;	      RAW = 1 if this device is in Raw mode
   148                              <5> ;		  = 0 if this device is cooked
   149                              <5> ;	      ISCLK = 1 if this device is the clock device
   150                              <5> ;	      ISNUL = 1 if this device is the null device
   151                              <5> ;	      ISCOT = 1 if this device is the console output
   152                              <5> ;	      ISCIN = 1 if this device is the console input
   153                              <5> ;
   154                              <5> ;	If ISDEV = 0
   155                              <5> ;	      EOF = 0 if channel has been written
   156                              <5> ;	      Bits 0-5	are  the  block  device  number  for
   157                              <5> ;		  the channel (0 = A, 1 = B, ...)
   158                              <5> ;
   159                              <5> devid_ISDEV	EQU	80h
   160                              <5> devid_EOF	EQU	40h
   161                              <5> devid_RAW	EQU	20h
   162                              <5> devid_SPECIAL	EQU	10H
   163                              <5> devid_ISCLK	EQU	08h
   164                              <5> devid_ISNUL	EQU	04h
   165                              <5> devid_ISCOT	EQU	02h
   166                              <5> devid_ISCIN	EQU	01h
   167                              <5> 
   168                              <5> devid_block_dev EQU	1Fh		; mask for block device number
   158                              <4> 
   159                              <4> %include "arena.mac"
     1                              <5> ;	SCCSID = @(#)arena.asm	1.1 85/04/09
     2                              <5> ;BREAK <Memory arena structure>
     3                              <5> 
     4                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <5> ;									   ;
     7                              <5> ;
     8                              <5> ; arena item
     9                              <5> ;
    10                              <5> arena	STRUC
    11 00000000 ??                  <5> arena_signature     DB	?		; 4D for valid item, 5A for last item
    12 00000001 ????                <5> arena_owner	    DW	?		; owner of arena item
    13 00000003 ????                <5> arena_size	    DW	?		; size in paragraphs of item
    14 00000005 ??????              <5> arena_reserved	    DB	3 DUP(?)	; reserved
    15 00000008 ????????????????    <5> arena_name	    DB	8 DUP(?)	; owner file name
    16                              <5> arena	ENDS
    17                              <5> 
    18                              <5> ;
    19                              <5> ; CAUTION: The routines in ALLOC.ASM rely on the fact that arena_signature
    20                              <5> ; and arena_owner_system are all equal to zero and are contained in DI.  Change
    21                              <5> ; them and change ALLOC.ASM.
    22                              <5> 
    23                              <5> arena_owner_system  EQU 0		; free block indication
    24                              <5> 
    25                              <5> arena_signature_normal	EQU 4Dh 	; valid signature, not end of arena
    26                              <5> arena_signature_end	EQU 5Ah 	; valid signature, last block in arena
    27                              <5> ;									   ;
    28                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    29                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    30                              <5> 
   160                              <4> 
   161                              <4> %include "intnat.mac"
     1                              <5> ;	SCCSID = @(#)intnat.asm	1.1 85/04/10
     2                              <5> BREAK <International data structure format>
     3                              <5> 
     4                              <5> ;
     5                              <5> ; Current structure of the data returned by the international call
     6                              <5> ;
     7                              <5> internat_block STRUC
     8 00000000 ????                <5> Date_tim_format DW	?		; 0-USA, 1-EUR, 2-JAP
     9 00000002 ??                  <5> Currency_sym	DB	?		; Currency Symbol 5 bytes
    10 00000003 ??                  <5> 		DB	?
    11 00000004 ??                  <5> 		DB	?
    12 00000005 ??                  <5> 		DB	?
    13 00000006 ??                  <5> 		DB	?
    14 00000007 ??                  <5> Thous_sep	DB	?		; Thousands separator 2 bytes
    15 00000008 ??                  <5> 		DB	?
    16 00000009 ??                  <5> Decimal_sep	DB	?		; Decimal separator 2 bytes
    17 0000000A ??                  <5> 		DB	?
    18 0000000B ??                  <5> Date_sep	DB	?		; Date separator 2 bytes
    19 0000000C ??                  <5> 		DB	?
    20 0000000D ??                  <5> Time_sep	DB	?		; Decimal separator 2 bytes
    21 0000000E ??                  <5> 		DB	?
    22 0000000F ??                  <5> Bit_field	DB	?		; Bit values
    23                              <5> 					;   Bit 0 = 0 if currency symbol first
    24                              <5> 					;	  = 1 if currency symbol last
    25                              <5> 					;   Bit 1 = 0 if No space after currency symbol
    26                              <5> 					;	  = 1 if space after currency symbol
    27 00000010 ??                  <5> Currency_cents	DB	?		; Number of places after currency dec point
    28 00000011 ??                  <5> Time_24 	DB	?		; 1 if 24 hour time, 0 if 12 hour time
    29 00000012 ????                <5> Map_call	DW	?		; Address of case mapping call (DWORD)
    30 00000014 ????                <5> 		DW	?		; THIS IS TWO WORDS SO IT CAN BE INITIALIZED
    31                              <5> 					;  in pieces.
    32 00000016 ??                  <5> Data_sep	DB	?		; Data list separator character
    33 00000017 ??                  <5> 		DB	?
    34                              <5> internat_block ENDS
    35                              <5> 
    36                              <5> ;
    37                              <5> ; Max size of the block returned by the INTERNATIONAL call
    38                              <5> ;
    39                              <5> internat_block_max	EQU	32
   162                              <4> 
   163                              <4> %include "mi.mac"
     1                              <5> ;	SCCSID = @(#)mi.asm	1.1 85/04/10
     2                              <5> BREAK <Machine instruction, flag definitions and character types>
     3                              <5> 
     4                              <5> mi_INT		EQU	0CDh
     5                              <5> mi_Long_JMP	EQU	0EAh
     6                              <5> mi_Long_CALL	EQU	09Ah
     7                              <5> mi_Long_RET	EQU	0CBh
     8                              <5> mi_Near_RET	EQU	0C3h
     9                              <5> 
    10                              <5> ;			xxxxoditszxaxpxc
    11                              <5> f_Overflow	EQU	0000100000000000B
    12                              <5> f_Direction	EQU	0000010000000000B
    13                              <5> f_Interrupt	EQU	0000001000000000B
    14                              <5> f_Trace 	EQU	0000000100000000B
    15                              <5> f_Sign		EQU	0000000010000000B
    16                              <5> f_Zero		EQU	0000000001000000B
    17                              <5> f_Aux		EQU	0000000000010000B
    18                              <5> f_Parity	EQU	0000000000000100B
    19                              <5> f_Carry 	EQU	0000000000000001B
   164                              <4> 
   165                              <4> fChk	equ 1
   166                              <4> fDelim	equ 2
   167                              <4> fSpChk	equ 4
   168                              <4> fFCB	equ 8
   169                              <4> 
   170                              <4> %include "filemode.mac"
     1                              <5> ;	SCCSID = @(#)filemode.asm	1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)filemode.asm	1.1 85/04/10
     3                              <5> BREAK <Standard I/O assignments>
     4                              <5> 
     5                              <5> stdin	    EQU     0
     6                              <5> stdout	    EQU     1
     7                              <5> stderr	    EQU     2
     8                              <5> stdaux	    EQU     3
     9                              <5> stdprn	    EQU     4
    10                              <5> 
    11                              <5> BREAK <File modes>
    12                              <5> 
    13                              <5> access_mask	EQU 0FH
    14                              <5> open_for_read	EQU 00h
    15                              <5> open_for_write	EQU 01h
    16                              <5> open_for_both	EQU 02h
    17                              <5> 
    18                              <5> sharing_mask	    EQU 0F0H
    19                              <5> sharing_compat	    EQU 000H
    20                              <5> sharing_deny_both   EQU 010H
    21                              <5> sharing_deny_write  EQU 020H
    22                              <5> sharing_deny_read   EQU 030H
    23                              <5> sharing_deny_none   EQU 040H
    24                              <5> sharing_net_FCB     EQU 070h
    25                              <5> sharing_no_inherit  EQU 080H
    26                              <5> 
    27                              <5> BREAK <Extended Open>
    28                              <5> 
    29                              <5> no_code_page_check	  EQU 0100H
    30                              <5> int_24_error		  EQU 2000H
    31                              <5> auto_commit_write	  EQU 4000H
    32                              <5> ext_open_on		  EQU 01H
    33                              <5> ext_file_not_exists	  EQU 04H
    34                              <5> ext_open_I24_off	  EQU 02H
    35                              <5> io_mode_id		  EQU 00000010B
    36                              <5> reserved_bits_mask	  EQU 0FE00H
    37                              <5> exists_mask		  EQU 0FH
    38                              <5> not_exists_mask 	  EQU 0F0H
    39                              <5> action_opened		  EQU  01H
    40                              <5> action_created_opened	  EQU  02H
    41                              <5> action_replaced_opened	  EQU  03H
    42                              <5> 
    43                              <5> ext_exists_open     EQU 01H
    44                              <5> ext_exists_fail     EQU 0H
    45                              <5> ext_nexists_create  EQU 10H
    46                              <5> 
    47                              <5> 
    48                              <5> 
    49                              <5> ext_open_parm	   struc
    50 00000000 ????????            <5> ext_set_list	    dd ?
    51 00000004 ????                <5> ext_num_of_parm     dw ?
    52                              <5> ext_open_parm	   ends
    53                              <5> 
    54                              <5> 
    55                              <5> 
   171                              <4> 
   172                              <4> %include "error.mac"
     1                              <5> ;	SCCSID = @(#)error.asm	1.1 85/04/10
     2                              <5> ;	SCCSID = @(#)error.asm	1.1 85/04/10
     3                              <5> BREAK <Xenix error codes>
     4                              <5> 
     5                              <5> ;
     6                              <5> ; XENIX calls all return error codes through AX.  If an error occurred then
     7                              <5> ; the carry bit will be set and the error code is in AX.  If no error occurred
     8                              <5> ; then the carry bit is reset and AX contains returned info.
     9                              <5> ;
    10                              <5> ; Since the set of error codes is being extended as we extend the operating
    11                              <5> ; system, we have provided a means for applications to ask the system for a
    12                              <5> ; recommended course of action when they receive an error.
    13                              <5> ;
    14                              <5> ; The GetExtendedError system call returns a universal error, an error
    15                              <5> ; location and a recommended course of action.	The universal error code is
    16                              <5> ; a symptom of the error REGARDLESS of the context in which GetExtendedError
    17                              <5> ; is issued.
    18                              <5> ;
    19                              <5> 
    20                              <5> ;
    21                              <5> ; These are the 2.0 error codes
    22                              <5> ;
    23                              <5> error_invalid_function		EQU	1
    24                              <5> error_file_not_found		EQU	2
    25                              <5> error_path_not_found		EQU	3
    26                              <5> error_too_many_open_files	EQU	4
    27                              <5> error_access_denied		EQU	5
    28                              <5> error_invalid_handle		EQU	6
    29                              <5> error_arena_trashed		EQU	7
    30                              <5> error_not_enough_memory 	EQU	8
    31                              <5> error_invalid_block		EQU	9
    32                              <5> error_bad_environment		EQU	10
    33                              <5> error_bad_format		EQU	11
    34                              <5> error_invalid_access		EQU	12
    35                              <5> error_invalid_data		EQU	13
    36                              <5> ;**** reserved			EQU	14	; *****
    37                              <5> error_invalid_drive		EQU	15
    38                              <5> error_current_directory 	EQU	16
    39                              <5> error_not_same_device		EQU	17
    40                              <5> error_no_more_files		EQU	18
    41                              <5> ;
    42                              <5> ; These are the universal int 24 mappings for the old INT 24 set of errors
    43                              <5> ;
    44                              <5> error_write_protect		EQU	19
    45                              <5> error_bad_unit			EQU	20
    46                              <5> error_not_ready 		EQU	21
    47                              <5> error_bad_command		EQU	22
    48                              <5> error_CRC			EQU	23
    49                              <5> error_bad_length		EQU	24
    50                              <5> error_Seek			EQU	25
    51                              <5> error_not_DOS_disk		EQU	26
    52                              <5> error_sector_not_found		EQU	27
    53                              <5> error_out_of_paper		EQU	28
    54                              <5> error_write_fault		EQU	29
    55                              <5> error_read_fault		EQU	30
    56                              <5> error_gen_failure		EQU	31
    57                              <5> ;
    58                              <5> ; These are the new 3.0 error codes reported through INT 24
    59                              <5> ;
    60                              <5> error_sharing_violation 	EQU	32
    61                              <5> error_lock_violation		EQU	33
    62                              <5> error_wrong_disk		EQU	34
    63                              <5> error_FCB_unavailable		EQU	35
    64                              <5> error_sharing_buffer_exceeded	EQU	36
    65                              <5> error_Code_Page_Mismatched	EQU	37    ; DOS 4.00 			;AN000;
    66                              <5> error_handle_EOF		EQU	38    ; DOS 4.00 			;AN000;
    67                              <5> error_handle_Disk_Full		EQU	39    ; DOS 4.00 			;AN000;
    68                              <5> ;
    69                              <5> ; New OEM network-related errors are 50-79
    70                              <5> ;
    71                              <5> error_not_supported		EQU	50
    72                              <5> ;
    73                              <5> ; End of INT 24 reportable errors
    74                              <5> ;
    75                              <5> error_file_exists		EQU	80
    76                              <5> error_DUP_FCB			EQU	81	; *****
    77                              <5> error_cannot_make		EQU	82
    78                              <5> error_FAIL_I24			EQU	83
    79                              <5> ;
    80                              <5> ; New 3.0 network related error codes
    81                              <5> ;
    82                              <5> error_out_of_structures 	EQU	84
    83                              <5> error_Already_assigned		EQU	85
    84                              <5> error_invalid_password		EQU	86
    85                              <5> error_invalid_parameter 	EQU	87
    86                              <5> error_NET_write_fault		EQU	88
    87                              <5> error_sys_comp_not_loaded	EQU	90    ; DOS 4.00				;AN000;
    88                              <5> 
    89                              <5> BREAK <Interrupt 24 error codes>
    90                              <5> 
    91                              <5> error_I24_write_protect 	EQU	0
    92                              <5> error_I24_bad_unit		EQU	1
    93                              <5> error_I24_not_ready		EQU	2
    94                              <5> error_I24_bad_command		EQU	3
    95                              <5> error_I24_CRC			EQU	4
    96                              <5> error_I24_bad_length		EQU	5
    97                              <5> error_I24_Seek			EQU	6
    98                              <5> error_I24_not_DOS_disk		EQU	7
    99                              <5> error_I24_sector_not_found	EQU	8
   100                              <5> error_I24_out_of_paper		EQU	9
   101                              <5> error_I24_write_fault		EQU	0Ah
   102                              <5> error_I24_read_fault		EQU	0Bh
   103                              <5> error_I24_gen_failure		EQU	0Ch
   104                              <5> ; NOTE: Code 0DH is used by MT-DOS.
   105                              <5> error_I24_wrong_disk		EQU	0Fh
   106                              <5> 
   107                              <5> ; THE FOLLOWING ARE MASKS FOR THE AH REGISTER ON Int 24
   108                              <5> 
   109                              <5> Allowed_FAIL			EQU	00001000B
   110                              <5> Allowed_RETRY			EQU	00010000B
   111                              <5> Allowed_IGNORE			EQU	00100000B
   112                              <5> ;NOTE: ABORT is ALWAYS allowed
   113                              <5> 
   114                              <5> I24_operation			EQU	00000001B	;Z if READ,NZ if Write
   115                              <5> I24_area			EQU	00000110B	; 00 if DOS
   116                              <5> 							; 01 if FAT
   117                              <5> 							; 10 if root DIR
   118                              <5> 							; 11 if DATA
   119                              <5> I24_class			EQU	10000000B	;Z if DISK, NZ if FAT or char
   120                              <5> 
   121                              <5> BREAK <GetExtendedError CLASSes ACTIONs LOCUSs>
   122                              <5> 
   123                              <5> ; Values for error CLASS
   124                              <5> 
   125                              <5> errCLASS_OutRes 	EQU	1	; Out of Resource
   126                              <5> errCLASS_TempSit	EQU	2	; Temporary Situation
   127                              <5> errCLASS_Auth		EQU	3	; Permission problem
   128                              <5> errCLASS_Intrn		EQU	4	; Internal System Error
   129                              <5> errCLASS_HrdFail	EQU	5	; Hardware Failure
   130                              <5> errCLASS_SysFail	EQU	6	; System Failure
   131                              <5> errCLASS_Apperr 	EQU	7	; Application Error
   132                              <5> errCLASS_NotFnd 	EQU	8	; Not Found
   133                              <5> errCLASS_BadFmt 	EQU	9	; Bad Format
   134                              <5> errCLASS_Locked 	EQU	10	; Locked
   135                              <5> errCLASS_Media		EQU	11	; Media Failure
   136                              <5> errCLASS_Already	EQU	12	; Collision with Existing Item
   137                              <5> errCLASS_Unk		EQU	13	; Unknown/other
   138                              <5> 
   139                              <5> ; Values for error ACTION
   140                              <5> 
   141                              <5> errACT_Retry		EQU	1	; Retry
   142                              <5> errACT_DlyRet		EQU	2	; Delay Retry, retry after pause
   143                              <5> errACT_User		EQU	3	; Ask user to regive info
   144                              <5> errACT_Abort		EQU	4	; abort with clean up
   145                              <5> errACT_Panic		EQU	5	; abort immediately
   146                              <5> errACT_Ignore		EQU	6	; ignore
   147                              <5> errACT_IntRet		EQU	7	; Retry after User Intervention
   148                              <5> 
   149                              <5> ; Values for error LOCUS
   150                              <5> 
   151                              <5> errLOC_Unk		EQU	1	; No appropriate value
   152                              <5> errLOC_Disk		EQU	2	; Random Access Mass Storage
   153                              <5> errLOC_Net		EQU	3	; Network
   154                              <5> errLOC_SerDev		EQU	4	; Serial Device
   155                              <5> errLOC_Mem		EQU	5	; Memory
   173                              <4> 
   174                              <4> %include "syscall.mac"
     1                              <5> ;	SCCSID = @(#)syscall.asm	1.1 85/04/10
     2                              <5> ;BREAK <system call definitions>
     3                              <5> ;SUBTTL	system call definitions
     4                              <5> ;PAGE
     5                              <5> 
     6                              <5> Abort				EQU 0	;  0	  0
     7                              <5> Std_Con_Input			EQU 1	;  1	  1
     8                              <5> Std_Con_Output			EQU 2	;  2	  2
     9                              <5> Std_Aux_Input			EQU 3	;  3	  3
    10                              <5> Std_Aux_Output			EQU 4	;  4	  4
    11                              <5> Std_Printer_Output		EQU 5	;  5	  5
    12                              <5> Raw_Con_IO			EQU 6	;  6	  6
    13                              <5> Raw_Con_Input			EQU 7	;  7	  7
    14                              <5> Std_Con_Input_No_Echo		EQU 8	;  8	  8
    15                              <5> Std_Con_String_Output		EQU 9	;  9	  9
    16                              <5> Std_Con_String_Input		EQU 10	; 10	  A
    17                              <5> Std_Con_Input_Status		EQU 11	; 11	  B
    18                              <5> Std_Con_Input_Flush		EQU 12	; 12	  C
    19                              <5> Disk_Reset			EQU 13	; 13	  D
    20                              <5> Set_Default_Drive		EQU 14	; 14	  E
    21                              <5> FCB_Open			EQU 15	; 15	  F
    22                              <5> FCB_Close			EQU 16	; 16	 10
    23                              <5> Dir_Search_First		EQU 17	; 17	 11
    24                              <5> Dir_Search_Next 		EQU 18	; 18	 12
    25                              <5> FCB_Delete			EQU 19	; 19	 13
    26                              <5> FCB_Seq_Read			EQU 20	; 20	 14
    27                              <5> FCB_Seq_Write			EQU 21	; 21	 15
    28                              <5> FCB_Create			EQU 22	; 22	 16
    29                              <5> FCB_Rename			EQU 23	; 23	 17
    30                              <5> Get_Default_Drive		EQU 25	; 25	 19
    31                              <5> Set_DMA 			EQU 26	; 26	 1A
    32                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    33                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    34                              <5> ;									   ;
    35                              <5> Get_Default_DPB 		EQU 31	; 31	 1F
    36                              <5> ;									   ;
    37                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    38                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    39                              <5> FCB_Random_Read 		EQU 33	; 33	 21
    40                              <5> FCB_Random_Write		EQU 34	; 34	 22
    41                              <5> Get_FCB_File_Length		EQU 35	; 35	 23
    42                              <5> Get_FCB_Position		EQU 36	; 36	 24
    43                              <5> Set_Interrupt_Vector		EQU 37	; 37	 25
    44                              <5> Create_Process_Data_Block	EQU 38	; 38	 26
    45                              <5> FCB_Random_Read_Block		EQU 39	; 39	 27
    46                              <5> FCB_Random_Write_Block		EQU 40	; 40	 28
    47                              <5> Parse_File_Descriptor		EQU 41	; 41	 29
    48                              <5> Get_Date			EQU 42	; 42	 2A
    49                              <5> Set_Date			EQU 43	; 43	 2B
    50                              <5> Get_Time			EQU 44	; 44	 2C
    51                              <5> Set_Time			EQU 45	; 45	 2D
    52                              <5> Set_Verify_On_Write		EQU 46	; 46	 2E
    53                              <5> ; Extended functionality group
    54                              <5> Get_DMA 			EQU 47	; 47	 2F
    55                              <5> Get_Version			EQU 48	; 48	 30
    56                              <5> Keep_Process			EQU 49	; 49	 31
    57                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    58                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    59                              <5> ;									   ;
    60                              <5> Get_DPB 			EQU 50	; 50	 32
    61                              <5> ;									   ;
    62                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    63                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    64                              <5> Set_CTRL_C_Trapping		EQU 51	; 51	 33
    65                              <5> Get_InDOS_Flag			EQU 52	; 52	 34
    66                              <5> Get_Interrupt_Vector		EQU 53	; 53	 35
    67                              <5> Get_Drive_Freespace		EQU 54	; 54	 36
    68                              <5> Char_Oper			EQU 55	; 55	 37
    69                              <5> International			EQU 56	; 56	 38
    70                              <5> ;   Directory Group
    71                              <5> MKDir				EQU 57	; 57	 39
    72                              <5> RMDir				EQU 58	; 58	 3A
    73                              <5> CHDir				EQU 59	; 59	 3B
    74                              <5> ;   File Group
    75                              <5> Creat				EQU 60	; 60	 3C
    76                              <5> Open				EQU 61	; 61	 3D
    77                              <5> Close				EQU 62	; 62	 3E
    78                              <5> Read				EQU 63	; 63	 3F
    79                              <5> Write				EQU 64	; 64	 40
    80                              <5> Unlink				EQU 65	; 65	 41
    81                              <5> LSeek				EQU 66	; 66	 42
    82                              <5> CHMod				EQU 67	; 67	 43
    83                              <5> IOCtl				EQU 68	; 68	 44
    84                              <5> XDup				EQU 69	; 69	 45
    85                              <5> XDup2				EQU 70	; 70	 46
    86                              <5> Current_Dir			EQU 71	; 71	 47
    87                              <5> ;    Memory Group
    88                              <5> Alloc				EQU 72	; 72	 48
    89                              <5> Dealloc 			EQU 73	; 73	 49
    90                              <5> Setblock			EQU 74	; 74	 4A
    91                              <5> ;    Process Group
    92                              <5> Exec				EQU 75	; 75	 4B
    93                              <5> Exit				EQU 76	; 76	 4C
    94                              <5> WaitProcess			EQU 77	; 77	 4D
    95                              <5> Find_First			EQU 78	; 78	 4E
    96                              <5> ;   Special Group
    97                              <5> Find_Next			EQU 79	; 79	 4F
    98                              <5> ; SPECIAL SYSTEM GROUP
    99                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   100                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   101                              <5> ;									   ;
   102                              <5> Set_Current_PDB 		EQU 80	; 80	 50
   103                              <5> Get_Current_PDB 		EQU 81	; 81	 51
   104                              <5> Get_In_Vars			EQU 82	; 82	 52
   105                              <5> SetDPB				EQU 83	; 83	 53
   106                              <5> ;									   ;
   107                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   108                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   109                              <5> Get_Verify_On_Write		EQU 84	; 84	 54
   110                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   111                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   112                              <5> ;									   ;
   113                              <5> Dup_PDB 			EQU 85	; 85	 55
   114                              <5> ;									   ;
   115                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   116                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   117                              <5> Rename				EQU 86	; 86	 56
   118                              <5> File_Times			EQU 87	; 87	 57
   119                              <5> AllocOper			EQU 88	; 88	 58
   120                              <5> ; Network extention system calls
   121                              <5> GetExtendedError		EQU 89	; 89	 59
   122                              <5> CreateTempFile			EQU 90	; 90	 5A
   123                              <5> CreateNewFile			EQU 91	; 91	 5B
   124                              <5> LockOper			EQU 92	; 92	 5C Lock and Unlock
   125                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   126                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   127                              <5> ;									   ;
   128                              <5> ServerCall			EQU 93	; 93	 5D CommitAll, ServerDOSCall,
   129                              <5> 					;	    CloseByName, CloseUser,
   130                              <5> 					;	    CloseUserProcess,
   131                              <5> 					;	    GetOpenFileList
   132                              <5> ;									   ;
   133                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   134                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   135                              <5> UserOper			EQU 94	; 94	 5E Get and Set
   136                              <5> AssignOper			EQU 95	; 95	 5F On, Off, Get, Set, Cancel
   137                              <5> xNameTrans			EQU 96	; 96	 60
   138                              <5> PathParse			EQU 97	; 97	 61
   139                              <5> GetCurrentPSP			EQU 98	; 98	 62
   140                              <5> Hongeul 			EQU 99	; 99	 63
   141                              <5> ECS_CALL			EQU 99	; 99	 63  ;; DBCS support
   142                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   143                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   144                              <5> ;									   ;
   145                              <5> Set_Printer_Flag		EQU 100 ; 100	 64
   146                              <5> ;									   ;
   147                              <5> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   148                              <5> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   149                              <5> GetExtCntry			EQU 101 ; 101	 65
   150                              <5> GetSetCdPg			EQU 102 ; 102	 66
   151                              <5> ExtHandle			EQU 103 ; 103	 67
   152                              <5> Commit				EQU 104 ; 104	 68
   153                              <5> GetSetMediaID			EQU 105 ; 105	 69
   154                              <5> IFS_IOCTL			EQU 107 ; 107	 6B
   155                              <5> ExtOpen 			EQU 108 ; 108	 6C
   156                              <5> ;
   157                              <5> ;
   158                              <5> Set_Oem_Handler 		EQU 248 ; 248	 F8
   159                              <5> OEM_C1				EQU 249 ; 249	 F9
   160                              <5> OEM_C2				EQU 250 ; 250	 FA
   161                              <5> OEM_C3				EQU 251 ; 251	 FB
   162                              <5> OEM_C4				EQU 252 ; 252	 FC
   163                              <5> OEM_C5				EQU 253 ; 253	 FD
   164                              <5> OEM_C6				EQU 254 ; 254	 FE
   165                              <5> OEM_C7				EQU 255 ; 255	 FF
   175                              <4> 
   176                              <4> ;SUBTTL
   177                              <4> 
   124                              <3> %include "devsym.mac"
     1                              <4> 	%warning out: DEVSYM.INC...
     1          ******************  <4>  warning: out: DEVSYM.INC... [-w+user]
     2                              <4> ;	SCCSID = @(#)DEVSYM.ASM 1.10 85/09/04
     3                              <4> ;	SCCSID = @(#)DEVSYM.ASM 1.10 85/09/04
     4                              <4> 
     5                              <4> ; THE DEVICE TABLE LIST HAS THE FORM:
     6                              <4> SYSDEV	       STRUC
     7 00000000 ????????            <4> SDEVNEXT       DD    ?		    ;POINTER TO NEXT DEVICE HEADER
     8 00000004 ????                <4> SDEVATT        DW    ?		    ;ATTRIBUTES OF THE DEVICE
     9 00000006 ????                <4> SDEVSTRAT      DW    ?		    ;STRATEGY ENTRY POINT
    10 00000008 ????                <4> SDEVINT        DW    ?		    ;INTERRUPT ENTRY POINT
    11 0000000A ????????????????    <4> SDEVNAME       DB    8 DUP (?)	    ;NAME OF DEVICE (ONLY FIRST BYTE USED FOR BLOCK)
    12                              <4> SYSDEV	       ENDS
    13                              <4> 
    14                              <4> ;
    15                              <4> ; ATTRIBUTE BIT MASKS
    16                              <4> ;
    17                              <4> ; CHARACTER DEVICES:
    18                              <4> ;
    19                              <4> ; BIT 15 -> MUST BE 1
    20                              <4> ;     14 -> 1 IF THE DEVICE UNDERSTANDS IOCTL CONTROL STRINGS
    21                              <4> ;     13 -> 1 IF THE DEVICE SUPPORTS OUTPUT-UNTIL-BUSY
    22                              <4> ;     12 -> UNUSED
    23                              <4> ;     11 -> 1 IF THE DEVICE UNDERSTANDS OPEN/CLOSE
    24                              <4> ;     10 -> MUST BE 0
    25                              <4> ;      9 -> MUST BE 0
    26                              <4> ;      8 -> UNUSED
    27                              <4> ;      7 -> UNUSED
    28                              <4> ;      6 -> UNUSED
    29                              <4> ;      5 -> UNUSED
    30                              <4> ;      4 -> 1 IF DEVICE IS RECIPIENT OF INT 29H
    31                              <4> ;      3 -> 1 IF DEVICE IS CLOCK DEVICE
    32                              <4> ;      2 -> 1 IF DEVICE IS NULL DEVICE
    33                              <4> ;      1 -> 1 IF DEVICE IS CONSOLE OUTPUT
    34                              <4> ;      0 -> 1 IF DEVICE IS CONSOLE INPUT
    35                              <4> ;
    36                              <4> ; BLOCK DEVICES:
    37                              <4> ;
    38                              <4> ; BIT 15 -> MUST BE 0
    39                              <4> ;     14 -> 1 IF THE DEVICE UNDERSTANDS IOCTL CONTROL STRINGS
    40                              <4> ;     13 -> 1 IF THE DEVICE DETERMINES MEDIA BY EXAMINING THE FAT ID BYTE.
    41                              <4> ;	    THIS REQUIRES THE FIRST SECTOR OF THE FAT TO *ALWAYS* RESIDE IN
    42                              <4> ;	    THE SAME PLACE.
    43                              <4> ;     12 -> UNUSED
    44                              <4> ;     11 -> 1 IF THE DEVICE UNDERSTANDS OPEN/CLOSE/REMOVABLE MEDIA
    45                              <4> ;     10 -> MUST BE 0
    46                              <4> ;      9 -> MUST BE 0
    47                              <4> ;      8 -> UNUSED
    48                              <4> ;      7 -> UNUSED
    49                              <4> ;      6 -> IF DEVICE HAS SUPPORT FOR GETMAP/SETMAP OF LOGICAL DRIVES.
    50                              <4> ;	    IF THE DEVICE UNDERSTANDS GENERIC IOCTL FUNCTION CALLS.
    51                              <4> ;      5 -> UNUSED
    52                              <4> ;      4 -> UNUSED
    53                              <4> ;      3 -> UNUSED
    54                              <4> ;      2 -> UNUSED
    55                              <4> ;      1 -> UNUSED
    56                              <4> ;      0 -> UNUSED
    57                              <4> ;
    58                              <4> 
    59                              <4> DEVTYP	       EQU   8000H	    ; BIT 15 - 1  IF CHAR, 0 IF BLOCK
    60                              <4> CHARDEV        EQU   8000H
    61                              <4> DEVIOCTL       EQU   4000H	    ; BIT 14 - CONTROL MODE BIT
    62                              <4> ISFATBYDEV     EQU   2000H	    ; BIT 13 - DEVICE USES FAT ID BYTES,
    63                              <4> 				    ;  COMP MEDIA.
    64                              <4> OUTTILBUSY     EQU   2000H	    ; OUTPUT UNTIL BUSY IS ENABLED
    65                              <4> ISNET	       EQU   1000H	    ; BIT 12 - 1 IF A NET DEVICE, 0 IF
    66                              <4> 				    ;  NOT.  CURRENTLY BLOCK ONLY.
    67                              <4> DEVOPCL        EQU   0800H	    ; BIT 11 - 1 IF THIS DEVICE HAS
    68                              <4> 				    ;  OPEN,CLOSE AND REMOVABLE MEDIA
    69                              <4> 				    ;  ENTRY POINTS, 0 IF NOT
    70                              <4> 
    71                              <4> EXTENTBIT      EQU   0400H	    ; BIT 10 - CURRENTLY 0 ON ALL DEVS
    72                              <4> 				    ;  THIS BIT IS RESERVED FOR FUTURE USE
    73                              <4> 				    ;  TO EXTEND THE DEVICE HEADER BEYOND
    74                              <4> 				    ;  ITS CURRENT FORM.
    75                              <4> 
    76                              <4> ; NOTE BIT 9 IS CURRENTLY USED ON IBM SYSTEMS TO INDICATE "DRIVE IS SHARED".
    77                              <4> ;    SEE IOCTL FUNCTION 9. THIS USE IS NOT DOCUMENTED, IT IS USED BY SOME
    78                              <4> ;    OF THE UTILITIES WHICH ARE SUPPOSED TO FAIL ON SHARED DRIVES ON SERVER
    79                              <4> ;    MACHINES (FORMAT,CHKDSK,RECOVER,..).
    80                              <4> 
    81                              <4> DEV320	       EQU   0040H	    ;BIT 6 - FOR BLOCK DEVICES, THIS
    82                              <4> 				    ;DEVICE SUPPORTS SET/GET MAP OF
    83                              <4> 				    ;LOGICAL DRIVES, AND SUPPORTS
    84                              <4> 				    ;GENERIC IOCTL CALLS.
    85                              <4> 				    ;FOR CHARACTER DEVICES, THIS
    86                              <4> 				    ;DEVICE SUPPORTS GENERIC IOCTL.
    87                              <4> 				    ;THIS IS A DOS 3.2 DEVICE DRIVER.
    88                              <4> ISSPEC	       EQU   0010H	    ;BIT 4 - THIS DEVICE IS SPECIAL
    89                              <4> ISCLOCK        EQU   0008H	    ;BIT 3 - THIS DEVICE IS THE CLOCK DEVICE.
    90                              <4> ISNULL	       EQU   0004H	    ;BIT 2 - THIS DEVICE IS THE NULL DEVICE.
    91                              <4> ISCOUT	       EQU   0002H	    ;BIT 1 - THIS DEVICE IS THE CONSOLE OUTPUT.
    92                              <4> ISCIN	       EQU   0001H	    ;BIT 0 - THIS DEVICE IS THE CONSOLE INPUT.
    93                              <4> EXTDRVR        EQU   0002H	    ;BIT 1 - BLOCK DEVICE EXTNDED DRIVER
    94                              <4> 
    95                              <4> ;STATIC REQUEST HEADER
    96                              <4> SRHEAD	       STRUC
    97 00000000 ??                  <4> REQLEN	       DB    ?		    ;LENGTH IN BYTES OF REQUEST BLOCK
    98 00000001 ??                  <4> REQUNIT        DB    ?		    ;DEVICE UNIT NUMBER
    99 00000002 ??                  <4> REQFUNC        DB    ?		    ;TYPE OF REQUEST
   100 00000003 ????                <4> REQSTAT        DW    ?		    ;STATUS WORD
   101 00000005 ????????????????    <4> 	       DB    8 DUP(?)	    ;RESERVED FOR QUEUE LINKS
   102                              <4> SRHEAD	       ENDS
   103                              <4> 
   104                              <4> ;STATUS WORD MASKS
   105                              <4> STERR	       EQU   8000H	    ;BIT 15 - ERROR
   106                              <4> STBUI	       EQU   0200H	    ;BIT 9 - BUISY
   107                              <4> STDON	       EQU   0100H	    ;BIT 8 - DONE
   108                              <4> STECODE        EQU   00FFH	    ;ERROR CODE
   109                              <4> ;						  2/12/KK
   110                              <4> ; Interim  character identifier 		  2/12/KK
   111                              <4> Ddkey		EQU	0000010000000000B	; 2/12/KK
   112                              <4> 
   113                              <4> ;FUNCTION CODES
   114                              <4> DEVINIT        EQU   0		    ;INITIALIZATION
   115                              <4> DINITHL        EQU   26 	    ;SIZE OF INIT HEADER
   116                              <4> DEVMDCH        EQU   1		    ;MEDIA CHECK
   117                              <4> DMEDHL	       EQU   15 	    ;SIZE OF MEDIA CHECK HEADER
   118                              <4> DEVBPB	       EQU   2		    ;GET BPB
   119                              <4> DEVRDIOCTL     EQU   3		    ;IOCTL READ
   120                              <4> DBPBHL	       EQU   22 	    ;SIZE OF GET BPB HEADER
   121                              <4> DEVRD	       EQU   4		    ;READ
   122                              <4> DRDWRHL        EQU   22 	    ;SIZE OF RD/WR HEADER
   123                              <4> DEVRDND        EQU   5		    ;NON DESTRUCTIVE READ NO WAIT (CHARACTER DEVS)
   124                              <4> DRDNDHL        EQU   14 	    ;SIZE OF NON DESTRUCTIVE READ HEADER
   125                              <4> DEVIST	       EQU   6		    ;INPUT STATUS
   126                              <4> DSTATHL        EQU   13 	    ;SIZE OF STATUS HEADER
   127                              <4> DEVIFL	       EQU   7		    ;INPUT FLUSH
   128                              <4> DFLSHL	       EQU   15 	    ;SIZE OF FLUSH HEADER
   129                              <4> DEVWRT	       EQU   8		    ;WRITE
   130                              <4> DEVWRTV        EQU   9		    ;WRITE WITH VERIFY
   131                              <4> DEVOST	       EQU   10 	    ;OUTPUT STATUS
   132                              <4> DEVOFL	       EQU   11 	    ;OUTPUT FLUSH
   133                              <4> DEVWRIOCTL     EQU   12 	    ;IOCTL WRITE
   134                              <4> DEVOPN	       EQU   13 	    ;DEVICE OPEN
   135                              <4> DEVCLS	       EQU   14 	    ;DEVICE CLOSE
   136                              <4> DOPCLHL        EQU   13 	    ;SIZE OF OPEN/CLOSE HEADER
   137                              <4> DEVRMD	       EQU   15 	    ;REMOVABLE MEDIA
   138                              <4> REMHL	       EQU   13 	    ;SIZE OF REMOVABLE MEDIA HEADER
   139                              <4> GENIOCTL       EQU   19
   140                              <4> ; THE NEXT THREE ARE USED IN DOS 4.0
   141                              <4> ;		     20
   142                              <4> ;		     21
   143                              <4> ;		     22
   144                              <4> DEVGETOWN      EQU   23 	    ;GET DEVICE OWNER
   145                              <4> DEVSETOWN      EQU   24 	    ;SET DEVICE OWNER
   146                              <4> QUERYGENIOCTL equ 25		; query generic IOCTL support (MS-DOS v5+)
   147                              <4> OWNHL	       EQU   13 	    ;SIZE OF DEVICE OWNER HEADER
   148                              <4> 
   149                              <4> DEVOUT	       EQU   16 	    ; OUTPUT UNTIL BUSY.
   150                              <4> DEVOUTL        EQU   DEVWRT	    ; LENGTH OF OUTPUT UNTIL BUSY
   151                              <4> 
   152                              <4> ; GENERIC IOCTL REQUEST STRUCTURE
   153                              <4> ;	SEE THE DOS 4.0 DEVICE DRIVER SPEC FOR FURTHER ELABORATION.
   154                              <4> ;
   155                              <4> IOCTL_REQ      STRUC
   156 00000000 ??????????????????- <4> 	       DB    (SRHEAD_struc_size) DUP(?)
   156 00000009 ????????            <4>
   157                              <4> 				    ; GENERIC IOCTL ADDITION.
   158 0000000D ??                  <4> MAJORFUNCTION  DB    ?		    ;FUNCTION CODE
   159 0000000E ??                  <4> MINORFUNCTION  DB    ?		    ;FUNCTION CATEGORY
   160 0000000F ????                <4> REG_SI	       DW    ?
   161 00000011 ????                <4> REG_DI	       DW    ?
   162 00000013 ????????            <4> GENERICIOCTL_PACKET DD ?	    ; POINTER TO DATA BUFFER
   163                              <4> IOCTL_REQ      ENDS
   164                              <4> 
   165                              <4> ;	DEFINITIONS FOR IOCTL_REQ.MINORFUNCTION
   166                              <4> GEN_IOCTL_WRT_TRK   EQU   40H
   167                              <4> GEN_IOCTL_RD_TRK    EQU   60H
   168                              <4> GEN_IOCTL_FN_TST    EQU   20H	    ; USED TO DIFF. BET READS AND WRTS
   169                              <4> 
   170                              <4> ;; 32-bit absolute read/write input list structure
   171                              <4> 
   172                              <4> ABS_32RW	 STRUC
   173 00000000 ????????            <4> SECTOR_RBA	 DD	 ?	    ; relative block address
   174 00000004 ????                <4> ABS_RW_COUNT	 DW	 ?	    ; number of sectors to be transferred
   175 00000006 ????????            <4> BUFFER_ADDR	 DD	 ?	    ; data addrress
   176                              <4> ABS_32RW	 ENDS
   177                              <4> 
   178                              <4> ;; media ID info
   179                              <4> 
   180                              <4> MEDIA_ID_INFO	 STRUC
   181 00000000 ????                <4> MEDIA_level	 DW	 ?	    ; info level
   182 00000002 ????????            <4> MEDIA_Serial	 DD	 ?	    ; serial #
   183 00000006 ??????????????????- <4> MEDIA_Label	 DB	 11 dup (?) ;volume label
   183 0000000F ????                <4>
   184 00000011 ????????????????    <4> MEDIA_System	 DB	 8  dup (?) ;system type
   185                              <4> MEDIA_ID_INFO	 ENDS
   186                              <4> 
   187                              <4> ;; equates for DOS34_FLAG
   188                              <4> 
   189                              <4> IFS_ABSRW	      EQU   00001H	   ;IFS absolute read/write
   190                              <4> NO_IFS_ABSRW	      EQU   0FFFEH	   ;no IFS absolute read/write
   191                              <4> IFS_DRIVE_RESET       EQU   00002H	   ;IFS drvive reset
   192                              <4> NO_IFS_DRIVE_RESET    EQU   0FFFDH	   ;no IFS drive reset
   193                              <4> FROM_DISK_RESET       EQU   00004H	   ;from disk reset
   194                              <4> NO_FROM_DISK_RESET    EQU   0FFFBH	   ;not from disk reset
   195                              <4> From_String_Output    EQU   00008H	   ;from con string output
   196                              <4> NO_From_String_Output EQU   0FFF7H	   ;not from con string output
   197                              <4> From_DOS_WRITE	      EQU   00010H	   ;from dos_write
   198                              <4> NO_From_DOS_WRITE     EQU   0FFEFH	   ;not from dos_write
   199                              <4> Force_I24_Fail	      EQU   00020H	   ;form IFS CALL BACK
   200                              <4> NO_Force_I24_Fail     EQU   0FFDFH	   ;not form IFS CALL BACK
   201                              <4> Disable_EOF_I24       EQU   00040H	   ;disable EOF int24 for input status
   202                              <4> NO_Disable_EOF_I24    EQU   0FFBFH	   ;disable EOF int24 for input status
   203                              <4> DBCS_VOLID	      EQU   00080H	   ;indicate from volume id
   204                              <4> DBCS_VOLID2	      EQU   00100H	   ;indicate 8th char is DBCS
   205                              <4> CTRL_BREAK_FLAG       EQU   00200H	   ;indicate control break is input
   206                              <4> NO_CTRL_BREAK_FLAG    EQU   0FDFFH	   ;reset control break
   207                              <4> SEARCH_FASTOPEN       EQU   00400H	   ;set fastopen flag for search
   208                              <4> X25_special	      EQU   00800H	   ;flag for X25 driver
   125                              <3> [list +]
   126                              <3> 
   127                              <3> %ifndef Installed
   128                              <3>  %iassign Installed 0
   129                              <3> %endif
   130                              <3> 
   131                              <3> section DOSSTARTJUMP
   132                              <3> 		ASSUME	CS:DOSGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
   133                              <3> 
   134                              <3> %ifndef DONOBITS
   135                              <3> 	JMP	near ptr DOSINIT
   136                              <3> %else	; DONOBITS
   137 00000000 ??????              <3> 	db ?,?,?
   138                              <3> %endif	; DONOBITS
   139                              <3> 
   140                              <3> ; (no prior section) ; DOSSTARTJUMP		ENDS
   141                              <3> 
   142                              <3> section LAST
   143                              <3> 	Extrn	DOSINIT:NEAR
   144                              <3> ; (no prior section) ; LAST		ENDS
   145                              <3> 
     8                              <2> ;=== Pop trace listing source
     9                              <2> %include "version.mac"
     1                              <3> ; Some modules really want TRUE to be 0FFH.  Best to let them have their way.
     2                              <3> 	TRUE	   EQU	   0FFFFh
     3                              <3> 	TRUEBYTE   EQU     0FFh
     4                              <3> 	FALSE	   EQU	   0
     5                              <3> 
     6                              <3> ;
     7                              <3> ; Use the following switches to control cmacros.inc
     8                              <3> ;
     9                              <3> ?PLM       equ       0
    10                              <3> ?WIN       equ       0
    11                              <3> 
    12                              <3> memS       EQU     1			; Small model
    13                              <3> ;
    14                              <3> ; Use the switches below to produce the standard Microsoft version or the IBM
    15                              <3> ; version of the operating system
    16                              <3> ;
    17                              <3> ; The below chart will indicate how to set the switches to build the various
    18                              <3> ; versions
    19                              <3> ;
    20                              <3> ;                     IBMVER          IBMCOPYRIGHT
    21                              <3> ; --------------------------------------------------------
    22                              <3> ;  IBM Version   |     TRUE              TRUE
    23                              <3> ; --------------------------------------------------------
    24                              <3> ;  MS Version    |     FALSE             FALSE
    25                              <3> ; --------------------------------------------------------
    26                              <3> ;  Clone Version |     TRUE              FALSE
    27                              <3> ;
    28                              <3> IBMVER     EQU     TRUE
    29                              <3> IBMCOPYRIGHT EQU   FALSE
    30                              <3> 
    31                              <3> BUFFERFLAG	EQU	~ IBMCOPYRIGHT
    32                              <3> 
    33                              <3> %ifndef	MSVER	
    34                              <3> MSVER      EQU     ~ IBMVER
    35                              <3> %endif
    36                              <3> IBM	   EQU	   IBMVER
    37                              <3> ;
    38                              <3> ;
    39                              <3> 	%IF IBMVER
    40                              <3> 	    %IF IBMCOPYRIGHT
    41                              <3>               %warning out: ... IBM version build switch on ...
    42                              <3> 	    %ELSE
    43                              <3> 	      %warning out: ... CLONE version build switch on ...
    43          ******************  <3>  warning: out: ... CLONE version build switch on ... [-w+user]
    44                              <3> 	    %ENDIF
    45                              <3> 	%ELSE
    46                              <3> 	    %IFN IBMCOPYRIGHT
    47                              <3> 	      %warning out: ... MS version build switch on ...
    48                              <3> 	    %ELSE
    49                              <3> 	      %warning out: !!!!!!!!!  VERSION SWITCHES SET INCORECTLY  !!!!!!!!!
    50                              <3> 	      %warning out: !!!!!!!!! CHECK SETTINGS IN INC\VERSION.INC !!!!!!!!!
    51                              <3> 	    %ENDIF
    52                              <3> 	%ENDIF   
    53                              <3> ;
    54                              <3> ;
    55                              <3> ;***************************************************************************
    56                              <3> ;*          The following switches are for DBCS or SBCS support            *
    57                              <3> ;*                                                                         *
    58                              <3> ;*                     Set INTERNAT EQU TRUE FOR DBCS                      *
    59                              <3> ;*                     Set INTERNAT EQU FALSE FOR SBCS                     *
    60                              <3> ;*                                                                         *
    61                              <3> ;***************************************************************************
    62                              <3> ;
    63                              <3> IBMJAPVER  EQU	   FALSE		;If TRUE set KANJI true also
    64                              <3> 
    65                              <3> ;
    66                              <3> ; Switch INTERNAT for DBCS support
    67                              <3> ;
    68                              <3> INTERNAT   EQU	   FALSE
    69                              <3> ;
    70                              <3> 	%IF INTERNAT
    71                              <3> %ifndef KANJI
    72                              <3> KANJI	   EQU	   TRUE
    73                              <3> %endif
    74                              <3> IBMJAPAN   EQU	   TRUE
    75                              <3> 	%ELSE
    76                              <3> %ifndef KANJI
    77                              <3> KANJI	   EQU	   FALSE
    78                              <3> %endif
    79                              <3> IBMJAPAN   EQU	   FALSE
    80                              <3> 	%ENDIF
    81                              <3> 
    82                              <3> %ifndef altvect				; avoid jerking off vector.inc
    83                              <3> ALTVECT    EQU	   FALSE		;Switch to build ALTVECT version
    84                              <3> %endif
    85                              <3> 
    86                              <3> ;
    87                              <3> ; Country code switches
    88                              <3> ; The default contry code is assumed as USA.
    89                              <3> ;
    90                              <3> 	%IF INTERNAT
    91                              <3>  KOREA	   EQU	   TRUE
    92                              <3>  JAPAN	   EQU	   FALSE
    93                              <3> 	%ELSE
    94                              <3>  KOREA	   EQU	   FALSE
    95                              <3>  JAPAN	   EQU	   FALSE
    96                              <3> 	%ENDIF
    97                              <3> ;
    98                              <3> 		%IF INTERNAT
    99                              <3> %warning out: Internat(ECS) version build switch on
   100                              <3> 		%ENDIF
    10                              <2> %include "lmacros1.mac"
     1                              <3> [list -]
    11                              <2> 
    12                              <2> 	extern okcallentry, badcallentry
    13                              <2> 
    14                              <2> section DOSCODECODE
    15                              <2> 	Extrn	LeaveDOS:NEAR
    16                              <2> 	Extrn	BadCall:FAR, OKCall:FAR
    17                              <2> ; (no prior section) ; DOSCODECODE		ENDS
    18                              <2> 
    19                              <2> section LAST
    20                              <2> 	extrn SYSBUF:byte
    21                              <2> ; (no prior section) ; LAST		ENDS
    22                              <2> 
    23                              <2> Break <Initialized data and data used at DOS initialization>
    24                              <2> 
    25                              <2> ;
    26                              <2> ; We need to identify the parts of the data area that are relevant to tasks
    27                              <2> ; and those that are relevant to the system as a whole.  Under 3.0, the system
    28                              <2> ; data will be gathered with the system code.  The process data under 2.x will
    29                              <2> ; be available for swapping and under 3.0 it will be allocated per-process.
    30                              <2> ;
    31                              <2> ; The data that is system data will be identified by [SYSTEM] in the comments
    32                              <2> ; describing that data item.
    33                              <2> ;
    34                              <2> 
    35                              <2> %ifndef Kanji
    36                              <2>  %iassign Kanji 0
    37                              <2> %endif
    38                              <2> %ifndef Debug
    39                              <2>  %iassign Debug 0
    40                              <2> %endif
    41                              <2> %ifndef Redirector
    42                              <2>  %iassign Redirector 0
    43                              <2> %endif
    44                              <2> %ifndef ShareF
    45                              <2>  %iassign ShareF 0
    46                              <2> %endif
    47                              <2> 
    48                              <2> section DOSENTRY
    49                              <2> 	extern ifsentry
    50                              <2> 
    51                              <2> section CONSTANTS
    52                              <2> 
    53                              <2> 	extrn	sfTabl:DWORD
    54                              <2> 
    55                              <2> 	;ORG	0
    56                              <2> 
    57                              <2> 	EVEN
    58                              <2> ;
    59                              <2> ; WANGO!!!  The following word is used by SHARE and REDIR to determin data
    60                              <2> ; area compatability.  This location must be incremented EACH TIME the data
    61                              <2> ; area here gets mucked with.
    62                              <2> ;
    63                              <2> ; Also, do NOT change this position relative to 0. wrt DOSGROUP
    64                              <2> ;
    65                              <2> Public MSCT001S,MSCT001E
    66                              <2> MSCT001S:
    67 00000000 ????                <2> 	I_am	DataVersion,WORD,<1>	;AC000; [SYSTEM] version number for DOS DATA
    68                              <2> 
    69                              <2> %warning "out: WARNING!!! Debug fields are being included!!!"
    69          ******************  <2>  warning: out: WARNING!!! Debug fields are being included!!! [-w+user]
    70 00000002 ????????            <2> 	DB	"BUG "                  ; THIS FIELD MUST BE EVEN # OF BYTES
    70          ******************  <2>  warning: unterminated string (missing `"') [-w+pp-open-string]
    71 00000006 ????                <2> 	I_am	BugTyp,WORD,<0>
    72 00000008 ????                <2> 	I_am	BugLev,WORD,<0>
    73                              <2> %include "bugtyp.nas"
     1                              <3> ;	SCCSID = @(#)bugtyp.asm	1.1 85/04/09
     2                              <3> ;
     3                              <3> ; debugging types and levels for MSDOS
     4                              <3> ;
     5                              <3> 
     6                              <3> TypAccess   EQU     0001h
     7                              <3>     LevSFN	EQU	0000h
     8                              <3>     LevBUSY	EQU	0001h
     9                              <3> 
    10                              <3> TypShare    EQU     0002h
    11                              <3>     LevShEntry	EQU	0000h
    12                              <3>     LevMFTSrch	EQU	0001h
    13                              <3> 
    14                              <3> TypSect     EQU     0004h
    15                              <3>     LevEnter	EQU	0000h
    16                              <3>     LevLeave	EQU	0001h
    17                              <3>     LevReq	EQU	0002h
    18                              <3> 
    19                              <3> TypSMB	    EQU     0008h
    20                              <3>     LevSMBin	EQU	0000h
    21                              <3>     LevSMBout	EQU	0001h
    22                              <3>     LevParm	EQU	0002h
    23                              <3>     LevASCIZ	EQU	0003h
    24                              <3>     LevSDB	EQU	0004h
    25                              <3>     LevVarlen	EQU	0005h
    26                              <3> 
    27                              <3> TypNCB	    EQU     0010h
    28                              <3>     LevNCBin	EQU	0000h
    29                              <3>     LevNCBout	EQU	0001h
    30                              <3> 
    31                              <3> TypSeg	    EQU     0020h
    32                              <3>     LevAll	EQU	0000h
    33                              <3> 
    34                              <3> TypSyscall  EQU     0040h
    35                              <3>     LevLog	EQU	0000h
    36                              <3>     LevArgs	EQU	0001h
    37                              <3> 
    38                              <3> TypInt24    EQU     0080h
    39                              <3>     LevLog	EQU	0000h
    40                              <3> 
    41                              <3> TypProlog   EQU     0100h
    42                              <3>     LevLog	EQU	0000h
    43                              <3> 
    44                              <3> TypInt	    EQU     0200h
    45                              <3>     LevLog	equ	0000h
    46                              <3> 
    47                              <3> typFCB	    equ     0400h
    48                              <3>     LevLog	equ	0000h
    49                              <3>     LevCheck	equ	0001h
    74                              <2> 
    75 0000000A ????                <2> 	I_am	MYNUM,WORD,<0>		; [SYSTEM] A number that goes with MYNAME
    76 0000000C ????                <2> 	I_am	FCBLRU,WORD,<0> 	; [SYSTEM] LRU count for FCB cache
    77 0000000E ????                <2> 	I_am	OpenLRU,WORD,<0>	; [SYSTEM] LRU count for FCB cache opens
    78                              <2> ; NOTE: We include the decl of OEM_HANDLER in IBM DOS even though it is not used.
    79                              <2> ;	This allows the REDIRector to work on either IBM or MS-DOS.
    80                              <2> 	PUBLIC	OEM_HANDLER
    81 00000010 ????????            <2> OEM_HANDLER	DD	-1		; [SYSTEM] Pointer to OEM handler code
    82                              <2> DOSGroup equ DOSGROUP	; NASM port equate
    83 00000014 ????                <2> 	I_am	LeaveAddr,WORD,<<OFFSET LeaveDOS wrt DOSGroup>> ; [SYSTEM]
    84 00000016 ????                <2> 	I_am	RetryCount,WORD,<3>	; [SYSTEM] Share retries
    85 00000018 ????                <2> 	I_am	RetryLoop,WORD,<1>	; [SYSTEM] Share retries
    86 0000001A ????????            <2> 	I_am	LastBuffer,DWORD,<-1,-1>; [SYSTEM] Buffer queue recency pointer
    87 0000001E ????                <2> 	I_am	CONTPOS,WORD		; [SYSTEM] location in buffer of next read
    88 00000020 ????                <2> 	I_am	arena_head,WORD 	; [SYSTEM] Segment # of first arena in memory
    89                              <2> ; The following block of data is used by SYSINIT.  Do not change the order or
    90                              <2> ; size of this block
    91                              <2> 	PUBLIC	SYSINITVAR		; [SYSTEM]
    92                              <2> SYSINITVAR  LABEL   WORD		; [SYSTEM]
    93 00000022 ????????            <2> 	I_am	DPBHEAD,DWORD,<0,0>	; [SYSTEM] Pointer to head of DPB-FAT list
    94                              <2> DosGroup equ DOSGROUP	; NASM port equate
    95 00000026 ????????            <2> 	I_am	sft_addr,DWORD,<<OFFSET sfTabl wrt DosGroup>,?> ; [SYSTEM] Pointer to first SFT table
    96 0000002A ????????            <2> 	I_am	BCLOCK,DWORD		; [SYSTEM] The CLOCK device
    97 0000002E ????????            <2> 	I_am	BCON,DWORD		; [SYSTEM] Console device entry points
    98 00000032 ????                <2> 	I_am	MAXSEC,WORD,<128>	; [SYSTEM] Maximum allowed sector size
    99                              <2> %ifdef BUF2
   100 00000034 ????????            <2> 	dd -1
   101                              <2> %else
   102                              <2> 	I_am	BUFFHEAD,DWORD		; [SYSTEM] Pointer to head of buffer queue
   103                              <2> %endif
   104 00000038 ????????            <2> 	I_am	CDSADDR,DWORD		; [SYSTEM] Pointer to curdir structure table
   105 0000003C ????????            <2> 	I_am	sftFCB,DWORD		; [SYSTEM] pointer to FCB cache table
   106 00000040 ????                <2> 	I_am	KeepCount,WORD		; [SYSTEM] count of FCB opens to keep
   107 00000042 ??                  <2> 	I_am	NUMIO,BYTE		; [SYSTEM] Number of disk tables
   108 00000043 ??                  <2> 	I_am	CDSCOUNT,BYTE		; [SYSTEM] Number of CDS structures in above
   109                              <2> ; A fake header for the NUL device
   110 00000044 ????????            <2> 	I_am	NULDEV,DWORD		; [SYSTEM] Link to rest of device list
   111 00000048 ????                <2> 	DW	DEVTYP | ISNULL	; [SYSTEM] Null device attributes
   112 0000004A ????                <2> 	short_addr  SNULDEV		; [SYSTEM] Strategy entry point
   113 0000004C ????                <2> 	short_addr  INULDEV		; [SYSTEM] Interrupt entry point
   114 0000004E ????????????????    <2> 	DB	"NUL     "              ; [SYSTEM] Name of null device
   114          ******************  <2>  warning: unterminated string (missing `"') [-w+pp-open-string]
   114          ******************  <2>  warning: unterminated string (missing `"') [-w+pp-open-string]
   114          ******************  <2>  warning: unterminated string (missing `"') [-w+pp-open-string]
   114          ******************  <2>  warning: unterminated string (missing `"') [-w+pp-open-string]
   115 00000056 ??                  <2> 	I_am	Splices,BYTE,<0>	; [SYSTEM] TRUE => splices being done
   116 00000057 ????                <2> 	I_am	Special_Entries,WORD,<0>; [SYSTEM] address of specail entries	;AN000;
   117 00000059 ????????            <2> 	I_am	IFS_DOS_CALL,DWORD,<ifsentry, DOSENTRY>	; [SYSTEM] entry for IFS DOS service	;AN000;
   118 0000005D ????????            <2> 	I_am	IFS_HEADER,DWORD	; [SYSTEM] IFS header chain		;AN000;
   119 00000061 ????                <2> 	I_am	BUFFERS_PARM1,WORD,<0>	; [SYSTEM] value of BUFFERS= ,m 	;AN000;
   120 00000063 ????                <2> 	I_am	BUFFERS_PARM2,WORD,<0>	; [SYSTEM] value of BUFFERS= ,n 	;AN000;
   121 00000065 ??                  <2> 	I_am	BOOTDRIVE,BYTE		; [SYSTEM] the boot drive		;AN000;
   122 00000066 ??                  <2> 	I_am	DDMOVE,BYTE,<0> 	; [SYSTEM] 1 if we need DWORD move	;AN000;
   123 00000067 ????                <2> 	I_am	EXT_MEM_SIZE,WORD,<0>	; [SYSTEM] extended memory size 	;AN000;
   124                              <2> 
   125                              <2> %ifndef BUF2
   126                              <2> 	PUBLIC	HASHINITVAR		; [SYSTEM]				;AN000;
   127                              <2> HASHINITVAR  LABEL   WORD		; [SYSTEM]				;AN000;
   128                              <2> 	I_am	BUF_HASH_PTR,DWORD	; [SYSTEM] buffer Hash table addr	;AN000;
   129                              <2> 	I_am	BUF_HASH_COUNT,WORD,<1> ; [SYSTEM] number of Hash entries	;AN000;
   130                              <2> 	I_am	SC_CACHE_PTR,DWORD	; [SYSTEM] secondary cache pointer	;AN000;
   131                              <2> 	I_am	SC_CACHE_COUNT,WORD,<0> ; [SYSTEM] secondary cache count	;AN000;
   132                              <2> 
   133                              <2> %IF	BUFFERFLAG
   134                              <2> 	I_am	BUF_EMS_SAFE_FLAG,BYTE,<1>	; indicates whether the page used by buffers is safe or not
   135                              <2> 	I_am	BUF_EMS_LAST_PAGE,4,<0,0,0,0>	; holds the last page above 640k
   136                              <2> 	I_am	BUF_EMS_FIRST_PAGE,4,<0,0,0,0>  ; holds the first page above 640K
   137                              <2> 	I_am	BUF_EMS_NPA640,WORD,<0>		; holds the number of pages above 640K
   138                              <2> 
   139                              <2> %ENDIF
   140                              <2> 
   141                              <2> 	I_am	BUF_EMS_MODE,BYTE,<-1>	; [SYSTEM] EMS mode			;AN000;
   142                              <2> 	I_am	BUF_EMS_HANDLE,WORD	; [SYSTEM] buffer EMS handle		;AN000;
   143                              <2> 	I_am	BUF_EMS_PAGE_FRAME,WORD ,<-1>;[SYSTEM] EMS page frame number	;AN000;
   144                              <2> 	I_am	BUF_EMS_SEG_CNT,WORD,<1>; [SYSTEM] EMS seg count		;AN000;
   145                              <2> 	I_am	BUF_EMS_PFRAME,WORD	; [SYSTEM] EMS page frame seg address	;AN000;
   146                              <2> 	I_am	BUF_EMS_RESERV,WORD,<0> ; [SYSTEM] reserved			;AN000;
   147                              <2> 
   148                              <2> %IF	BUFFERFLAG
   149                              <2> 	I_am	BUF_EMS_MAP_BUFF,1,<0>	; this is not used to save the state of the 
   150                              <2> 					; of the buffers page. this one byte is
   151                              <2> 					; retained to keep the size of this data 
   152                              <2> 					; block the same.
   153                              <2> %ELSE
   154                              <2> 	I_am	BUF_EMS_MAP_BUFF,12,<0,0,0,0,0,0,0,0,0,0,0,0>	; map buufer	;AN000;
   155                              <2> %ENDIF
   156                              <2> %endif
   157                              <2> 
   158                              <2> %ifdef BUF2
   159 00000069 ??                  <2> 	align 2, db ?
   160 0000006A ????                <2> 	I_am	BUF2_Dirty_Count,WORD,0
   161 0000006C ????????            <2> 	I_am	BUFFHEAD,DWORD		; [SYSTEM] Pointer to head of buffer queue
   162 00000070 ????????            <2> 	I_am	BuffFree,DWORD
   163                              <2> %endif
   164                              <2> 
   165                              <2> ; End of SYSINITVar block
   166                              <2> 
   167 00000074 ??<rep 18h>         <2> 	_fill 90h, ?, DataVersion - 4
   168                              <2> 
   169                              <2> ;
   170                              <2> ; Sharer jump table
   171                              <2> ;
   172                              <2> PUBLIC	JShare
   173                              <2> 	EVEN
   174                              <2> JShare	LABEL	DWORD
   175 0000008C ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY
   176 00000090 ????????            <2> 	DW	OFFSET okcallentry, DOSENTRY	;  1   MFT_enter
   177 00000094 ????????            <2> 	DW	OFFSET okcallentry, DOSENTRY	;  2   MFTClose
   178 00000098 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	;  3   MFTclU
   179 0000009C ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	;  4   MFTCloseP
   180 000000A0 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	;  5   MFTCloN
   181 000000A4 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	;  6   set_block
   182 000000A8 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	;  7   clr_block
   183 000000AC ????????            <2> 	DW	OFFSET okcallentry, DOSENTRY	;  8   chk_block
   184 000000B0 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	;  9   MFT_get
   185 000000B4 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	; 10  ShSave
   186 000000B8 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	; 11  ShChk
   187 000000BC ????????            <2> 	DW	OFFSET okcallentry , DOSENTRY	; 12  ShCol
   188 000000C0 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	; 13  ShCloseFile
   189 000000C4 ????????            <2> 	DW	OFFSET badcallentry, DOSENTRY	; 14  ShSU
   190                              <2> 
   191                              <2> MSCT001E:
   192                              <2> ; (no prior section) ; CONSTANTS	ENDS
   193                              <2> 
   194                              <2> 
    10                              <1> ;=== Pop trace listing source
    11                              <1> 	END
