     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 "msdosme.nas"
     1                              <1> ;	SCCSID = @(#)ibmdosmes.asm	1.1 85/04/10
     2                              <1> ;
     3                              <1> ; Standard device IO for MSDOS (first 12 function calls)
     4                              <1> ;
     5                              <1> debug equ 0
     6                              <1> [list -]
     6          ******************  <1>  warning: out: ... CLONE version build switch on ... [-w+user]
    13                              <1> 
    14                              <1> ;TITLE   IBMDOSMES - DOS OEM dependancies
    15                              <1> ;NAME    IBMDOSMES
    16                              <1> 
    17                              <1> ;=== Push trace listing source: dosmes.nas
    18                              <1> %include "dosmes.nas" ; NASM included file
     1                              <2> ;	SCCSID = @(#)dosmes.asm 1.7 85/10/23
     2                              <2> ;	SCCSID = @(#)dosmes.asm 1.7 85/10/23
     3                              <2> ;
     4                              <2> ; Message file for Internationalized messages.	There is
     5                              <2> ; only one message here available for translation.
     6                              <2> ;
     7                              <2> ;
     8                              <2> ;    Revision history
     9                              <2> ;	  A000	  version 4.00  Jan. 1988
    10                              <2> ;
    11                              <2> 
    12                              <2> %IFNdef	KANJI
    13                              <2>  %iassign KANJI	FALSE
    14                              <2> %ENDIF
    15                              <2> 
    16                              <2> %IFNdef	Rainbow
    17                              <2>  %iassign Rainbow FALSE
    18                              <2> %ENDIF
    19                              <2> 
    20                              <2> [list -]
    20          ******************  <2>  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
    22                              <2> %include "dosseg.nas"
     1                              <3> ;	SCCSID = @(#)dosseg.asm	1.1 85/04/10
     2                              <3> ;	SCCSID = @(#)dosseg.asm	1.1 85/04/10
     3                              <3> ;
     4                              <3> ; segment ordering for MSDOS
     5                              <3> ;
     6                              <3> 
     7                              <3> %include "ddataseg.nas"
     1                              <4> 
     2                              <4> %include "lmacros3.mac"
     1                              <5> [list -]
     3                              <4> 
     4                              <4> addsection DOSSTART, align=16 PUBLIC class=DOSSTART
     5                              <4> ; (no prior section) ; DOSSTART		ENDS
     6                              <4> 
     7                              <4> addsection DOSSTARTJUMP, align=1 PUBLIC class=START
     8                              <4> ; (no prior section) ; DOSSTARTJUMP		ENDS
     9                              <4> 
    10                              <4> addsection CONSTANTS, align=2 PUBLIC class=CONST
    11                              <4> ; (no prior section) ; CONSTANTS	ENDS
    12                              <4> 
    13                              <4> addsection DATA, align=2 PUBLIC class=DATA
    14                              <4> ; (no prior section) ; DATA		ENDS
    15                              <4> 
    16                              <4> addsection TABLE, align=2 PUBLIC class=TABLE
    17                              <4> ; (no prior section) ; TABLE		ENDS
    18                              <4> 
    19                              <4> addsection DOSDATATABLE, align=2 PUBLIC class=DOSDATACODE
    20                              <4> ; (no prior section) ; DOSDATATABLE		ENDS
    21                              <4> 
    22                              <4> addsection DOSDATACODE, align=1 PUBLIC class=DOSDATACODE
    23                              <4> ; (no prior section) ; DOSDATACODE		ENDS
    24                              <4> 
    25                              <4> addsection DOSBIODATA, align=2 PUBLIC class=DOSBIODATA
    26                              <4> 
    27                              <4> addsection LAST, align=16 PUBLIC class=LAST
    28                              <4> ; (no prior section) ; LAST		ENDS
    29                              <4> 
    30                              <4> group DOSGROUP DOSSTART DOSSTARTJUMP CONSTANTS DATA TABLE DOSDATATABLE DOSDATACODE DOSBIODATA LAST
     8                              <3> 
     9                              <3> %include "dcodeseg.nas"
     1                              <4> 
     2                              <4> %ifndef DCODESEGNAS
     3                              <4> %assign DCODESEGNAS 1
     4                              <4> 
     5                              <4> section DOSCODETABLE align=2 PUBLIC class=DOSCODE
     6                              <4> ; (no prior section) ; DOSCODETABLE		ENDS
     7                              <4> section DOSCODECODE align=1 PUBLIC class=DOSCODE
     8                              <4> ; (no prior section) ; DOSCODECODE		ENDS
     9                              <4> section DOSBIOCODE align=2 PUBLIC class=DOSCODE
    10                              <4> section BIOCODE	align=2 PUBLIC class=DOSCODE
    11                              <4> 
    12                              <4> %ifnidni DOSENTRYGROUP, DOSCODEGROUP
    13                              <4>  group DOSCODEGROUP DOSCODETABLE DOSCODECODE DOSBIOCODE BIOCODE
    14                              <4> %endif
    15                              <4> 
    16                              <4> %endif
    10                              <3> 
    11                              <3> section LAST
    12                              <3> ; (no prior section) ; LAST		ENDS
    23                              <2> %include "dossym.mac"
     1                              <3> ;	SCCSID = @(#)dossym.asm 1.1 85/04/10
     2                              <3> ;	SCCSID = @(#)dossym.asm 1.1 85/04/10
     3                              <3> ;	PAGE 80,132
     4                              <3> TRUE	    EQU 0FFFFh
     5                              <3> FALSE	    EQU 0
     6                              <3> 
     7                              <3> Installed   equ TRUE
     8                              <3> %IFNDEF	DEBUG
     9                              <3>     DEBUG	equ FALSE
    10                              <3> %ENDIF
    11                              <3> %IFNDEF	debug
    12                              <3>     debug	equ DEBUG
    13                              <3> %ENDIF
    14                              <3> 
    15                              <3> %if 0
    16                              <3>  DBCS equ FALSE		; for fixmem.pl operation
    17                              <3> %endif
    18                              <3> 
    19                              <3> ; NASM original macros
    20                              <3> 
    21                              <3> %macro DBCS 1.nolist
    22                              <3> %defstr %%string %1
    23                              <3> %substr %%prefix %%string 1,2
    24                              <3> %substr %%suffix %%string 3,-1
    25                              <3> %ifnidni %%prefix, "= "
    26                              <3>  %error Unexpected DBCS prefix
    27                              <3> %endif
    28                              <3> %deftok %%token %%suffix
    29                              <3> %xdefine DBCS %%token
    30                              <3> %endmacro
    31                              <3> 
    32                              <3> %include "DBCS.SW"
     1                              <4> DBCS = FALSE
     2                              <4> 
    33                              <3> %unmacro DBCS 1.nolist
    34                              <3> 
    35                              <3> ; end of NASM original macros
    36                              <3> 
    37                              <3> %include "dosmac.mac"
     1                              <4> ;	SCCSID = @(#)dosmac.asm	1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)dosmac.asm	1.1 85/04/10
     3                              <4> ;
     4                              <4> ; Macro file for MSDOS.
     5                              <4> ;
     6                              <4> 
     7                              <4> %ifndef __DOSMAC_MAC__
     8                              <4>  %assign __DOSMAC_MAC__ 1
     9                              <4> 
    10                              <4> TRUE    EQU 0FFFFh
    11                              <4> FALSE   EQU 0
    12                              <4> 
    13                              <4> 
    14                              <4> ; NASM original macros (comment for fixmem.pl)
    15                              <4> 
    16                              <4> ;SUBTTL BREAK a listing into pages and give new subtitles
    17                              <4> ;PAGE
    18                              <4> %imacro BREAK 0-1+.nolist
    19                              <4> 	;SUBTTL  subtitle
    20                              <4> 	;PAGE
    21                              <4> %endmacro
    22                              <4> ;.xcref  break
    23                              <4> 
    24                              <4> BREAK   <ASMVAR - handle assembly variables once and for all>
    25                              <4> 
    26                              <4> %if 0
    27                              <4> AsmVars Macro   varlist
    28                              <4> IRP     var,<varlist>
    29                              <4> AsmVar  var
    30                              <4> ENDM
    31                              <4> ENDM
    32                              <4> 
    33                              <4> AsmVar  Macro   var
    34                              <4> IFNDEF  var
    35                              <4> var = FALSE
    36                              <4> ENDIF
    37                              <4> ENDM
    38                              <4> %endif
    39                              <4> 
    40                              <4> BREAK <I_NEED: declare a variable external, if necessary, and allocate a size>
    41                              <4> 
    42                              <4> ;
    43                              <4> ; declare a variable external and allocate a size
    44                              <4> ;
    45                              <4> ;AsmVar  InstalledData
    46                              <4> %ifndef InstalledData
    47                              <4>  %define InstalledData 0
    48                              <4> %endif
    49                              <4> 
    50                              <4> %imacro I_NEED 1-2.nolist
    51                              <4> %ifn InstalledData
    52                              <4> 	[section DATA]
    53                              <4>     %IFIDNi   %2, WORD
    54                              <4> 	EXTRN   %1:WORD
    55                              <4>     %ELSE
    56                              <4> 	%IFIDNi   %2, DWORD
    57                              <4> 	EXTRN   %1:DWORD
    58                              <4> 	%ELSE
    59                              <4> 	EXTRN   %1:BYTE
    60                              <4> 	%ENDIF
    61                              <4>     %ENDIF
    62                              <4> 	__SECT__
    63                              <4> %ENDIF
    64                              <4> %endmacro
    65                              <4> 	;.xcref I_need
    66                              <4> 
    67                              <4> ;
    68                              <4> ; call a procedure that may be external.  The call will be short.
    69                              <4> ;
    70                              <4> %imacro invoke 1.nolist
    71                              <4> ;.xcref
    72                              <4> 	EXTRN   %1:NEAR
    73                              <4> ;.cref
    74                              <4> 	CALL    %1
    75                              <4> %endmacro
    76                              <4> ;.xcref  invoke
    77                              <4> 
    78                              <4> ;PAGE
    79                              <4> ;
    80                              <4> ; jump to a label that may be external.  The jump will be near.
    81                              <4> ;
    82                              <4> %imacro transfer 1.nolist
    83                              <4> ;.xcref
    84                              <4> 	EXTRN   %1:NEAR
    85                              <4> ;.cref
    86                              <4> 	JUMP    %1
    87                              <4> %endmacro
    88                              <4> ;.xcref  transfer
    89                              <4> 
    90                              <4> ;
    91                              <4> ; get a short address in a word
    92                              <4> ;
    93                              <4> %imacro short_addr 1.nolist
    94                              <4>     %ifnidn %1, ?
    95                              <4> 	EXTRN   %1:NEAR
    96                              <4> 	DW  OFFSET %1
    97                              <4>     %ELSE
    98                              <4> 	DW  ?
    99                              <4>     %ENDIF
   100                              <4> %endmacro
   101                              <4> ;.xcref  short_addr
   102                              <4> 
   103                              <4> ;
   104                              <4> ; get a long address in a dword
   105                              <4> ;
   106                              <4> %imacro long_addr 1.nolist
   107                              <4> 	EXTRN   %1:NEAR
   108                              <4> 	DD  %1
   109                              <4> %endmacro
   110                              <4> ;.xcref  long_addr
   111                              <4> 
   112                              <4> ;
   113                              <4> ; declare a PROC near or far but PUBLIC nonetheless
   114                              <4> ;
   115                              <4> ;.xcref ?frame
   116                              <4> ;.xcref ?aframe
   117                              <4> ;.xcref ?stackdepth
   118                              <4> ;.xcref ?initstack
   119                              <4> %assign ?frame           0                     ; initial
   120                              <4> %assign ?aframe          0                     ; initial
   121                              <4> %assign ?stackdepth      0                     ; initial stack size
   122                              <4> %assign ?initstack       0                     ; initial stack size
   123                              <4> 
   124                              <4> %imacro procedure 1-2.nolist
   125                              <4> 	%assign ?frame     0
   126                              <4> 	%assign ?aframe    2                   ;; remember the pushed BP
   127                              <4> 	%warning proc %1...
   128                              <4> %1    PROC    %2
   129                              <4> 	PUBLIC  %1
   130                              <4> 	%assign ?initstack     ?stackdepth     ;; beginning of procedure
   131                              <4> %endmacro
   132                              <4> ;.xcref  procedure
   133                              <4> 
   134                              <4> ;
   135                              <4> ; end a procedure and check that stack depth is preserved
   136                              <4> ;
   137                              <4> %imacro EndProc 1-2.nolist
   138                              <4> 	%ifnidni   %2, NoCheck        ;; check the stack size
   139                              <4> 	%if ?initstack != ?stackdepth    ;; is it different?
   140                              <4> 	%warning    ***** Possible stack size error in %1 *****
   141                              <4> 	%endif
   142                              <4> 	%endif
   143                              <4> %1    ENDP
   144                              <4> %endmacro
   145                              <4> ;.xcref  endproc
   146                              <4> ;PAGE
   147                              <4> ;
   148                              <4> ; define a data item to be public and of an appropriate size/type
   149                              <4> ;
   150                              <4> 
   151                              <4> %imacro stripangles 2.nolist
   152                              <4> %defstr %%param %2
   153                              <4> %rep 16
   154                              <4>  %substr %%opening %%param 1
   155                              <4>  %ifidn %%opening, '<'
   156                              <4>   %substr %%param %%param 2,-1
   157                              <4>  %endif
   158                              <4> %endrep
   159                              <4> %rep 16
   160                              <4>  %strlen %%length %%param
   161                              <4>  %substr %%closing %%param %%length
   162                              <4>  %ifidn %%closing, '>'
   163                              <4>   %substr %%param %%param 1,-2
   164                              <4>  %endif
   165                              <4> %endrep
   166                              <4> %deftok %%token %%param
   167                              <4> %1 %%token
   168                              <4> %endmacro
   169                              <4> 
   170                              <4> %imacro I_AM 2-*.nolist
   171                              <4> ;I_AM    MACRO   name,size,init
   172                              <4> %xdefine %%name %1
   173                              <4> ;; declare the type of the object
   174                              <4>     %IFIDNi %2, WORD
   175                              <4> %1    LABEL WORD
   176                              <4> 	%assign I_AM_SIZE      1
   177                              <4> 	%assign I_AM_LEN       2
   178                              <4>     %ELSE
   179                              <4> 	%IFIDNi %2, DWORD
   180                              <4> %1    LABEL DWORD
   181                              <4> 	%assign I_AM_SIZE      2
   182                              <4> 	%assign I_AM_LEN       2
   183                              <4> 	%ELSE
   184                              <4> 	    %IFIDNi %2, BYTE
   185                              <4> %1    LABEL BYTE
   186                              <4> 	%assign I_AM_SIZE      1
   187                              <4> 	%assign I_AM_LEN       1
   188                              <4> 	    %ELSE
   189                              <4> %1    LABEL BYTE
   190                              <4> %undef I_AM_SIZE
   191                              <4> 	stripangles %assign I_AM_SIZE, %2
   192                              <4> 	%assign I_AM_LEN       1
   193                              <4> 	    %ENDIF
   194                              <4> 	%ENDIF
   195                              <4>     %ENDIF
   196                              <4> ;; declare the object public
   197                              <4> 	PUBLIC  %%name
   198                              <4> ;; if no initialize then allocate blank storage
   199                              <4>     %IF %0 == 2
   200                              <4> 	DB  I_AM_SIZE*I_AM_LEN DUP (?)
   201                              <4>     %ELSE
   202                              <4> %ifn InstalledData
   203                              <4>  %rotate 2
   204                              <4>  %rep %0 - 2
   205                              <4> 	    %IF I_AM_LEN == 1
   206                              <4> 		stripangles db, %1
   207                              <4> 	    %ELSE
   208                              <4> 		stripangles dw, %1
   209                              <4> 	    %ENDIF
   210                              <4> 	    %assign I_AM_SIZE I_AM_SIZE - 1
   211                              <4> 	    %rotate 1
   212                              <4>  %endrep
   213                              <4> 	%IF I_AM_SIZE != 0
   214                              <4> 	    %error    ***** initialization of %%name not complete *****
   215                              <4> 	%ENDIF
   216                              <4> %ELSE
   217                              <4> 	DB  I_AM_SIZE*I_AM_LEN DUP (?)
   218                              <4> %ENDIF
   219                              <4>     %ENDIF
   220                              <4> %endmacro
   221                              <4> 
   222                              <4> %imacro I_AM_NOBITS 2-*.nolist
   223                              <4> ;I_AM    MACRO   name,size,init
   224                              <4> %xdefine %%name %1
   225                              <4> ;; declare the type of the object
   226                              <4>     %IFIDNi %2, WORD
   227                              <4> %1    LABEL WORD
   228                              <4> 	%assign I_AM_SIZE      1
   229                              <4> 	%assign I_AM_LEN       2
   230                              <4>     %ELSE
   231                              <4> 	%IFIDNi %2, DWORD
   232                              <4> %1    LABEL DWORD
   233                              <4> 	%assign I_AM_SIZE      2
   234                              <4> 	%assign I_AM_LEN       2
   235                              <4> 	%ELSE
   236                              <4> 	    %IFIDNi %2, BYTE
   237                              <4> %1    LABEL BYTE
   238                              <4> 	%assign I_AM_SIZE      1
   239                              <4> 	%assign I_AM_LEN       1
   240                              <4> 	    %ELSE
   241                              <4> %1    LABEL BYTE
   242                              <4> %undef I_AM_SIZE
   243                              <4> 	stripangles %assign I_AM_SIZE, %2
   244                              <4> 	%assign I_AM_LEN       1
   245                              <4> 	    %ENDIF
   246                              <4> 	%ENDIF
   247                              <4>     %ENDIF
   248                              <4> ;; declare the object public
   249                              <4> 	PUBLIC  %%name
   250                              <4> ;; if no initialize then allocate blank storage
   251                              <4>     %IF %0 == 2
   252                              <4> 	resb  I_AM_SIZE*I_AM_LEN
   253                              <4>     %ELSE
   254                              <4> %ifn InstalledData
   255                              <4>  %rotate 2
   256                              <4>  %rep %0 - 2
   257                              <4> 	    %IF I_AM_LEN == 1
   258                              <4> 		resb 1
   259                              <4> 	    %ELSE
   260                              <4> 		resw 1
   261                              <4> 	    %ENDIF
   262                              <4> 	    %assign I_AM_SIZE I_AM_SIZE - 1
   263                              <4> 	    %rotate 1
   264                              <4>  %endrep
   265                              <4> 	%IF I_AM_SIZE != 0
   266                              <4> 	    %error    ***** initialization of %%name not complete *****
   267                              <4> 	%ENDIF
   268                              <4> %ELSE
   269                              <4> 	resb  I_AM_SIZE*I_AM_LEN
   270                              <4> %ENDIF
   271                              <4>     %ENDIF
   272                              <4> %endmacro
   273                              <4> 
   274                              <4> ;.xcref  I_AM
   275                              <4> ;.xcref  I_AM_SIZE
   276                              <4> ;.xcref  I_AM_LEN
   277                              <4> %assign I_AM_SIZE 0
   278                              <4> %assign I_AM_LEN  0
   279                              <4> 
   280                              <4> ;PAGE
   281                              <4> 
   282                              <4> ;
   283                              <4> ; define an entry in a procedure
   284                              <4> ;
   285                              <4> %imacro entry 1-2.nolist
   286                              <4> %1:
   287                              <4> 	PUBLIC  %1
   288                              <4> %endmacro
   289                              <4> ;.xcref  entry
   290                              <4> 
   291                              <4> BREAK <ERROR - store an error code then jump to a label>
   292                              <4> 
   293                              <4> %imacro error 1.nolist
   294                              <4> ;.xcref
   295                              <4> 	MOV AL, %1
   296                              <4> 	transfer    SYS_RET_ERR
   297                              <4> ;.cref
   298                              <4> %endmacro
   299                              <4> ;.xcref  error
   300                              <4> 
   301                              <4> BREAK <JUMP - real jump that links up shortwise>
   302                              <4> ;
   303                              <4> ; given a label <lbl> either 2 byte jump to another label <lbl>_J
   304                              <4> ; if it is near enough or 3 byte jump to <lbl>
   305                              <4> ;
   306                              <4> 
   307                              <4> %imacro jump 1.nolist
   308                              <4> ;.xcref
   309                              <4> 
   310                              <4>     %ifndef %1_J                       ;; is this the first invocation
   311                              <4> %%a:      JMP %1
   312                              <4>     %ELSE
   313                              <4> 	%IF (%1_J >= $) || ($-%1_J > 126)
   314                              <4> %%a:      JMP %1                         ;; is the jump too far away?
   315                              <4> 	%ELSE
   316                              <4> %%a:      JMP %1_J                      ;; do the short one...
   317                              <4> 	%ENDIF
   318                              <4>     %ENDIF
   319                              <4>     %ixdefine %1_j %%a
   320                              <4> ;.cref
   321                              <4> %endmacro
   322                              <4> ;.xcref  jump
   323                              <4> 
   324                              <4> BREAK <RETURN - return from a function>
   325                              <4> 
   326                              <4> %imacro return 0.nolist
   327                              <4> %%a:
   328                              <4> 	RET
   329                              <4> %xdefine ret_l %%a
   330                              <4> %endmacro
   331                              <4> ;.xcref  return
   332                              <4> 
   333                              <4> BREAK <CONDRET - conditional return>
   334                              <4> 
   335                              <4> %imacro condret 2.nolist
   336                              <4> %assign %%exit 0
   337                              <4>     %ifdef   ret_l                       ;; if ret_l is defined
   338                              <4> 	%if (($ - ret_l) <= 126) && ($ > ret_l)
   339                              <4> 					;;     if ret_l is near enough then
   340                              <4> 	    %%a:  j%1    ret_l           ;;         a: j<CC> to ret_l
   341                              <4> 	    %xdefine ret_%1 %%a                 ;;         define ret_<CC> to be a:
   342                              <4> 	    %assign %%exit 1
   343                              <4> 	%endif
   344                              <4>     %endif
   345                              <4>     %ifn %%exit
   346                              <4>     %ifdef   ret_%1                     ;; if ret_<CC> defined
   347                              <4> 	%if (($ - ret_%1) <= 126) && ($ > ret_%1)
   348                              <4> 					;;     if ret_<CC> is near enough
   349                              <4> 	    %%a:  j%1    ret_%1         ;;         a: j<CC> to ret_<CC>
   350                              <4> 	    %xdefine ret_%1 %%a                 ;;         define ret_<CC> to be a:
   351                              <4> 	    %assign %%exit 1
   352                              <4> 	%endif
   353                              <4>     %endif
   354                              <4>     %endif
   355                              <4>     %ifn %%exit
   356                              <4>     j%2   %%a                           ;; j<NCC> a:
   357                              <4>     return                              ;; return
   358                              <4>     %%a:                                  ;; a:
   359                              <4>     %xdefine ret_%1 ret_l                     ;; define ret_<CC> to be ret_l
   360                              <4>     %endif
   361                              <4> %endmacro
   362                              <4> ;.xcref  condret
   363                              <4> 
   364                              <4> BREAK <RETZ - return if zero, links up shortwise if necessary>
   365                              <4> 
   366                              <4> %imacro retz 0.nolist
   367                              <4>     condret z,nz
   368                              <4> %endmacro
   369                              <4> ;.xcref  retz
   370                              <4> 
   371                              <4> BREAK <RETNZ - return if not zero, links up shortwise if necessary>
   372                              <4> 
   373                              <4> %imacro retnz 0.nolist
   374                              <4>     condret nz,z
   375                              <4> %endmacro
   376                              <4> ;.xcref  retnz
   377                              <4> 
   378                              <4> BREAK <RETC - return if carry set, links up shortwise if necessary>
   379                              <4> 
   380                              <4> %imacro retc 0.nolist
   381                              <4>     condret c,nc
   382                              <4> %endmacro
   383                              <4> ;.xcref  retc
   384                              <4> 
   385                              <4> BREAK <RETNC - return if not carry, links up shortwise if necessary>
   386                              <4> 
   387                              <4> %imacro retnc 0.nolist
   388                              <4>     condret nc,c
   389                              <4> %endmacro
   390                              <4> ;.xcref  retnc
   391                              <4> 
   392                              <4> BREAK <CONTEXT - set the DOS context to a particular register>
   393                              <4> 
   394                              <4> %imacro context 1.nolist
   395                              <4> 	PUSH    SS
   396                              <4> 	stripangles POP, %1
   397                              <4> 	; ASSUME  %1:DOSGROUP
   398                              <4> %endmacro
   399                              <4> ;.xcref  context
   400                              <4> 
   401                              <4> BREAK <SaveReg - save a set of registers>
   402                              <4> 
   403                              <4> %imacro SaveReg 0-*.nolist                 ;; push those registers
   404                              <4>  %rep %0
   405                              <4> 	%assign ?stackdepth ?stackdepth + 1
   406                              <4> 	stripangles push, %1
   407                              <4> 	%rotate 1
   408                              <4>  %endrep
   409                              <4> %endmacro
   410                              <4> ;.xcref  SaveReg
   411                              <4> 
   412                              <4> BREAK <RestoreReg - unsave some registers>
   413                              <4> 
   414                              <4> %imacro RestoreReg 0-*.nolist             ;; pop those registers
   415                              <4>  %rep %0
   416                              <4> 	%assign ?stackdepth ?stackdepth - 1
   417                              <4> 	stripangles pop, %1
   418                              <4> 	%rotate 1
   419                              <4>  %endrep
   420                              <4> %endmacro
   421                              <4> ;.xcref  RestoreReg
   422                              <4> 
   423                              <4> BREAK <Critical section macros>
   424                              <4> 
   425                              <4> %imacro EnterCrit 1.nolist
   426                              <4> 	Invoke  E%1
   427                              <4> %endmacro
   428                              <4> 
   429                              <4> %imacro LeaveCrit 1.nolist
   430                              <4> 	Invoke  L%1
   431                              <4> %endmacro
   432                              <4> 
   433                              <4> Break   <message - display a message>
   434                              <4> 
   435                              <4> ;AsmVars <ShareF,Cargs,Redirector>
   436                              <4> %ifndef ShareF
   437                              <4>  %idefine ShareF 0
   438                              <4> %endif
   439                              <4> %ifndef Cargs
   440                              <4>  %idefine Cargs 0
   441                              <4> %endif
   442                              <4> %ifndef Redirector
   443                              <4>  %idefine Redirector 0
   444                              <4> %endif
   445                              <4> %ifndef debug
   446                              <4>  %idefine debug 0
   447                              <4> %endif
   448                              <4> 
   449                              <4> %if debug
   450                              <4> %imacro fmt 3-*.nolist
   451                              <4> ;fmt     MACRO   typ,lev,fmts,args
   452                              <4> ;local   a,b,c
   453                              <4> 	PUSHF
   454                              <4> %IFNempty %1
   455                              <4> 	TEST    word [BugTyp],%1
   456                              <4> 	JZ      %%c
   457                              <4> 	CMP     word [BugLev],%2
   458                              <4> 	JB      %%c
   459                              <4> %ENDIF
   460                              <4> 	PUSH    AX
   461                              <4> 	PUSH    BP
   462                              <4> 	MOV     BP,SP
   463                              <4> %If (! sharef) && (! redirector)
   464                              <4> 	[section Table]
   465                              <4> %%a:       db      %3,0
   466                              <4> 	__SECT__
   467                              <4> 	MOV     AX,OFFSET %%a wrt DOSGROUP
   468                              <4> %else
   469                              <4> 	jmp     short %%b
   470                              <4> %%a:       db      %3,0
   471                              <4> %if sharef
   472                              <4> %%b:      mov     ax,offset %%a wrt share
   473                              <4> %else
   474                              <4> %%b:      mov     ax,offset %%a wrt netwrk
   475                              <4> %endif
   476                              <4> %endif
   477                              <4> 	PUSH    AX
   478                              <4> %iassign cargs 2
   479                              <4> %rotate 3
   480                              <4> %rep %0 - 3
   481                              <4>  %ifidni ax, %1
   482                              <4> 	MOV     AX,[BP+2]
   483                              <4>  %ELSE
   484                              <4> 	MOV     AX, %1
   485                              <4>  %ENDIF
   486                              <4> 	PUSH    AX
   487                              <4>  %iassign cargs cargs + 2
   488                              <4>  %rotate 1
   489                              <4> %endrep
   490                              <4> 	invoke  PFMT
   491                              <4> 	ADD     SP, Cargs
   492                              <4> 	POP     BP
   493                              <4> 	POP     AX
   494                              <4> %%c:
   495                              <4> 	POPF
   496                              <4> %endmacro
   497                              <4> %else
   498                              <4> %imacro fmt 3-*.nolist
   499                              <4> %endmacro
   500                              <4> %endif
   501                              <4> 
   502                              <4> Break   <DOSAssume - validate assumes>
   503                              <4> 
   504                              <4> ;AsmVar  Debug,$temp
   505                              <4> 
   506                              <4> %imacro detectstripangles 4.nolist
   507                              <4> %defstr %%param %4
   508                              <4> %assign ?%2 0
   509                              <4> %assign ?%3 0
   510                              <4> %rep 16
   511                              <4>  %substr %%opening %%param 1
   512                              <4>  %ifidn %%opening, '<'
   513                              <4>   %substr %%param %%param 2,-1
   514                              <4>   %assign ?%2 ?%2 + 1
   515                              <4>  %endif
   516                              <4> %endrep
   517                              <4> %rep 16
   518                              <4>  %strlen %%length %%param
   519                              <4>  %substr %%closing %%param %%length
   520                              <4>  %ifidn %%closing, '>'
   521                              <4>   %substr %%param %%param 1,-2
   522                              <4>   %assign ?%3 ?%3 + 1
   523                              <4>  %endif
   524                              <4> %endrep
   525                              <4> %deftok %%token %%param
   526                              <4> %define ?%1 %%token
   527                              <4> %endmacro
   528                              <4> 
   529                              <4> 
   530                              <4> %IF debug
   531                              <4> %imacro DOSAssume 3-*.nolist
   532                              <4> ;DOSAssume   Macro   reg,reglist,message
   533                              <4>  %ifidni %1, CS
   534                              <4>   %assign %%temp 1
   535                              <4>  %else
   536                              <4>   %ifidni %1, SS
   537                              <4>    %assign %%temp 0
   538                              <4>   %else
   539                              <4>    %error ***** Invalid DOS register %1 in DOSAssume *****
   540                              <4>   %endif
   541                              <4>  %endif
   542                              <4>  %rotate 1
   543                              <4>  %assign %%level 0
   544                              <4>  %assign %%amount %0 - 1
   545                              <4>  %rep 16
   546                              <4>   detectstripangles %%token, %%opening, %%closing, %1
   547                              <4>   %assign %%level %%level + ? %+ %%opening
   548                              <4>   %assign %%level %%level - ? %+ %%closing
   549                              <4>   %ifidni ? %+ %%token, DS
   550                              <4>    %assign %%temp %%temp | 2
   551                              <4>   %else
   552                              <4>    %ifidni ? %+ %%token, ES
   553                              <4>     %assign %%temp %%temp | 4
   554                              <4>    %else
   555                              <4>     %error ***** Invalid register reg in DOSAssume *****
   556                              <4>    %endif
   557                              <4>   %endif
   558                              <4>   %assign %%amount %%amount - 1
   559                              <4>   %rotate 1
   560                              <4>   %if %%level <= 0
   561                              <4>    %exitrep
   562                              <4>   %endif
   563                              <4>  %endrep
   564                              <4> 
   565                              <4> 	PUSH    AX
   566                              <4> 	MOV     AX, %%temp
   567                              <4> 	PUSH    AX
   568                              <4> %IF SHAREF
   569                              <4> 	MOV     AX,OFFSET %%a
   570                              <4> %ELSE
   571                              <4> 	MOV     AX,OFFSET %%a wrt DOSGroup
   572                              <4> %ENDIF
   573                              <4> 	PUSH    AX
   574                              <4> 	Invoke  SegCheck
   575                              <4> 	POP     AX
   576                              <4> %IFN SHAREF
   577                              <4> 	[section Table]
   578                              <4> %ELSE
   579                              <4> 	JMP     SHORT %%b
   580                              <4> %ENDIF
   581                              <4> %%a:
   582                              <4>  %rep %%amount
   583                              <4>         DB      %1
   584                              <4>   %rotate 1
   585                              <4>  %endrep
   586                              <4> 	db 0
   587                              <4> %IFN SHAREF
   588                              <4> 	__SECT__
   589                              <4> %ELSE
   590                              <4> %%b:
   591                              <4> %ENDIF
   592                              <4> ;IRP r,<reglist>
   593                              <4> ;    ASSUME  r:DOSGroup
   594                              <4> ;ENDM
   595                              <4> %endmacro
   596                              <4> %ELSE
   597                              <4> %imacro DOSAssume 3-*.nolist
   598                              <4> ;DOSAssume   Macro   reg,reglist,message
   599                              <4> ;IRP r,<reglist>
   600                              <4> ;    ASSUME  r:DOSGroup
   601                              <4> ;ENDM
   602                              <4> %endmacro
   603                              <4> %ENDIF
   604                              <4> 
   605                              <4> BREAK   <ASSERT - make assertions about registers>
   606                              <4> 
   607                              <4> %if 0
   608                              <4> ;IF DEBUG
   609                              <4> Assert  MACRO   kind, objs, message
   610                              <4> 	LOCAL   a,b
   611                              <4>     IFIDN   <kind>,<Z>
   612                              <4> 	CMP     objs,0
   613                              <4> 	JZ      a
   614                              <4> 	fmt <>,<>,<message>
   615                              <4> a:
   616                              <4>     ELSE
   617                              <4> 	IFIDN   <kind>,<NZ>
   618                              <4> 	CMP     objs,0
   619                              <4> 	JNZ     a
   620                              <4> 	fmt <>,<>,<message>
   621                              <4> a:
   622                              <4> 	ELSE
   623                              <4>     PUSH    AX
   624                              <4> 	    IRP obj,<objs>
   625                              <4> 	PUSH    obj
   626                              <4> 	    ENDM
   627                              <4> 	    IF SHAREF
   628                              <4>     MOV     AX,OFFSET b
   629                              <4> 	    ELSE
   630                              <4>     MOV     AX,OFFSET DOSGroup:b
   631                              <4> 	    ENDIF
   632                              <4>     PUSH    AX
   633                              <4> 	    IFIDN   <kind>,<ISBUF>
   634                              <4> 	Invoke  BUFCheck
   635                              <4> 	    ENDIF
   636                              <4> 	    IFIDN   <kind>,<ISSFT>
   637                              <4> 	Invoke  SFTCheck
   638                              <4> 	    ENDIF
   639                              <4> 	    IFIDN   <kind>,<ISDPB>
   640                              <4> 	Invoke  DPBCheck
   641                              <4> 	    ENDIF
   642                              <4>     POP     AX
   643                              <4> 	    IF SHAREF
   644                              <4>     JMP SHORT a
   645                              <4> b   DB  Message,0
   646                              <4> a:
   647                              <4> 	    ELSE
   648                              <4> Table   segment
   649                              <4> b   db  Message,0
   650                              <4> Table   ends
   651                              <4> 	    ENDIF
   652                              <4> 	ENDIF
   653                              <4>     ENDIF
   654                              <4> ENDM
   655                              <4> %ELSE
   656                              <4> %imacro Assert 0-*.nolist
   657                              <4> %endmacro
   658                              <4> %ENDIF
   659                              <4> 
   660                              <4> %ifndef Installed
   661                              <4>  %idefine Installed 1
   662                              <4> %endif
   663                              <4> 
   664                              <4> Break   <CallInstall - hook to installable pieces>
   665                              <4> 
   666                              <4> %imacro CallInstall 3-*.nolist
   667                              <4> ;CallInstall MACRO   name,mpx,fn,save,restore
   668                              <4> %define %%name %1
   669                              <4> %assign %%mpx %2
   670                              <4> %assign %%fn %3
   671                              <4> %IF Installed
   672                              <4>  %rotate 3
   673                              <4>  %assign %%level 0
   674                              <4>  %assign %%amountsaved 0
   675                              <4>  %rep %0 - 3
   676                              <4>   %ifnempty %1
   677                              <4>    detectstripangles %%token, %%opening, %%closing, %1
   678                              <4>    %assign %%level %%level + ? %+ %%opening
   679                              <4>    %assign %%level %%level - ? %+ %%closing
   680                              <4>    SaveReg ? %+ %%token
   681                              <4>   %endif
   682                              <4>   %assign %%amountsaved %%amountsaved + 1
   683                              <4>   %rotate 1
   684                              <4>   %if %%level <= 0
   685                              <4>    %exitrep
   686                              <4>   %endif
   687                              <4>  %endrep
   688                              <4> 	MOV     AX,(%%mpx << 8) + %%fn
   689                              <4> 	INT     2Fh
   690                              <4>  %assign %%level 0
   691                              <4>  %assign %%amountrestored 0
   692                              <4>  %rep %0 - 3 - %%amountsaved
   693                              <4>   %ifnempty %1
   694                              <4>    detectstripangles %%token, %%opening, %%closing, %1
   695                              <4>    %assign %%level %%level + ? %+ %%opening
   696                              <4>    %assign %%level %%level - ? %+ %%closing
   697                              <4>    RestoreReg ? %+ %%token
   698                              <4>   %endif
   699                              <4>   %assign %%amountrestored %%amountrestored + 1
   700                              <4>   %rotate 1
   701                              <4>   %if %%level <= 0
   702                              <4>    %exitrep
   703                              <4>   %endif
   704                              <4>  %endrep
   705                              <4>  %if %%level > 0 || %0 != 3 + %%amountsaved + %%amountrestored
   706                              <4>   %error Wrong amount saved or restored
   707                              <4>  %endif
   708                              <4> %ELSE
   709                              <4> 	Invoke  %%name
   710                              <4> %ENDIF
   711                              <4> %endmacro
   712                              <4> 
   713                              <4> Break   <Stack frame manipulators>
   714                              <4> 
   715                              <4> %imacro localvar 2.nolist
   716                              <4> %ifidni %2, BYTE
   717                              <4>  %assign ?frame ?frame + 1
   718                              <4>  %assign %%a ?frame
   719                              <4>  labelsize %1, byte, bp - %%a
   720                              <4> %else
   721                              <4>  %ifidni %2, WORD
   722                              <4>   %assign ?frame ?frame + 2
   723                              <4>   %assign %%a ?frame
   724                              <4>   labelsize %1, word, bp - %%a
   725                              <4>  %else
   726                              <4>   %ifidni %2, DWORD
   727                              <4>    %assign ?frame ?frame + 4
   728                              <4>    %assign %%a ?frame
   729                              <4>    labelsize %1 %+ l, word, bp - %%a
   730                              <4>    labelsize %1 %+ h, word, bp - %%a + 2
   731                              <4>    labelsize %1, dword, bp - %%a
   732                              <4>   %else
   733                              <4>    %assign ?frame ?frame + %2
   734                              <4>    %assign %%a ?frame
   735                              <4>    labelsize %1, byte, bp - %%a
   736                              <4>   %endif
   737                              <4>  %endif
   738                              <4> %endif
   739                              <4> %endmacro
   740                              <4> 
   741                              <4> %imacro enter 0.nolist
   742                              <4> 	push    bp
   743                              <4> 	mov     bp,sp
   744                              <4> 	sub     sp,?frame
   745                              <4> %endmacro
   746                              <4> 
   747                              <4> %imacro leave 0.nolist
   748                              <4> 	mov     sp,bp
   749                              <4> 	pop     bp
   750                              <4> %endmacro
   751                              <4> 
   752                              <4> 
   753                              <4> %imacro argvar 2.nolist
   754                              <4> %ifidni %2, BYTE
   755                              <4>  %assign %%a ?aframe
   756                              <4>  %assign ?aframe ?aframe + 1
   757                              <4>  labelsize %1, byte, bp + %%a
   758                              <4> %else
   759                              <4>  %ifidni %2, WORD
   760                              <4>   %assign %%a ?aframe
   761                              <4>   %assign ?aframe ?aframe + 2
   762                              <4>   labelsize %1, word, bp + %%a
   763                              <4>  %else
   764                              <4>   %ifidni %2, DWORD
   765                              <4>    %assign %%a ?aframe
   766                              <4>    %assign ?aframe ?aframe + 4
   767                              <4>    labelsize %1 %+ l, word, bp + %%a
   768                              <4>    labelsize %1 %+ h, word, bp + %%a + 2
   769                              <4>    labelsize %1, dword, bp + %%a
   770                              <4>   %else
   771                              <4>    %assign %%a ?aframe
   772                              <4>    %assign ?aframe ?aframe + %2
   773                              <4>    labelsize %1, byte, bp + %%a
   774                              <4>   %endif
   775                              <4>  %endif
   776                              <4> %endif
   777                              <4> %endmacro
   778                              <4> 
   779                              <4> BREAK   <errnz - generate compilation errors>
   780                              <4> 
   781                              <4> %imacro errnz 1.nolist
   782                              <4> detectstripangles %%token, %%opening, %%closing, %1
   783                              <4> %if ? %+ %%token
   784                              <4>     %error %1 <> 0
   785                              <4> %endif
   786                              <4> %endmacro
   787                              <4> 
   788                              <4> %endif
    38                              <3> 
    39                              <3> %include "versiona.mac"
     1                              <4> 
     2                              <4> major_version	    equ     4	    ;Major DOS version
     3                              <4> minor_version	    equ     00	    ;Minor DOS Version
     4                              <4> 
     5                              <4> MINOR_VERSION equ minor_version	; NASM port equate
     6                              <4> MAJOR_VERSION equ major_version	; NASM port equate
     7                              <4> expected_version    equ     (MINOR_VERSION << 8)+MAJOR_VERSION
     8                              <4> 
     9                              <4> alt_major_version    equ     5	    ;Major DOS version
    10                              <4> alt_minor_version    equ     26	    ;Minor DOS Version
    11                              <4> 
    12                              <4> alt_expected_version    equ     (alt_minor_version << 8) + alt_major_version
    13                              <4> 
    14                              <4> new_major_version    equ     5	    ;Major DOS version
    15                              <4> new_minor_version    equ     38	    ;Minor DOS Version
    16                              <4> new_expected_version    equ     (new_minor_version << 8) + new_major_version
    17                              <4> 
    18                              <4>        %warning out: ... for DOS Version 4.00 ...
    18          ******************  <4>  warning: out: ... for DOS Version 4.00 ... [-w+user]
    19                              <4> 
    20                              <4>        ;******************************
    21                              <4>        ;Each assembler program should:
    22                              <4>        ;  mov ah,030h			;DOS Get Version function
    23                              <4>        ;  int 021h			;Version ret. in AX,minor version first
    24                              <4>        ;  cmp ax,expected_version	;ALL utilities should check for an
    25                              <4>        ;  jne error_handler		; EXACT version match.
    26                              <4>        ;******************************
    27                              <4> 
    40                              <3> 
    41                              <3> BREAK <Control character definitions>
    42                              <3> 
    43                              <3> c_DEL	    EQU     7Fh 		;    ASCII rubout or delete previous char
    44                              <3> c_BS	    EQU     08h 		; ^H ASCII backspace
    45                              <3> c_CR	    EQU     0Dh 		; ^M ASCII carriage return
    46                              <3> c_LF	    EQU     0Ah 		; ^J ASCII linefeed
    47                              <3> c_ETB	    EQU     17h 		; ^W ASCII end of transmission
    48                              <3> c_NAK	    EQU     15h 		; ^U ASCII negative acknowledge
    49                              <3> c_ETX	    EQU     03h 		; ^C ASCII end of text
    50                              <3> c_HT	    EQU     09h 		; ^I ASCII tab
    51                              <3> 
    52                              <3> BREAK <Read This and Weep>
    53                              <3> 
    54                              <3> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    55                              <3> ;									   ;
    56                              <3> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    57                              <3> ;									   ;
    58                              <3> ; Certain structures, constants and system  calls  below  are  private	to ;
    59                              <3> ; the DOS  and	are  extremely	version-dependent.  They may change at any ;
    60                              <3> ; time at  the	implementors'  whim.   As  a  result,  they  must  not  be ;
    61                              <3> ; documented to  the  general  public.	 If  an  extreme case arises, they ;
    62                              <3> ; must be documented with this warning. 				   ;
    63                              <3> ;									   ;
    64                              <3> ; Those structures and constants that are subject to  the  above  will	be ;
    65                              <3> ; marked and bracketed with the flag:					   ;
    66                              <3> ;									   ;
    67                              <3> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    68                              <3> ;									   ;
    69                              <3> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    70                              <3> 
    71                              <3> %include "bpb.mac"
     1                              <4> 	%warning out: BPB.INC...
     1          ******************  <4>  warning: out: BPB.INC... [-w+user]
     2                              <4> ;	SCCSID = @(#)BPB.ASM	1.1 85/04/29
     3                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     4                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     5                              <4> ;									   ;
     6                              <4> 
     7                              <4> ; BIOS PARAMETER BLOCK DEFINITION
     8                              <4> ; THIS STRUCTURE IS USED TO BUILD A FULL DPB
     9                              <4> 
    10                              <4> BPBLOCK STRUC
    11 00000000 ????                <4> BPSECSZ DW	?			; SIZE IN BYTES OF PHYSICAL SECTOR
    12 00000002 ??                  <4> BPCLUS	DB	?			; SECTORS/ALLOC UNIT
    13 00000003 ????                <4> BPRES	DW	?			; NUMBER OF RESERVED SECTORS
    14 00000005 ??                  <4> BPFTCNT DB	?			; NUMBER OF FATS
    15 00000006 ????                <4> BPDRCNT DW	?			; NUMBER OF DIRECTORY ENTRIES
    16 00000008 ????                <4> BPSCCNT DW	?			; TOTAL NUMBER OF SECTORS
    17 0000000A ??                  <4> BPMEDIA DB	?			; MEDIA DESCRIPTOR BYTE
    18 0000000B ????                <4> BPFTSEC DW	?			; NUMBER OF SECTORS TAKEN UP BY ONE FAT
    19                              <4> BPBLOCK ENDS
    20                              <4> 
    21                              <4> A_BPB			STRUC
    22 00000000 ????                <4> BPB_BYTESPERSECTOR	DW	?
    23 00000002 ??                  <4> BPB_SECTORSPERCLUSTER	DB	?
    24 00000003 ????                <4> BPB_RESERVEDSECTORS	DW	?
    25 00000005 ??                  <4> BPB_NUMBEROFFATS	DB	?
    26 00000006 ????                <4> BPB_ROOTENTRIES 	DW	?
    27 00000008 ????                <4> BPB_TOTALSECTORS	DW	?
    28 0000000A ??                  <4> BPB_MEDIADESCRIPTOR	DB	?
    29 0000000B ????                <4> BPB_SECTORSPERFAT	DW	?
    30 0000000D ????                <4> BPB_SECTORSPERTRACK	DW	?
    31 0000000F ????                <4> BPB_HEADS		DW	?
    32 00000011 ????                <4> BPB_HIDDENSECTORS	DW	?
    33 00000013 ????                <4> 			DW	?
    34 00000015 ????                <4> BPB_BIGTOTALSECTORS	DW	?
    35 00000017 ????                <4> 			DW	?
    36 00000019 ????????????        <4> 			DB	6 DUP(?)
    37                              <4> A_BPB			ENDS
    38                              <4> ;									   ;
    39                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    40                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    72                              <3> 
    73                              <3> %include "buffer.mac"
     1                              <4> %include "buf2sw.mac"
     1                              <5> %define BUF2 1
     2                              <4> 
     3                              <4> ;	SCCSID = @(#)buffer.asm 1.1 85/04/09
     4                              <4> BREAK <Disk I/O Buffer Header>
     5                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     6                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     7                              <4> ;									   ;
     8                              <4> 
     9                              <4> %ifdef BUF2
    10                              <4> 
    11                              <4> ; Field definition for I/O buffer information
    12                              <4> 
    13                              <4> BUFFINFO        STRUC
    14 00000000 ????????            <4> NEXTBUF         DD      ?       ; Pointer to next buffer in list
    15                              <4> ; The next two items are often refed as a word
    16                              <4> buf_ID:
    17 00000004 ??                  <4> BUFDRV          DB      ?       ; Logical drive # assoc with buffer FF = free
    18                              <4> buf_flags:
    19 00000005 ??                  <4> BUFDATAFLAG	db	?
    20 00000006 ??                  <4> BUFPRI          DB      ?       ; Buffer selection priority (see EQUs below)
    21 00000007 ??                  <4> 	alignb 2
    22                              <4> buf_sector:
    23 00000008 ????????            <4> BUFSECNO        dd      ?       ; Sector number of buffer
    24                              <4> 	alignb 2
    25 0000000C ????????            <4> BUFDRVDP        DD      ?       ; Pointer to drive parameters
    26                              <4> BUFFINFO        ENDS
    27                              <4> 
    28                              <4> BUFINSIZ        EQU     BUFFINFO_struc_size
    29                              <4>                                 ; Size of structure in bytes
    30                              <4> BUFINSIZE equ BUFINSIZ
    31                              <4> 
    32                              <4> FREEPRI EQU     0
    33                              <4> LBRPRI  EQU     2               ; Last byte of buffer read
    34                              <4> LBWPRI  EQU     4               ; Last byte written
    35                              <4> RPRI    EQU     6               ; Read but not last byte
    36                              <4> WPRI    EQU     8               ; Written but not last byte
    37                              <4> DIRPRI  EQU     15              ; Directory Sector
    38                              <4> FATPRI  EQU     30              ; FAT sector
    39                              <4> 
    40                              <4> buf_dirty	EQU	01000000B
    41                              <4> buf_isDATA	EQU	00001000B
    42                              <4> buf_isDIR	EQU	00000100B
    43                              <4> buf_isFAT	EQU	00000010B
    44                              <4> buf_type_0	EQU	11110001B	; AND sets type to "none"
    45                              <4> 
    46                              <4> %else
    47                              <4> 
    48                              <4> ; Field definition for I/O buffer information
    49                              <4> 
    50                              <4> BUFFINFO	STRUC
    51                              <4> buf_next	DW	?		; Pointer to next buffer in list
    52                              <4> buf_prev	DW	?		; Pointer to prev buffer in list
    53                              <4> buf_ID		DB	?		; Drive of buffer (bit 7 = 0)
    54                              <4> 					; SFT table index (bit 7 = 1)
    55                              <4> 					; = FFH if buffer free
    56                              <4> buf_flags	DB	?		; Bit 7 = 1 if Remote file buffer
    57                              <4> 					;	= 0 if Local device buffer
    58                              <4> 					; Bit 6 = 1 if buffer dirty
    59                              <4> 					; Bit 5 = Reserved
    60                              <4> 					; Bit 4 = Search bit (bit 7 = 1)
    61                              <4> 					; Bit 3 = 1 if buffer is DATA
    62                              <4> 					; Bit 2 = 1 if buffer is DIR
    63                              <4> 					; Bit 1 = 1 if buffer is FAT
    64                              <4> 					; Bit 0 = Reserved
    65                              <4> buf_sector	DD	?		; Sector number of buffer (bit 7 = 0)
    66                              <4> ; The next two items are often refed as a word (bit 7 = 0)
    67                              <4> buf_wrtcnt	DB	?		; For FAT sectors, # times sector written out
    68                              <4> buf_wrtcntinc	DW	?		; "   "     "   , # sectors between each write
    69                              <4> buf_DPB 	DD	?		; Pointer to drive parameters
    70                              <4> buf_fill	DW	?		; How full buffer is (bit 7 = 1)
    71                              <4> buf_reserved	DB	?		; make DWORD boundary for 386
    72                              <4> BUFFINFO	ENDS
    73                              <4> 
    74                              <4> labelsize buf_offset, dword, buf_sector
    75                              <4> 					;For bit 7 = 1, this is the byte
    76                              <4> 					;offset of the start of the buffer in
    77                              <4> 					;the file pointed to by buf_ID.  Thus
    78                              <4> 					;the buffer starts at location
    79                              <4> 					;buf_offset in the file and contains
    80                              <4> 					;buf_fill bytes.
    81                              <4> 
    82                              <4> BUFINSIZ	EQU	BUFFINFO_struc_size
    83                              <4> 					; Size of structure in bytes
    84                              <4> 
    85                              <4> buf_Free	EQU	0FFh		; buf_id of free buffer
    86                              <4> 
    87                              <4> ;Flag byte masks
    88                              <4> buf_isnet	EQU	10000000B
    89                              <4> buf_dirty	EQU	01000000B
    90                              <4> 
    91                              <4> buf_isDATA	EQU	00001000B
    92                              <4> buf_isDIR	EQU	00000100B
    93                              <4> buf_isFAT	EQU	00000010B
    94                              <4> buf_type_0	EQU	11110001B	; AND sets type to "none"
    95                              <4> 
    96                              <4> buf_NetID	EQU	BUFINSIZ
    97                              <4> 
    98                              <4> ;
    99                              <4> ; Buffer Hash Entry Structure
   100                              <4> 
   101                              <4> BUFFER_HASH_ENTRY	STRUC		; DOS 4.00
   102                              <4> EMS_PAGE_NUM	DW	?		; logical page number for EMS handle
   103                              <4> BUFFER_BUCKET	DD	 ?		; pointer to buffers
   104                              <4> DIRTY_COUNT	DB	 ?		; number of dirty buffers
   105                              <4> BUFFER_RESERVED DB	 ?		; reserved
   106                              <4> BUFFER_HASH_ENTRY	ENDS
   107                              <4> 
   108                              <4> MaxBuffinBucket EQU	15		; Max number of buffers per bucket
   109                              <4> MaxBucketinPage EQU	 2		; Max number of buckets per 16kb page
   110                              <4> 
   111                              <4> %endif
   112                              <4> 
   113                              <4> ;									   ;
   114                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   115                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    74                              <3> 
    75                              <3> BREAK <User stack inside of system call and SysVars>
    76                              <3> ; Location of user registers relative user stack pointer
    77                              <3> 
    78                              <3> user_environ	STRUC
    79 00000000 ????                <3> user_AX     DW	    ?
    80 00000002 ????                <3> user_BX     DW	    ?
    81 00000004 ????                <3> user_CX     DW	    ?
    82 00000006 ????                <3> user_DX     DW	    ?
    83 00000008 ????                <3> user_SI     DW	    ?
    84 0000000A ????                <3> user_DI     DW	    ?
    85 0000000C ????                <3> user_BP     DW	    ?
    86 0000000E ????                <3> user_DS     DW	    ?
    87 00000010 ????                <3> user_ES     DW	    ?
    88 00000012 ????                <3> user_IP     DW	    ?
    89 00000014 ????                <3> user_CS     DW	    ?
    90 00000016 ????                <3> user_F	    DW	    ?
    91                              <3> user_environ	ENDS
    92                              <3> 
    93                              <3> %include "sysvar.mac"
     1                              <4> ;	SCCSID = @(#)sysvar.asm 1.1 85/04/10
     2                              <4> %include "version.mac"
     1                              <5> ; Some modules really want TRUE to be 0FFH.  Best to let them have their way.
     2                              <5> 	TRUE	   EQU	   0FFFFh
     3                              <5> 	TRUEBYTE   EQU     0FFh
     4                              <5> 	FALSE	   EQU	   0
     5                              <5> 
     6                              <5> ;
     7                              <5> ; Use the following switches to control cmacros.inc
     8                              <5> ;
     9                              <5> ?PLM       equ       0
    10                              <5> ?WIN       equ       0
    11                              <5> 
    12                              <5> memS       EQU     1			; Small model
    13                              <5> ;
    14                              <5> ; Use the switches below to produce the standard Microsoft version or the IBM
    15                              <5> ; version of the operating system
    16                              <5> ;
    17                              <5> ; The below chart will indicate how to set the switches to build the various
    18                              <5> ; versions
    19                              <5> ;
    20                              <5> ;                     IBMVER          IBMCOPYRIGHT
    21                              <5> ; --------------------------------------------------------
    22                              <5> ;  IBM Version   |     TRUE              TRUE
    23                              <5> ; --------------------------------------------------------
    24                              <5> ;  MS Version    |     FALSE             FALSE
    25                              <5> ; --------------------------------------------------------
    26                              <5> ;  Clone Version |     TRUE              FALSE
    27                              <5> ;
    28                              <5> IBMVER     EQU     TRUE
    29                              <5> IBMCOPYRIGHT EQU   FALSE
    30                              <5> 
    31                              <5> BUFFERFLAG	EQU	~ IBMCOPYRIGHT
    32                              <5> 
    33                              <5> %ifndef	MSVER	
    34                              <5> MSVER      EQU     ~ IBMVER
    35                              <5> %endif
    36                              <5> IBM	   EQU	   IBMVER
    37                              <5> ;
    38                              <5> ;
    39                              <5> 	%IF IBMVER
    40                              <5> 	    %IF IBMCOPYRIGHT
    41                              <5>               %warning out: ... IBM version build switch on ...
    42                              <5> 	    %ELSE
    43                              <5> 	      %warning out: ... CLONE version build switch on ...
    43          ******************  <5>  warning: out: ... CLONE version build switch on ... [-w+user]
    44                              <5> 	    %ENDIF
    45                              <5> 	%ELSE
    46                              <5> 	    %IFN IBMCOPYRIGHT
    47                              <5> 	      %warning out: ... MS version build switch on ...
    48                              <5> 	    %ELSE
    49                              <5> 	      %warning out: !!!!!!!!!  VERSION SWITCHES SET INCORECTLY  !!!!!!!!!
    50                              <5> 	      %warning out: !!!!!!!!! CHECK SETTINGS IN INC\VERSION.INC !!!!!!!!!
    51                              <5> 	    %ENDIF
    52                              <5> 	%ENDIF   
    53                              <5> ;
    54                              <5> ;
    55                              <5> ;***************************************************************************
    56                              <5> ;*          The following switches are for DBCS or SBCS support            *
    57                              <5> ;*                                                                         *
    58                              <5> ;*                     Set INTERNAT EQU TRUE FOR DBCS                      *
    59                              <5> ;*                     Set INTERNAT EQU FALSE FOR SBCS                     *
    60                              <5> ;*                                                                         *
    61                              <5> ;***************************************************************************
    62                              <5> ;
    63                              <5> IBMJAPVER  EQU	   FALSE		;If TRUE set KANJI true also
    64                              <5> 
    65                              <5> ;
    66                              <5> ; Switch INTERNAT for DBCS support
    67                              <5> ;
    68                              <5> INTERNAT   EQU	   FALSE
    69                              <5> ;
    70                              <5> 	%IF INTERNAT
    71                              <5> %ifndef KANJI
    72                              <5> KANJI	   EQU	   TRUE
    73                              <5> %endif
    74                              <5> IBMJAPAN   EQU	   TRUE
    75                              <5> 	%ELSE
    76                              <5> %ifndef KANJI
    77                              <5> KANJI	   EQU	   FALSE
    78                              <5> %endif
    79                              <5> IBMJAPAN   EQU	   FALSE
    80                              <5> 	%ENDIF
    81                              <5> 
    82                              <5> %ifndef altvect				; avoid jerking off vector.inc
    83                              <5> ALTVECT    EQU	   FALSE		;Switch to build ALTVECT version
    84                              <5> %endif
    85                              <5> 
    86                              <5> ;
    87                              <5> ; Country code switches
    88                              <5> ; The default contry code is assumed as USA.
    89                              <5> ;
    90                              <5> 	%IF INTERNAT
    91                              <5>  KOREA	   EQU	   TRUE
    92                              <5>  JAPAN	   EQU	   FALSE
    93                              <5> 	%ELSE
    94                              <5>  KOREA	   EQU	   FALSE
    95                              <5>  JAPAN	   EQU	   FALSE
    96                              <5> 	%ENDIF
    97                              <5> ;
    98                              <5> 		%IF INTERNAT
    99                              <5> %warning out: Internat(ECS) version build switch on
   100                              <5> 		%ENDIF
     3                              <4> 
     4                              <4> SysInitVars STRUC
     5 00000000 ????????            <4> SYSI_DPB	    DD	    ?		; DPB chain
     6 00000004 ????????            <4> SYSI_SFT	    DD	    ?		; SFT chain
     7 00000008 ????????            <4> SYSI_CLOCK	    DD	    ?		; CLOCK device
     8 0000000C ????????            <4> SYSI_CON	    DD	    ?		; CON device
     9 00000010 ????                <4> SYSI_MAXSEC	    DW	    ?		; maximum sector size
    10 00000012 ????????            <4> SYSI_BUF	    DD	    ?		; points to Hashinitvar
    11 00000016 ????????            <4> SYSI_CDS	    DD	    ?		; CDS list
    12 0000001A ????????            <4> SYSI_FCB	    DD	    ?		; FCB chain
    13 0000001E ????                <4> SYSI_Keep	    DW	    ?		; keep count
    14 00000020 ??                  <4> SYSI_NUMIO	    DB	    ?		; Number of block devices
    15 00000021 ??                  <4> SYSI_NCDS	    DB	    ?		; number of CDS's
    16 00000022 ????????            <4> SYSI_DEV	    DD	    ?		; device list
    17 00000026 ????                <4> SYSI_ATTR	    DW	    ?		; null device attribute word
    18 00000028 ????                <4> SYSI_STRAT	    DW	    ?		; null device strategy entry point
    19 0000002A ????                <4> SYSI_INTER	    DW	    ?		; null device interrupt entry point
    20 0000002C ????????????????    <4> SYSI_NAME	    DB	 8 DUP(?)	; null device name
    21 00000034 ??                  <4> SYSI_SPLICE	    DB	    ?		; TRUE -> splicees being done
    22 00000035 ????                <4> SYSI_IBMDOS_SIZE    DW	    ?		; DOS size in paragraphs
    23 00000037 ????????            <4> SYSI_IFS_DOSCALL@   DD	    ?		; IFS DOS service rountine entry
    24 0000003B ????????            <4> SYSI_IFS	    DD	    ?		; IFS header chain
    25 0000003F ????????            <4> SYSI_BUFFERS	    DW	    ?,? 	; BUFFERS= values (m,n)
    26 00000043 ??                  <4> SYSI_BOOT_DRIVE     DB	    ?		; boot drive A=1 B=2,..
    27 00000044 ??                  <4> SYSI_DWMOVE	    DB	    ?		; 1 if 386 machine
    28 00000045 ????                <4> SYSI_EXT_MEM	    DW	    ?		; Extended memory size in KB.
    29                              <4> SysInitVars ENDS
    30                              <4> 
    31                              <4> ;This is added for more information exchage between DOS, BIOS.
    32                              <4> ;DOS will give the pointer to SysInitTable in ES:DI. - J.K. 5/29/86
    33                              <4> SysInitVars_Ext struc
    34 00000000 ????????            <4> SYSI_InitVars		DD	?	; Points to the above structure.
    35 00000004 ????????            <4> SYSI_Country_Tab	DD	?	; DOS_Country_cdpg_info
    36                              <4> SysInitVars_Ext ends
    37                              <4> 
    38                              <4> ;The SYSI_BUF of SysInitVars points to the follwong structure
    39                              <4> EMS_MAP_BUFF_SIZE      EQU	12	; EMS map buffer size
    40                              <4> 
    41                              <4> Buffinfo    STRUC
    42 00000000 ????????            <4> Hash_ptr	 DD	 ?		     ; pointer to Hash table
    43 00000004 ????                <4> Hash_count	 DW	 ?		     ; number of Hash entries
    44 00000006 ????????            <4> Cache_ptr	 DD	 ?		     ; pointer to secondary cache
    45 0000000A ????                <4> Cache_count	 DW	 ?		     ; number of secondary cache entries
    46                              <4> 
    47                              <4> %IF	BUFFERFLAG
    48                              <4> 
    49 0000000C ??                  <4> EMS_SAFE_FLAG	DB	?
    50 0000000D ????????            <4> EMS_LAST_PAGE	DW	?, ?
    51 00000011 ????????            <4> EMS_FIRST_PAGE	DW	?, ?
    52 00000015 ????                <4> EMS_NPA640	DW	?
    53                              <4> 
    54                              <4> %ENDIF
    55                              <4> 
    56 00000017 ??                  <4> EMS_mode	 DB	 ?		     ; no EMS = -1
    57 00000018 ????                <4> EMS_handle	 DW	 ?		     ; EMS handle for buffers
    58 0000001A ????                <4> EMS_PageFrame_Number	DW   ?		     ; EMS page frame number
    59 0000001C ????                <4> EMS_Seg_Cnt	 DW	 ?		     ; EMS segment count
    60 0000001E ????                <4> EMS_Page_Frame	 DW	 ?		     ; EMS page frame segment address
    61 00000020 ????                <4> EMS_reserved	 DW	 ?		     ; EMS segment count
    62                              <4> 
    63                              <4> %IF	BUFFERFLAG
    64 00000022 ??                  <4> EMS_Map_Buff	 DB	 ?  ; map buffer
    65                              <4> %ELSE
    66                              <4> EMS_Map_Buff	DB	12 dup(?)
    67                              <4> %ENDIF
    68                              <4> 
    69                              <4> Buffinfo    ENDS
    70                              <4> 
    71                              <4> 
    72                              <4> 
    73                              <4> 
    74                              <4> 
    75                              <4> 
    76                              <4> 
    77                              <4> 
    94                              <3> 
    95                              <3> %include "vector.mac"
     1                              <4> ;	SCCSID = @(#)vector.asm	1.1 85/04/10
     2                              <4> BREAK <interrupt definitions>
     3                              <4> 
     4                              <4> ;Asmvar	AltVect
     5                              <4> %ifndef AltVect
     6                              <4>  %iassign AltVect 0
     7                              <4> %endif
     8                              <4> 
     9                              <4> INTTAB		EQU	20H
    10                              <4> inttab equ INTTAB	; NASM port equate
    11                              <4> INTBASE 	EQU	4 * inttab
    12                              <4> ENTRYPOINT	EQU	INTBASE+40H
    13                              <4> 
    14                              <4> 	%IF	ALTVECT
    15                              <4> ALTTAB	EQU	0F0H
    16                              <4> ALTBASE EQU	4 * ALTTAB
    17                              <4> 	%ENDIF
    18                              <4> 
    19                              <4> ;
    20                              <4> ; interrupt assignments
    21                              <4> ;
    22                              <4> 	%IFN ALTVECT
    23                              <4> int_abort	    EQU     INTTAB	; abort process
    24                              <4> int_command	    EQU     int_abort+1 ; call MSDOS
    25                              <4> int_terminate	    EQU     int_abort+2 ; int to terminate address
    26                              <4> int_ctrl_c	    EQU     int_abort+3 ; ^c trapper
    27                              <4> int_fatal_abort     EQU     int_abort+4 ; hard disk error
    28                              <4> int_disk_read	    EQU     int_abort+5 ; logical sector disk read
    29                              <4> int_disk_write	    EQU     int_abort+6 ; logical sector disk write
    30                              <4> int_keep_process    EQU     int_abort+7 ; terminate program and stay
    31                              <4> 					; resident
    32                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    33                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    34                              <4> ;									   ;
    35                              <4> int_spooler	    EQU     int_abort+8 ; spooler call
    36                              <4> int_fastcon	    EQU     int_abort+9 ; fast CON interrupt
    37                              <4> int_IBM 	    EQU     int_abort+10; critical section maintenance
    38                              <4> ;									   ;
    39                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    40                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    41                              <4> 	%ELSE
    42                              <4> int_abort	    EQU     INTTAB	; abort process
    43                              <4> int_command	    EQU     int_abort+1 ; call MSDOS
    44                              <4> int_terminate	    EQU     ALTTAB	; int to terminate address
    45                              <4> int_ctrl_c	    EQU     int_terminate+1 ; ^c trapper
    46                              <4> int_fatal_abort     EQU     int_terminate+2 ; hard disk error
    47                              <4> int_disk_read	    EQU     int_abort+5 ; logical sector disk read
    48                              <4> int_disk_write	    EQU     int_abort+6 ; logical sector disk write
    49                              <4> int_keep_process    EQU     int_abort+7 ; terminate program and stay resident
    50                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    51                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    52                              <4> ;									   ;
    53                              <4> int_spooler	    EQU     int_terminate+3 ; spooler call
    54                              <4> int_fastcon	    EQU     int_abort+9 ; fast CON interrupt
    55                              <4> ;									   ;
    56                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    57                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    58                              <4> 	%ENDIF
    59                              <4> 
    60                              <4> addr_int_abort		EQU    4 * int_abort
    61                              <4> addr_int_command	EQU    4 * int_command
    62                              <4> addr_int_terminate	EQU    4 * int_terminate
    63                              <4> addr_int_ctrl_c 	EQU    4 * int_ctrl_c
    64                              <4> addr_int_fatal_abort	EQU    4 * int_fatal_abort
    65                              <4> addr_int_disk_read	EQU    4 * int_disk_read
    66                              <4> addr_int_disk_write	EQU    4 * int_disk_write
    67                              <4> addr_int_keep_process	EQU    4 * int_keep_process
    68                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    69                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    70                              <4> ;									   ;
    71                              <4> addr_int_spooler	EQU    4 * int_spooler
    72                              <4> addr_int_fastcon	EQU    4 * int_fastcon
    73                              <4> addr_int_IBM		EQU    4 * int_IBM
    74                              <4> ;									   ;
    75                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    76                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    96                              <3> 
    97                              <3> %include "mult.mac"
     1                              <4> ;	SCCSID = @(#)mult.asm	1.2 85/04/12
     2                              <4> Break <Critical section and Multiplex channels>
     3                              <4> 
     4                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <4> ;									   ;
     7                              <4> ; Critical section definitions
     8                              <4> ;
     9                              <4> ; These below are subject to leave-all sections
    10                              <4> critDisk    EQU     1			; Disk I/O critical section
    11                              <4> critDevice  EQU     2			; Device I/O critical section
    12                              <4> critShare   EQU     1			; Sharer I/O critical section
    13                              <4> critMem     EQU     1			; memory maintenance critical section
    14                              <4> critNet     EQU     5			; network critical section
    15                              <4> critSFT     EQU     1			; sft table allocation
    16                              <4> critIFS     EQU     6			; ifsfunc critical section
    17                              <4> ; These below are not subject to leave-all sections
    18                              <4> critASSIGN  EQU     8			; Assign has munged a system call
    19                              <4> ;									   ;
    20                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    21                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    22                              <4> 
    23                              <4> ;
    24                              <4> ; The current set of defined multiplex channels is (* means documented):
    25                              <4> ;
    26                              <4> ;   Channel(h)	Issuer		Receiver    Function
    27                              <4> ;      00	server		PSPRINT     print job control
    28                              <4> ;     *01	print/apps	PRINT	    Queueing of files
    29                              <4> ;      02	BIOS		REDIR	    signal open/close of printers
    30                              <4> ;
    31                              <4> ;      05	command 	REDIR	    obtain text of net int 24 message
    32                              <4> ;     *06	server/assign	ASSIGN	    Install check
    33                              <4> ;
    34                              <4> ;      08	external driver IBMBIO	    interface to internal routines
    35                              <4> ;
    36                              <4> ;      10	sharer/server	Sharer	    install check
    37                              <4> ;      11	DOS/server	Redir	    install check/redirection funcs
    38                              <4> ;      12	sharer/redir	DOS	    dos functions and structure maint
    39                              <4> ;      13	MSNET		MSNET	    movement of NCBs
    40                              <4> ;      13	external driver IBMBIO	    Reset_Int_13, allows installation
    41                              <4> ;					    of alternative INT_13 drivers after
    42                              <4> ;					    boot_up
    43                              <4> ;      14 (IBM) DOS		NLSFUNC     down load NLS country info,DOS 3.3
    44                              <4> ;      14 (MS)	APPS		POPUP	    MSDOS 4 popup screen functions
    45                              <4> ;      15	APPS		MSCDEX	    CD-ROM extensions interface
    46                              <4> ;      16	WIN386		WIN386	    Windows communications
    47                              <4> ;      17	Clipboard	WINDOWS     Clipboard interface
    48                              <4> ;     *18	Applications	MS-Manger   Toggle interface to manager
    49                              <4> ;      19	Shell
    50                              <4> ;      1A	Ansi.sys
    51                              <4> ;      1B	Fastopen,Vdisk	 IBMBIO     EMS INT 67H stub handler
    52                              <4> ;
    53                              <4> ;      AC	Graphics
    54                              <4> ;      AD	NLS (toronto)
    55                              <4> ;      AE
    56                              <4> ;      AF	Mode
    57                              <4> ;      B0	GRAFTABL	GRAFTABL
    58                              <4> ;
    59                              <4> 
    60                              <4> 
    61                              <4> ;MUX 00-3F reserverd for IBM
    62                              <4> ;MUX 80-BF reserverd for IBM
    63                              <4> ;MUX 40-7F reserved for Microsoft
    64                              <4> ;MUX C0-FF users
    65                              <4> 
    66                              <4> 
    67                              <4> 
    68                              <4> MultSHARE   EQU     10h 		; sharer
    69                              <4>     ;	1   MFT_enter
    70                              <4>     ;	2   MFTClose
    71                              <4>     ;	3   MFTclU
    72                              <4>     ;	4   MFTCloseP
    73                              <4>     ;	5   MFTCloN
    74                              <4>     ;	6   set_block
    75                              <4>     ;	7   clr_block
    76                              <4>     ;	8   chk_block
    77                              <4>     ;	9   MFT_get
    78                              <4>     ;	10  ShSave
    79                              <4>     ;	11  ShChk
    80                              <4>     ;	12  ShCol
    81                              <4>     ;	13  ShCloseFile
    82                              <4> 
    83                              <4> MultNET     EQU     11h 		; Network support
    84                              <4> MultIFS     EQU     11h 		; Network support
    85                              <4>     ;	1   IFS_RMDIR
    86                              <4>     ;	2   IFS_SEQ_RMDIR
    87                              <4>     ;	3   IFS_MKDIR
    88                              <4>     ;	4   IFS_SEQ_MKDIR
    89                              <4>     ;	5   IFS_CHDIR
    90                              <4>     ;	6   IFS_CLOSE
    91                              <4>     ;	7   IFS_COMMIT
    92                              <4>     ;	8   IFS_READ
    93                              <4>     ;	9   IFS_WRITE
    94                              <4>     ;	10  IFS_LOCK
    95                              <4>     ;	11  IFS_UNLOCK
    96                              <4>     ;	12  IFS_DISK_INFO
    97                              <4>     ;	13  IFS_SET_FILE_ATTRIBUTE
    98                              <4>     ;	14  IFS_SEQ_SET_FILE_ATTRIBUTE
    99                              <4>     ;	15  IFS_GET_FILE_INFO
   100                              <4>     ;	16  IFS_SEQ_GET_FILE_INFO
   101                              <4>     ;	17  IFS_RENAME
   102                              <4>     ;	18  IFS_SEQ_RENAME
   103                              <4>     ;	19  IFS_DELETE
   104                              <4>     ;	20  IFS_SEQ_DELETE
   105                              <4>     ;	21  IFS_OPEN
   106                              <4>     ;	22  IFS_SEQ_OPEN
   107                              <4>     ;	23  IFS_CREATE
   108                              <4>     ;	24  IFS_SEQ_CREATE
   109                              <4>     ;	25  IFS_SEQ_SEARCH_FIRST
   110                              <4>     ;	26  IFS_SEQ_SEARCH_NEXT
   111                              <4>     ;	27  IFS_SEARCH_FIRST
   112                              <4>     ;	28  IFS_SEARCH_NEXT
   113                              <4>     ;	29  IFS_ABORT
   114                              <4>     ;	30  IFS_ASSOPER
   115                              <4>     ;	31  Printer_SET_STRING
   116                              <4>     ;	32  IFSFlushBuf
   117                              <4>     ;	33  IFSBufWrite
   118                              <4>     ;	34  IFSResetEnvironment
   119                              <4>     ;	35  IFSSpoolCheck
   120                              <4>     ;	36  IFSSpoolClose
   121                              <4> 
   122                              <4> MultDOS     EQU     12h 		; DOS call back
   123                              <4>     ;	1   DOS_CLOSE
   124                              <4>     ;	2   RECSET
   125                              <4>     ;	3   Get DOSGROUP
   126                              <4>     ;	4   PATHCHRCMP
   127                              <4>     ;	5   OUT
   128                              <4>     ;	6   NET_I24_ENTRY
   129                              <4>     ;	7   PLACEBUF
   130                              <4>     ;	8   FREE_SFT
   131                              <4>     ;	9   BUFWRITE
   132                              <4>     ;	10  SHARE_VIOLATION
   133                              <4>     ;	11  SHARE_ERROR
   134                              <4>     ;	12  SET_SFT_MODE
   135                              <4>     ;	13  DATE16
   136                              <4>     ;	14  SETVISIT
   137                              <4>     ;	15  SCANPLACE
   138                              <4>     ;	16  SKIPVISIT
   139                              <4>     ;	17  StrCpy
   140                              <4>     ;	18  StrLen
   141                              <4>     ;	19  Ucase
   142                              <4>     ;	20  POINTCOMP
   143                              <4>     ;	21  CHECKFLUSH
   144                              <4>     ;	22  SFFromSFN
   145                              <4>     ;	23  GetCDSFromDrv
   146                              <4>     ;	24  Get_User_Stack
   147                              <4>     ;	25  GetThisDrv
   148                              <4>     ;	26  DriveFromText
   149                              <4>     ;	27  SETYEAR
   150                              <4>     ;	28  DSUM
   151                              <4>     ;	29  DSLIDE
   152                              <4>     ;	30  StrCmp
   153                              <4>     ;	31  initcds
   154                              <4>     ;	32  pjfnfromhandle
   155                              <4>     ;	33  $NameTrans
   156                              <4>     ;	34  CAL_LK
   157                              <4>     ;	35  DEVNAME
   158                              <4>     ;	36  Idle
   159                              <4>     ;	37  DStrLen
   160                              <4>     ;	38  NLS_OPEN	  DOS 3.3
   161                              <4>     ;	39  $CLOSE	  DOS 3.3
   162                              <4>     ;	40  NLS_LSEEK	  DOS 3.3
   163                              <4>     ;	41  $READ	  DOS 3.3
   164                              <4>     ;	42  FastInit	  DOS 4.0
   165                              <4>     ;	43  NLS_IOCTL	  DOS 3.3
   166                              <4>     ;	44  GetDevList	  DOS 3.3
   167                              <4>     ;	45  NLS_GETEXT	  DOS 3.3
   168                              <4>     ;	46  MSG_RETRIEVAL DOS 4.0
   169                              <4>     ;	47  FAKE_VERSION  DOS 4.0
   170                              <4>     ;
   171                              <4> NLSFUNC     EQU     14h 		; NLSFUNC CALL , DOS 3.3
   172                              <4>     ;	0   NLSInstall
   173                              <4>     ;	1   ChgCodePage
   174                              <4>     ;	2   GetExtInfo
   175                              <4>     ;	3   SetCodePage
   176                              <4>     ;	4   GetCntry
   177                              <4>     ;
   178                              <4> ;FASTOPEN is not chained through INT 2F   ; DOS 3.3 F.C.
   179                              <4> ;	  it calls Multdos 42 to set up an entry routine address
   180                              <4>     ;	0   Install status  (reserved)
   181                              <4>     ;	1   Lookup
   182                              <4>     ;	2   Insert
   183                              <4>     ;	3   Delete
   184                              <4>     ;	4   Purge	    (reserved)
    98                              <3> 
    99                              <3> BREAK <Disk map>
   100                              <3> ;  MSDOS partitions the disk into 4 sections:
   101                              <3> ;
   102                              <3> ;  phys sector 0:   +-------------------+
   103                              <3> ;	|	    | boot/reserved	|
   104                              <3> ;	|	    +-------------------+
   105                              <3> ;	|	    |  File allocation	|
   106                              <3> ;	v	    |	   table(s)	|
   107                              <3> ;		    |  (multiple copies |
   108                              <3> ;		    |	  are kept)	|
   109                              <3> ;		    +-------------------+
   110                              <3> ;		    |	  Directory	|
   111                              <3> ;		    +-------------------+
   112                              <3> ;		    |	  File space	|
   113                              <3> ;		    +-------------------+
   114                              <3> ;		    |	Unaddressable	|
   115                              <3> ;		    |  (to end of disk) |
   116                              <3> ;		    +-------------------+
   117                              <3> ;
   118                              <3> ; All partition boundaries are sector boundaries.  The size of the FAT is
   119                              <3> ; adjusted to maximize the file space addressable.
   120                              <3> 
   121                              <3> %include "dirent.mac"
     1                              <4> ;	SCCSID = @(#)dirent.asm 1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)dirent.asm 1.1 85/04/10
     3                              <4> Break <Directory entry>
     4                              <4> 
     5                              <4> ;
     6                              <4> ;	+---------------------------+
     7                              <4> ;	|  (12 BYTE) filename/ext   |	    0	    0
     8                              <4> ;	+---------------------------+
     9                              <4> ;	|     (BYTE) attributes     |	    11	    B
    10                              <4> ;	+---------------------------+
    11                              <4> ;	|    (10 BYTE) reserved     |	    12	    C
    12                              <4> ;	+---------------------------+
    13                              <4> ;	| (WORD) time of last write |	    22	    16
    14                              <4> ;	+---------------------------+
    15                              <4> ;	| (WORD) date of last write |	    24	    18
    16                              <4> ;	+---------------------------+
    17                              <4> ;	|   (WORD) First cluster    |	    26	    1A
    18                              <4> ;	+---------------------------+
    19                              <4> ;	|     (DWORD) file size     |	    28	    1C
    20                              <4> ;	+---------------------------+
    21                              <4> ;
    22                              <4> ;   First byte of filename  = E5 -> free directory entry
    23                              <4> ;			    = 00 -> end of allocated directory
    24                              <4> ;   Time:   Bits 0-4=seconds/2, bits 5-10=minute, 11-15=hour
    25                              <4> ;   Date:   Bits 0-4=day, bits 5-8=month, bits 9-15=year-1980
    26                              <4> ;
    27                              <4> 
    28                              <4> dir_entry   STRUC
    29 00000000 ??????????????????- <4> dir_name    DB	    11 DUP (?)		; file name
    29 00000009 ????                <4>
    30 0000000B ??                  <4> dir_attr    DB	    ?			; attribute bits
    31 0000000C ????                <4> dir_codepg  dw	    ?			; code page DOS 4.00
    32 0000000E ????                <4> dir_extcluster dw   ?			; extended attribute starting cluster
    33 00000010 ??                  <4> dir_attr2   db	    ?			; reserved
    34 00000011 ??????????          <4> dir_pad     DB	    5  DUP (?)		; reserved for expansion
    35 00000016 ????                <4> dir_time    DW	    ?			; time of last write
    36 00000018 ????                <4> dir_date    DW	    ?			; date of last write
    37 0000001A ????                <4> dir_first   DW	    ?			; first allocation unit of file
    38 0000001C ????                <4> dir_size_l  DW	    ?			; low 16 bits of file size
    39 0000001E ????                <4> dir_size_h  DW	    ?			; high 16 bits of file size
    40                              <4> dir_entry   ENDS
    41                              <4> 
    42                              <4> attr_read_only	    EQU      1h
    43                              <4> attr_hidden	    EQU      2h
    44                              <4> attr_system	    EQU      4h
    45                              <4> attr_volume_id	    EQU      8h
    46                              <4> attr_directory	    EQU     10h
    47                              <4> attr_archive	    EQU     20h
    48                              <4> attr_device	    EQU     40h 	; This is a VERY special bit.
    49                              <4> 					;   NO directory entry on a disk EVER
    50                              <4> 					;   has this bit set. It is set non-zero
    51                              <4> 					;   when a device is found by GETPATH
    52                              <4> 
    53                              <4> attr_all	    EQU     attr_hidden+attr_system+attr_directory
    54                              <4> 					; OR of hard attributes for FINDENTRY
    55                              <4> 
    56                              <4> attr_ignore	    EQU     attr_read_only+attr_archive+attr_device
    57                              <4> 					; ignore this(ese) attribute(s) during
    58                              <4> 					; search first/next
    59                              <4> 
    60                              <4> attr_changeable     EQU     attr_read_only+attr_hidden+attr_system+attr_archive
    61                              <4> 					; changeable via CHMOD
   122                              <3> 
   123                              <3> BREAK <File allocation Table information>
   124                              <3> ;
   125                              <3> ; The File Allocation Table uses a 12-bit entry for each allocation unit on
   126                              <3> ; the disk.  These entries are packed, two for every three bytes.  The contents
   127                              <3> ; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
   128                              <3> ; to the base address of the Allocation Table; 3) fetching the 16-bit word
   129                              <3> ; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
   130                              <3> ; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex).  Entry
   131                              <3> ; number zero is used as an end-of-file trap in the OS and is passed to the
   132                              <3> ; BIOS to help determine disk format.  Entry 1 is reserved for future use.
   133                              <3> ; The first available allocation unit is assigned entry number two, and even
   134                              <3> ; though it is the first, is called cluster 2.	Entries greater than 0FF8H
   135                              <3> ; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero
   136                              <3> ; are unallocated.  Otherwise, the contents of a FAT entry is the number of
   137                              <3> ; the next cluster in the file.
   138                              <3> ;
   139                              <3> ; Clusters with bad sectors are tagged with FF7H.  Any non-zero number would
   140                              <3> ; do because these clusters show as allocated, but are not part of any
   141                              <3> ; allocation chain and thus will never be allocated to a file.	A particular
   142                              <3> ; number is selected so that disk checking programs know what to do (ie.  a
   143                              <3> ; cluster with entry FF7H which is not in a chain is not an error).
   144                              <3> 
   145                              <3> %include "dpb.mac"
     1                              <4> ;	SCCSID = @(#)dpb.asm	1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)dpb.asm	1.1 85/04/10
     3                              <4> BREAK <DPB structure>
     4                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <4> ;									   ;
     7                              <4> dpb	STRUC
     8 00000000 ??                  <4> dpb_drive	    DB	    ?		; Logical drive # assoc with DPB (A=0,B=1,...)
     9 00000001 ??                  <4> dpb_UNIT	    DB	    ?		; Driver unit number of DPB
    10 00000002 ????                <4> dpb_sector_size     DW	    ?		; Size of physical sector in bytes
    11 00000004 ??                  <4> dpb_cluster_mask    DB	    ?		; Sectors/cluster - 1
    12 00000005 ??                  <4> dpb_cluster_shift   DB	    ?		; Log2 of sectors/cluster
    13 00000006 ????                <4> dpb_first_FAT	    DW	    ?		; Starting record of FATs
    14 00000008 ??                  <4> dpb_FAT_count	    DB	    ?		; Number of FATs for this drive
    15 00000009 ????                <4> dpb_root_entries    DW	    ?		; Number of directory entries
    16 0000000B ????                <4> dpb_first_sector    DW	    ?		; First sector of first cluster
    17 0000000D ????                <4> dpb_max_cluster     DW	    ?		; Number of clusters on drive + 1
    18 0000000F ????                <4> dpb_FAT_size	    DW	    ?		;;Number of records occupied by FAT
    19 00000011 ????                <4> dpb_dir_sector	    DW	    ?		; Starting record of directory
    20 00000013 ????????            <4> dpb_driver_addr     DD	    ?		; Pointer to driver
    21 00000017 ??                  <4> dpb_media	    DB	    ?		; Media byte
    22 00000018 ??                  <4> dpb_first_access    DB	    ?		; This is initialized to -1 to force a media
    23                              <4> 					; check the first time this DPB is used
    24 00000019 ????????            <4> dpb_next_dpb	    DD	    ?		; Pointer to next Drive parameter block
    25 0000001D ????                <4> dpb_next_free	    DW	    ?		; Cluster # of last allocated cluster
    26 0000001F ????                <4> dpb_free_cnt	    DW	    ?		; Count of free clusters, -1 if unknown
    27                              <4> dpb	ENDS
    28                              <4> 
    29                              <4> DPBSIZ	EQU	dpb_struc_size		; Size of the structure in bytes
    30                              <4> 
    31                              <4> DSKSIZ	equ	dpb_max_cluster 	; Size of disk (temp used during init only)
    32                              <4> ;									   ;
    33                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    34                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   146                              <3> 
   147                              <3> %include "curdir.mac"
     1                              <4> ;	SCCSID = @(#)curdir.asm 1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)curdir.asm 1.1 85/04/10
     3                              <4> BREAK <Current directory list structure>
     4                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <4> ;									   ;
     7                              <4> ; CDS items are used bu the internal routines to store cluster numbers and ;
     8                              <4> ; network identifiers for each logical name.  The ID field is used dually, ;
     9                              <4> ; both as net ID and for a cluster number for local devices.  In the case  ;
    10                              <4> ; of local devices, the cluster number will be -1 if there is a potential  ;
    11                              <4> ; of the disk being changed or if the path must be recracked.  The END	   ;
    12                              <4> ; field is the location of the end of the definition.  No .. is allowed    ;
    13                              <4> ; past this point							   ;
    14                              <4> 
    15                              <4> DIRSTRLEN	EQU	64+3		; Max length in bytes of directory strings
    16                              <4> TEMPLEN 	EQU	DIRSTRLEN*2
    17                              <4> 
    18                              <4> curdir_list	STRUC
    19 00000000 ??????????????????- <4> curdir_text	DB	DIRSTRLEN DUP (?)   ; text of assignment and curdir
    19 00000009 ??????????????????- <4>
    19 00000012 ??????????????????- <4>
    19 0000001B ??????????????????- <4>
    19 00000024 ??????????????????- <4>
    19 0000002D ??????????????????- <4>
    19 00000036 ??????????????????- <4>
    19 0000003F ????????            <4>
    20 00000043 ????                <4> curdir_flags	DW	?		; various flags
    21 00000045 ????????            <4> curdir_devptr	DD	?		; local pointer to DPB or net device
    22 00000049 ????                <4> curdir_ID	DW	?		; cluster of current dir (net ID)
    23 0000004B ????                <4> 		DW	?
    24 0000004D ????                <4> curdir_user_word DW	?
    25 0000004F ????                <4> curdir_end	DW	?		; end of assignment
    26 00000051 ??                  <4> curdir_type	DB	?		; IFS drive (2=ifs, 4=netuse)
    27 00000052 ????????            <4> curdir_ifs_hdr	DD	?		; Ptr to File System Header
    28 00000056 ????                <4> curdir_fsda	DB	2 DUP (?)	; File System Dependent Data Area
    29                              <4> curdir_list	ENDS
    30                              <4> 
    31                              <4> curdirLen	EQU	curdir_list_struc_size	; Needed for screwed up
    32                              <4> 						; ASM87 which doesn't allow
    33                              <4> 						; Size directive as a macro
    34                              <4> 						; argument
    35                              <4> labelsize curdir_netID, dword, curdir_ID
    36                              <4> 
    37                              <4> ;Flag word masks
    38                              <4> curdir_isnet	EQU	1000000000000000B
    39                              <4> curdir_isifs	EQU	1000000000000000B	; DOS 4.00
    40                              <4> curdir_inuse	EQU	0100000000000000B
    41                              <4> curdir_splice	EQU	0010000000000000B
    42                              <4> curdir_local	EQU	0001000000000000B
    43                              <4> ;									   ;
    44                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    45                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   148                              <3> 
   149                              <3> %include "cpmfcb.mac"
     1                              <4> ;       SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
     2                              <4> ;       SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
     3                              <4> ;BREAK <File Control Block definition>
     4                              <4> 
     5                              <4> ;
     6                              <4> ; Field definition for FCBs
     7                              <4> ; The FCB has the following structure:
     8                              <4> ;
     9                              <4> ;       +---------------------------+
    10                              <4> ;       |   Drive indicator(byte)   |
    11                              <4> ;       +---------------------------+
    12                              <4> ;       |    Filename (8 chars)     |
    13                              <4> ;       +---------------------------+
    14                              <4> ;       |    Extension (3 chars)    |
    15                              <4> ;       +---------------------------+
    16                              <4> ;       |   Current Extent(word)    |
    17                              <4> ;       +---------------------------+
    18                              <4> ;       |    Record size (word)     |
    19                              <4> ;       +---------------------------+
    20                              <4> ;       |    File Size (2 words)    |
    21                              <4> ;       +---------------------------+
    22                              <4> ;       |       Date of write       |
    23                              <4> ;       +---------------------------+
    24                              <4> ;       |       Time of write       |
    25                              <4> ;       +---------------------------+
    26                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    27                              <4> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    28                              <4> ;                                                                          ;
    29                              <4> ;       +---------------------------+
    30                              <4> ;       |   8 bytes reserved        |
    31                              <4> ;       +---------------------------+
    32                              <4> ;                                                                          ;
    33                              <4> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    34                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    35                              <4> ;       |    next record number     |
    36                              <4> ;       +---------------------------+
    37                              <4> ;       |   random record number    |
    38                              <4> ;       +---------------------------+
    39                              <4> ;
    40                              <4> 
    41                              <4> sys_fcb     STRUC
    42 00000000 ??                  <4> fcb_drive   DB      ?
    43 00000001 ????????????????    <4> fcb_name    DB      8 DUP (?)
    44 00000009 ??????              <4> fcb_ext     DB      3 DUP (?)
    45 0000000C ????                <4> fcb_EXTENT  DW      ?
    46 0000000E ????                <4> fcb_RECSIZ  DW      ?                   ; Size of record (user settable)
    47 00000010 ????                <4> fcb_FILSIZ  DW      ?                   ; Size of file in bytes; used with the
    48                              <4>                                         ; following word
    49 00000012 ????                <4> fcb_DRVBP   DW      ?                   ; BP for SEARCH FIRST and SEARCH NEXT
    50 00000014 ????                <4> fcb_FDATE   DW      ?                   ; Date of last writing
    51 00000016 ????                <4> fcb_FTIME   DW      ?                   ; Time of last writing
    52                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    53                              <4> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    54                              <4> ;                                                                          ;
    55 00000018 ????????????????    <4> fcb_reserved DB      8 DUP (?)           ; RESERVED
    56                              <4> ;                                                                          ;
    57                              <4> ;            C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R             ;
    58                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    59 00000020 ??                  <4> fcb_NR      DB      ?                   ; Next record
    60 00000021 ????????            <4> fcb_RR      DB      4 DUP (?)           ; Random record
    61                              <4> sys_fcb     ENDS
    62                              <4> 
    63                              <4> FILDIRENT       equ fcb_FILSIZ            ; Used only by SEARCH FIRST and SEARCH
    64                              <4>                                         ; NEXT
    65                              <4> 
    66                              <4> labelsize fcb_sfn, byte, fcb_reserved
    67                              <4> 
    68                              <4> ; Note that fcb_net_handle, fcb_nsl_drive, fcb_nsld_drive and fcb_l_drive
    69                              <4> ; all must point to the same byte.  Otherwise, the FCBRegen will fail.
    70                              <4> ; NOTE about this byte (fcb_nsl_drive)
    71                              <4> ;   The high two bits of this byte are used as follows to indicate the FCB type
    72                              <4> ;       00 means a local file or device with sharing loaded
    73                              <4> ;       10 means a remote (network) file
    74                              <4> ;       01 means a local file with no sharing loaded
    75                              <4> ;       11 means a local device with no sharing loaded
    76                              <4> 
    77                              <4> ;
    78                              <4> ; Network FCB
    79                              <4> ;
    80                              <4> labelsize fcb_net_drive, byte, fcb_reserved+1
    81                              <4> labelsize fcb_net_handle, word, fcb_reserved+2
    82                              <4> labelsize fcb_netID, dword, fcb_reserved+4
    83                              <4> 
    84                              <4> ;
    85                              <4> ; No sharing local file FCB
    86                              <4> ;
    87                              <4> labelsize fcb_nsl_drive, byte, fcb_reserved+1
    88                              <4> labelsize fcb_nsl_bits, byte, fcb_reserved+2
    89                              <4> labelsize fcb_nsl_firclus, word, fcb_reserved+3
    90                              <4> labelsize fcb_nsl_dirsec, word, fcb_reserved+5
    91                              <4> labelsize fcb_nsl_dirpos, byte, fcb_reserved+7
    92                              <4> 
    93                              <4> ;
    94                              <4> ; No sharing local device FCB
    95                              <4> ;
    96                              <4> labelsize fcb_nsld_drive, byte, fcb_reserved+1
    97                              <4> labelsize fcb_nsld_drvptr, dword, fcb_reserved+2
    98                              <4> 
    99                              <4> ;
   100                              <4> ; Sharing local FCB
   101                              <4> ;
   102                              <4> labelsize fcb_l_drive, byte, fcb_reserved+1
   103                              <4> labelsize fcb_l_firclus, word, fcb_reserved+2
   104                              <4> labelsize fcb_l_mfs, word, fcb_reserved+4
   105                              <4> labelsize fcb_l_attr, byte, fcb_reserved+6
   106                              <4> 
   107                              <4> ;
   108                              <4> ; Bogusness:  the four cases are:
   109                              <4> ;
   110                              <4> ;   local file      00
   111                              <4> ;   local device    40
   112                              <4> ;   local sharing   C0
   113                              <4> ;   network         80
   114                              <4> ;
   115                              <4> ; Since sharing and network collide, we cannot use a test instruction for
   116                              <4> ; deciding whether a network or a share check in involved
   117                              <4> ;
   118                              <4> FCBDEVICE   EQU 040h
   119                              <4> FCBNETWORK  EQU 080h
   120                              <4> FCBSHARE    EQU 0C0h
   121                              <4> 
   122                              <4> ; FCBSPECIAL must be able to mask off both net and share
   123                              <4> FCBSPECIAL  EQU 080h
   124                              <4> FCBMASK     EQU 0C0h
   150                              <3> 
   151                              <3> %include "find.mac"
     1                              <4> ;	SCCSID = @(#)find.asm	1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)find.asm	1.1 85/04/10
     3                              <4> Break	<find first/next buffer>
     4                              <4> 
     5                              <4> find_buf    STRUC
     6                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     7                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     8                              <4> ;									   ;
     9 00000000 ??                  <4> find_buf_drive	    DB	?		; drive of search
    10 00000001 ??????????????????- <4> find_buf_name	    DB	11 DUP (?)	; formatted name
    10 0000000A ????                <4>
    11 0000000C ??                  <4> find_buf_sattr	    DB	?		; attribute of search
    12 0000000D ????                <4> find_buf_LastEnt    DW	?		; LastEnt
    13 0000000F ????                <4> find_buf_DirStart   DW	?		; DirStart
    14 00000011 ????????            <4> find_buf_NetID	    DB	4 DUP (?)	; Reserved for NET
    15                              <4> ;									   ;
    16                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    17                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    18                              <4> 
    19 00000015 ??                  <4> find_buf_attr	    DB	?		; attribute found
    20 00000016 ????                <4> find_buf_time	    DW	?		; time
    21 00000018 ????                <4> find_buf_date	    DW	?		; date
    22 0000001A ????                <4> find_buf_size_l     DW	?		; low(size)
    23 0000001C ????                <4> find_buf_size_h     DW	?		; high(size)
    24 0000001E ??????????????????- <4> find_buf_pname	    DB	13 DUP (?)	; packed name
    24 00000027 ????????            <4>
    25                              <4> find_buf    ENDS
   152                              <3> 
   153                              <3> %include "pdb.mac"
     1                              <4> ;	SCCSID = @(#)pdb.asm	1.1 85/04/10
     2                              <4> BREAK <Process data block>
     3                              <4> 
     4                              <4> ;
     5                              <4> ; Process data block (otherwise known as program header)
     6                              <4> ;
     7                              <4> 
     8                              <4> FilPerProc	    EQU     20
     9                              <4> 
    10                              <4> Process_data_block  STRUC
    11 00000000 ????                <4> PDB_Exit_Call	    DW	    ?		; INT int_abort system terminate
    12 00000002 ????                <4> PDB_block_len	    DW	    ?		; size of execution block
    13 00000004 ??                  <4> 		    DB	    ?
    14 00000005 ??????????          <4> PDB_CPM_Call	    DB	5 DUP (?)	; ancient call to system
    15 0000000A ????????            <4> PDB_Exit	    DD	    ?		; pointer to exit routine
    16 0000000E ????????            <4> PDB_Ctrl_C	    DD	    ?		; pointer to ^C routine
    17 00000012 ????????            <4> PDB_Fatal_abort     DD	    ?		; pointer to fatal error
    18                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    19                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    20                              <4> ;									   ;
    21 00000016 ????                <4> PDB_Parent_PID	    DW	    ?		; PID of parent (terminate PID)
    22 00000018 ??????????????????- <4> PDB_JFN_Table	    DB	FilPerProc DUP (?)
    22 00000021 ??????????????????- <4>
    22 0000002A ????                <4>
    23                              <4> 					; indices into system table
    24                              <4> ;									   ;
    25                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    26                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    27 0000002C ????                <4> PDB_environ	    DW	    ?		; seg addr of environment
    28                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    29                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    30                              <4> ;									   ;
    31 0000002E ????????            <4> PDB_User_stack	    DD	    ?		; stack of self during system calls
    32 00000032 ????                <4> PDB_JFN_Length	    DW	    ?		; number of handles allowed
    33 00000034 ????????            <4> PDB_JFN_Pointer     DD	    ?		; pointer to JFN table
    34 00000038 ????????            <4> PDB_Next_PDB	    DD	    ?		; pointer to nested PDB's
    35 0000003C ??????????????????- <4> PDB_PAD1	    DB	    14h DUP (?)
    35 00000045 ??????????????????- <4>
    35 0000004E ????                <4>
    36                              <4> ;									   ;
    37                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    38                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    39 00000050 ??????????          <4> PDB_Call_system     DB	    5 DUP (?)	; portable method of system call
    40                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    41                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    42                              <4> ;									   ;
    43 00000055 ??????????????      <4> PDB_PAD2	    DB	    7h DUP (?)
    44                              <4> ;									   ;
    45                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    46                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    47                              <4> Process_data_block  ENDS
    48                              <4> 
    49                              <4> labelsize PDB_InterCon, byte, PDB_PAD1	; 2/12/KK
    50                              <4> labelsize PDB_Append, byte, PDB_PAD1+1	; 2/12/KK
   154                              <3> 
   155                              <3> %include "exe.mac"
     1                              <4> ;	SCCSID = @(#)exe.asm	1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)exe.asm	1.1 85/04/10
     3                              <4> BREAK <EXEC and EXE file structures>
     4                              <4> ;
     5                              <4> ; EXEC arg block - load/go program
     6                              <4> ;
     7                              <4> 
     8                              <4> ;
     9                              <4> ; The following get used as arguments to the EXEC system call.	They indicate
    10                              <4> ; whether or not the program is executed or whether or not a program header
    11                              <4> ; gets created.
    12                              <4> ;
    13                              <4> exec_func_no_execute	EQU 1		; no execute bit
    14                              <4> exec_func_overlay	EQU 2		; overlay bit
    15                              <4> 
    16                              <4> Exec0		STRUC
    17 00000000 ????                <4> Exec0_environ	DW	?		; seg addr of environment
    18 00000002 ????????            <4> Exec0_com_line	DD	?		; pointer to asciz command line
    19 00000006 ????????            <4> Exec0_5C_FCB	DD	?		; default fcb at 5C
    20 0000000A ????????            <4> Exec0_6C_FCB	DD	?		; default fcb at 6C
    21                              <4> Exec0		ENDS
    22                              <4> 
    23                              <4> Exec1		STRUC
    24 00000000 ????                <4> Exec1_environ	DW	?		; seg addr of environment
    25 00000002 ????????            <4> Exec1_com_line	DD	?		; pointer to asciz command line
    26 00000006 ????????            <4> Exec1_5C_FCB	DD	?		; default fcb at 5C
    27 0000000A ????????            <4> Exec1_6C_FCB	DD	?		; default fcb at 6C
    28 0000000E ????                <4> Exec1_SP	DW	?		; stack pointer of program
    29 00000010 ????                <4> Exec1_SS	DW	?		; stack seg register of program
    30 00000012 ????                <4> Exec1_IP	DW	?		; entry point IP
    31 00000014 ????                <4> Exec1_CS	DW	?		; entry point CS
    32                              <4> Exec1		ENDS
    33                              <4> 
    34                              <4> Exec3		STRUC
    35 00000000 ????                <4> Exec3_load_addr DW	?		; seg address of load point
    36 00000002 ????                <4> Exec3_reloc_fac DW	?		; relocation factor
    37                              <4> Exec3		ENDS
    38                              <4> 
    39                              <4> ;
    40                              <4> ; Exit codes in upper byte
    41                              <4> ;
    42                              <4> Exit_terminate	    EQU     0
    43                              <4> Exit_abort	    EQU     0
    44                              <4> Exit_Ctrl_C	    EQU     1
    45                              <4> Exit_Hard_Error     EQU     2
    46                              <4> Exit_Keep_process   EQU     3
    47                              <4> 
    48                              <4> ;
    49                              <4> ; EXE file header
    50                              <4> ;
    51                              <4> 
    52                              <4> EXE_file    STRUC
    53 00000000 ????                <4> exe_signature	DW  ?			; must contain 4D5A  (yay zibo!)
    54 00000002 ????                <4> exe_len_mod_512 DW  ?			; low 9 bits of length
    55 00000004 ????                <4> exe_pages	DW  ?			; number of 512b pages in file
    56 00000006 ????                <4> exe_rle_count	DW  ?			; count of reloc entries
    57 00000008 ????                <4> exe_par_dir	DW  ?			; number of paragraphs before image
    58 0000000A ????                <4> exe_min_BSS	DW  ?			; minimum number of para of BSS
    59 0000000C ????                <4> exe_max_BSS	DW  ?			; max number of para of BSS
    60 0000000E ????                <4> exe_SS		DW  ?			; stack of image
    61 00000010 ????                <4> exe_SP		DW  ?			; SP of image
    62 00000012 ????                <4> exe_chksum	DW  ?			; checksum  of file (ignored)
    63 00000014 ????                <4> exe_IP		DW  ?			; IP of entry
    64 00000016 ????                <4> exe_CS		DW  ?			; CS of entry
    65 00000018 ????                <4> exe_rle_table	DW  ?			; byte offset of reloc table
    66 0000001A ????                <4> exe_iov 	DW  ?			; overlay number (0 for root)
    67 0000001C ????????            <4> exe_sym_tab	DD  ?			; offset of symbol table in file
    68                              <4> EXE_file    ENDS
    69                              <4> 
    70                              <4> exe_valid_signature	EQU 5A4Dh
    71                              <4> exe_valid_old_signature EQU 4D5Ah
    72                              <4> 
    73                              <4> symbol_entry	STRUC
    74 00000000 ????????            <4> sym_value	DD  ?
    75 00000004 ????                <4> sym_type	DW  ?
    76 00000006 ??                  <4> sym_len 	DB  ?
    77 00000007 ??????????????????- <4> sym_name	DB  255 dup (?)
    77 00000010 ??????????????????- <4>
    77 00000019 ??????????????????- <4>
    77 00000022 ??????????????????- <4>
    77 0000002B ??????????????????- <4>
    77 00000034 ??????????????????- <4>
    77 0000003D ??????????????????- <4>
    77 00000046 ??????????????????- <4>
    77 0000004F ??????????????????- <4>
    77 00000058 ??????????????????- <4>
    77 00000061 ??????????????????- <4>
    77 0000006A ??????????????????- <4>
    77 00000073 ??????????????????- <4>
    77 0000007C ??????????????????- <4>
    77 00000085 ??????????????????- <4>
    77 0000008E ??????????????????- <4>
    77 00000097 ??????????????????- <4>
    77 000000A0 ??????????????????- <4>
    77 000000A9 ??????????????????- <4>
    77 000000B2 ??????????????????- <4>
    77 000000BB ??????????????????- <4>
    77 000000C4 ??????????????????- <4>
    77 000000CD ??????????????????- <4>
    77 000000D6 ??????????????????- <4>
    77 000000DF ??????????????????- <4>
    77 000000E8 ??????????????????- <4>
    77 000000F1 ??????????????????- <4>
    77 000000FA ??????????????????- <4>
    77 00000103 ??????              <4>
    78                              <4> symbol_entry	ENDS
   156                              <3> 
   157                              <3> %include "sf.mac"
     1                              <4> ;	SCCSID = @(#)sf.asm	1.1 85/04/10
     2                              <4> BREAK <Internal system file table format>
     3                              <4> ;
     4                              <4> ;   AN000   version 4.00   Jan. 1988
     5                              <4> ;   AN003   PTM 3680 --  make NAME offset the same as before (<=3.30)
     6                              <4> ;   AN009   PTM 3839	 reorder SFT for MS WINDOWS
     7                              <4> 
     8                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     9                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    10                              <4> ;									   ;
    11                              <4> ;
    12                              <4> ; system file table
    13                              <4> ;
    14                              <4> 
    15                              <4> SF		STRUC
    16 00000000 ????????            <4> SFLink		DD	?
    17 00000004 ????                <4> SFCount 	DW	?		; number of entries
    18 00000006 ????                <4> SFTable 	DW	?		; beginning of array of the following
    19                              <4> SF		ENDS
    20                              <4> 
    21                              <4> ;
    22                              <4> ; system file table entry
    23                              <4> ;
    24                              <4> 
    25                              <4> sf_entry	STRUC
    26 00000000 ????                <4> sf_ref_count	DW	?		; number of processes sharing entry
    27                              <4> 					;   if FCB then ref count
    28 00000002 ????                <4> sf_mode 	DW	?		; mode of access or high bit on if FCB
    29 00000004 ??                  <4> sf_attr 	DB	?		; attribute of file
    30 00000005 ????                <4> sf_flags	DW	?		;Bits 8-15
    31                              <4> 					; Bit 15 = 1 if remote file
    32                              <4> 					;	 = 0 if local file or device
    33                              <4> 					; Bit 14 = 1 if date/time is not to be
    34                              <4> 					;   set from clock at CLOSE.  Set by
    35                              <4> 					;   FILETIMES and FCB_CLOSE.  Reset by
    36                              <4> 					;   other reseters of the dirty bit
    37                              <4> 					;   (WRITE)
    38                              <4> 					; Bit 13 = Pipe bit (reserved)
    39                              <4> 					;
    40                              <4> 					; Bits 0-7 (old FCB_devid bits)
    41                              <4> 					; If remote file or local file, bit
    42                              <4> 					; 6=0 if dirty Device ID number, bits
    43                              <4> 					; 0-5 if local file.
    44                              <4> 					; bit 7=0 for local file, bit 7
    45                              <4> 					;      =1 for local I/O device
    46                              <4> 					; If local I/O device, bit 6=0 if EOF (input)
    47                              <4> 					;		Bit 5=1 if Raw mode
    48                              <4> 					;		Bit 0=1 if console input device
    49                              <4> 					;		Bit 1=1 if console output device
    50                              <4> 					;		Bit 2=1 if null device
    51                              <4> 					;		Bit 3=1 if clock device
    52 00000007 ????????            <4> sf_devptr	DD	?		; Points to DPB if local file, points
    53                              <4> 					; to device header if local device,
    54                              <4> 					; points to net device header if
    55                              <4> 					; remote
    56 0000000B ????                <4> sf_firclus	DW	?		; First cluster of file (bit 15 = 0)
    57 0000000D ????                <4> sf_time 	DW	?		; Time associated with file
    58 0000000F ????                <4> sf_date 	DW	?		; Date associated with file
    59 00000011 ????????            <4> sf_size 	DD	?		; Size associated with file
    60 00000015 ????????            <4> sf_position	DD	?		; Read/Write pointer or LRU count for FCBs
    61                              <4> ;
    62                              <4> ; Starting here, the next 7 bytes may be used by the file system to store an
    63                              <4> ; ID
    64                              <4> ;
    65 00000019 ????                <4> sf_cluspos	DW	?		; Position of last cluster accessed
    66 0000001B ????????            <4> sf_dirsec	DD	?		; Sector number of directory sector for
    67                              <4> 					; for this file
    68 0000001F ??                  <4> sf_dirpos	DB	?		; Offset of this entry in the above
    69                              <4> ;
    70                              <4> ; End of 7 bytes of file-system specific info.
    71                              <4> ;
    72 00000020 ??????????????????- <4> sf_name 	DB	11 DUP (?)	; 11 character name that is in the
    72 00000029 ????                <4>
    73                              <4> 					; directory entry.  This is used by
    74                              <4> 					; close to detect file deleted and
    75                              <4> 					; disk changed errors.
    76                              <4> 
    77                              <4> ; SHARING INFO
    78 0000002B ????????            <4> sf_chain	DD	?		; link to next SF
    79 0000002F ????                <4> sf_UID		DW	?
    80 00000031 ????                <4> sf_PID		DW	?
    81 00000033 ????                <4> sf_MFT		DW	?
    82 00000035 ????                <4> sf_lstclus	DW	?		;AN009; Last cluster accessed
    83 00000037 ????????            <4> sf_IFS_HDR	DD	?
    84                              <4> sf_entry	ENDS
    85                              <4> 
    86                              <4> labelsize sf_fsda, byte, sf_cluspos	     ;DOS 4.00
    87                              <4> labelsize sf_serial_ID, word, sf_firclus	     ;DOS 4.00
    88                              <4> labelsize sf_netid, byte, sf_cluspos
    89                              <4> labelsize sf_OpenAge, word, sf_position+2
    90                              <4> labelsize sf_LRU, word, sf_position
    91                              <4> 
    92                              <4> sf_default_number   EQU     5h
    93                              <4> 
    94                              <4> ;
    95                              <4> ; Note that we need to mark an SFT as being busy for OPEN/CREATE.  This is
    96                              <4> ; because an INT 24 may prevent us from 'freeing' it.  We mark this as such
    97                              <4> ; by placing a -1 in the ref_count field.
    98                              <4> ;
    99                              <4> 
   100                              <4> sf_busy EQU -1
   101                              <4> 
   102                              <4> 
   103                              <4> ; mode mask for FCB detection
   104                              <4> sf_isfcb		EQU	1000000000000000B
   105                              <4> 
   106                              <4> ; Flag word masks
   107                              <4> sf_isnet		EQU	1000000000000000B
   108                              <4> sf_close_nodate 	EQU	0100000000000000B
   109                              <4> sf_pipe 		EQU	0010000000000000B
   110                              <4> sf_no_inherit		EQU	0001000000000000B
   111                              <4> sf_net_spool		EQU	0000100000000000B
   112                              <4> Handle_Fail_I24 	EQU	0000000100000000B  ;BIT 8 - DISK FULL I24 ERROR
   113                              <4> 
   114                              <4> ; Local file/device flag masks
   115                              <4> devid_file_clean	EQU	40h	; true if file and not written
   116                              <4> devid_file_mask_drive	EQU	3Fh	; mask for drive number
   117                              <4> 
   118                              <4> devid_device		EQU	80h	; true if a device
   119                              <4> devid_device_EOF	EQU	40h	; true if end of file reached
   120                              <4> devid_device_raw	EQU	20h	; true if in raw mode
   121                              <4> devid_device_special	EQU	10h	; true if special device
   122                              <4> devid_device_clock	EQU	08h	; true if clock device
   123                              <4> devid_device_null	EQU	04h	; true if null device
   124                              <4> devid_device_con_out	EQU	02h	; true if console output
   125                              <4> devid_device_con_in	EQU	01h	; true if consle input
   126                              <4> ;									   ;
   127                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   128                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   129                              <4> 
   130                              <4> ;
   131                              <4> ; structure of devid field as returned by IOCTL is:
   132                              <4> ;
   133                              <4> ;	BIT	7   6	5   4	3   2	1   0
   134                              <4> ;	      |---|---|---|---|---|---|---|---|
   135                              <4> ;	      | I | E | R | S | I | I | I | I |
   136                              <4> ;	      | S | O | A | P | S | S | S | S |
   137                              <4> ;	      | D | F | W | E | C | N | C | C |
   138                              <4> ;	      | E |   |   | C | L | U | O | I |
   139                              <4> ;	      | V |   |   | L | K | L | T | N |
   140                              <4> ;	      |---|---|---|---|---|---|---|---|
   141                              <4> ;	ISDEV = 1 if this channel is a device
   142                              <4> ;	      = 0 if this channel is a disk file
   143                              <4> ;
   144                              <4> ;	If ISDEV = 1
   145                              <4> ;
   146                              <4> ;	      EOF = 0 if End Of File on input
   147                              <4> ;	      RAW = 1 if this device is in Raw mode
   148                              <4> ;		  = 0 if this device is cooked
   149                              <4> ;	      ISCLK = 1 if this device is the clock device
   150                              <4> ;	      ISNUL = 1 if this device is the null device
   151                              <4> ;	      ISCOT = 1 if this device is the console output
   152                              <4> ;	      ISCIN = 1 if this device is the console input
   153                              <4> ;
   154                              <4> ;	If ISDEV = 0
   155                              <4> ;	      EOF = 0 if channel has been written
   156                              <4> ;	      Bits 0-5	are  the  block  device  number  for
   157                              <4> ;		  the channel (0 = A, 1 = B, ...)
   158                              <4> ;
   159                              <4> devid_ISDEV	EQU	80h
   160                              <4> devid_EOF	EQU	40h
   161                              <4> devid_RAW	EQU	20h
   162                              <4> devid_SPECIAL	EQU	10H
   163                              <4> devid_ISCLK	EQU	08h
   164                              <4> devid_ISNUL	EQU	04h
   165                              <4> devid_ISCOT	EQU	02h
   166                              <4> devid_ISCIN	EQU	01h
   167                              <4> 
   168                              <4> devid_block_dev EQU	1Fh		; mask for block device number
   158                              <3> 
   159                              <3> %include "arena.mac"
     1                              <4> ;	SCCSID = @(#)arena.asm	1.1 85/04/09
     2                              <4> ;BREAK <Memory arena structure>
     3                              <4> 
     4                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
     5                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
     6                              <4> ;									   ;
     7                              <4> ;
     8                              <4> ; arena item
     9                              <4> ;
    10                              <4> arena	STRUC
    11 00000000 ??                  <4> arena_signature     DB	?		; 4D for valid item, 5A for last item
    12 00000001 ????                <4> arena_owner	    DW	?		; owner of arena item
    13 00000003 ????                <4> arena_size	    DW	?		; size in paragraphs of item
    14 00000005 ??????              <4> arena_reserved	    DB	3 DUP(?)	; reserved
    15 00000008 ????????????????    <4> arena_name	    DB	8 DUP(?)	; owner file name
    16                              <4> arena	ENDS
    17                              <4> 
    18                              <4> ;
    19                              <4> ; CAUTION: The routines in ALLOC.ASM rely on the fact that arena_signature
    20                              <4> ; and arena_owner_system are all equal to zero and are contained in DI.  Change
    21                              <4> ; them and change ALLOC.ASM.
    22                              <4> 
    23                              <4> arena_owner_system  EQU 0		; free block indication
    24                              <4> 
    25                              <4> arena_signature_normal	EQU 4Dh 	; valid signature, not end of arena
    26                              <4> arena_signature_end	EQU 5Ah 	; valid signature, last block in arena
    27                              <4> ;									   ;
    28                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    29                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    30                              <4> 
   160                              <3> 
   161                              <3> %include "intnat.mac"
     1                              <4> ;	SCCSID = @(#)intnat.asm	1.1 85/04/10
     2                              <4> BREAK <International data structure format>
     3                              <4> 
     4                              <4> ;
     5                              <4> ; Current structure of the data returned by the international call
     6                              <4> ;
     7                              <4> internat_block STRUC
     8 00000000 ????                <4> Date_tim_format DW	?		; 0-USA, 1-EUR, 2-JAP
     9 00000002 ??                  <4> Currency_sym	DB	?		; Currency Symbol 5 bytes
    10 00000003 ??                  <4> 		DB	?
    11 00000004 ??                  <4> 		DB	?
    12 00000005 ??                  <4> 		DB	?
    13 00000006 ??                  <4> 		DB	?
    14 00000007 ??                  <4> Thous_sep	DB	?		; Thousands separator 2 bytes
    15 00000008 ??                  <4> 		DB	?
    16 00000009 ??                  <4> Decimal_sep	DB	?		; Decimal separator 2 bytes
    17 0000000A ??                  <4> 		DB	?
    18 0000000B ??                  <4> Date_sep	DB	?		; Date separator 2 bytes
    19 0000000C ??                  <4> 		DB	?
    20 0000000D ??                  <4> Time_sep	DB	?		; Decimal separator 2 bytes
    21 0000000E ??                  <4> 		DB	?
    22 0000000F ??                  <4> Bit_field	DB	?		; Bit values
    23                              <4> 					;   Bit 0 = 0 if currency symbol first
    24                              <4> 					;	  = 1 if currency symbol last
    25                              <4> 					;   Bit 1 = 0 if No space after currency symbol
    26                              <4> 					;	  = 1 if space after currency symbol
    27 00000010 ??                  <4> Currency_cents	DB	?		; Number of places after currency dec point
    28 00000011 ??                  <4> Time_24 	DB	?		; 1 if 24 hour time, 0 if 12 hour time
    29 00000012 ????                <4> Map_call	DW	?		; Address of case mapping call (DWORD)
    30 00000014 ????                <4> 		DW	?		; THIS IS TWO WORDS SO IT CAN BE INITIALIZED
    31                              <4> 					;  in pieces.
    32 00000016 ??                  <4> Data_sep	DB	?		; Data list separator character
    33 00000017 ??                  <4> 		DB	?
    34                              <4> internat_block ENDS
    35                              <4> 
    36                              <4> ;
    37                              <4> ; Max size of the block returned by the INTERNATIONAL call
    38                              <4> ;
    39                              <4> internat_block_max	EQU	32
   162                              <3> 
   163                              <3> %include "mi.mac"
     1                              <4> ;	SCCSID = @(#)mi.asm	1.1 85/04/10
     2                              <4> BREAK <Machine instruction, flag definitions and character types>
     3                              <4> 
     4                              <4> mi_INT		EQU	0CDh
     5                              <4> mi_Long_JMP	EQU	0EAh
     6                              <4> mi_Long_CALL	EQU	09Ah
     7                              <4> mi_Long_RET	EQU	0CBh
     8                              <4> mi_Near_RET	EQU	0C3h
     9                              <4> 
    10                              <4> ;			xxxxoditszxaxpxc
    11                              <4> f_Overflow	EQU	0000100000000000B
    12                              <4> f_Direction	EQU	0000010000000000B
    13                              <4> f_Interrupt	EQU	0000001000000000B
    14                              <4> f_Trace 	EQU	0000000100000000B
    15                              <4> f_Sign		EQU	0000000010000000B
    16                              <4> f_Zero		EQU	0000000001000000B
    17                              <4> f_Aux		EQU	0000000000010000B
    18                              <4> f_Parity	EQU	0000000000000100B
    19                              <4> f_Carry 	EQU	0000000000000001B
   164                              <3> 
   165                              <3> fChk	equ 1
   166                              <3> fDelim	equ 2
   167                              <3> fSpChk	equ 4
   168                              <3> fFCB	equ 8
   169                              <3> 
   170                              <3> %include "filemode.mac"
     1                              <4> ;	SCCSID = @(#)filemode.asm	1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)filemode.asm	1.1 85/04/10
     3                              <4> BREAK <Standard I/O assignments>
     4                              <4> 
     5                              <4> stdin	    EQU     0
     6                              <4> stdout	    EQU     1
     7                              <4> stderr	    EQU     2
     8                              <4> stdaux	    EQU     3
     9                              <4> stdprn	    EQU     4
    10                              <4> 
    11                              <4> BREAK <File modes>
    12                              <4> 
    13                              <4> access_mask	EQU 0FH
    14                              <4> open_for_read	EQU 00h
    15                              <4> open_for_write	EQU 01h
    16                              <4> open_for_both	EQU 02h
    17                              <4> 
    18                              <4> sharing_mask	    EQU 0F0H
    19                              <4> sharing_compat	    EQU 000H
    20                              <4> sharing_deny_both   EQU 010H
    21                              <4> sharing_deny_write  EQU 020H
    22                              <4> sharing_deny_read   EQU 030H
    23                              <4> sharing_deny_none   EQU 040H
    24                              <4> sharing_net_FCB     EQU 070h
    25                              <4> sharing_no_inherit  EQU 080H
    26                              <4> 
    27                              <4> BREAK <Extended Open>
    28                              <4> 
    29                              <4> no_code_page_check	  EQU 0100H
    30                              <4> int_24_error		  EQU 2000H
    31                              <4> auto_commit_write	  EQU 4000H
    32                              <4> ext_open_on		  EQU 01H
    33                              <4> ext_file_not_exists	  EQU 04H
    34                              <4> ext_open_I24_off	  EQU 02H
    35                              <4> io_mode_id		  EQU 00000010B
    36                              <4> reserved_bits_mask	  EQU 0FE00H
    37                              <4> exists_mask		  EQU 0FH
    38                              <4> not_exists_mask 	  EQU 0F0H
    39                              <4> action_opened		  EQU  01H
    40                              <4> action_created_opened	  EQU  02H
    41                              <4> action_replaced_opened	  EQU  03H
    42                              <4> 
    43                              <4> ext_exists_open     EQU 01H
    44                              <4> ext_exists_fail     EQU 0H
    45                              <4> ext_nexists_create  EQU 10H
    46                              <4> 
    47                              <4> 
    48                              <4> 
    49                              <4> ext_open_parm	   struc
    50 00000000 ????????            <4> ext_set_list	    dd ?
    51 00000004 ????                <4> ext_num_of_parm     dw ?
    52                              <4> ext_open_parm	   ends
    53                              <4> 
    54                              <4> 
    55                              <4> 
   171                              <3> 
   172                              <3> %include "error.mac"
     1                              <4> ;	SCCSID = @(#)error.asm	1.1 85/04/10
     2                              <4> ;	SCCSID = @(#)error.asm	1.1 85/04/10
     3                              <4> BREAK <Xenix error codes>
     4                              <4> 
     5                              <4> ;
     6                              <4> ; XENIX calls all return error codes through AX.  If an error occurred then
     7                              <4> ; the carry bit will be set and the error code is in AX.  If no error occurred
     8                              <4> ; then the carry bit is reset and AX contains returned info.
     9                              <4> ;
    10                              <4> ; Since the set of error codes is being extended as we extend the operating
    11                              <4> ; system, we have provided a means for applications to ask the system for a
    12                              <4> ; recommended course of action when they receive an error.
    13                              <4> ;
    14                              <4> ; The GetExtendedError system call returns a universal error, an error
    15                              <4> ; location and a recommended course of action.	The universal error code is
    16                              <4> ; a symptom of the error REGARDLESS of the context in which GetExtendedError
    17                              <4> ; is issued.
    18                              <4> ;
    19                              <4> 
    20                              <4> ;
    21                              <4> ; These are the 2.0 error codes
    22                              <4> ;
    23                              <4> error_invalid_function		EQU	1
    24                              <4> error_file_not_found		EQU	2
    25                              <4> error_path_not_found		EQU	3
    26                              <4> error_too_many_open_files	EQU	4
    27                              <4> error_access_denied		EQU	5
    28                              <4> error_invalid_handle		EQU	6
    29                              <4> error_arena_trashed		EQU	7
    30                              <4> error_not_enough_memory 	EQU	8
    31                              <4> error_invalid_block		EQU	9
    32                              <4> error_bad_environment		EQU	10
    33                              <4> error_bad_format		EQU	11
    34                              <4> error_invalid_access		EQU	12
    35                              <4> error_invalid_data		EQU	13
    36                              <4> ;**** reserved			EQU	14	; *****
    37                              <4> error_invalid_drive		EQU	15
    38                              <4> error_current_directory 	EQU	16
    39                              <4> error_not_same_device		EQU	17
    40                              <4> error_no_more_files		EQU	18
    41                              <4> ;
    42                              <4> ; These are the universal int 24 mappings for the old INT 24 set of errors
    43                              <4> ;
    44                              <4> error_write_protect		EQU	19
    45                              <4> error_bad_unit			EQU	20
    46                              <4> error_not_ready 		EQU	21
    47                              <4> error_bad_command		EQU	22
    48                              <4> error_CRC			EQU	23
    49                              <4> error_bad_length		EQU	24
    50                              <4> error_Seek			EQU	25
    51                              <4> error_not_DOS_disk		EQU	26
    52                              <4> error_sector_not_found		EQU	27
    53                              <4> error_out_of_paper		EQU	28
    54                              <4> error_write_fault		EQU	29
    55                              <4> error_read_fault		EQU	30
    56                              <4> error_gen_failure		EQU	31
    57                              <4> ;
    58                              <4> ; These are the new 3.0 error codes reported through INT 24
    59                              <4> ;
    60                              <4> error_sharing_violation 	EQU	32
    61                              <4> error_lock_violation		EQU	33
    62                              <4> error_wrong_disk		EQU	34
    63                              <4> error_FCB_unavailable		EQU	35
    64                              <4> error_sharing_buffer_exceeded	EQU	36
    65                              <4> error_Code_Page_Mismatched	EQU	37    ; DOS 4.00 			;AN000;
    66                              <4> error_handle_EOF		EQU	38    ; DOS 4.00 			;AN000;
    67                              <4> error_handle_Disk_Full		EQU	39    ; DOS 4.00 			;AN000;
    68                              <4> ;
    69                              <4> ; New OEM network-related errors are 50-79
    70                              <4> ;
    71                              <4> error_not_supported		EQU	50
    72                              <4> ;
    73                              <4> ; End of INT 24 reportable errors
    74                              <4> ;
    75                              <4> error_file_exists		EQU	80
    76                              <4> error_DUP_FCB			EQU	81	; *****
    77                              <4> error_cannot_make		EQU	82
    78                              <4> error_FAIL_I24			EQU	83
    79                              <4> ;
    80                              <4> ; New 3.0 network related error codes
    81                              <4> ;
    82                              <4> error_out_of_structures 	EQU	84
    83                              <4> error_Already_assigned		EQU	85
    84                              <4> error_invalid_password		EQU	86
    85                              <4> error_invalid_parameter 	EQU	87
    86                              <4> error_NET_write_fault		EQU	88
    87                              <4> error_sys_comp_not_loaded	EQU	90    ; DOS 4.00				;AN000;
    88                              <4> 
    89                              <4> BREAK <Interrupt 24 error codes>
    90                              <4> 
    91                              <4> error_I24_write_protect 	EQU	0
    92                              <4> error_I24_bad_unit		EQU	1
    93                              <4> error_I24_not_ready		EQU	2
    94                              <4> error_I24_bad_command		EQU	3
    95                              <4> error_I24_CRC			EQU	4
    96                              <4> error_I24_bad_length		EQU	5
    97                              <4> error_I24_Seek			EQU	6
    98                              <4> error_I24_not_DOS_disk		EQU	7
    99                              <4> error_I24_sector_not_found	EQU	8
   100                              <4> error_I24_out_of_paper		EQU	9
   101                              <4> error_I24_write_fault		EQU	0Ah
   102                              <4> error_I24_read_fault		EQU	0Bh
   103                              <4> error_I24_gen_failure		EQU	0Ch
   104                              <4> ; NOTE: Code 0DH is used by MT-DOS.
   105                              <4> error_I24_wrong_disk		EQU	0Fh
   106                              <4> 
   107                              <4> ; THE FOLLOWING ARE MASKS FOR THE AH REGISTER ON Int 24
   108                              <4> 
   109                              <4> Allowed_FAIL			EQU	00001000B
   110                              <4> Allowed_RETRY			EQU	00010000B
   111                              <4> Allowed_IGNORE			EQU	00100000B
   112                              <4> ;NOTE: ABORT is ALWAYS allowed
   113                              <4> 
   114                              <4> I24_operation			EQU	00000001B	;Z if READ,NZ if Write
   115                              <4> I24_area			EQU	00000110B	; 00 if DOS
   116                              <4> 							; 01 if FAT
   117                              <4> 							; 10 if root DIR
   118                              <4> 							; 11 if DATA
   119                              <4> I24_class			EQU	10000000B	;Z if DISK, NZ if FAT or char
   120                              <4> 
   121                              <4> BREAK <GetExtendedError CLASSes ACTIONs LOCUSs>
   122                              <4> 
   123                              <4> ; Values for error CLASS
   124                              <4> 
   125                              <4> errCLASS_OutRes 	EQU	1	; Out of Resource
   126                              <4> errCLASS_TempSit	EQU	2	; Temporary Situation
   127                              <4> errCLASS_Auth		EQU	3	; Permission problem
   128                              <4> errCLASS_Intrn		EQU	4	; Internal System Error
   129                              <4> errCLASS_HrdFail	EQU	5	; Hardware Failure
   130                              <4> errCLASS_SysFail	EQU	6	; System Failure
   131                              <4> errCLASS_Apperr 	EQU	7	; Application Error
   132                              <4> errCLASS_NotFnd 	EQU	8	; Not Found
   133                              <4> errCLASS_BadFmt 	EQU	9	; Bad Format
   134                              <4> errCLASS_Locked 	EQU	10	; Locked
   135                              <4> errCLASS_Media		EQU	11	; Media Failure
   136                              <4> errCLASS_Already	EQU	12	; Collision with Existing Item
   137                              <4> errCLASS_Unk		EQU	13	; Unknown/other
   138                              <4> 
   139                              <4> ; Values for error ACTION
   140                              <4> 
   141                              <4> errACT_Retry		EQU	1	; Retry
   142                              <4> errACT_DlyRet		EQU	2	; Delay Retry, retry after pause
   143                              <4> errACT_User		EQU	3	; Ask user to regive info
   144                              <4> errACT_Abort		EQU	4	; abort with clean up
   145                              <4> errACT_Panic		EQU	5	; abort immediately
   146                              <4> errACT_Ignore		EQU	6	; ignore
   147                              <4> errACT_IntRet		EQU	7	; Retry after User Intervention
   148                              <4> 
   149                              <4> ; Values for error LOCUS
   150                              <4> 
   151                              <4> errLOC_Unk		EQU	1	; No appropriate value
   152                              <4> errLOC_Disk		EQU	2	; Random Access Mass Storage
   153                              <4> errLOC_Net		EQU	3	; Network
   154                              <4> errLOC_SerDev		EQU	4	; Serial Device
   155                              <4> errLOC_Mem		EQU	5	; Memory
   173                              <3> 
   174                              <3> %include "syscall.mac"
     1                              <4> ;	SCCSID = @(#)syscall.asm	1.1 85/04/10
     2                              <4> ;BREAK <system call definitions>
     3                              <4> ;SUBTTL	system call definitions
     4                              <4> ;PAGE
     5                              <4> 
     6                              <4> Abort				EQU 0	;  0	  0
     7                              <4> Std_Con_Input			EQU 1	;  1	  1
     8                              <4> Std_Con_Output			EQU 2	;  2	  2
     9                              <4> Std_Aux_Input			EQU 3	;  3	  3
    10                              <4> Std_Aux_Output			EQU 4	;  4	  4
    11                              <4> Std_Printer_Output		EQU 5	;  5	  5
    12                              <4> Raw_Con_IO			EQU 6	;  6	  6
    13                              <4> Raw_Con_Input			EQU 7	;  7	  7
    14                              <4> Std_Con_Input_No_Echo		EQU 8	;  8	  8
    15                              <4> Std_Con_String_Output		EQU 9	;  9	  9
    16                              <4> Std_Con_String_Input		EQU 10	; 10	  A
    17                              <4> Std_Con_Input_Status		EQU 11	; 11	  B
    18                              <4> Std_Con_Input_Flush		EQU 12	; 12	  C
    19                              <4> Disk_Reset			EQU 13	; 13	  D
    20                              <4> Set_Default_Drive		EQU 14	; 14	  E
    21                              <4> FCB_Open			EQU 15	; 15	  F
    22                              <4> FCB_Close			EQU 16	; 16	 10
    23                              <4> Dir_Search_First		EQU 17	; 17	 11
    24                              <4> Dir_Search_Next 		EQU 18	; 18	 12
    25                              <4> FCB_Delete			EQU 19	; 19	 13
    26                              <4> FCB_Seq_Read			EQU 20	; 20	 14
    27                              <4> FCB_Seq_Write			EQU 21	; 21	 15
    28                              <4> FCB_Create			EQU 22	; 22	 16
    29                              <4> FCB_Rename			EQU 23	; 23	 17
    30                              <4> Get_Default_Drive		EQU 25	; 25	 19
    31                              <4> Set_DMA 			EQU 26	; 26	 1A
    32                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    33                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    34                              <4> ;									   ;
    35                              <4> Get_Default_DPB 		EQU 31	; 31	 1F
    36                              <4> ;									   ;
    37                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    38                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    39                              <4> FCB_Random_Read 		EQU 33	; 33	 21
    40                              <4> FCB_Random_Write		EQU 34	; 34	 22
    41                              <4> Get_FCB_File_Length		EQU 35	; 35	 23
    42                              <4> Get_FCB_Position		EQU 36	; 36	 24
    43                              <4> Set_Interrupt_Vector		EQU 37	; 37	 25
    44                              <4> Create_Process_Data_Block	EQU 38	; 38	 26
    45                              <4> FCB_Random_Read_Block		EQU 39	; 39	 27
    46                              <4> FCB_Random_Write_Block		EQU 40	; 40	 28
    47                              <4> Parse_File_Descriptor		EQU 41	; 41	 29
    48                              <4> Get_Date			EQU 42	; 42	 2A
    49                              <4> Set_Date			EQU 43	; 43	 2B
    50                              <4> Get_Time			EQU 44	; 44	 2C
    51                              <4> Set_Time			EQU 45	; 45	 2D
    52                              <4> Set_Verify_On_Write		EQU 46	; 46	 2E
    53                              <4> ; Extended functionality group
    54                              <4> Get_DMA 			EQU 47	; 47	 2F
    55                              <4> Get_Version			EQU 48	; 48	 30
    56                              <4> Keep_Process			EQU 49	; 49	 31
    57                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    58                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    59                              <4> ;									   ;
    60                              <4> Get_DPB 			EQU 50	; 50	 32
    61                              <4> ;									   ;
    62                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
    63                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
    64                              <4> Set_CTRL_C_Trapping		EQU 51	; 51	 33
    65                              <4> Get_InDOS_Flag			EQU 52	; 52	 34
    66                              <4> Get_Interrupt_Vector		EQU 53	; 53	 35
    67                              <4> Get_Drive_Freespace		EQU 54	; 54	 36
    68                              <4> Char_Oper			EQU 55	; 55	 37
    69                              <4> International			EQU 56	; 56	 38
    70                              <4> ;   Directory Group
    71                              <4> MKDir				EQU 57	; 57	 39
    72                              <4> RMDir				EQU 58	; 58	 3A
    73                              <4> CHDir				EQU 59	; 59	 3B
    74                              <4> ;   File Group
    75                              <4> Creat				EQU 60	; 60	 3C
    76                              <4> Open				EQU 61	; 61	 3D
    77                              <4> Close				EQU 62	; 62	 3E
    78                              <4> Read				EQU 63	; 63	 3F
    79                              <4> Write				EQU 64	; 64	 40
    80                              <4> Unlink				EQU 65	; 65	 41
    81                              <4> LSeek				EQU 66	; 66	 42
    82                              <4> CHMod				EQU 67	; 67	 43
    83                              <4> IOCtl				EQU 68	; 68	 44
    84                              <4> XDup				EQU 69	; 69	 45
    85                              <4> XDup2				EQU 70	; 70	 46
    86                              <4> Current_Dir			EQU 71	; 71	 47
    87                              <4> ;    Memory Group
    88                              <4> Alloc				EQU 72	; 72	 48
    89                              <4> Dealloc 			EQU 73	; 73	 49
    90                              <4> Setblock			EQU 74	; 74	 4A
    91                              <4> ;    Process Group
    92                              <4> Exec				EQU 75	; 75	 4B
    93                              <4> Exit				EQU 76	; 76	 4C
    94                              <4> WaitProcess			EQU 77	; 77	 4D
    95                              <4> Find_First			EQU 78	; 78	 4E
    96                              <4> ;   Special Group
    97                              <4> Find_Next			EQU 79	; 79	 4F
    98                              <4> ; SPECIAL SYSTEM GROUP
    99                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   100                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   101                              <4> ;									   ;
   102                              <4> Set_Current_PDB 		EQU 80	; 80	 50
   103                              <4> Get_Current_PDB 		EQU 81	; 81	 51
   104                              <4> Get_In_Vars			EQU 82	; 82	 52
   105                              <4> SetDPB				EQU 83	; 83	 53
   106                              <4> ;									   ;
   107                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   108                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   109                              <4> Get_Verify_On_Write		EQU 84	; 84	 54
   110                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   111                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   112                              <4> ;									   ;
   113                              <4> Dup_PDB 			EQU 85	; 85	 55
   114                              <4> ;									   ;
   115                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   116                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   117                              <4> Rename				EQU 86	; 86	 56
   118                              <4> File_Times			EQU 87	; 87	 57
   119                              <4> AllocOper			EQU 88	; 88	 58
   120                              <4> ; Network extention system calls
   121                              <4> GetExtendedError		EQU 89	; 89	 59
   122                              <4> CreateTempFile			EQU 90	; 90	 5A
   123                              <4> CreateNewFile			EQU 91	; 91	 5B
   124                              <4> LockOper			EQU 92	; 92	 5C Lock and Unlock
   125                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   126                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   127                              <4> ;									   ;
   128                              <4> ServerCall			EQU 93	; 93	 5D CommitAll, ServerDOSCall,
   129                              <4> 					;	    CloseByName, CloseUser,
   130                              <4> 					;	    CloseUserProcess,
   131                              <4> 					;	    GetOpenFileList
   132                              <4> ;									   ;
   133                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   134                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   135                              <4> UserOper			EQU 94	; 94	 5E Get and Set
   136                              <4> AssignOper			EQU 95	; 95	 5F On, Off, Get, Set, Cancel
   137                              <4> xNameTrans			EQU 96	; 96	 60
   138                              <4> PathParse			EQU 97	; 97	 61
   139                              <4> GetCurrentPSP			EQU 98	; 98	 62
   140                              <4> Hongeul 			EQU 99	; 99	 63
   141                              <4> ECS_CALL			EQU 99	; 99	 63  ;; DBCS support
   142                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   143                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   144                              <4> ;									   ;
   145                              <4> Set_Printer_Flag		EQU 100 ; 100	 64
   146                              <4> ;									   ;
   147                              <4> ;	     C	A  V  E  A  T	  P  R	O  G  R  A  M  M  E  R		   ;
   148                              <4> ;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
   149                              <4> GetExtCntry			EQU 101 ; 101	 65
   150                              <4> GetSetCdPg			EQU 102 ; 102	 66
   151                              <4> ExtHandle			EQU 103 ; 103	 67
   152                              <4> Commit				EQU 104 ; 104	 68
   153                              <4> GetSetMediaID			EQU 105 ; 105	 69
   154                              <4> IFS_IOCTL			EQU 107 ; 107	 6B
   155                              <4> ExtOpen 			EQU 108 ; 108	 6C
   156                              <4> ;
   157                              <4> ;
   158                              <4> Set_Oem_Handler 		EQU 248 ; 248	 F8
   159                              <4> OEM_C1				EQU 249 ; 249	 F9
   160                              <4> OEM_C2				EQU 250 ; 250	 FA
   161                              <4> OEM_C3				EQU 251 ; 251	 FB
   162                              <4> OEM_C4				EQU 252 ; 252	 FC
   163                              <4> OEM_C5				EQU 253 ; 253	 FD
   164                              <4> OEM_C6				EQU 254 ; 254	 FE
   165                              <4> OEM_C7				EQU 255 ; 255	 FF
   175                              <3> 
   176                              <3> ;SUBTTL
   177                              <3> 
    24                              <2> %include "dosmac.mac"
     1                              <3> ;	SCCSID = @(#)dosmac.asm	1.1 85/04/10
     2                              <3> ;	SCCSID = @(#)dosmac.asm	1.1 85/04/10
     3                              <3> ;
     4                              <3> ; Macro file for MSDOS.
     5                              <3> ;
     6                              <3> 
     7                              <3> %ifndef __DOSMAC_MAC__
     8                              <3>  %assign __DOSMAC_MAC__ 1
     9                              <3> 
    10                              <3> TRUE    EQU 0FFFFh
    11                              <3> FALSE   EQU 0
    12                              <3> 
    13                              <3> 
    14                              <3> ; NASM original macros (comment for fixmem.pl)
    15                              <3> 
    16                              <3> ;SUBTTL BREAK a listing into pages and give new subtitles
    17                              <3> ;PAGE
    18                              <3> %imacro BREAK 0-1+.nolist
    19                              <3> 	;SUBTTL  subtitle
    20                              <3> 	;PAGE
    21                              <3> %endmacro
    22                              <3> ;.xcref  break
    23                              <3> 
    24                              <3> BREAK   <ASMVAR - handle assembly variables once and for all>
    25                              <3> 
    26                              <3> %if 0
    27                              <3> AsmVars Macro   varlist
    28                              <3> IRP     var,<varlist>
    29                              <3> AsmVar  var
    30                              <3> ENDM
    31                              <3> ENDM
    32                              <3> 
    33                              <3> AsmVar  Macro   var
    34                              <3> IFNDEF  var
    35                              <3> var = FALSE
    36                              <3> ENDIF
    37                              <3> ENDM
    38                              <3> %endif
    39                              <3> 
    40                              <3> BREAK <I_NEED: declare a variable external, if necessary, and allocate a size>
    41                              <3> 
    42                              <3> ;
    43                              <3> ; declare a variable external and allocate a size
    44                              <3> ;
    45                              <3> ;AsmVar  InstalledData
    46                              <3> %ifndef InstalledData
    47                              <3>  %define InstalledData 0
    48                              <3> %endif
    49                              <3> 
    50                              <3> %imacro I_NEED 1-2.nolist
    51                              <3> %ifn InstalledData
    52                              <3> 	[section DATA]
    53                              <3>     %IFIDNi   %2, WORD
    54                              <3> 	EXTRN   %1:WORD
    55                              <3>     %ELSE
    56                              <3> 	%IFIDNi   %2, DWORD
    57                              <3> 	EXTRN   %1:DWORD
    58                              <3> 	%ELSE
    59                              <3> 	EXTRN   %1:BYTE
    60                              <3> 	%ENDIF
    61                              <3>     %ENDIF
    62                              <3> 	__SECT__
    63                              <3> %ENDIF
    64                              <3> %endmacro
    65                              <3> 	;.xcref I_need
    66                              <3> 
    67                              <3> ;
    68                              <3> ; call a procedure that may be external.  The call will be short.
    69                              <3> ;
    70                              <3> %imacro invoke 1.nolist
    71                              <3> ;.xcref
    72                              <3> 	EXTRN   %1:NEAR
    73                              <3> ;.cref
    74                              <3> 	CALL    %1
    75                              <3> %endmacro
    76                              <3> ;.xcref  invoke
    77                              <3> 
    78                              <3> ;PAGE
    79                              <3> ;
    80                              <3> ; jump to a label that may be external.  The jump will be near.
    81                              <3> ;
    82                              <3> %imacro transfer 1.nolist
    83                              <3> ;.xcref
    84                              <3> 	EXTRN   %1:NEAR
    85                              <3> ;.cref
    86                              <3> 	JUMP    %1
    87                              <3> %endmacro
    88                              <3> ;.xcref  transfer
    89                              <3> 
    90                              <3> ;
    91                              <3> ; get a short address in a word
    92                              <3> ;
    93                              <3> %imacro short_addr 1.nolist
    94                              <3>     %ifnidn %1, ?
    95                              <3> 	EXTRN   %1:NEAR
    96                              <3> 	DW  OFFSET %1
    97                              <3>     %ELSE
    98                              <3> 	DW  ?
    99                              <3>     %ENDIF
   100                              <3> %endmacro
   101                              <3> ;.xcref  short_addr
   102                              <3> 
   103                              <3> ;
   104                              <3> ; get a long address in a dword
   105                              <3> ;
   106                              <3> %imacro long_addr 1.nolist
   107                              <3> 	EXTRN   %1:NEAR
   108                              <3> 	DD  %1
   109                              <3> %endmacro
   110                              <3> ;.xcref  long_addr
   111                              <3> 
   112                              <3> ;
   113                              <3> ; declare a PROC near or far but PUBLIC nonetheless
   114                              <3> ;
   115                              <3> ;.xcref ?frame
   116                              <3> ;.xcref ?aframe
   117                              <3> ;.xcref ?stackdepth
   118                              <3> ;.xcref ?initstack
   119                              <3> %assign ?frame           0                     ; initial
   120                              <3> %assign ?aframe          0                     ; initial
   121                              <3> %assign ?stackdepth      0                     ; initial stack size
   122                              <3> %assign ?initstack       0                     ; initial stack size
   123                              <3> 
   124                              <3> %imacro procedure 1-2.nolist
   125                              <3> 	%assign ?frame     0
   126                              <3> 	%assign ?aframe    2                   ;; remember the pushed BP
   127                              <3> 	%warning proc %1...
   128                              <3> %1    PROC    %2
   129                              <3> 	PUBLIC  %1
   130                              <3> 	%assign ?initstack     ?stackdepth     ;; beginning of procedure
   131                              <3> %endmacro
   132                              <3> ;.xcref  procedure
   133                              <3> 
   134                              <3> ;
   135                              <3> ; end a procedure and check that stack depth is preserved
   136                              <3> ;
   137                              <3> %imacro EndProc 1-2.nolist
   138                              <3> 	%ifnidni   %2, NoCheck        ;; check the stack size
   139                              <3> 	%if ?initstack != ?stackdepth    ;; is it different?
   140                              <3> 	%warning    ***** Possible stack size error in %1 *****
   141                              <3> 	%endif
   142                              <3> 	%endif
   143                              <3> %1    ENDP
   144                              <3> %endmacro
   145                              <3> ;.xcref  endproc
   146                              <3> ;PAGE
   147                              <3> ;
   148                              <3> ; define a data item to be public and of an appropriate size/type
   149                              <3> ;
   150                              <3> 
   151                              <3> %imacro stripangles 2.nolist
   152                              <3> %defstr %%param %2
   153                              <3> %rep 16
   154                              <3>  %substr %%opening %%param 1
   155                              <3>  %ifidn %%opening, '<'
   156                              <3>   %substr %%param %%param 2,-1
   157                              <3>  %endif
   158                              <3> %endrep
   159                              <3> %rep 16
   160                              <3>  %strlen %%length %%param
   161                              <3>  %substr %%closing %%param %%length
   162                              <3>  %ifidn %%closing, '>'
   163                              <3>   %substr %%param %%param 1,-2
   164                              <3>  %endif
   165                              <3> %endrep
   166                              <3> %deftok %%token %%param
   167                              <3> %1 %%token
   168                              <3> %endmacro
   169                              <3> 
   170                              <3> %imacro I_AM 2-*.nolist
   171                              <3> ;I_AM    MACRO   name,size,init
   172                              <3> %xdefine %%name %1
   173                              <3> ;; declare the type of the object
   174                              <3>     %IFIDNi %2, WORD
   175                              <3> %1    LABEL WORD
   176                              <3> 	%assign I_AM_SIZE      1
   177                              <3> 	%assign I_AM_LEN       2
   178                              <3>     %ELSE
   179                              <3> 	%IFIDNi %2, DWORD
   180                              <3> %1    LABEL DWORD
   181                              <3> 	%assign I_AM_SIZE      2
   182                              <3> 	%assign I_AM_LEN       2
   183                              <3> 	%ELSE
   184                              <3> 	    %IFIDNi %2, BYTE
   185                              <3> %1    LABEL BYTE
   186                              <3> 	%assign I_AM_SIZE      1
   187                              <3> 	%assign I_AM_LEN       1
   188                              <3> 	    %ELSE
   189                              <3> %1    LABEL BYTE
   190                              <3> %undef I_AM_SIZE
   191                              <3> 	stripangles %assign I_AM_SIZE, %2
   192                              <3> 	%assign I_AM_LEN       1
   193                              <3> 	    %ENDIF
   194                              <3> 	%ENDIF
   195                              <3>     %ENDIF
   196                              <3> ;; declare the object public
   197                              <3> 	PUBLIC  %%name
   198                              <3> ;; if no initialize then allocate blank storage
   199                              <3>     %IF %0 == 2
   200                              <3> 	DB  I_AM_SIZE*I_AM_LEN DUP (?)
   201                              <3>     %ELSE
   202                              <3> %ifn InstalledData
   203                              <3>  %rotate 2
   204                              <3>  %rep %0 - 2
   205                              <3> 	    %IF I_AM_LEN == 1
   206                              <3> 		stripangles db, %1
   207                              <3> 	    %ELSE
   208                              <3> 		stripangles dw, %1
   209                              <3> 	    %ENDIF
   210                              <3> 	    %assign I_AM_SIZE I_AM_SIZE - 1
   211                              <3> 	    %rotate 1
   212                              <3>  %endrep
   213                              <3> 	%IF I_AM_SIZE != 0
   214                              <3> 	    %error    ***** initialization of %%name not complete *****
   215                              <3> 	%ENDIF
   216                              <3> %ELSE
   217                              <3> 	DB  I_AM_SIZE*I_AM_LEN DUP (?)
   218                              <3> %ENDIF
   219                              <3>     %ENDIF
   220                              <3> %endmacro
   221                              <3> 
   222                              <3> %imacro I_AM_NOBITS 2-*.nolist
   223                              <3> ;I_AM    MACRO   name,size,init
   224                              <3> %xdefine %%name %1
   225                              <3> ;; declare the type of the object
   226                              <3>     %IFIDNi %2, WORD
   227                              <3> %1    LABEL WORD
   228                              <3> 	%assign I_AM_SIZE      1
   229                              <3> 	%assign I_AM_LEN       2
   230                              <3>     %ELSE
   231                              <3> 	%IFIDNi %2, DWORD
   232                              <3> %1    LABEL DWORD
   233                              <3> 	%assign I_AM_SIZE      2
   234                              <3> 	%assign I_AM_LEN       2
   235                              <3> 	%ELSE
   236                              <3> 	    %IFIDNi %2, BYTE
   237                              <3> %1    LABEL BYTE
   238                              <3> 	%assign I_AM_SIZE      1
   239                              <3> 	%assign I_AM_LEN       1
   240                              <3> 	    %ELSE
   241                              <3> %1    LABEL BYTE
   242                              <3> %undef I_AM_SIZE
   243                              <3> 	stripangles %assign I_AM_SIZE, %2
   244                              <3> 	%assign I_AM_LEN       1
   245                              <3> 	    %ENDIF
   246                              <3> 	%ENDIF
   247                              <3>     %ENDIF
   248                              <3> ;; declare the object public
   249                              <3> 	PUBLIC  %%name
   250                              <3> ;; if no initialize then allocate blank storage
   251                              <3>     %IF %0 == 2
   252                              <3> 	resb  I_AM_SIZE*I_AM_LEN
   253                              <3>     %ELSE
   254                              <3> %ifn InstalledData
   255                              <3>  %rotate 2
   256                              <3>  %rep %0 - 2
   257                              <3> 	    %IF I_AM_LEN == 1
   258                              <3> 		resb 1
   259                              <3> 	    %ELSE
   260                              <3> 		resw 1
   261                              <3> 	    %ENDIF
   262                              <3> 	    %assign I_AM_SIZE I_AM_SIZE - 1
   263                              <3> 	    %rotate 1
   264                              <3>  %endrep
   265                              <3> 	%IF I_AM_SIZE != 0
   266                              <3> 	    %error    ***** initialization of %%name not complete *****
   267                              <3> 	%ENDIF
   268                              <3> %ELSE
   269                              <3> 	resb  I_AM_SIZE*I_AM_LEN
   270                              <3> %ENDIF
   271                              <3>     %ENDIF
   272                              <3> %endmacro
   273                              <3> 
   274                              <3> ;.xcref  I_AM
   275                              <3> ;.xcref  I_AM_SIZE
   276                              <3> ;.xcref  I_AM_LEN
   277                              <3> %assign I_AM_SIZE 0
   278                              <3> %assign I_AM_LEN  0
   279                              <3> 
   280                              <3> ;PAGE
   281                              <3> 
   282                              <3> ;
   283                              <3> ; define an entry in a procedure
   284                              <3> ;
   285                              <3> %imacro entry 1-2.nolist
   286                              <3> %1:
   287                              <3> 	PUBLIC  %1
   288                              <3> %endmacro
   289                              <3> ;.xcref  entry
   290                              <3> 
   291                              <3> BREAK <ERROR - store an error code then jump to a label>
   292                              <3> 
   293                              <3> %imacro error 1.nolist
   294                              <3> ;.xcref
   295                              <3> 	MOV AL, %1
   296                              <3> 	transfer    SYS_RET_ERR
   297                              <3> ;.cref
   298                              <3> %endmacro
   299                              <3> ;.xcref  error
   300                              <3> 
   301                              <3> BREAK <JUMP - real jump that links up shortwise>
   302                              <3> ;
   303                              <3> ; given a label <lbl> either 2 byte jump to another label <lbl>_J
   304                              <3> ; if it is near enough or 3 byte jump to <lbl>
   305                              <3> ;
   306                              <3> 
   307                              <3> %imacro jump 1.nolist
   308                              <3> ;.xcref
   309                              <3> 
   310                              <3>     %ifndef %1_J                       ;; is this the first invocation
   311                              <3> %%a:      JMP %1
   312                              <3>     %ELSE
   313                              <3> 	%IF (%1_J >= $) || ($-%1_J > 126)
   314                              <3> %%a:      JMP %1                         ;; is the jump too far away?
   315                              <3> 	%ELSE
   316                              <3> %%a:      JMP %1_J                      ;; do the short one...
   317                              <3> 	%ENDIF
   318                              <3>     %ENDIF
   319                              <3>     %ixdefine %1_j %%a
   320                              <3> ;.cref
   321                              <3> %endmacro
   322                              <3> ;.xcref  jump
   323                              <3> 
   324                              <3> BREAK <RETURN - return from a function>
   325                              <3> 
   326                              <3> %imacro return 0.nolist
   327                              <3> %%a:
   328                              <3> 	RET
   329                              <3> %xdefine ret_l %%a
   330                              <3> %endmacro
   331                              <3> ;.xcref  return
   332                              <3> 
   333                              <3> BREAK <CONDRET - conditional return>
   334                              <3> 
   335                              <3> %imacro condret 2.nolist
   336                              <3> %assign %%exit 0
   337                              <3>     %ifdef   ret_l                       ;; if ret_l is defined
   338                              <3> 	%if (($ - ret_l) <= 126) && ($ > ret_l)
   339                              <3> 					;;     if ret_l is near enough then
   340                              <3> 	    %%a:  j%1    ret_l           ;;         a: j<CC> to ret_l
   341                              <3> 	    %xdefine ret_%1 %%a                 ;;         define ret_<CC> to be a:
   342                              <3> 	    %assign %%exit 1
   343                              <3> 	%endif
   344                              <3>     %endif
   345                              <3>     %ifn %%exit
   346                              <3>     %ifdef   ret_%1                     ;; if ret_<CC> defined
   347                              <3> 	%if (($ - ret_%1) <= 126) && ($ > ret_%1)
   348                              <3> 					;;     if ret_<CC> is near enough
   349                              <3> 	    %%a:  j%1    ret_%1         ;;         a: j<CC> to ret_<CC>
   350                              <3> 	    %xdefine ret_%1 %%a                 ;;         define ret_<CC> to be a:
   351                              <3> 	    %assign %%exit 1
   352                              <3> 	%endif
   353                              <3>     %endif
   354                              <3>     %endif
   355                              <3>     %ifn %%exit
   356                              <3>     j%2   %%a                           ;; j<NCC> a:
   357                              <3>     return                              ;; return
   358                              <3>     %%a:                                  ;; a:
   359                              <3>     %xdefine ret_%1 ret_l                     ;; define ret_<CC> to be ret_l
   360                              <3>     %endif
   361                              <3> %endmacro
   362                              <3> ;.xcref  condret
   363                              <3> 
   364                              <3> BREAK <RETZ - return if zero, links up shortwise if necessary>
   365                              <3> 
   366                              <3> %imacro retz 0.nolist
   367                              <3>     condret z,nz
   368                              <3> %endmacro
   369                              <3> ;.xcref  retz
   370                              <3> 
   371                              <3> BREAK <RETNZ - return if not zero, links up shortwise if necessary>
   372                              <3> 
   373                              <3> %imacro retnz 0.nolist
   374                              <3>     condret nz,z
   375                              <3> %endmacro
   376                              <3> ;.xcref  retnz
   377                              <3> 
   378                              <3> BREAK <RETC - return if carry set, links up shortwise if necessary>
   379                              <3> 
   380                              <3> %imacro retc 0.nolist
   381                              <3>     condret c,nc
   382                              <3> %endmacro
   383                              <3> ;.xcref  retc
   384                              <3> 
   385                              <3> BREAK <RETNC - return if not carry, links up shortwise if necessary>
   386                              <3> 
   387                              <3> %imacro retnc 0.nolist
   388                              <3>     condret nc,c
   389                              <3> %endmacro
   390                              <3> ;.xcref  retnc
   391                              <3> 
   392                              <3> BREAK <CONTEXT - set the DOS context to a particular register>
   393                              <3> 
   394                              <3> %imacro context 1.nolist
   395                              <3> 	PUSH    SS
   396                              <3> 	stripangles POP, %1
   397                              <3> 	; ASSUME  %1:DOSGROUP
   398                              <3> %endmacro
   399                              <3> ;.xcref  context
   400                              <3> 
   401                              <3> BREAK <SaveReg - save a set of registers>
   402                              <3> 
   403                              <3> %imacro SaveReg 0-*.nolist                 ;; push those registers
   404                              <3>  %rep %0
   405                              <3> 	%assign ?stackdepth ?stackdepth + 1
   406                              <3> 	stripangles push, %1
   407                              <3> 	%rotate 1
   408                              <3>  %endrep
   409                              <3> %endmacro
   410                              <3> ;.xcref  SaveReg
   411                              <3> 
   412                              <3> BREAK <RestoreReg - unsave some registers>
   413                              <3> 
   414                              <3> %imacro RestoreReg 0-*.nolist             ;; pop those registers
   415                              <3>  %rep %0
   416                              <3> 	%assign ?stackdepth ?stackdepth - 1
   417                              <3> 	stripangles pop, %1
   418                              <3> 	%rotate 1
   419                              <3>  %endrep
   420                              <3> %endmacro
   421                              <3> ;.xcref  RestoreReg
   422                              <3> 
   423                              <3> BREAK <Critical section macros>
   424                              <3> 
   425                              <3> %imacro EnterCrit 1.nolist
   426                              <3> 	Invoke  E%1
   427                              <3> %endmacro
   428                              <3> 
   429                              <3> %imacro LeaveCrit 1.nolist
   430                              <3> 	Invoke  L%1
   431                              <3> %endmacro
   432                              <3> 
   433                              <3> Break   <message - display a message>
   434                              <3> 
   435                              <3> ;AsmVars <ShareF,Cargs,Redirector>
   436                              <3> %ifndef ShareF
   437                              <3>  %idefine ShareF 0
   438                              <3> %endif
   439                              <3> %ifndef Cargs
   440                              <3>  %idefine Cargs 0
   441                              <3> %endif
   442                              <3> %ifndef Redirector
   443                              <3>  %idefine Redirector 0
   444                              <3> %endif
   445                              <3> %ifndef debug
   446                              <3>  %idefine debug 0
   447                              <3> %endif
   448                              <3> 
   449                              <3> %if debug
   450                              <3> %imacro fmt 3-*.nolist
   451                              <3> ;fmt     MACRO   typ,lev,fmts,args
   452                              <3> ;local   a,b,c
   453                              <3> 	PUSHF
   454                              <3> %IFNempty %1
   455                              <3> 	TEST    word [BugTyp],%1
   456                              <3> 	JZ      %%c
   457                              <3> 	CMP     word [BugLev],%2
   458                              <3> 	JB      %%c
   459                              <3> %ENDIF
   460                              <3> 	PUSH    AX
   461                              <3> 	PUSH    BP
   462                              <3> 	MOV     BP,SP
   463                              <3> %If (! sharef) && (! redirector)
   464                              <3> 	[section Table]
   465                              <3> %%a:       db      %3,0
   466                              <3> 	__SECT__
   467                              <3> 	MOV     AX,OFFSET %%a wrt DOSGROUP
   468                              <3> %else
   469                              <3> 	jmp     short %%b
   470                              <3> %%a:       db      %3,0
   471                              <3> %if sharef
   472                              <3> %%b:      mov     ax,offset %%a wrt share
   473                              <3> %else
   474                              <3> %%b:      mov     ax,offset %%a wrt netwrk
   475                              <3> %endif
   476                              <3> %endif
   477                              <3> 	PUSH    AX
   478                              <3> %iassign cargs 2
   479                              <3> %rotate 3
   480                              <3> %rep %0 - 3
   481                              <3>  %ifidni ax, %1
   482                              <3> 	MOV     AX,[BP+2]
   483                              <3>  %ELSE
   484                              <3> 	MOV     AX, %1
   485                              <3>  %ENDIF
   486                              <3> 	PUSH    AX
   487                              <3>  %iassign cargs cargs + 2
   488                              <3>  %rotate 1
   489                              <3> %endrep
   490                              <3> 	invoke  PFMT
   491                              <3> 	ADD     SP, Cargs
   492                              <3> 	POP     BP
   493                              <3> 	POP     AX
   494                              <3> %%c:
   495                              <3> 	POPF
   496                              <3> %endmacro
   497                              <3> %else
   498                              <3> %imacro fmt 3-*.nolist
   499                              <3> %endmacro
   500                              <3> %endif
   501                              <3> 
   502                              <3> Break   <DOSAssume - validate assumes>
   503                              <3> 
   504                              <3> ;AsmVar  Debug,$temp
   505                              <3> 
   506                              <3> %imacro detectstripangles 4.nolist
   507                              <3> %defstr %%param %4
   508                              <3> %assign ?%2 0
   509                              <3> %assign ?%3 0
   510                              <3> %rep 16
   511                              <3>  %substr %%opening %%param 1
   512                              <3>  %ifidn %%opening, '<'
   513                              <3>   %substr %%param %%param 2,-1
   514                              <3>   %assign ?%2 ?%2 + 1
   515                              <3>  %endif
   516                              <3> %endrep
   517                              <3> %rep 16
   518                              <3>  %strlen %%length %%param
   519                              <3>  %substr %%closing %%param %%length
   520                              <3>  %ifidn %%closing, '>'
   521                              <3>   %substr %%param %%param 1,-2
   522                              <3>   %assign ?%3 ?%3 + 1
   523                              <3>  %endif
   524                              <3> %endrep
   525                              <3> %deftok %%token %%param
   526                              <3> %define ?%1 %%token
   527                              <3> %endmacro
   528                              <3> 
   529                              <3> 
   530                              <3> %IF debug
   531                              <3> %imacro DOSAssume 3-*.nolist
   532                              <3> ;DOSAssume   Macro   reg,reglist,message
   533                              <3>  %ifidni %1, CS
   534                              <3>   %assign %%temp 1
   535                              <3>  %else
   536                              <3>   %ifidni %1, SS
   537                              <3>    %assign %%temp 0
   538                              <3>   %else
   539                              <3>    %error ***** Invalid DOS register %1 in DOSAssume *****
   540                              <3>   %endif
   541                              <3>  %endif
   542                              <3>  %rotate 1
   543                              <3>  %assign %%level 0
   544                              <3>  %assign %%amount %0 - 1
   545                              <3>  %rep 16
   546                              <3>   detectstripangles %%token, %%opening, %%closing, %1
   547                              <3>   %assign %%level %%level + ? %+ %%opening
   548                              <3>   %assign %%level %%level - ? %+ %%closing
   549                              <3>   %ifidni ? %+ %%token, DS
   550                              <3>    %assign %%temp %%temp | 2
   551                              <3>   %else
   552                              <3>    %ifidni ? %+ %%token, ES
   553                              <3>     %assign %%temp %%temp | 4
   554                              <3>    %else
   555                              <3>     %error ***** Invalid register reg in DOSAssume *****
   556                              <3>    %endif
   557                              <3>   %endif
   558                              <3>   %assign %%amount %%amount - 1
   559                              <3>   %rotate 1
   560                              <3>   %if %%level <= 0
   561                              <3>    %exitrep
   562                              <3>   %endif
   563                              <3>  %endrep
   564                              <3> 
   565                              <3> 	PUSH    AX
   566                              <3> 	MOV     AX, %%temp
   567                              <3> 	PUSH    AX
   568                              <3> %IF SHAREF
   569                              <3> 	MOV     AX,OFFSET %%a
   570                              <3> %ELSE
   571                              <3> 	MOV     AX,OFFSET %%a wrt DOSGroup
   572                              <3> %ENDIF
   573                              <3> 	PUSH    AX
   574                              <3> 	Invoke  SegCheck
   575                              <3> 	POP     AX
   576                              <3> %IFN SHAREF
   577                              <3> 	[section Table]
   578                              <3> %ELSE
   579                              <3> 	JMP     SHORT %%b
   580                              <3> %ENDIF
   581                              <3> %%a:
   582                              <3>  %rep %%amount
   583                              <3>         DB      %1
   584                              <3>   %rotate 1
   585                              <3>  %endrep
   586                              <3> 	db 0
   587                              <3> %IFN SHAREF
   588                              <3> 	__SECT__
   589                              <3> %ELSE
   590                              <3> %%b:
   591                              <3> %ENDIF
   592                              <3> ;IRP r,<reglist>
   593                              <3> ;    ASSUME  r:DOSGroup
   594                              <3> ;ENDM
   595                              <3> %endmacro
   596                              <3> %ELSE
   597                              <3> %imacro DOSAssume 3-*.nolist
   598                              <3> ;DOSAssume   Macro   reg,reglist,message
   599                              <3> ;IRP r,<reglist>
   600                              <3> ;    ASSUME  r:DOSGroup
   601                              <3> ;ENDM
   602                              <3> %endmacro
   603                              <3> %ENDIF
   604                              <3> 
   605                              <3> BREAK   <ASSERT - make assertions about registers>
   606                              <3> 
   607                              <3> %if 0
   608                              <3> ;IF DEBUG
   609                              <3> Assert  MACRO   kind, objs, message
   610                              <3> 	LOCAL   a,b
   611                              <3>     IFIDN   <kind>,<Z>
   612                              <3> 	CMP     objs,0
   613                              <3> 	JZ      a
   614                              <3> 	fmt <>,<>,<message>
   615                              <3> a:
   616                              <3>     ELSE
   617                              <3> 	IFIDN   <kind>,<NZ>
   618                              <3> 	CMP     objs,0
   619                              <3> 	JNZ     a
   620                              <3> 	fmt <>,<>,<message>
   621                              <3> a:
   622                              <3> 	ELSE
   623                              <3>     PUSH    AX
   624                              <3> 	    IRP obj,<objs>
   625                              <3> 	PUSH    obj
   626                              <3> 	    ENDM
   627                              <3> 	    IF SHAREF
   628                              <3>     MOV     AX,OFFSET b
   629                              <3> 	    ELSE
   630                              <3>     MOV     AX,OFFSET DOSGroup:b
   631                              <3> 	    ENDIF
   632                              <3>     PUSH    AX
   633                              <3> 	    IFIDN   <kind>,<ISBUF>
   634                              <3> 	Invoke  BUFCheck
   635                              <3> 	    ENDIF
   636                              <3> 	    IFIDN   <kind>,<ISSFT>
   637                              <3> 	Invoke  SFTCheck
   638                              <3> 	    ENDIF
   639                              <3> 	    IFIDN   <kind>,<ISDPB>
   640                              <3> 	Invoke  DPBCheck
   641                              <3> 	    ENDIF
   642                              <3>     POP     AX
   643                              <3> 	    IF SHAREF
   644                              <3>     JMP SHORT a
   645                              <3> b   DB  Message,0
   646                              <3> a:
   647                              <3> 	    ELSE
   648                              <3> Table   segment
   649                              <3> b   db  Message,0
   650                              <3> Table   ends
   651                              <3> 	    ENDIF
   652                              <3> 	ENDIF
   653                              <3>     ENDIF
   654                              <3> ENDM
   655                              <3> %ELSE
   656                              <3> %imacro Assert 0-*.nolist
   657                              <3> %endmacro
   658                              <3> %ENDIF
   659                              <3> 
   660                              <3> %ifndef Installed
   661                              <3>  %idefine Installed 1
   662                              <3> %endif
   663                              <3> 
   664                              <3> Break   <CallInstall - hook to installable pieces>
   665                              <3> 
   666                              <3> %imacro CallInstall 3-*.nolist
   667                              <3> ;CallInstall MACRO   name,mpx,fn,save,restore
   668                              <3> %define %%name %1
   669                              <3> %assign %%mpx %2
   670                              <3> %assign %%fn %3
   671                              <3> %IF Installed
   672                              <3>  %rotate 3
   673                              <3>  %assign %%level 0
   674                              <3>  %assign %%amountsaved 0
   675                              <3>  %rep %0 - 3
   676                              <3>   %ifnempty %1
   677                              <3>    detectstripangles %%token, %%opening, %%closing, %1
   678                              <3>    %assign %%level %%level + ? %+ %%opening
   679                              <3>    %assign %%level %%level - ? %+ %%closing
   680                              <3>    SaveReg ? %+ %%token
   681                              <3>   %endif
   682                              <3>   %assign %%amountsaved %%amountsaved + 1
   683                              <3>   %rotate 1
   684                              <3>   %if %%level <= 0
   685                              <3>    %exitrep
   686                              <3>   %endif
   687                              <3>  %endrep
   688                              <3> 	MOV     AX,(%%mpx << 8) + %%fn
   689                              <3> 	INT     2Fh
   690                              <3>  %assign %%level 0
   691                              <3>  %assign %%amountrestored 0
   692                              <3>  %rep %0 - 3 - %%amountsaved
   693                              <3>   %ifnempty %1
   694                              <3>    detectstripangles %%token, %%opening, %%closing, %1
   695                              <3>    %assign %%level %%level + ? %+ %%opening
   696                              <3>    %assign %%level %%level - ? %+ %%closing
   697                              <3>    RestoreReg ? %+ %%token
   698                              <3>   %endif
   699                              <3>   %assign %%amountrestored %%amountrestored + 1
   700                              <3>   %rotate 1
   701                              <3>   %if %%level <= 0
   702                              <3>    %exitrep
   703                              <3>   %endif
   704                              <3>  %endrep
   705                              <3>  %if %%level > 0 || %0 != 3 + %%amountsaved + %%amountrestored
   706                              <3>   %error Wrong amount saved or restored
   707                              <3>  %endif
   708                              <3> %ELSE
   709                              <3> 	Invoke  %%name
   710                              <3> %ENDIF
   711                              <3> %endmacro
   712                              <3> 
   713                              <3> Break   <Stack frame manipulators>
   714                              <3> 
   715                              <3> %imacro localvar 2.nolist
   716                              <3> %ifidni %2, BYTE
   717                              <3>  %assign ?frame ?frame + 1
   718                              <3>  %assign %%a ?frame
   719                              <3>  labelsize %1, byte, bp - %%a
   720                              <3> %else
   721                              <3>  %ifidni %2, WORD
   722                              <3>   %assign ?frame ?frame + 2
   723                              <3>   %assign %%a ?frame
   724                              <3>   labelsize %1, word, bp - %%a
   725                              <3>  %else
   726                              <3>   %ifidni %2, DWORD
   727                              <3>    %assign ?frame ?frame + 4
   728                              <3>    %assign %%a ?frame
   729                              <3>    labelsize %1 %+ l, word, bp - %%a
   730                              <3>    labelsize %1 %+ h, word, bp - %%a + 2
   731                              <3>    labelsize %1, dword, bp - %%a
   732                              <3>   %else
   733                              <3>    %assign ?frame ?frame + %2
   734                              <3>    %assign %%a ?frame
   735                              <3>    labelsize %1, byte, bp - %%a
   736                              <3>   %endif
   737                              <3>  %endif
   738                              <3> %endif
   739                              <3> %endmacro
   740                              <3> 
   741                              <3> %imacro enter 0.nolist
   742                              <3> 	push    bp
   743                              <3> 	mov     bp,sp
   744                              <3> 	sub     sp,?frame
   745                              <3> %endmacro
   746                              <3> 
   747                              <3> %imacro leave 0.nolist
   748                              <3> 	mov     sp,bp
   749                              <3> 	pop     bp
   750                              <3> %endmacro
   751                              <3> 
   752                              <3> 
   753                              <3> %imacro argvar 2.nolist
   754                              <3> %ifidni %2, BYTE
   755                              <3>  %assign %%a ?aframe
   756                              <3>  %assign ?aframe ?aframe + 1
   757                              <3>  labelsize %1, byte, bp + %%a
   758                              <3> %else
   759                              <3>  %ifidni %2, WORD
   760                              <3>   %assign %%a ?aframe
   761                              <3>   %assign ?aframe ?aframe + 2
   762                              <3>   labelsize %1, word, bp + %%a
   763                              <3>  %else
   764                              <3>   %ifidni %2, DWORD
   765                              <3>    %assign %%a ?aframe
   766                              <3>    %assign ?aframe ?aframe + 4
   767                              <3>    labelsize %1 %+ l, word, bp + %%a
   768                              <3>    labelsize %1 %+ h, word, bp + %%a + 2
   769                              <3>    labelsize %1, dword, bp + %%a
   770                              <3>   %else
   771                              <3>    %assign %%a ?aframe
   772                              <3>    %assign ?aframe ?aframe + %2
   773                              <3>    labelsize %1, byte, bp + %%a
   774                              <3>   %endif
   775                              <3>  %endif
   776                              <3> %endif
   777                              <3> %endmacro
   778                              <3> 
   779                              <3> BREAK   <errnz - generate compilation errors>
   780                              <3> 
   781                              <3> %imacro errnz 1.nolist
   782                              <3> detectstripangles %%token, %%opening, %%closing, %1
   783                              <3> %if ? %+ %%token
   784                              <3>     %error %1 <> 0
   785                              <3> %endif
   786                              <3> %endmacro
   787                              <3> 
   788                              <3> %endif
    25                              <2> %include "doscntry.mac"
     1                              <3> ;
     2                              <3> ;Equates for COUNTRY INFORMATION.
     3                              <3> SetCountryInfo		EQU	1	;country info
     4                              <3> SetUcase		EQU	2	;uppercase table
     5                              <3> SetLcase		EQU	3	;lowercase table (Reserved)
     6                              <3> SetUcaseFile		EQU	4	;uppercase file spec table
     7                              <3> SetFileList		EQU	5	;valid file character list
     8                              <3> SetCollate		EQU	6	;collating sequence
     9                              <3> SetDBCS 		EQU	7	;double byte character set
    10                              <3> SetALL			EQU	-1	;all the entries
    11                              <3> 
    12                              <3> 
    13                              <3> ;DOS country and code page information table structure.
    14                              <3> ;Internally, DOS gives a pointer to this table.
    15                              <3> ;IBMBIO, MODE and NLSFUNC modules communicate with DOS through
    16                              <3> ;this structure.
    17                              <3> DOS_country_cdpg_info struc
    18 00000000 ????????????????    <3> ccInfo_reserved 	db	8 dup (?) ;reserved for internal use
    19 00000008 ??????????????????- <3> ccPath_CountrySys	db	64 dup (?);path and filename for country info
    19 00000011 ??????????????????- <3>
    19 0000001A ??????????????????- <3>
    19 00000023 ??????????????????- <3>
    19 0000002C ??????????????????- <3>
    19 00000035 ??????????????????- <3>
    19 0000003E ??????????????????- <3>
    19 00000047 ??                  <3>
    20 00000048 ????                <3> ccSysCodePage		dw	? ;0	;system code page id
    21 0000004A ????                <3> ccNumber_of_entries	dw	? ;6	; 6 entries
    22 0000004C ??                  <3> ccSetUcase		db	? ;SetUcase
    23 0000004D ????????            <3> ccUcase_ptr		dd	?	;pointer to Ucase table
    24                              <3> 
    25 00000051 ??                  <3> ccSetUcaseFile		db	? ;SetUcaseFile
    26 00000052 ????????            <3> ccFileUcase_ptr 	dd	?	;pointer to File Ucase table
    27                              <3> 
    28 00000056 ??                  <3> ccSetFileList		db	? ;SetFileList
    29 00000057 ????????            <3> ccFileChar_ptr		dd	?	;pointer to File char list table
    30                              <3> 
    31 0000005B ??                  <3> ccSetCollate		db	? ;SetCollate
    32 0000005C ????????            <3> ccCollate_ptr		dd	?	;pointer to collate table
    33                              <3> 
    34 00000060 ??                  <3> ccSetDBCS		db	? ;SetDBCS
    35 00000061 ????????            <3> ccDBCS_ptr		dd	?	;pointer to DBCS  table
    36                              <3> 
    37 00000065 ??                  <3> ccSetCountryInfo	db	?; SetCountryInfo
    38 00000066 ????                <3> ccCountryInfoLen	dw	?	;length of country info
    39 00000068 ????                <3> ccDosCountry		dw	?	;active country code id
    40 0000006A ????                <3> ccDosCodePage		dw	?	;active code page id
    41 0000006C ????                <3> ccDFormat		dw	?	;date format
    42 0000006E ??????????          <3> ccCurSymbol		db	5 dup (?) ;"    ",0;5 byte of (currency symbol+0)
    43 00000073 ????                <3> cc1000Sep		db	?,? ;" ",0   ;2 byte of (1000 sep. + 0)
    44 00000075 ????                <3> ccDecSep		db	?,? ;" ",0   ;2 byte of (Decimal sep. + 0)
    45 00000077 ????                <3> ccDateSep		db	?,? ;" ",0   ;2 byte of (date sep. + 0)
    46 00000079 ????                <3> ccTimeSep		db	?,? ;" ",0   ;2 byte of (time sep. + 0)
    47 0000007B ??                  <3> ccCFormat		db	?	;currency format flags
    48 0000007C ??                  <3> ccCSigDigits		db	?	;# of digits in currency
    49 0000007D ??                  <3> ccTFormat		db	?	;time format
    50 0000007E ????????            <3> ccMono_Ptr		dd	?	;monocase routine entry point
    51 00000082 ????                <3> ccListSep		db	?,? ;" ",0   ;data list separator
    52 00000084 ????????????????-   <3> ccReserved_area 	dw	5 dup(?);reserved
    52 0000008C ????                <3>
    53                              <3> 
    54                              <3> DOS_country_cdpg_info ends
    55                              <3> 
    56                              <3> ;Ucase table
    57                              <3> CC_UCASE_TAB	struc
    58 00000000 ????                <3> ccUcase_leng	       dw	? ;128
    59 00000002 ??????????????????- <3> ccUcase_data	       db	128 dup (?)
    59 0000000B ??????????????????- <3>
    59 00000014 ??????????????????- <3>
    59 0000001D ??????????????????- <3>
    59 00000026 ??????????????????- <3>
    59 0000002F ??????????????????- <3>
    59 00000038 ??????????????????- <3>
    59 00000041 ??????????????????- <3>
    59 0000004A ??????????????????- <3>
    59 00000053 ??????????????????- <3>
    59 0000005C ??????????????????- <3>
    59 00000065 ??????????????????- <3>
    59 0000006E ??????????????????- <3>
    59 00000077 ??????????????????- <3>
    59 00000080 ????                <3>
    60                              <3> CC_UCASE_TAB	ends
    61                              <3> 
    62                              <3> ;File Ucase table
    63                              <3> CC_FILE_UCASE_TAB	struc
    64 00000000 ????                <3> ccFileucase_leng	dw	? ;128
    65 00000002 ??????????????????- <3> ccFileucase_data	db	128 dup (?)
    65 0000000B ??????????????????- <3>
    65 00000014 ??????????????????- <3>
    65 0000001D ??????????????????- <3>
    65 00000026 ??????????????????- <3>
    65 0000002F ??????????????????- <3>
    65 00000038 ??????????????????- <3>
    65 00000041 ??????????????????- <3>
    65 0000004A ??????????????????- <3>
    65 00000053 ??????????????????- <3>
    65 0000005C ??????????????????- <3>
    65 00000065 ??????????????????- <3>
    65 0000006E ??????????????????- <3>
    65 00000077 ??????????????????- <3>
    65 00000080 ????                <3>
    66                              <3> CC_FILE_UCASE_TAB	ends
    67                              <3> 
    68                              <3> ;File char list
    69                              <3> CC_FILE_CHAR_TAB	struc
    70 00000000 ????                <3> ccFilechar_leng 	dw	?
    71 00000002 ??????????????????- <3> ccFilechar_data 	db	46 dup (?)
    71 0000000B ??????????????????- <3>
    71 00000014 ??????????????????- <3>
    71 0000001D ??????????????????- <3>
    71 00000026 ??????????????????- <3>
    71 0000002F ??                  <3>
    72                              <3> CC_FILE_CHAR_TAB	ends
    73                              <3> 
    74                              <3> ;collate table
    75                              <3> CC_COLLATE_TAB	struc
    76 00000000 ????                <3> ccCollate_leng		dw	? ;256
    77 00000002 ??????????????????- <3> ccCollate_data		db	256 dup (?)
    77 0000000B ??????????????????- <3>
    77 00000014 ??????????????????- <3>
    77 0000001D ??????????????????- <3>
    77 00000026 ??????????????????- <3>
    77 0000002F ??????????????????- <3>
    77 00000038 ??????????????????- <3>
    77 00000041 ??????????????????- <3>
    77 0000004A ??????????????????- <3>
    77 00000053 ??????????????????- <3>
    77 0000005C ??????????????????- <3>
    77 00000065 ??????????????????- <3>
    77 0000006E ??????????????????- <3>
    77 00000077 ??????????????????- <3>
    77 00000080 ??????????????????- <3>
    77 00000089 ??????????????????- <3>
    77 00000092 ??????????????????- <3>
    77 0000009B ??????????????????- <3>
    77 000000A4 ??????????????????- <3>
    77 000000AD ??????????????????- <3>
    77 000000B6 ??????????????????- <3>
    77 000000BF ??????????????????- <3>
    77 000000C8 ??????????????????- <3>
    77 000000D1 ??????????????????- <3>
    77 000000DA ??????????????????- <3>
    77 000000E3 ??????????????????- <3>
    77 000000EC ??????????????????- <3>
    77 000000F5 ??????????????????- <3>
    77 000000FE ????????            <3>
    78                              <3> CC_COLLATE_TAB	ends
    79                              <3> 
    80                              <3> ;DBCS table -  for DOS 4.00
    81                              <3> CC_DBCS_TAB	struc
    82 00000000 ????                <3> ccDBCS_leng	       dw      ? ;6
    83 00000002 ????????????        <3> ccDBCS_data	       db      6 dup (?)
    84                              <3> CC_DBCS_TAB	ends
    85                              <3> 
    86                              <3> ;						2/12/KK
    87                              <3> ; Define subfunctions of ECS_call ( 63H )	2/12/KK
    88                              <3> ;						2/12/KK
    89                              <3> GetLeadBTBL	EQU	0	;		2/12/KK
    90                              <3> SetInterimMode	EQU	1	;		2/12/KK
    91                              <3> GetInterimMode	EQU	2	;		2/12/KK
    92                              <3> 				;		2/12/KK
    93                              <3> NonInterimMode	EQU	0	;		2/12/KK
    94                              <3> InterimMode	EQU	1	;		2/12/KK
    95                              <3> 
    96                              <3> OLD_COUNTRY_SIZE    equ     (DOS_country_cdpg_info_struc_size - ccDFormat - 10)
    97                              <3> NEW_COUNTRY_SIZE    equ     (DOS_country_cdpg_info_struc_size - ccDosCountry)
    98                              <3> 
    99                              <3> ;CAPITALIZATION equates
   100                              <3> CAP_ONE_CHAR	    equ      20H
   101                              <3> CAP_STRING	    equ      21H
   102                              <3> CAP_ASCIIZ	    equ      22H
   103                              <3> CHECK_YES_NO	    equ      23H
   104                              <3> UPPER_TABLE	    equ      80H
   105                              <3> 
   106                              <3> ;NLS_YES	     equ      59H
   107                              <3> ;NLS_yes2	     equ      79H
   108                              <3> ;NLS_NO 	     equ      4EH
   109                              <3> ;NLS_no2	     equ      6EH
    26                              <2> %include "entrysw.mac"
     1                              <3> 
     2                              <3> %ifndef __ENTRYSW_MAC__
     3                              <3>  %assign __ENTRYSW_MAC__ 1
     4                              <3> 
     5                              <3> %assign _DOSCODEHMA		1
     6                              <3> %assign _RELOCATEDOSCODE	0
     7                              <3> 
     8                              <3> 		; Write a label "%1" (only if DOSCODE isn't relocated) and
     9                              <3> 		; "relocated%1" (always).
    10                              <3> 	%imacro relocated 1-2.nolist
    11                              <3> %ifnidni %2, device
    12                              <3>  %ifnidni %2, amis
    13                              <3>   %ifn _RELOCATEDOSCODE
    14                              <3> %1:
    15                              <3> 	global %1
    16                              <3>   %endif
    17                              <3>  %endif
    18                              <3> %endif
    19                              <3> relocated%1:				; always used for local labels
    20                              <3> 	global relocated%1
    21                              <3> 	%endmacro
    22                              <3> 
    23                              <3> %if _RELOCATEDOSCODE
    24                              <3> DOSENTRYADJUSTSEGMENT equ 60h - 26h
    25                              <3> %else
    26                              <3> DOSENTRYADJUSTSEGMENT equ 0
    27                              <3> %endif
    28                              <3> DOSENTRYADJUSTOFFSET equ DOSENTRYADJUSTSEGMENT * 16
    29                              <3> 
    30                              <3> DOSENTRYDEVICEBASE equ 10h
    31                              <3> 
    32                              <3> %endif
    27                              <2> extern casemap
    28                              <2> [list +]
    29                              <2> 
    30                              <2> section CONSTANTS
    31                              <2> 
    32                              <2> UserNum equ USERNUM	; NASM port label
    33                              <2> OEMNum equ OEMNUM	; NASM port label
    34                              <2>     PUBLIC  UserNum, OEMNum
    35                              <2>     Public DMES001S,DMES001E
    36                              <2> DMES001S Label byte
    37 00000000 ????                <2> USERNUM DW	?			; 24 bit user number
    38 00000002 ??                  <2> 	DB	?
    39                              <2> OEMNUM:
    40                              <2> %if 0
    41                              <2> %IF	IBM
    42                              <2> 	%IF	IBMCOPYRIGHT
    43                              <2> 	DB	0			; 8 bit OEM number
    44                              <2> 	%ELSE
    45                              <2> 	DB	0FFH			; 8 bit OEM number
    46                              <2> 	%ENDIF
    47                              <2> %ELSE
    48                              <2> 	DB	0FFH
    49                              <2> %ENDIF
    50                              <2> %else
    51 00000003 ??                  <2> 	db 26h				; lDOS OEM number = 26h
    52                              <2> %endif
    53                              <2> 
    54                              <2> DMES001E label byte
    55                              <2> ; (no prior section) ; CONSTANTS	ENDS
    56                              <2> 
    57                              <2> section TABLE		; in DOSDATA
    58                              <2> Public DMES002S
    59                              <2> DMES002S  label byte
    60                              <2> 
    61                              <2> 
    62                              <2> ; The following table is used for DOS 3.3
    63                              <2> ;DOS country and code page information is defined here for DOS 3.3.
    64                              <2> ;The initial value for ccDosCountry is 1 (USA).
    65                              <2> ;The initial value for ccDosCodepage is 850.
    66                              <2> ;
    67                              <2> ;
    68                              <2> 		   PUBLIC  COUNTRY_CDPG,UCASE_TAB,FILE_UCASE_TAB
    69                              <2> 		   PUBLIC  FILE_CHAR_TAB
    70                              <2> ;
    71                              <2> ; country and code page infomation
    72                              <2> ;
    73                              <2> COUNTRY_CDPG  label  byte
    74                              <2> 
    75 00000000 ????????????????    <2> 	 db   0,0,0,0,0,0,0,0	      ; reserved words
    76 00000008 ??????????????????- <2> 	 db   '\COUNTRY.SYS',0        ; path name of country.sys
    76 00000011 ????????            <2>
    77 00000015 ??????????????????- <2> 	 db   51 dup (?)
    77 0000001E ??????????????????- <2>
    77 00000027 ??????????????????- <2>
    77 00000030 ??????????????????- <2>
    77 00000039 ??????????????????- <2>
    77 00000042 ????????????        <2>
    78 00000048 ????                <2> 	 dw   437		      ; system code page id
    79 0000004A ????                <2> 	 dw   6 		      ; number of entries
    80 0000004C ??                  <2> 	 db   SetUcase		      ; Ucase type
    81 0000004D ????                <2> 	 dw   OFFSET UCASE_TAB wrt DOSGROUP    ;pointer to upper case table
    82 0000004F ????                <2> 	 dw   0 			   ; segment of poiter
    83 00000051 ??                  <2> 	 db   SetUcaseFile	      ; Ucase file char type
    84 00000052 ????                <2> 	 dw   OFFSET FILE_UCASE_TAB wrt DOSGROUP	;pointer to file upper case table
    85 00000054 ????                <2> 	 dw   0 			   ; segment of poiter
    86 00000056 ??                  <2> 	 db   SetFileList	      ; valid file chars type
    87 00000057 ????                <2> 	 dw   OFFSET FILE_CHAR_TAB wrt DOSGROUP   ;pointer to valid file char tab
    88 00000059 ????                <2> 	 dw   0 			   ; segment of poiter
    89 0000005B ??                  <2> 	 db   SetCollate	      ; collate type
    90 0000005C ????                <2> 	 dw   OFFSET COLLATE_TAB wrt DOSGROUP  ;pointer to collate table
    91 0000005E ????                <2> 	 dw   0 			   ; segment of poiter
    92 00000060 ??                  <2> 	 db   SetDBCS		      ;AN000; DBCS Ev			  2/12/KK
    93 00000061 ????                <2> 	 dw   OFFSET DBCS_TAB wrt DOSGROUP ;AN000;;pointer to DBCS Ev table   2/12/KK
    94 00000063 ????                <2> 	 dw   0 		       ;AN000; segment of poiter	 2/12/KK
    95 00000065 ??                  <2> 	 db   SetCountryInfo	      ; country info type
    96 00000066 ????                <2> 	 dw   NEW_COUNTRY_SIZE	      ; extended country info size
    97 00000068 ????                <2> 	 dw   1 		      ; USA country id
    98 0000006A ????                <2> 	 dw   437		      ; USA system code page id
    99 0000006C ????                <2> 	 dw   0 		      ; date format
   100 0000006E ??????????          <2> 	 db   '$',0,0,0,0             ; currency symbol
   101 00000073 ????                <2> 	 db   ',',0                   ; thousand separator
   102 00000075 ????                <2> 	 db   '.',0                   ; decimal separator
   103 00000077 ????                <2> 	 db   '-',0                   ; date separator
   104 00000079 ????                <2> 	 db   ':',0                   ; time separator
   105 0000007B ??                  <2> 	 db   0 		      ; currency format flag
   106 0000007C ??                  <2> 	 db   2 		      ; # of disgit in currency
   107 0000007D ??                  <2> 	 db   0 		      ; time format
   108 0000007E ????                <2> 	 dw   casemap + DOSENTRYADJUSTOFFSET	;mono case routine entry point
   109 00000080 ????                <2> 	 dw   DOSENTRY - DOSENTRYADJUSTSEGMENT	; segment of entry point
   110 00000082 ????                <2> 	 db   ',',0                    ; data list separator
   111 00000084 ????????????????-   <2> 	 dw   0,0,0,0,0 	       ; reserved
   111 0000008C ????                <2>
   112                              <2> 
   113                              <2> 
   114                              <2> 
   115                              <2> ;
   116                              <2> ;
   117                              <2> ;
   118                              <2> ;
   119                              <2> ;
   120                              <2> ; upper case table
   121                              <2> ;
   122                              <2> UCASE_TAB    label   byte
   123 0000008E ????                <2> 		    dw	128
   124 00000090 ????????????????    <2> 		    db	128,154,069,065,142,065,143,128
   125 00000098 ????????????????    <2> 		    db	069,069,069,073,073,073,142,143
   126 000000A0 ????????????????    <2> 		    db	144,146,146,079,153,079,085,085
   127 000000A8 ????????????????    <2> 		    db	089,153,154,155,156,157,158,159
   128 000000B0 ????????????????    <2> 		    db	065,073,079,085,165,165,166,167
   129 000000B8 ????????????????    <2> 		    db	168,169,170,171,172,173,174,175
   130 000000C0 ????????????????    <2> 		    db	176,177,178,179,180,181,182,183
   131 000000C8 ????????????????    <2> 		    db	184,185,186,187,188,189,190,191
   132 000000D0 ????????????????    <2> 		    db	192,193,194,195,196,197,198,199
   133 000000D8 ????????????????    <2> 		    db	200,201,202,203,204,205,206,207
   134 000000E0 ????????????????    <2> 		    db	208,209,210,211,212,213,214,215
   135 000000E8 ????????????????    <2> 		    db	216,217,218,219,220,221,222,223
   136 000000F0 ????????????????    <2> 		    db	224,225,226,227,228,229,230,231
   137 000000F8 ????????????????    <2> 		    db	232,233,234,235,236,237,238,239
   138 00000100 ????????????????    <2> 		    db	240,241,242,243,244,245,246,247
   139 00000108 ????????????????    <2> 		    db	248,249,250,251,252,253,254,255
   140                              <2> 
   141                              <2> ;
   142                              <2> ; file upper case table
   143                              <2> ;
   144                              <2> FILE_UCASE_TAB	label  byte
   145 00000110 ????                <2> 		    dw	128
   146 00000112 ????????????????    <2> 		    db	128,154,069,065,142,065,143,128
   147 0000011A ????????????????    <2> 		    db	069,069,069,073,073,073,142,143
   148 00000122 ????????????????    <2> 		    db	144,146,146,079,153,079,085,085
   149 0000012A ????????????????    <2> 		    db	089,153,154,155,156,157,158,159
   150 00000132 ????????????????    <2> 		    db	065,073,079,085,165,165,166,167
   151 0000013A ????????????????    <2> 		    db	168,169,170,171,172,173,174,175
   152 00000142 ????????????????    <2> 		    db	176,177,178,179,180,181,182,183
   153 0000014A ????????????????    <2> 		    db	184,185,186,187,188,189,190,191
   154 00000152 ????????????????    <2> 		    db	192,193,194,195,196,197,198,199
   155 0000015A ????????????????    <2> 		    db	200,201,202,203,204,205,206,207
   156 00000162 ????????????????    <2> 		    db	208,209,210,211,212,213,214,215
   157 0000016A ????????????????    <2> 		    db	216,217,218,219,220,221,222,223
   158 00000172 ????????????????    <2> 		    db	224,225,226,227,228,229,230,231
   159 0000017A ????????????????    <2> 		    db	232,233,234,235,236,237,238,239
   160 00000182 ????????????????    <2> 		    db	240,241,242,243,244,245,246,247
   161 0000018A ????????????????    <2> 		    db	248,249,250,251,252,253,254,255
   162                              <2> 
   163                              <2> ;
   164                              <2> ; file char list
   165                              <2> ;
   166                              <2> FILE_CHAR_TAB  label  byte
   167 00000192 ????                <2> 		dw	22				; length
   168 00000194 ??????              <2> 		db	1,0,255 			; include all
   169 00000197 ??????              <2> 		db	0,0,20h 			; exclude 0 - 20h
   170 0000019A ??????????????????- <2> 		db	2,14,'."/\[]:|<>+=;,'           ; exclude 14 special
   170          ******************  <2>  warning: unterminated string (missing `'') [-w+pp-open-string]
   170 000001A3 ??????????????      <2>
   171 000001AA ??????????????????- <2> 		db	24 dup (?)			; reserved
   171 000001B3 ??????????????????- <2>
   171 000001BC ????????????        <2>
   172                              <2> ;
   173                              <2> ; collate table
   174                              <2> ;
   175                              <2> COLLATE_TAB    label   byte
   176 000001C2 ????                <2> 		dw	256
   177 000001C4 ????????????????    <2> 	db	0,1,2,3,4,5,6,7
   178 000001CC ????????????????    <2> 	db	8,9,10,11,12,13,14,15
   179 000001D4 ????????????????    <2> 	db	16,17,18,19,20,21,22,23
   180 000001DC ????????????????    <2> 	db	24,25,26,27,28,29,30,31
   181 000001E4 ????????????????    <2> 	db	" ","!",'"',"#","$","%","&","'"
   181          ******************  <2>  warning: unterminated string (missing `"') [-w+pp-open-string]
   182 000001EC ????????????????    <2> 	db	"(",")","*","+",",","-",".","/"
   183 000001F4 ????????????????    <2> 	db	"0","1","2","3","4","5","6","7"
   184 000001FC ????????????????    <2> 	db	"8","9",":",";","<","=",">","?"
   184          ******************  <2>  warning: unterminated string (missing `"') [-w+pp-open-string]
   185 00000204 ????????????????    <2> 	db	"@","A","B","C","D","E","F","G"
   186 0000020C ????????????????    <2> 	db	"H","I","J","K","L","M","N","O"
   187 00000214 ????????????????    <2> 	db	"P","Q","R","S","T","U","V","W"
   188 0000021C ????????????????    <2> 	db	"X","Y","Z","[","\","]","^","_"
   189 00000224 ????????????????    <2> 	db	"`","A","B","C","D","E","F","G"
   189          ******************  <2>  warning: unterminated string (missing ``') [-w+pp-open-string]
   190 0000022C ????????????????    <2> 	db	"H","I","J","K","L","M","N","O"
   191 00000234 ????????????????    <2> 	db	"P","Q","R","S","T","U","V","W"
   192 0000023C ????????????????    <2> 	db	"X","Y","Z","{","|","}","~",127
   193 00000244 ????????????????    <2> 	db	"C","U","E","A","A","A","A","C"
   194 0000024C ????????????????    <2> 	db	"E","E","E","I","I","I","A","A"
   195 00000254 ????????????????    <2> 	db	"E","A","A","O","O","O","U","U"
   196 0000025C ????????????????    <2> 	db	"Y","O","U","$","$","$","$","$"
   197 00000264 ????????????????    <2> 	db	"A","I","O","U","N","N",166,167
   198 0000026C ????????????????    <2> 	db	"?",169,170,171,172,"!",'"','"'
   199 00000274 ????????????????    <2> 	db	176,177,178,179,180,181,182,183
   200 0000027C ????????????????    <2> 	db	184,185,186,187,188,189,190,191
   201 00000284 ????????????????    <2> 	db	192,193,194,195,196,197,198,199
   202 0000028C ????????????????    <2> 	db	200,201,202,203,204,205,206,207
   203 00000294 ????????????????    <2> 	db	208,209,210,211,212,213,214,215
   204 0000029C ????????????????    <2> 	db	216,217,218,219,220,221,222,223
   205 000002A4 ????                <2> 	db	224,"S"
   206 000002A6 ????????????        <2> 	db	226,227,228,229,230,231
   207 000002AC ????????????????    <2> 	db	232,233,234,235,236,237,238,239
   208 000002B4 ????????????????    <2> 	db	240,241,242,243,244,245,246,247
   209 000002BC ????????????????    <2> 	db	248,249,250,251,252,253,254,255
   210                              <2> ;
   211                              <2> ; dbcs is not supported in DOS 3.3
   212                              <2> ;		   DBCS_TAB	    CC_DBCS <>
   213                              <2> ;
   214                              <2> ; DBCS for DOS 4.00			   2/12/KK
   215                              <2>    PUBLIC    DBCS_TAB
   216                              <2> DBCS_TAB	label byte		;AN000;  2/12/KK
   217 000002C4 ????                <2> 		dw	0		;AN000;  2/12/KK      max number
   218 000002C6 ??????????????????- <2> 		db	16 dup(0)	;AN000;  2/12/KK
   218 000002CF ??????????????      <2>
   219                              <2> 
   220                              <2> ;		dw	6		;  2/12/KK
   221                              <2> ;		db	081h,09fh	;  2/12/KK
   222                              <2> ;		db	0e0h,0fch	;  2/12/KK
   223                              <2> ;		db	0,0		;  2/12/KK
   224                              <2> ;
   225                              <2> ;
   226                              <2> 
   227                              <2> section DOSCODETABLE
   228                              <2> 
   229                              <2> ;=== Push trace listing source: divmes.nas
   230                              <2> %include "divmes.nas" ; NASM included file
     1                              <3> ; THIS IS THE ONLY DOS "MESSAGE". IT DOES NOT NEED A TERMINATOR.
     2                              <3> 	PUBLIC	DIVMES
     3                              <3> Public DIVM001S,DIVM001E
     4                              <3> DIVM001S	label byte
     5                              <3> 
     6                              <3> ;=== Push trace listing source: msdos.cl1
     7                              <3> %include "msdos.cl1" ; NASM included file
     1                              <4> ; msdos.cl1 
     2                              <4> 
     3                              <4> 
     4                              <4> ;_______________________
     5                              <4> 
     6 00000000 ??????????????????- <4> DIVMES DB    13,10,"Divide overflow",13,10
     6 00000009 ??????????????????- <4>
     6 00000012 ??                  <4>
     8                              <3> ;=== Pop trace listing source
     9                              <3> 
    10                              <3> 	PUBLIC	DivMesLen
    11                              <3> DivMes equ DIVMES	; NASM port label
    12 00000013 ????                <3> DivMesLen   DW	$-DivMes	; Length of the above message in bytes
    13                              <3> DIVM001E	label byte
   231                              <2> ;=== Pop trace listing source
   232                              <2> 
   233                              <2> section TABLE	; in DOSDATA
   234                              <2> 
   235                              <2> ;=== Push trace listing source: yesno.nas
   236                              <2> %include "yesno.nas" ; NASM included file
     1                              <3> ; This is for contry Yes and No
     2                              <3>   PUBLIC NLS_YES,NLS_yes2,NLS_NO,NLS_no2
     3                              <3> ;=== Push trace listing source: msdos.cl3
     4                              <3> %include "msdos.cl3" ; NASM included file
     1                              <4> ; msdos.cl3 
     2                              <4> 
     3                              <4> 
     4                              <4> ;_______________________
     5                              <4> 
     6 000002D6 ??                  <4> NLS_YES DB    "Y"
     7                              <4> 
     8                              <4> ;_______________________
     9                              <4> 
    10 000002D7 ??                  <4> NLS_NO DB    "N"
    11                              <4> 
    12                              <4> ;_______________________
    13                              <4> 
    14 000002D8 ??                  <4> NLS_yes2 DB    "y"
    15                              <4> 
    16                              <4> ;_______________________
    17                              <4> 
    18 000002D9 ??                  <4> NLS_no2 DB    "n"
     5                              <3> ;=== Pop trace listing source
   237                              <2> ;=== Pop trace listing source
   238                              <2> 
   239                              <2> 
   240                              <2> %ifndef DONOBITS
   241                              <2> 
   242                              <2> section DOSCODECODE
   243                              <2> 
   244                              <2> extern doscode_getdosdata
   245                              <2> 
   246                              <2> relocated casemap
   247                              <2>  assume ds:nothing, es:nothing, ss:nothing
   248                              <2> 	push ax
   249                              <2> 	call doscode_getdosdata
   250                              <2> 	push ax
   251                              <2> 	mov ax, MAP_CASE
   252                              <2> 	push ax
   253                              <2> 	retf
   254                              <2> 
   255                              <2> 
   256                              <2> section DOSDATACODE	; in DOSDATA
   257                              <2> 
   258                              <2> ;CASE MAPPER ROUTINE FOR 80H-FFH character range, DOS 3.3
   259                              <2> ;     ENTRY: AL = Character to map
   260                              <2> ;     EXIT:  AL = The converted character
   261                              <2> ; Alters no registers except AL and flags.
   262                              <2> ; The routine should do nothing to chars below 80H.
   263                              <2> ;
   264                              <2> ; Example:
   265                              <2> 
   266                              <2> Procedure   MAP_CASE,FAR
   267                              <2> ASSUME	CS:DOSGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
   268                              <2> 	pop ax
   269                              <2> 	CMP	AL,80H
   270                              <2> 	JAE	Map1		;Map no chars below 80H ever
   271                              <2> 	RET
   272                              <2> Map1:
   273                              <2> 	SUB	AL,80H		;Turn into index value
   274                              <2> 	PUSH	DS
   275                              <2> 	PUSH	BX
   276                              <2> 	MOV	BX,OFFSET UCASE_TAB + 2 wrt DOSGROUP	; access with cs
   277                              <2> FINISH:
   278                              <2> 	PUSH	CS		;Move to DS
   279                              <2> 	POP	DS
   280                              <2>  assume ds:DOSGROUP
   281                              <2> 	xlatb 	;Get upper case character
   282                              <2> 	POP	BX
   283                              <2> 	POP	DS
   284                              <2>  assume ds:nothing
   285                              <2> L_RET:	RET
   286                              <2> EndProc MAP_CASE
   287                              <2> 
   288                              <2> ;SUBTTL EDIT FUNCTION ASSIGNMENTS AND HEADERS
   289                              <2> ;PAGE
   290                              <2> ; The following two tables implement the current buffered input editing
   291                              <2> ; routines.  The tables are pairwise associated in reverse order for ease
   292                              <2> ; in indexing.	That is; The first entry in ESCTAB corresponds to the last
   293                              <2> ; entry in ESCFUNC, and the last entry in ESCTAB to the first entry in ESCFUNC.
   294                              <2> 
   295                              <2> %endif	; DONOBITS
   296                              <2> 
   297                              <2> 
   298                              <2> section TABLE		; in DOSDATA
   299                              <2> 	PUBLIC	CANCHAR
   300 000002DA ??                  <2> CANCHAR DB	CANCEL			;Cancel line character
   301                              <2> 	PUBLIC	ESCCHAR
   302 000002DB ??                  <2> ESCCHAR DB	ESCCH			;Lead-in character for escape sequences
   303                              <2> 
   304                              <2> section DOSCODETABLE
   305                              <2> 	%IFN Rainbow
   306                              <2> ESCTAB	LABEL BYTE
   307                              <2> 	%IFN IBM
   308                              <2> 	%IF	WANG
   309                              <2> 	DB	0C0h			; ^Z inserter
   310                              <2> 	DB	0C1H			; Copy one char
   311                              <2> 	DB	0C1H			; Copy one char
   312                              <2> 	DB	0C7H			; Skip one char
   313                              <2> 	DB	08AH			; Copy to char
   314                              <2> 	DB	088H			; Skip to char
   315                              <2> 	DB	09AH			; Copy line
   316                              <2> 	DB	0CBH			; Kill line (no change in template)
   317                              <2> 	DB	08BH			; Reedit line (new template)
   318                              <2> 	DB	0C3H			; Backspace
   319                              <2> 	DB	0C6H			; Enter insert mode
   320                              <2> 	DB	0D6H			; Exit insert mode
   321                              <2> 	DB	0C6H			; Escape character
   322                              <2> 	DB	0C6H			; End of table
   323                              <2> 	%ELSE
   324                              <2> 					; VT52 equivalences
   325                              <2> 	DB	"Z"                     ; ^Z inserter
   326                              <2> 	DB	"S"                     ; F1 Copy one char
   327                              <2> 	DB	"S"                     ; F1 Copy one char
   328                              <2> 	DB	"V"                     ; F4 Skip one char
   329                              <2> 	DB	"T"                     ; F2 Copy to char
   330                              <2> 	DB	"W"                     ; F5 Skip to char
   331                              <2> 	DB	"U"                     ; F3 Copy line
   332                              <2> 	DB	"E"                     ; SHIFT ERASE Kill line (no change in template)
   333                              <2> 	DB	"J"                     ; ERASE Reedit line (new template)
   334                              <2> 	DB	"D"                     ; LEFT Backspace
   335                              <2> 	DB	"P"                     ; BLUE Enter insert mode
   336                              <2> 	DB	"Q"                     ; RED Exit insert mode
   337                              <2> 	DB	"R"                     ; GRAY Escape character
   338                              <2> 	DB	"R"                     ; End of table
   339                              <2> 	%ENDIF
   340                              <2> 	%ENDIF
   341                              <2> 	%IF	IBM
   342 00000015 ??                  <2> 	DB	64			; Ctrl-Z - F6
   343 00000016 ??                  <2> 	DB	77			; Copy one char - -->
   344 00000017 ??                  <2> 	DB	59			; Copy one char - F1
   345 00000018 ??                  <2> 	DB	83			; Skip one char - DEL
   346 00000019 ??                  <2> 	DB	60			; Copy to char - F2
   347 0000001A ??                  <2> 	DB	62			; Skip to char - F4
   348 0000001B ??                  <2> 	DB	61			; Copy line - F3
   349 0000001C ??                  <2> 	DB	61			; Kill line (no change to template ) - Not used
   350 0000001D ??                  <2> 	DB	63			; Reedit line (new template) - F5
   351 0000001E ??                  <2> 	DB	75			; Backspace - <--
   352 0000001F ??                  <2> 	DB	82			; Enter insert mode - INS (toggle)
   353 00000020 ??                  <2> 	DB	82			; Exit insert mode - INS (toggle)
   354 00000021 ??                  <2> 	DB	65			; Escape character - F7
   355 00000022 ??                  <2> 	DB	65			; End of table
   356                              <2> 	%ENDIF
   357                              <2> ESCEND LABEL BYTE
   358                              <2> ESCTABLEN EQU	ESCEND-ESCTAB
   359                              <2> 
   360                              <2> section DOSDATATABLE	; in DOSDATA
   361                              <2> 
   362                              <2> 	align 2, db 0
   363                              <2> ESCFUNC LABEL	WORD
   364 00000000 ????                <2> 	short_addr  GETCH		; Ignore the escape sequence
   365 00000002 ????                <2> 	short_addr  TWOESC
   366 00000004 ????                <2> 	short_addr  EXITINS
   367 00000006 ????                <2> 	short_addr  ENTERINS
   368 00000008 ????                <2> 	short_addr  BACKSP
   369 0000000A ????                <2> 	short_addr  REEDIT
   370 0000000C ????                <2> 	short_addr  KILNEW
   371 0000000E ????                <2> 	short_addr  COPYLIN
   372 00000010 ????                <2> 	short_addr  SKIPSTR
   373 00000012 ????                <2> 	short_addr  COPYSTR
   374 00000014 ????                <2> 	short_addr  SKIPONE
   375 00000016 ????                <2> 	short_addr  COPYONE
   376 00000018 ????                <2> 	short_addr  COPYONE
   377 0000001A ????                <2> 	short_addr  CTRLZ
   378                              <2> 	%ENDIF
   379                              <2> 
   380                              <2> %ifndef DONOBITS
   381                              <2> 
   382                              <2> section DOSCODECODE	; TABLE	ENDS
   383                              <2> 
   384                              <2> ;
   385                              <2> ; OEMFunction key is expected to process a single function
   386                              <2> ;   key input from a device and dispatch to the proper
   387                              <2> ;   routines leaving all registers UNTOUCHED.
   388                              <2> ;
   389                              <2> ; Inputs:   CS, SS are DOSGROUP
   390                              <2> ; Outputs:  None. This function is expected to JMP to one of
   391                              <2> ;	    the following labels:
   392                              <2> ;
   393                              <2> ;	    GetCh	- ignore the sequence
   394                              <2> ;	    TwoEsc	- insert an ESCChar in the buffer
   395                              <2> ;	    ExitIns	- toggle insert mode
   396                              <2> ;	    EnterIns	- toggle insert mode
   397                              <2> ;	    BackSp	- move backwards one space
   398                              <2> ;	    ReEdit	- reedit the line with a new template
   399                              <2> ;	    KilNew	- discard the current line and start from scratch
   400                              <2> ;	    CopyLin	- copy the rest of the template into the line
   401                              <2> ;	    SkipStr	- read the next character and skip to it in the template
   402                              <2> ;	    CopyStr	- read next char and copy from template to line until char
   403                              <2> ;	    SkipOne	- advance position in template one character
   404                              <2> ;	    CopyOne	- copy next character in template into line
   405                              <2> ;	    CtrlZ	- place a ^Z into the template
   406                              <2> ; Registers that are allowed to be modified by this function are:
   407                              <2> ;	    AX, CX, BP
   408                              <2> 
   409                              <2> Procedure   OEMFunctionKey,NEAR
   410                              <2> 	ASSUME	DS:NOTHING,ES:NOTHING,SS:DOSGROUP
   411                              <2>  %IF  DBCS				;AN000;
   412                              <2> extrn	intCNE0:near			;AN000; 2/17/KK
   413                              <2> 	CALL	intCNE0 		;AN000; 2/17/KK
   414                              <2>  %ELSE					;AN000;
   415                              <2> 	invoke	D_std_con_input_no_echo	; Get the second byte of the sequence
   416                              <2>  %ENDIF					;AN000;
   417                              <2> 	%IFN Rainbow
   418                              <2> 	MOV	CL,ESCTABLEN		; length of table for scan
   419                              <2> 	push es
   420                              <2> 	PUSH	DI			; save DI (cannot change it!)
   421                              <2> 	 push cs
   422                              <2> 	 pop es
   423                              <2>  assume es:DOSCODEGROUP
   424                              <2> 	MOV	DI,OFFSET ESCTAB	; offset of second byte table ; access with es
   425                              <2> 	REPNE	SCASB			; Look it up in the table
   426                              <2> 	POP	DI			; restore DI
   427                              <2> 	pop es
   428                              <2>  assume es:nothing
   429                              <2> 	SHL	CX,1			; convert byte offset to word
   430                              <2> 	MOV	BP,CX			; move to indexable register
   431                              <2> 	JMP	[BP+OFFSET ESCFUNC wrt DOSGROUP]	; Go to the right routine
   432                              <2> 	%ENDIF
   433                              <2> 	%IF Rainbow
   434                              <2> 
   435                              <2> TransferIf  MACRO   value,address
   436                              <2> 	local	a
   437                              <2> 	CMP	AL,[value]
   438                              <2> 	JNZ	a
   439                              <2> 	transfer    address
   440                              <2> a:
   441                              <2> ENDM
   442                              <2> 
   443                              <2> 	CMP	AL,'['                  ; is it second lead char
   444                              <2> 	JZ	EatParm 		; yes, go walk tree
   445                              <2> GoGetCh:
   446                              <2> 	transfer    GetCh		; no, ignore sequence
   447                              <2> EatParm:
   448                              <2> 	invoke	D_std_con_input_no_echo	; get argument
   449                              <2> 	CMP	AL,'A'                  ; is it alphabetic arg?
   450                              <2> 	JAE	EatAlpha		; yes, go snarf one up
   451                              <2> 	XOR	BP,BP			; init digit counter
   452                              <2> 	JMP	InDigit 		; jump into internal eat digit routine
   453                              <2> EatNum:
   454                              <2> 	invoke	D_std_con_input_no_echo	; get next digit
   455                              <2> InDigit:
   456                              <2> 	CMP	AL,'9'                  ; still a digit?
   457                              <2> 	JA	CheckNumEnd		; no, go check for end char
   458                              <2> 	SUB	AL,'0'                  ; turn into potential digit
   459                              <2> 	JL	GoGetCh 		; oops, not a digit, ignore
   460                              <2> 	MOV	CX,BP			; save BP for 10 multiply
   461                              <2> 	CBW				; make AL into AX
   462                              <2> 	SHL	BP,1			; 2*BP
   463                              <2> 	SHL	BP,1			; 4*BP
   464                              <2> 	ADD	BP,CX			; 5*BP
   465                              <2> 	SHL	BP,1			; 10*BP
   466                              <2> 	ADD	BP,AX			; 10*BP + digit
   467                              <2> 	JMP	EatNum			; continue with number
   468                              <2> CheckNumEnd:
   469                              <2> 	CMP	AL,7Eh			; is it end char ~
   470                              <2> 	JNZ	GoGetCh 		; nope, ignore key sequence
   471                              <2> 	MOV	AX,BP
   472                              <2> 	transferIf  1,SkipStr		; FIND key
   473                              <2> 	transferIf  2,EnterIns		; INSERT HERE key
   474                              <2> 	transferIf  3,SkipOne		; REMOVE
   475                              <2> 	transferIf  4,CopyStr		; SELECT
   476                              <2> 	transferIf  17,TwoEsc		; INTERRUPT
   477                              <2> 	transferIf  18,ReEdit		; RESUME
   478                              <2> 	transferIf  19,KilNew		; CANCEL
   479                              <2> 	transferIf  21,CtrlZ		; EXIT
   480                              <2> 	transferIf  29,CopyLin		; DO
   481                              <2> 	JMP	GoGetCh
   482                              <2> EatAlpha:
   483                              <2> 	CMP	AL,'O'                  ; is it O?
   484                              <2> 	JA	GoGetCh 		; no, after assume bogus
   485                              <2> 	JZ	EatPQRS 		; eat the rest of the bogus key
   486                              <2> 	transferIf  'C',CopyOne         ; RIGHT
   487                              <2> 	transferIf  'D',BackSp          ; LEFT
   488                              <2> 	JMP	GoGetCh
   489                              <2> EatPQRS:
   490                              <2> 	invoke	D_std_con_input_no_echo	; eat char after O
   491                              <2> 	JMP	GoGetCh
   492                              <2> 	%ENDIF
   493                              <2> 
   494                              <2> EndProc OEMFunctionKey
   495                              <2> 
   496                              <2> ; (no prior section) ; DOSCODECODE		ENDS
   497                              <2> 
   498                              <2> %endif	; DONOBITS
   499                              <2> 
   500                              <2> 	END
    19                              <1> ;=== Pop trace listing source
