     1                                  
     2                                  ; Public Domain
     3                                  
     4                                  ; test run command: *.com; .; .
     5                                  
     6                                  %include "lmacros3.mac"
     1                              <1> [list -]
    14                              <2> [list -]
    14                              <1> [list -]
     7                                  %include "eld.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2025 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELD_MAC
    16                              <1> %define ELD_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    19                              <1> 
    20                              <1> 		; ELD executable header
    21                              <1> 	struc ELD_HEADER
    22 00000000 ????????            <1> eldhSignature:		resb 4	; "ELD1"
    23 00000004 ??????              <1> 			resb 3	; reserved
    24 00000007 ??                  <1> 			resb 1	; 26 (Ctrl-Z)
    25 00000008 ????????            <1> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26 0000000C ????                <1> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27 0000000E ????                <1> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28 00000010 ????????            <1> eldhDataOffset:		resd 1
    29 00000014 ????                <1> eldhDataImageLength:	resw 1	; (zero allowed)
    30 00000016 ????                <1> eldhDataAllocLength:	resw 1	; (zero allowed)
    31 00000018 ????                <1> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32 0000001A ????????            <1> eldhReserved:		resb 4	; reserved
    33 0000001E ????                <1> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <1> 	endstruc
    35                              <1> 	endarea ELD_HEADER, 1
    36                              <1> 
    37                              <1> 	struc ELD_HEADERX
    38 00000000 <res 20h>           <1> eldhxHeader:		resb ELD_HEADER_size
    39 00000020 ????????            <1> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40 00000024 ????????            <1> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41 00000028 ????????            <1> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42 0000002C ????????            <1> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <1> 	alignb 16
    44                              <1> 	endstruc
    45                              <1> 
    46                              <1> 	struc ELD_TRAILER_HEADER
    47 00000000 ????????????????    <1> eldthSignature:		resb 8	; "ELD1TAIL"
    48 00000008 ????????            <1> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <1> 				;  add this dword to the seek offset
    50 0000000C ????                <1> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51 0000000E ????                <1> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <1> 	endstruc
    53                              <1> 	endarea ELD_TRAILER_HEADER, 1
    54                              <1> 
    55                              <1> 	struc ELD_LIBTABLE
    56 00000000 ????                <1> eldltFormat:		resw 1
    57                              <1> 	; 0 = uncompressed
    58                              <1> 	; 2 = heatshrink compressed
    59                              <1> 	; 3 = lzexedat -4 compressed
    60                              <1> 	; 4 = lzexedat -4 -l compressed
    61 00000002 ????                <1> eldltAmount:		resw 1
    62 00000004 ????????            <1> eldltOffset:		resd 1	; from eldhxHeader
    63                              <1> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <1> 	endstruc
    65                              <1> 	endarea ELD_LIBTABLE, 1
    66                              <1> 
    67                              <1> 		; ELD instance header
    68                              <1> 	struc ELD_INSTANCE
    69 00000000 ????                <1> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70 00000002 ????                <1> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71 00000004 ????                <1> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72 00000006 ????                <1> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73 00000008 ????????????????    <1> eldiIdentifier:		resb 8	; blank-filled text
    74 00000010 ????                <1> eldiFlags:		resw 1	; flags
    75                              <1> eldiListing_size equ 14
    76 00000012 <res Eh>            <1> eldiListing:		resb eldiListing_size
    77                              <1> 				; ASCIZ listing file name
    78                              <1> 	endstruc
    79                              <1> 		; flags for eldiFlags:
    80                              <1> eldifResident:		equ 1
    81                              <1> 
    82                              <1> 		; ELD link info header
    83                              <1> 	struc ELD_LINKINFO
    84 00000000 ????                <1> eldlSignature:		resw 1	; 0E1D1h
    85 00000002 ????????            <1> eldlReserved:		resw 2
    86 00000006 ????                <1> eldlUseLinkHash:	resw 1
    87 00000008 ????                <1> eldlDataAmount:		resw 1
    88 0000000A ????                <1> eldlDataPrefixes:	resw 1
    89 0000000C ????                <1> eldlDataEntries:	resw 1
    90 0000000E ????                <1> eldlDataAddresses:	resw 1
    91 00000010 ????                <1> eldlCodeAmount:		resw 1
    92 00000012 ????                <1> eldlCodePrefixes:	resw 1
    93 00000014 ????                <1> eldlCodeEntries:	resw 1
    94 00000016 ????                <1> eldlCodeAddresses:	resw 1
    95                              <1> 	endstruc
    96                              <1> 
    97                              <1> 	numdef ELD_CODE_VSTART, 9001h
    98                              <1> 	numdef ELD_DATA_VSTART, 8000h
    99                              <1> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <1> 
   101                              <1> 	numdef ELD_RECLAIM_HINT, 0
   102                              <1> 	strdef ELD_LISTING, ""
   103                              <1> 	numdef ELD_DATETIME, 0
   104                              <1> 
   105                              <1> %if _ELD_DATETIME
   106                              <1>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <1>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <1> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <1> 		asciz		; for future extension
   110                              <1>  %endmacro
   111                              <1> %else
   112                              <1>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <1>  %define PUT_ELD_DATETIME
   114                              <1> %endif
   115                              <1> 
   116                              <1> %endif
     8                                  %include "eldcall.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug call macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2024 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELDCALL_MAC
    16                              <1> %define ELDCALL_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    19                              <1> %include "nasmhash.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> Hashing macros
     5                              <2>  by E. C. Masloch, 2019
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef __NASMHASH_MAC__
    16                              <2> %assign __NASMHASH_MAC__ 1
    17                              <2> 
    18                              <2> 
    19                              <2> 	%macro hashdef 2+.nolist
    20                              <2> %ifempty %2
    21                              <2>  %assign _%1 1
    22                              <2> %else
    23                              <2> %ifstr %2
    24                              <2>  %define %%string %2
    25                              <2> %elifid %2
    26                              <2>  %defstr %%string %2
    27                              <2> %elifnum %2
    28                              <2>  %defstr %%string %2
    29                              <2> %eliftok %2
    30                              <2>  %defstr %%string %2
    31                              <2> %else
    32                              <2>  %error Unknown input
    33                              <2> %endif
    34                              <2> %strlen %%length %%string
    35                              <2> %assign %%hash 1
    36                              <2> %assign %%index 1
    37                              <2> %rep %%length
    38                              <2>  %substr %%char %%string %%index
    39                              <2>  %assign %%hash (%%hash * 31 + %%char) & 0FFFFh
    40                              <2>  %assign %%index %%index + 1
    41                              <2> %endrep
    42                              <2> %assign _%1 %%hash
    43                              <2> %endif
    44                              <2> 	%endmacro
    45                              <2> 
    46                              <2> 
    47                              <2> %endif
    20                              <1> %include "elddata.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug data relocation macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2024 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef ELDDATA_MAC
    16                              <2> %define ELDDATA_MAC 1
    17                              <2> 
    18                              <2> %include "lmacros3.mac"
     1                              <3> [list -]
    19                              <2> %include "nasmhash.mac"
     1                              <3> 
     2                              <3> %if 0
     3                              <3> 
     4                              <3> Hashing macros
     5                              <3>  by E. C. Masloch, 2019
     6                              <3> 
     7                              <3> Usage of the works is permitted provided that this
     8                              <3> instrument is retained with the works, so that any entity
     9                              <3> that uses the works is notified of this instrument.
    10                              <3> 
    11                              <3> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <3> 
    13                              <3> %endif
    14                              <3> 
    15                              <3> %ifndef __NASMHASH_MAC__
    16                              <3> %assign __NASMHASH_MAC__ 1
    17                              <3> 
    18                              <3> 
    19                              <3> 	%macro hashdef 2+.nolist
    20                              <3> %ifempty %2
    21                              <3>  %assign _%1 1
    22                              <3> %else
    23                              <3> %ifstr %2
    24                              <3>  %define %%string %2
    25                              <3> %elifid %2
    26                              <3>  %defstr %%string %2
    27                              <3> %elifnum %2
    28                              <3>  %defstr %%string %2
    29                              <3> %eliftok %2
    30                              <3>  %defstr %%string %2
    31                              <3> %else
    32                              <3>  %error Unknown input
    33                              <3> %endif
    34                              <3> %strlen %%length %%string
    35                              <3> %assign %%hash 1
    36                              <3> %assign %%index 1
    37                              <3> %rep %%length
    38                              <3>  %substr %%char %%string %%index
    39                              <3>  %assign %%hash (%%hash * 31 + %%char) & 0FFFFh
    40                              <3>  %assign %%index %%index + 1
    41                              <3> %endrep
    42                              <3> %assign _%1 %%hash
    43                              <3> %endif
    44                              <3> 	%endmacro
    45                              <3> 
    46                              <3> 
    47                              <3> %endif
    20                              <2> %include "eldcheck.mac"
     1                              <3> %if 0
     2                              <3> 
     3                              <3> Extensions for lDebug relocation check macros
     4                              <3> 
     5                              <3> Copyright (C) 2008-2023 E. C. Masloch
     6                              <3> 
     7                              <3> Usage of the works is permitted provided that this
     8                              <3> instrument is retained with the works, so that any entity
     9                              <3> that uses the works is notified of this instrument.
    10                              <3> 
    11                              <3> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <3> 
    13                              <3> %endif
    14                              <3> 
    15                              <3> %ifndef ELDCHECK_MAC
    16                              <3> %define ELDCHECK_MAC 1
    17                              <3> 
    18                              <3> %assign ELDSTRICT 0
    19                              <3> %assign ELDSTRICTCOUNTER 0
    20                              <3> 
    21                              <3> 	%imacro eldstrict 1.nolist
    22                              <3> %ifidni %1, on
    23                              <3>  %assign ELDSTRICT 1
    24                              <3>  [warning +error=reloc-abs]
    25                              <3>  [warning +reloc-abs]
    26                              <3> %elifidni %1, off
    27                              <3>  %assign ELDSTRICT 0
    28                              <3>  [warning -reloc-abs]
    29                              <3> %else
    30                              <3>  %error Unknown keyword
    31                              <3> %endif
    32                              <3> 	%endmacro
    33                              <3> 
    34                              <3> 	%imacro reloc 1+.nolist
    35                              <3> %if ELDSTRICT
    36                              <3>  %if ELDSTRICTCOUNTER
    37                              <3>   %error Missing relocation
    38                              <3>  %endif
    39                              <3>  [warning -reloc-abs]
    40                              <3>  %assign ELDSTRICTCOUNTER 1
    41                              <3> %endif
    42                              <3> %1
    43                              <3> 	%endmacro
    44                              <3> 
    45                              <3> 	%imacro reloc2 1+.nolist
    46                              <3> %if ELDSTRICT
    47                              <3>  %if ELDSTRICTCOUNTER
    48                              <3>   %error Missing relocation
    49                              <3>  %endif
    50                              <3>  [warning -reloc-abs]
    51                              <3>  %assign ELDSTRICTCOUNTER 2
    52                              <3> %endif
    53                              <3> %1
    54                              <3> 	%endmacro
    55                              <3> 
    56                              <3> 	%imacro eldstrictcheck 0.nolist
    57                              <3> %if ELDSTRICT
    58                              <3>  %ifn ELDSTRICTCOUNTER
    59                              <3>   %error Unexpected relocation
    60                              <3>  %else
    61                              <3>   %assign ELDSTRICTCOUNTER ELDSTRICTCOUNTER - 1
    62                              <3>   %ifn ELDSTRICTCOUNTER
    63                              <3>    [warning +reloc-abs]
    64                              <3>   %endif
    65                              <3>  %endif
    66                              <3> %endif
    67                              <3> 	%endmacro
    68                              <3> 
    69                              <3> %endif
    70                              <3> 
    21                              <2> 
    22                              <2> 
    23                              <2> %assign ELDLINKER 0
    24                              <2> 
    25                              <2> %define INTERNAL_CODE_TO_CODE_RELOCATIONS ""
    26                              <2> %define INTERNAL_CODE_TO_DATA_RELOCATIONS ""
    27                              <2> %define INTERNAL_DATA_TO_CODE_RELOCATIONS ""
    28                              <2> %define INTERNAL_DATA_TO_DATA_RELOCATIONS ""
    29                              <2> %define INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS ""
    30                              <2> %define INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS ""
    31                              <2> %define INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS ""
    32                              <2> %define INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS ""
    33                              <2> %assign ELDDATA_OPTIONAL_STATUS 0		; not any seen yet
    34                              <2> %assign ELDDATA_PMREQUIRED_STATUS 0		; not any seen yet
    35                              <2> 
    36                              <2> 	%imacro internalcoderelocation 0-1.nolist -2
    37                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    38                              <2> %if ELDLINKER
    39                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    40                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    41                              <2>  %else
    42                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    43                              <2>  %endif
    44                              <2> %else
    45                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    46                              <2>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    47                              <2>  %else
    48                              <2>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    49                              <2>  %endif
    50                              <2> %endif
    51                              <2> 	eldstrictcheck
    52                              <2> 	%endmacro
    53                              <2> 
    54                              <2> 	%imacro internaldatarelocation 0-1.nolist -2
    55                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    56                              <2> %if ELDLINKER
    57                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    58                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    59                              <2>  %else
    60                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    61                              <2>  %endif
    62                              <2> %else
    63                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    64                              <2>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    65                              <2>  %else
    66                              <2>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    67                              <2>  %endif
    68                              <2> %endif
    69                              <2> 	eldstrictcheck
    70                              <2> 	%endmacro
    71                              <2> 
    72                              <2> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    73                              <2> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    74                              <2> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    75                              <2> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    76                              <2> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    77                              <2> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    78                              <2> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    79                              <2> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    80                              <2> 
    81                              <2> 
    82                              <2> %define LINK_DATA_RELOCATIONS ""
    83                              <2> %define LINK_LINKER_DATA_RELOCATIONS ""
    84                              <2> %define LINK_DATA_NAMES db ""
    85                              <2> %define LINK_DATA_DETECTION none, none
    86                              <2> 
    87                              <2> %define LINK_OTHER_DATA_RELOCATIONS ""
    88                              <2> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    89                              <2> %define LINK_OTHER_DATA_NAMES db ""
    90                              <2> %define LINK_OTHER_DATA_DETECTION none, none
    91                              <2> 
    92                              <2> %ifndef ELDOTHER
    93                              <2>  %assign ELDOTHER 0
    94                              <2> %endif
    95                              <2> %assign ELDOTHERLINK 0
    96                              <2> 
    97                              <2> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
    98                              <2> %if ELDOTHER
    99                              <2>  %assign ELDOTHERLINK 1
   100                              <2> %endif
   101                              <2> 	linkdatarelocation %1, %2, %3
   102                              <2> %assign ELDOTHERLINK 0
   103                              <2> 	%endmacro
   104                              <2> 
   105                              <2> 	%imacro linkdatarelocation 1-3.nolist -2, required
   106                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   107                              <2> %ifidni %3, required
   108                              <2>  %assign %%optional 0
   109                              <2> %elifidni %3, optional
   110                              <2>  %assign %%optional 100h
   111                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   112                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   113                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   114                              <2>  %else
   115                              <2>   %error Optional data link not allowed here
   116                              <2>  %endif
   117                              <2> %elifidni %3, PM required
   118                              <2>  %assign %%optional 300h
   119                              <2>  %assign ELDDATA_PMREQUIRED_STATUS 1
   120                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   121                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   122                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   123                              <2>  %else
   124                              <2>   %error Optional data link not allowed here
   125                              <2>  %endif
   126                              <2> %else
   127                              <2>  %fatal Unknown optional keyword
   128                              <2> %endif
   129                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
   130                              <2>  %assign %%DATASECTION 1
   131                              <2> %else
   132                              <2>  %assign %%DATASECTION 0
   133                              <2> %endif
   134                              <2> 	%if ELDOTHERLINK
   135                              <2> %if ELDLINKER
   136                              <2>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   137                              <2> %else
   138                              <2>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   139                              <2> %endif
   140                              <2> 	%else
   141                              <2> %if ELDLINKER
   142                              <2>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   143                              <2> %else
   144                              <2>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   145                              <2> %endif
   146                              <2> 	%endif
   147                              <2> %defstr %%string %1
   148                              <2> %strlen %%length %%string
   149                              <2> %if %%length > 64
   150                              <2>  %error Too long link name: %1
   151                              <2> %endif
   152                              <2> %define LINK_DATA_CHECK %1
   153                              <2> 	%if ELDOTHERLINK
   154                              <2> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   155                              <2> %if LINK_DATA_NEW
   156                              <2>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   157                              <2> 	hashdef HASH, %%string
   158                              <2>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   160                              <2> %else
   161                              <2>  %%name equ LINK_DATA_DUPLICATE
   162                              <2> %endif
   163                              <2> 	%else
   164                              <2> 	linkdata_detect LINK_DATA_DETECTION
   165                              <2> %if LINK_DATA_NEW
   166                              <2>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   167                              <2> 	hashdef HASH, %%string
   168                              <2>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   170                              <2> %else
   171                              <2>  %%name equ LINK_DATA_DUPLICATE
   172                              <2> %endif
   173                              <2> 	%endif
   174                              <2> 	eldstrictcheck
   175                              <2> 	%endmacro
   176                              <2> 
   177                              <2> 	%imacro linkdata_detect 2-*.nolist
   178                              <2> %assign LINK_DATA_NEW 1
   179                              <2> %rep (%0 - 2) / 2
   180                              <2>  %rotate 2
   181                              <2>  %ifidni %1, LINK_DATA_CHECK
   182                              <2>   %assign LINK_DATA_NEW 0
   183                              <2>   %xdefine LINK_DATA_DUPLICATE %2
   184                              <2>   %exitrep
   185                              <2>  %endif
   186                              <2> %endrep
   187                              <2> 	%endmacro
   188                              <2> 
   189                              <2> 	%imacro link_data_dump_names 1-*.nolist
   190                              <2> %rep %0
   191                              <2> 	%1
   192                              <2>  %rotate 1
   193                              <2> %endrep
   194                              <2> 	%endmacro
   195                              <2> 
   196                              <2> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   197                              <2> ; dw LINK_DATA_RELOCATIONS, 0, 0
   198                              <2> ; link_data_dump_names ELDCALL_CODE_NAMES
   199                              <2> 
   200                              <2> %endif
    21                              <1> 
    22                              <1> %assign ELDLINKER 0
    23                              <1> 
    24                              <1> [section relocatedzero nobits vstart=0]
    25                              <1> relocatedzero:
    26                              <1> __SECT__
    27                              <1> 
    28                              <1> 	numdef HOUDINI, 1
    29                              <1> 	numdef HOUDINI_CONDITIONAL, 1
    30                              <1> 
    31                              <1> %imacro houdini 0.nolist
    32                              <1> %if _HOUDINI
    33                              <1>  %if _HOUDINI_CONDITIONAL
    34                              <1> reloc	testopt [ss:relocateddata], 100h
    35                              <1> linkdatarelocation options7, -3
    36                              <1> 	jz %%skip
    37                              <1>  %endif
    38                              <1> reloc	testopt [ss:relocateddata], 100h
    39                              <1> linkdatarelocation internalflags6, -3
    40                              <1> 	jz %%skip
    41                              <1> 	int3
    42                              <1> %%skip:
    43                              <1> %endif
    44                              <1> %endmacro
    45                              <1> 
    46                              <1> %define ELDCALL_CODE_RELOCATIONS ""
    47                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS ""
    48                              <1> %define ELDCALL_CODE_RELOCATIONS_OPTIONAL ""
    49                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ""
    50                              <1> %define ELDCALL_CODE_NAMES db ""
    51                              <1> %define ELDCALL_CODE_DETECTION none, none
    52                              <1> %assign ELDCALL_OPTIONAL_STATUS 0		; not any seen yet
    53                              <1> %assign ELDCALL_PMREQUIRED_STATUS 0		; not any seen yet
    54                              <1> 
    55                              <1> 	%imacro extcall 1-2.nolist required
    56                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
    57                              <1>  %error "ELD call cannot be used in ELD data block"
    58                              <1> %endif
    59                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP
    60                              <1> %ifidni %2, required
    61                              <1>  %assign %%optional 0
    62                              <1> %elifidni %2, optional
    63                              <1>  %assign %%optional 100h
    64                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    65                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    66                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    67                              <1>  %else
    68                              <1>   %error Optional code link not allowed here
    69                              <1>  %endif
    70                              <1> %elifidni %2, PM required
    71                              <1>  %assign %%optional 300h
    72                              <1>  %assign ELDCALL_PMREQUIRED_STATUS 1
    73                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    74                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    75                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    76                              <1>  %else
    77                              <1>   %error Optional code link not allowed here
    78                              <1>  %endif
    79                              <1> %else
    80                              <1>  %fatal Unknown optional keyword
    81                              <1> %endif
    82                              <1> %if 0
    83                              <1> [warning -reloc-rel-word]
    84                              <1> 	call near relocatedzero
    85                              <1> [warning +reloc-rel-word]
    86                              <1> %else
    87                              <1> 	db 0E8h
    88                              <1> reloc	dw relocatedzero
    89                              <1> 	eldstrictcheck
    90                              <1> %endif
    91                              <1> 	jmp strict short %%skipparameter
    92                              <1> 	dw 0
    93                              <1> %%skipparameter:
    94                              <1> %if ELDLINKER
    95                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS ELDCALL_LINKER_CODE_RELOCATIONS, %%entry, %%name
    96                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
    97                              <1> %else
    98                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS ELDCALL_CODE_RELOCATIONS, %%entry, %%name
    99                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS_OPTIONAL ELDCALL_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
   100                              <1> %endif
   101                              <1> %defstr %%string %1
   102                              <1> %strlen %%length %%string
   103                              <1> %if %%length > 64
   104                              <1>  %error Too long link name: %1
   105                              <1> %endif
   106                              <1> %define ELDCALL_CODE_CHECK %1
   107                              <1> 	linkcode_detect ELDCALL_CODE_DETECTION
   108                              <1> %if ELDCALL_CODE_NEW
   109                              <1>  %xdefine ELDCALL_CODE_DETECTION ELDCALL_CODE_DETECTION, %1, %%name
   110                              <1> 	hashdef HASH, %%string
   111                              <1> %xdefine ELDCALL_CODE_NAMES 	ELDCALL_CODE_NAMES, %%name:, dw _HASH, {counted %%string}
   113                              <1> %else
   114                              <1>  %%name equ ELDCALL_CODE_DUPLICATE
   115                              <1> %endif
   116                              <1> 	%endmacro
   117                              <1> 
   118                              <1> 	%imacro linkcode_detect 2-*.nolist
   119                              <1> %assign ELDCALL_CODE_NEW 1
   120                              <1> %rep (%0 - 2) / 2
   121                              <1>  %rotate 2
   122                              <1>  %ifidni %1, ELDCALL_CODE_CHECK
   123                              <1>   %assign ELDCALL_CODE_NEW 0
   124                              <1>   %xdefine ELDCALL_CODE_DUPLICATE %2
   125                              <1>   %exitrep
   126                              <1>  %endif
   127                              <1> %endrep
   128                              <1> 	%endmacro
   129                              <1> 
   130                              <1> 
   131                              <1> %define ELDCALL_CALLCALL_LIST none
   132                              <1> 
   133                              <1> 	%imacro extcallcall 1.nolist
   134                              <1> 	call %1
   135                              <1> %xdefine ELDCALL_CALLCALL_LIST ELDCALL_CALLCALL_LIST, %1
   136                              <1> 	%endmacro
   137                              <1> 
   138                              <1> %assign ELDCALLCALL_DUMPED 0
   139                              <1> 
   140                              <1> 	%imacro eldcall_dump_callcall 1-*.nolist
   141                              <1> %define ELDCALL_CALLCALL_PROCESSED none
   142                              <1>  %rep %0 - 1
   143                              <1>   %rotate 1
   144                              <1>   %define ELDCALL_CHECK %1
   145                              <1> 	eldcall_callcall_detect ELDCALL_CALLCALL_PROCESSED
   146                              <1>   %if ELDCALL_NEW
   147                              <1>    %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED, %1
   148                              <1> 	align 8, nop
   149                              <1> %1:
   150                              <1> 	extcall %1
   151                              <1> 	retn
   152                              <1>   %endif
   153                              <1>  %endrep
   154                              <1> %unimacro extcallcall 1.nolist
   155                              <1> %assign ELDCALLCALL_DUMPED 1
   156                              <1> %define ELDCALL_CALLCALL_LIST none
   157                              <1> 	%endmacro
   158                              <1> 
   159                              <1> 	%imacro eldcall_callcall_detect 1-*.nolist
   160                              <1> %assign ELDCALL_NEW 1
   161                              <1> %rep %0 - 1
   162                              <1>  %rotate 1
   163                              <1>  %ifidni %1, ELDCALL_CHECK
   164                              <1>   %assign ELDCALL_NEW 0
   165                              <1>   %exitrep
   166                              <1>  %endif
   167                              <1> %endrep
   168                              <1> 	%endmacro
   169                              <1> 
   170                              <1> 	%imacro eldcall_dump_names 1-*.nolist
   171                              <1> %rep %0
   172                              <1> 	%1
   173                              <1>  %rotate 1
   174                              <1> %endrep
   175                              <1> 	%endmacro
   176                              <1> 
   177                              <1> ; eldcall_dump_callcall ELDCALL_CALLCALL_LIST
   178                              <1> ; if using optional code links:
   179                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   180                              <1> ;  dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   181                              <1> ; if not using optional code links:
   182                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   183                              <1> ;  dw ELDCALL_CODE_RELOCATIONS, 0, 0
   184                              <1> ; eldcall_dump_names ELDCALL_CODE_NAMES
   185                              <1> 
   186                              <1> %endif
     9                                  %include "elddata.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug data relocation macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2024 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELDDATA_MAC
    16                              <1> %define ELDDATA_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
    19                              <1> %include "nasmhash.mac"
    20                              <1> %include "eldcheck.mac"
    21                              <1> 
    22                              <1> 
    23                              <1> %assign ELDLINKER 0
    24                              <1> 
    25                              <1> %define INTERNAL_CODE_TO_CODE_RELOCATIONS ""
    26                              <1> %define INTERNAL_CODE_TO_DATA_RELOCATIONS ""
    27                              <1> %define INTERNAL_DATA_TO_CODE_RELOCATIONS ""
    28                              <1> %define INTERNAL_DATA_TO_DATA_RELOCATIONS ""
    29                              <1> %define INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS ""
    30                              <1> %define INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS ""
    31                              <1> %define INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS ""
    32                              <1> %define INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS ""
    33                              <1> %assign ELDDATA_OPTIONAL_STATUS 0		; not any seen yet
    34                              <1> %assign ELDDATA_PMREQUIRED_STATUS 0		; not any seen yet
    35                              <1> 
    36                              <1> 	%imacro internalcoderelocation 0-1.nolist -2
    37                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    38                              <1> %if ELDLINKER
    39                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    40                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    41                              <1>  %else
    42                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    43                              <1>  %endif
    44                              <1> %else
    45                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    46                              <1>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    47                              <1>  %else
    48                              <1>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    49                              <1>  %endif
    50                              <1> %endif
    51                              <1> 	eldstrictcheck
    52                              <1> 	%endmacro
    53                              <1> 
    54                              <1> 	%imacro internaldatarelocation 0-1.nolist -2
    55                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    56                              <1> %if ELDLINKER
    57                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    58                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    59                              <1>  %else
    60                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    61                              <1>  %endif
    62                              <1> %else
    63                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    64                              <1>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    65                              <1>  %else
    66                              <1>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    67                              <1>  %endif
    68                              <1> %endif
    69                              <1> 	eldstrictcheck
    70                              <1> 	%endmacro
    71                              <1> 
    72                              <1> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    73                              <1> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    74                              <1> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    75                              <1> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    76                              <1> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    77                              <1> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    78                              <1> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    79                              <1> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    80                              <1> 
    81                              <1> 
    82                              <1> %define LINK_DATA_RELOCATIONS ""
    83                              <1> %define LINK_LINKER_DATA_RELOCATIONS ""
    84                              <1> %define LINK_DATA_NAMES db ""
    85                              <1> %define LINK_DATA_DETECTION none, none
    86                              <1> 
    87                              <1> %define LINK_OTHER_DATA_RELOCATIONS ""
    88                              <1> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    89                              <1> %define LINK_OTHER_DATA_NAMES db ""
    90                              <1> %define LINK_OTHER_DATA_DETECTION none, none
    91                              <1> 
    92                              <1> %ifndef ELDOTHER
    93                              <1>  %assign ELDOTHER 0
    94                              <1> %endif
    95                              <1> %assign ELDOTHERLINK 0
    96                              <1> 
    97                              <1> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
    98                              <1> %if ELDOTHER
    99                              <1>  %assign ELDOTHERLINK 1
   100                              <1> %endif
   101                              <1> 	linkdatarelocation %1, %2, %3
   102                              <1> %assign ELDOTHERLINK 0
   103                              <1> 	%endmacro
   104                              <1> 
   105                              <1> 	%imacro linkdatarelocation 1-3.nolist -2, required
   106                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   107                              <1> %ifidni %3, required
   108                              <1>  %assign %%optional 0
   109                              <1> %elifidni %3, optional
   110                              <1>  %assign %%optional 100h
   111                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   112                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   113                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   114                              <1>  %else
   115                              <1>   %error Optional data link not allowed here
   116                              <1>  %endif
   117                              <1> %elifidni %3, PM required
   118                              <1>  %assign %%optional 300h
   119                              <1>  %assign ELDDATA_PMREQUIRED_STATUS 1
   120                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   121                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   122                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   123                              <1>  %else
   124                              <1>   %error Optional data link not allowed here
   125                              <1>  %endif
   126                              <1> %else
   127                              <1>  %fatal Unknown optional keyword
   128                              <1> %endif
   129                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
   130                              <1>  %assign %%DATASECTION 1
   131                              <1> %else
   132                              <1>  %assign %%DATASECTION 0
   133                              <1> %endif
   134                              <1> 	%if ELDOTHERLINK
   135                              <1> %if ELDLINKER
   136                              <1>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   137                              <1> %else
   138                              <1>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   139                              <1> %endif
   140                              <1> 	%else
   141                              <1> %if ELDLINKER
   142                              <1>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   143                              <1> %else
   144                              <1>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   145                              <1> %endif
   146                              <1> 	%endif
   147                              <1> %defstr %%string %1
   148                              <1> %strlen %%length %%string
   149                              <1> %if %%length > 64
   150                              <1>  %error Too long link name: %1
   151                              <1> %endif
   152                              <1> %define LINK_DATA_CHECK %1
   153                              <1> 	%if ELDOTHERLINK
   154                              <1> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   155                              <1> %if LINK_DATA_NEW
   156                              <1>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   157                              <1> 	hashdef HASH, %%string
   158                              <1>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   160                              <1> %else
   161                              <1>  %%name equ LINK_DATA_DUPLICATE
   162                              <1> %endif
   163                              <1> 	%else
   164                              <1> 	linkdata_detect LINK_DATA_DETECTION
   165                              <1> %if LINK_DATA_NEW
   166                              <1>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   167                              <1> 	hashdef HASH, %%string
   168                              <1>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   170                              <1> %else
   171                              <1>  %%name equ LINK_DATA_DUPLICATE
   172                              <1> %endif
   173                              <1> 	%endif
   174                              <1> 	eldstrictcheck
   175                              <1> 	%endmacro
   176                              <1> 
   177                              <1> 	%imacro linkdata_detect 2-*.nolist
   178                              <1> %assign LINK_DATA_NEW 1
   179                              <1> %rep (%0 - 2) / 2
   180                              <1>  %rotate 2
   181                              <1>  %ifidni %1, LINK_DATA_CHECK
   182                              <1>   %assign LINK_DATA_NEW 0
   183                              <1>   %xdefine LINK_DATA_DUPLICATE %2
   184                              <1>   %exitrep
   185                              <1>  %endif
   186                              <1> %endrep
   187                              <1> 	%endmacro
   188                              <1> 
   189                              <1> 	%imacro link_data_dump_names 1-*.nolist
   190                              <1> %rep %0
   191                              <1> 	%1
   192                              <1>  %rotate 1
   193                              <1> %endrep
   194                              <1> 	%endmacro
   195                              <1> 
   196                              <1> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   197                              <1> ; dw LINK_DATA_RELOCATIONS, 0, 0
   198                              <1> ; link_data_dump_names ELDCALL_CODE_NAMES
   199                              <1> 
   200                              <1> %endif
    10                                  
    11                                  	numdef DEBUG, 1
    12                                  	numdef BOOT, 0
    13                                  
    14                                  %assign _CATCHINT0C 0
    15                                  %assign _CATCHINT0D 0
    16                                  %assign _CATCHINTFAULTCOND 0
    17                                  %assign _DEBUG_COND 1
    18                                  %assign _DELAY_BEFORE_BP 0
    19                                  %assign _DHIGHLIGHT 0
    20                                  %assign _GETLINEHIGHLIGHT 0
    21                                  %assign _IMMASM 0
    22                                  %assign _INPUT_FILE_BOOT 0
    23                                  %assign _INPUT_FILE_HANDLES 0
    24                                  %assign _MS_0RANGE_COMPAT 0
    25                                  %assign _PM 0
    26                                  %assign _RH 0
    27                                  %assign _SYMBOLIC 0
    28                                  %assign _VXCHG 0
    29                                  %include "options.mac"
     1                              <1> 
     2                              <1> %if 0
     3                              <1> 
     4                              <1> lDebug options and internal flags
     5                              <1> 
     6                              <1> Copyright (C) 2008-2023 E. C. Masloch
     7                              <1> 
     8                              <1> Usage of the works is permitted provided that this
     9                              <1> instrument is retained with the works, so that any entity
    10                              <1> that uses the works is notified of this instrument.
    11                              <1> 
    12                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <1> 
    14                              <1> %endif
    15                              <1> 
    16                              <1> 
    17                              <1> dispregs32	equ	  1	; RX: 32-bit register display (R, T/P/G)
    18                              <1> traceints	equ	  2	; TM: trace into interrupts (T)
    19                              <1> cpdepchars	equ	  4	; allow dumping of CP-dependent characters (D, DX)
    20                              <1> fakeindos	equ	  8	; always assume InDOS flag non-zero (all)
    21                              <1> nonpagingdevice	equ	 10h	; disallow paged output with [more] prompt (all exc. P, T)
    22                              <1> 	; This option was never used anywhere:
    23                              <1> ; pagingdevice	equ	 20h	; allow paged output with [more] prompt (all exc. P, T)
    24                              <1> 				; paged output is by default on if the output device is StdOut, else off
    25                              <1> hexrn		equ	 40h	; display raw hexadecimal content of FPU registers (RN)
    26                              <1> ;novdd		equ	 80h	; don't use a registered NTVDM VDD (L, W)
    27                              <1> nondospaging	equ	100h	; paging: don't use DOS for input when waiting for a key
    28                              <1> opt1_86mnohlt	equ	200h	; (86 Mode:) HLT doesn't work, don't use it
    29                              <1> biosidles	equ	400h	; don't idle with HLT or Int2F.1680, only call BIOS Int16.00
    30                              <1> opt_usegetinput	equ	800h	; use getinput for int 21h interactive input
    31                              <1> use_si_units	equ    1000h	; in disp_*_size use SI units (kB = 1000, etc)
    32                              <1> use_jedec_units	equ    2000h	; in disp_*_size use JEDEC units (kB = 1024)
    33                              <1> enable_serial	equ    4000h	; enable serial I/O (preferred over DOS or BIOS terminal)
    34                              <1> int8_disable_serial equ	   8000h	; disable serial I/O when breaking due to intr8
    35                              <1> gg_do_not_skip_bp equ	 1_0000h	; gg: do not skip a breakpoint (bb or gg)
    36                              <1> gg_no_autorepeat equ	 2_0000h	; gg: do not auto-repeat
    37                              <1> tp_do_not_skip_bp equ	 4_0000h	; T/TP/P: do not skip a (bb) breakpoint
    38                              <1> gg_bb_hit_no_repeat equ	 8_0000h	; gg: do not auto-repeat after bb hit
    39                              <1> tp_bb_hit_no_repeat equ	10_0000h	; T/TP/P: do not auto-repeat after bb hit
    40                              <1> gg_unexpected_no_repeat equ 20_0000h	; gg: do not auto-repeat after unexpectedinterrupt
    41                              <1> tp_unexpected_no_repeat equ 40_0000h	; T/TP/P
    42                              <1> ss_no_dump:		equ 80_0000h
    43                              <1> %if _SYMBOLIC
    44                              <1> dd_no_blanks_sym:	equ 100_0000h
    45                              <1> zz_no_pm_xms:		equ 200_0000h
    46                              <1> %endif
    47                              <1> rr_disasm_no_rept:	equ 1000_0000h
    48                              <1> rr_disasm_no_show:	equ 2000_0000h
    49                              <1> opt_cmdline_quiet_input:equ 4000_0000h
    50                              <1> opt_cmdline_quiet_output:equ 8000_0000h
    51                              <1> %if _SYMBOLIC
    52                              <1> DEFAULTOPTIONS	equ zz_no_pm_xms
    53                              <1> %else
    54                              <1> DEFAULTOPTIONS	equ 0
    55                              <1> %endif
    56                              <1> 
    57                              <1> 
    58                              <1> opt2_db_header:		equ 1
    59                              <1> opt2_db_trailer:	equ 2
    60                              <1> opt2_dw_header:		equ 10h
    61                              <1> opt2_dw_trailer:	equ 20h
    62                              <1> opt2_dd_header:		equ 100h
    63                              <1> opt2_dd_trailer:	equ 200h
    64                              <1> opt2_getinput_dpmi:	equ 800h
    65                              <1> opt2_hh_compat:		equ 1000h
    66                              <1> opt2_getc_idle:		equ 2000h
    67                              <1> opt2_getc_idle_dpmi:	equ 4000h
    68                              <1> opt2_re_cancel_tpg:	equ 8000h
    69                              <1> opt2_nn_compat:		equ 1_0000h
    70                              <1> opt2_nn_capitalise:	equ 2_0000h
    71                              <1> %if _MS_0RANGE_COMPAT
    72                              <1> opt2_0range_compat:	equ 4_0000h
    73                              <1> %endif
    74                              <1> opt2_rr16_compat:	equ 8_0000h
    75                              <1> opt2_r_prompt_compat:	equ 10_0000h
    76                              <1> opt2_r_separate:	equ 20_0000h
    77                              <1> opt2_r_linebreak_always:equ 40_0000h
    78                              <1> opt2_dpminohlt:		equ 8000_0000h	; DPMI doesn't like hlt
    79                              <1> DEFAULTOPTIONS2	equ opt2_dw_header | opt2_dd_header | opt2_getc_idle_dpmi | opt2_dpminohlt
    80                              <1> 
    81                              <1> 
    82                              <1> opt3_tt_no_paging:	equ 1
    83                              <1> opt3_tp_no_paging:	equ 2
    84                              <1> opt3_pp_no_paging:	equ 4
    85                              <1> opt3_gg_no_paging:	equ 8
    86                              <1> opt3_silence_paging_set:equ 100h
    87                              <1> opt3_silence_paging_on:	equ 200h
    88                              <1> opt3_paging_rc:		equ 1000h
    89                              <1> opt3_paging_yy:		equ 2000h
    90                              <1> opt3_paging_re:		equ 4000h
    91                              <1> opt3_r_highlight_diff:	equ 10000h
    92                              <1> opt3_r_highlight_dumb:	equ 20000h
    93                              <1> opt3_r_highlight_full:	equ 40000h
    94                              <1> opt3_r_highlight_eip:	equ 80000h
    95                              <1> %if _PM
    96                              <1> opt3_ss_b_bit_set:	equ   10_0000h
    97                              <1>  %if _BREAK_INSTALLDPMI
    98                              <1> opt3_break_installdpmi:	equ   20_0000h
    99                              <1>  %endif
   100                              <1> %endif
   101                              <1> %if _DHIGHLIGHT
   102                              <1> opt3_d_highlight:	equ   80_0000h
   103                              <1> %endif
   104                              <1> %if _GETLINEHIGHLIGHT
   105                              <1> opt3_getline_highlight:	equ  100_0000h
   106                              <1> %endif
   107                              <1> opt3_no_idle_2F:	equ  200_0000h
   108                              <1> %if _DELAY_BEFORE_BP
   109                              <1> opt3_delay_before_bp:	equ  400_0000h
   110                              <1> %endif
   111                              <1> opt3_no_call_amis:	equ  800_0000h
   112                              <1> opt3_disable_autorepeat:equ 1000_0000h
   113                              <1> opt3_check_ctrlc_keyb:	equ 2000_0000h
   114                              <1> opt3_check_ctrlc_0bh:	equ 4000_0000h
   115                              <1> opt3_tsr_quit_leave_tf:	equ 8000_0000h
   116                              <1> DEFAULTOPTIONS3	equ opt3_tt_no_paging | opt3_tp_no_paging 		| opt3_pp_no_paging | opt3_gg_no_paging 		| opt3_check_ctrlc_keyb | opt3_check_ctrlc_0bh
   119                              <1> 
   120                              <1> 
   121                              <1> opt4_int_2F_hook:	equ 2
   122                              <1> opt4_int_08_hook:	equ 4
   123                              <1> opt4_int_2D_hook:	equ 8
   124                              <1> %if _CATCHINTFAULTCOND
   125                              <1> opt4_int_fault_hook:	equ 10h
   126                              <1> %endif
   127                              <1> opt4_int_serial_force:	equ 1_0000h
   128                              <1> opt4_int_2F_force:	equ 2_0000h
   129                              <1> opt4_int_08_force:	equ 4_0000h
   130                              <1> opt4_int_2D_force:	equ 8_0000h
   131                              <1> %if _CATCHINT0D
   132                              <1> opt4_int_0D_force:	equ   10_0000h
   133                              <1> %endif
   134                              <1> %if _CATCHINT0C
   135                              <1> opt4_int_0C_force:	equ   20_0000h
   136                              <1> %endif
   137                              <1> opt4_int_00_force:	equ  100_0000h
   138                              <1> opt4_int_01_force:	equ  200_0000h
   139                              <1> opt4_int_03_force:	equ  400_0000h
   140                              <1> opt4_int_06_force:	equ  800_0000h
   141                              <1> opt4_int_18_force:	equ 1000_0000h
   142                              <1> opt4_int_19_force:	equ 2000_0000h
   143                              <1> opt4_int_09_force:	equ 4000_0000h	; not used at the same time as 15h
   144                              <1> opt4_int_15_force:	equ 4000_0000h	; not used at the same time as 09h
   145                              <1> opt4_int_07_force:	equ 8000_0000h
   146                              <1> DEFAULTOPTIONS4 equ opt4_int_2F_hook
   147                              <1> 
   148                              <1> 
   149                              <1> %if _VXCHG
   150                              <1> opt6_vv_mode:		equ 1
   151                              <1> opt6_vv_keep:		equ 2
   152                              <1> opt6_vv_int16:		equ 10h
   153                              <1>  %if _VXCHG_DEFAULT_ON
   154                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq | opt6_vv_mode
   155                              <1>  %else
   156                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   157                              <1>  %endif
   158                              <1> %else
   159                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   160                              <1> %endif
   161                              <1> %if _DEBUG
   162                              <1> opt6_debug_exception_late:	equ  20h
   163                              <1> opt6_debug_exception_early:	equ  40h
   164                              <1>  %if _DEBUG_COND
   165                              <1> opt6_debug_exception:	equ  80h
   166                              <1> opt6_debug_mode:	equ 100h
   167                              <1>  %endif
   168                              <1> %endif
   169                              <1> opt6_bios_output:	equ 200h
   170                              <1> opt6_flat_binary:	equ 400h
   171                              <1> opt6_big_stack:		equ 800h
   172                              <1> opt6_40_columns:	equ 1000h
   173                              <1> opt6_40_indent_odd:	equ 2000h
   174                              <1> opt6_40_dash:		equ 4000h
   175                              <1> opt6_share_serial_irq:	equ 1_0000h
   176                              <1> opt6_serial_EOI_call:	equ 2_0000h
   177                              <1> %if _RH
   178                              <1> opt6_rh_mode:		equ 10_0000h
   179                              <1> %endif
   180                              <1> %if _DEBUG
   181                              <1> opt6_debug_putrunint_early:	equ  40_0000h
   182                              <1>  %if _DEBUG_COND
   183                              <1> opt6_debug_putrunint:		equ  80_0000h
   184                              <1>  %endif
   185                              <1> %endif
   186                              <1> opt6_bios_io:		equ 100_0000h
   187                              <1> opt6_immasm_display_uu:	equ 200_0000h
   188                              <1> opt6_immasm_debug:	equ 400_0000h
   189                              <1> opt6_immasm_flag:	equ 800_0000h
   190                              <1> opt6_immasm_nobranch:	equ 1000_0000h
   191                              <1> opt6_r_flags_style2:	equ 2000_0000h
   192                              <1> opt6_r_flags_style3:	equ 4000_0000h
   193                              <1> opt6_r_linebreak_conditional:	equ 8000_0000h
   194                              <1> 
   195                              <1> 
   196                              <1> DEFAULTOPTIONS7 equ opt7_no_tsr_ll
   197                              <1> opt7_no_free_oneshot_eld:	equ 1
   198                              <1> opt7_debug_optional_link:	equ 2
   199                              <1> opt7_quiet_install:		equ 4
   200                              <1> opt7_quick_run:			equ 8
   201                              <1> opt7_houdini:			equ 100h
   202                              <1> opt7_no_ensure:			equ 1000h
   203                              <1> opt7_no_tsr_ll:			equ 2000h
   204                              <1> 
   205                              <1> 
   206                              <1> oldpacket	equ	  1	; Int25/Int26 packet method available (L, W)
   207                              <1> newpacket	equ	  2	; Int21.7305 packet method available (L, W)
   208                              <1> ntpacket	equ	  4	; VDD registered and usable (L, W)
   209                              <1> pagedcommand	equ	  8	; allows paging in puts
   210                              <1> notstdinput	equ	 10h	; DEBUG's StdIn isn't a device with StdIn bit (is file or other device)
   211                              <1> inputfile	equ	 20h	; DEBUG's StdIn is a file, notstdinput also set
   212                              <1> notstdoutput	equ	 40h	; DEBUG's StdOut isn't a device with StdOut bit (is file or other device)
   213                              <1> outputfile	equ	  80h	; DEBUG's StdOut is a file, notstdoutput also set
   214                              <1> hooked2F	equ	 100h	; Int2F hooked
   215                              <1> nohook2F	equ	 200h	; don't hook Int2F.1687 (required for Win9x, DosEmu?)
   216                              <1> unused_dif1_dpminohlt equ 400h	; DPMI doesn't like hlt
   217                              <1> protectedmode	equ	 800h	; in (DPMI) protected mode
   218                              <1> debuggeeA20	equ	1000h	; state of debuggee's A20
   219                              <1> debuggerA20	equ	2000h	; state of debugger's A20 (will be on if possible)
   220                              <1> nodosloaded	equ	4000h	; No DOS loaded currently (Boot loader mode)
   221                              <1> has386		equ	8000h	; CPU is a 386
   222                              <1> usecharcounter	equ    1_0000h	; don't reset charcounter between calls to puts
   223                              <1> runningnt	equ    2_0000h	; running in NTVDM
   224                              <1> canswitchmode	equ    4_0000h	; can switch modes (auxbuff large enough, DPMI mode switch set up)
   225                              <1> modeswitched	equ    8_0000h	; switched mode (now in the mode that we weren't entered in)
   226                              <1> promptwaiting	equ   10_0000h	; puts: any more output needs to display a prompt first
   227                              <1> switchbuffer	equ   20_0000h	; mode switch needs a buffer (auxbuff)
   228                              <1> tsrmode		equ   40_0000h	; in TSR mode; DPI and DPP not valid
   229                              <1> attachedterm	equ   80_0000h	; the attached process terminated
   230                              <1> runningdosemu	equ  100_0000h	; running in dosemu
   231                              <1> ; load_is_ldp	equ  200_0000h	; boot load: partition specified as "ldp"
   232                              <1> tt_while:	equ  400_0000h	; tt: while condition specified
   233                              <1> tt_p:		equ  800_0000h	; tt: proceed past repeated string instructions
   234                              <1> tt_silent_mode:	equ 1000_0000h	; tt: run should be silent (dump at end)
   235                              <1> tt_silence:	equ 2000_0000h	; tt: silent writing (write to auxbuff instead)
   236                              <1> tt_no_bb:	equ 4000_0000h	; tt: do not use bb breakpoints
   237                              <1> tt_no_bb_first:	equ 8000_0000h	; tt: do not use bb breakpoints at first
   238                              <1> 
   239                              <1> 
   240                              <1> dif2_gg_is_first:	equ   1
   241                              <1> dif2_gg_skip_non_cseip:	equ   2
   242                              <1> dif2_gg_skip_cseip:	equ   4
   243                              <1> dif2_gg_is_gg:		equ   8
   244                              <1> dif2_gg_first_detected:	equ  10h
   245                              <1> dif2_gg_again:		equ  20h
   246                              <1> dif2_tpg_proceed_bp_set:equ  40h
   247                              <1> dif2_tpg_keep_proceed_bp: equ 80h
   248                              <1> dif2_tpg_have_bp:	equ 100h
   249                              <1> dif2_tpg_adjusted_cseip:equ 200h
   250                              <1> dif2_tpg_do_not_adjust:	equ 400h
   251                              <1> dif2_bp_failure:	equ 800h
   252                              <1> dif2_is_pp:		equ 1000h
   253                              <1> %if _SYMBOLIC
   254                              <1> dif2_createdprocess:	equ 800_0000h	; created empty debuggee process
   255                              <1> dif2_sym_req_xms:	equ 2000h
   256                              <1> dif2_sym_req_86mm:	equ 4000h
   257                              <1> dif2_sym_req_mask equ dif2_sym_req_86mm | dif2_sym_req_xms
   258                              <1> dif2_no_pm_xms:		equ 1_0000h
   259                              <1> dif2_xms_detection_done:equ 2_0000h
   260                              <1> %endif
   261                              <1> %if _INPUT_FILE_HANDLES
   262                              <1> dif2_input_file:	equ 10_0000h
   263                              <1> dif2_closed_input_file:	equ 20_0000h
   264                              <1> %endif
   265                              <1> dif2_did_getline_file:	equ 40_0000h
   266                              <1> %if _SYMBOLIC
   267                              <1> dif2_poison:		equ 80_0000h
   268                              <1> %endif
   269                              <1> dif2_boot_loaded_kernel:equ 100_0000h
   270                              <1> %if _INPUT_FILE_BOOT
   271                              <1> dif2_input_file_boot:	equ 200_0000h
   272                              <1> dif2_closed_input_file_boot:	equ 400_0000h
   273                              <1> %endif
   274                              <1> dif2_in_silence_dump:	equ 1000_0000h
   275                              <1> dif2_int31_segment:	equ 2000_0000h
   276                              <1> dif2_nn_compat:		equ 4000_0000h
   277                              <1> dif2_nn_capitalise:	equ 8000_0000h
   278                              <1> 
   279                              <1> 
   280                              <1> dif3_load_is_ldp:	equ 1	; boot load: partition specified as "ldp"
   281                              <1> dif3_load_is_sdp:	equ 2	; boot load: partition specified as "sdp"
   282                              <1> dif3_load_is_ydp:	equ 4	; boot load: partition specified as "ydp"
   283                              <1> dif3_load_is_dp:	equ dif3_load_is_ldp 				| dif3_load_is_sdp 				| dif3_load_is_ydp
   286                              <1> dif3_load_dir_dir:	equ 8
   287                              <1> dif3_input_terminal_override:	equ 10h
   288                              <1> dif3_input_serial_override:	equ 20h
   289                              <1> dif3_if_not:		equ 40h
   290                              <1> dif3_partition_changed:	equ 80h
   291                              <1> ;
   292                              <1> dif3_input_cmdline:	equ 100h; input reading from cmdline_buffer
   293                              <1> dif3_input_cmdline_closed: equ 200h
   294                              <1> dif3_at_line_end:	equ 400h
   295                              <1> dif3_quiet_input_single:equ 800h
   296                              <1> dif3_quiet_output:	equ 1000h
   297                              <1> dif3_unquiet_error:	equ 2000h
   298                              <1> dif3_unquiet_prompt:	equ 4000h
   299                              <1> dif3_unquiet:		equ dif3_unquiet_error | dif3_unquiet_prompt
   300                              <1> dif3_return_eof:	equ 8000h
   301                              <1> dif3_highlighting:	equ 1_0000h
   302                              <1> dif3_do_not_highlight:	equ 2_0000h
   303                              <1> dif3_int10_highlight:	equ 2_0000h
   304                              <1> dif3_nosymbols_1:	equ 4_0000h
   305                              <1> dif3_nosymbols_2:	equ 8_0000h
   306                              <1> %if _PM
   307                              <1> dif3_ss_b_bit_set:	equ  10_0000h
   308                              <1> %endif
   309                              <1> dif3_gotint19:		equ  20_0000h
   310                              <1> dif3_prior_pm:		equ  40_0000h
   311                              <1> %if _DELAY_BEFORE_BP
   312                              <1> dif3_delayed		equ  80_0000h
   313                              <1> %endif
   314                              <1> dif3_input_re:		equ 100_0000h	; input reading from re_buffer
   315                              <1> dif3_input_re_closed:	equ 200_0000h
   316                              <1> dif3_accept_getrange_0:	equ 400_0000h
   317                              <1> %if _INPUT_FILE_HANDLES || _INPUT_FILE_BOOT
   318                              <1> dif3_in_if:		equ 800_0000h
   319                              <1> %endif
   320                              <1> dif3_auxbuff_guarded_1:	equ 1000_0000h
   321                              <1> dif3_auxbuff_guarded_2:	equ 2000_0000h
   322                              <1> dif3_auxbuff_guarded_3:	equ 4000_0000h
   323                              <1> dif3_sss_is_reverse:	equ 8000_0000h
   324                              <1> 
   325                              <1> 
   326                              <1> dif4_int_serial_hooked:	equ 1
   327                              <1> dif4_int_2F_hooked:	equ 2
   328                              <1> dif4_int_08_hooked:	equ 4
   329                              <1> dif4_int_2D_hooked:	equ 8
   330                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0D
   331                              <1> dif4_int_0D_hooked:	equ 10h
   332                              <1> %endif
   333                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0C
   334                              <1> dif4_int_0C_hooked:	equ 20h
   335                              <1> %endif
   336                              <1> 
   337                              <1> 
   338                              <1> %if _VXCHG
   339                              <1> dif6_vv_mode:		equ 1
   340                              <1> %endif
   341                              <1> dif6_in_hook2F:		equ 2
   342                              <1> dif6_in_amis_hook2F:	equ 4
   343                              <1> dif6_debug_mode:	equ 100h
   344                              <1> dif6_locked:		equ 200h
   345                              <1> %if _RH
   346                              <1> dif6_rh_mode_was:	equ  8_0000h
   347                              <1> dif6_rh_mode:		equ 10_0000h
   348                              <1> dif6_rh_mode_2:		equ 20_0000h
   349                              <1> %endif
   350                              <1> dif6_device_mode:	equ 40_0000h
   351                              <1> dif6_cpdepchars:	equ 80_0000h
   352                              <1> %if _IMMASM
   353                              <1> dif6_immasm_no_output:	equ 100_0000h
   354                              <1> dif6_immasm:		equ 200_0000h
   355                              <1> dif6_immasm_rel8:	equ 400_0000h
   356                              <1> %endif
   357                              <1> 
   358                              <1> 
   359                              <1> disasm_lowercase	equ 1
   360                              <1> disasm_commablank	equ 2
   361                              <1> disasm_nasm		equ 4
   362                              <1> disasm_lowercase_refmem:equ 8
   363                              <1> disasm_show_short:	equ 10h
   364                              <1> disasm_show_near:	equ 20h
   365                              <1> disasm_show_far:	equ 40h
   366                              <1> disasm_nec:		equ 80h
   367                              <1> disasm_40_columns:	equ 100h
   368                              <1> disasm_no_indent:	equ 200h
   369                              <1> disasm_msdebug_mnemonofs: equ 400h
   370                              <1> disasm_a16_memref:	equ 1000h
   371                              <1> disasm_a32_memref:	equ 2000h
   372                              <1> disasm_a16_string:	equ 4000h
   373                              <1> disasm_a32_string:	equ 8000h
   374                              <1> disasm_hide_modrm:	equ 10000h
   375                              <1> disasm_asize_loop_nasm:	equ 20000h
   376                              <1> disasm_modrm_always:	equ 40000h
   377                              <1> DEFAULTASMOPTIONS equ disasm_lowercase|disasm_commablank|disasm_nasm 	| disasm_a16_memref | disasm_a32_memref 	| disasm_a16_string | disasm_a32_string
    30                                  
    31                                  %include "iniload.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> lDebug iniload/boot interfacing structs and macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2023 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> 
    16                              <1> 	struc BS
    17 00000000 ??????              <1> bsJump:	resb 3
    18 00000003 ????????????????    <1> bsOEM:	resb 8
    19                              <1> bsBPB:
    20                              <1> 	endstruc
    21                              <1> 
    22                              <1> 	struc EBPB		;        BPB sec
    23 00000000 ????                <1> bpbBytesPerSector:	resw 1	; offset 00h 0Bh
    24 00000002 ??                  <1> bpbSectorsPerCluster:	resb 1	; offset 02h 0Dh
    25 00000003 ????                <1> bpbReservedSectors:	resw 1	; offset 03h 0Eh
    26 00000005 ??                  <1> bpbNumFATs:		resb 1	; offset 05h 10h
    27 00000006 ????                <1> bpbNumRootDirEnts:	resw 1	; offset 06h 11h -- 0 for FAT32
    28 00000008 ????                <1> bpbTotalSectors:	resw 1	; offset 08h 13h
    29 0000000A ??                  <1> bpbMediaID:		resb 1	; offset 0Ah 15h
    30 0000000B ????                <1> bpbSectorsPerFAT:	resw 1	; offset 0Bh 16h -- 0 for FAT32
    31 0000000D ????                <1> bpbCHSSectors:		resw 1	; offset 0Dh 18h
    32 0000000F ????                <1> bpbCHSHeads:		resw 1	; offset 0Fh 1Ah
    33 00000011 ????????            <1> bpbHiddenSectors:	resd 1	; offset 11h 1Ch
    34 00000015 ????????            <1> bpbTotalSectorsLarge:	resd 1	; offset 15h 20h
    35                              <1> bpbNew:				; offset 19h 24h
    36                              <1> 
    37 00000019 ????????            <1> ebpbSectorsPerFATLarge:	resd 1	; offset 19h 24h
    38 0000001D ????                <1> ebpbFSFlags:		resw 1	; offset 1Dh 28h
    39 0000001F ????                <1> ebpbFSVersion:		resw 1	; offset 1Fh 2Ah
    40 00000021 ????????            <1> ebpbRootCluster:	resd 1	; offset 21h 2Ch
    41 00000025 ????                <1> ebpbFSINFOSector:	resw 1	; offset 25h 30h
    42 00000027 ????                <1> ebpbBackupSector:	resw 1	; offset 27h 32h
    43 00000029 <res Ch>            <1> ebpbReserved:		resb 12	; offset 29h 34h
    44                              <1> ebpbNew:			; offset 35h 40h
    45                              <1> 	endstruc
    46                              <1> 
    47                              <1> 	struc BPBN		; ofs B16 S16 B32 S32
    48 00000000 ??                  <1> bpbnBootUnit:		resb 1	; 00h 19h 24h 35h 40h
    49 00000001 ??                  <1> 			resb 1	; 01h 1Ah 25h 36h 41h
    50 00000002 ??                  <1> bpbnExtBPBSignature:	resb 1	; 02h 1Bh 26h 37h 42h -- 29h for valid BPBN
    51 00000003 ????????            <1> bpbnSerialNumber:	resd 1	; 03h 1Ch 27h 38h 43h
    52 00000007 <res Bh>            <1> bpbnVolumeLabel:	resb 11	; 07h 20h 2Bh 3Ch 47h
    53 00000012 ????????????????    <1> bpbnFilesystemID:	resb 8	; 12h 2Bh 36h 47h 52h
    54                              <1> 	endstruc		; 1Ah 33h 3Eh 4Fh 5Ah
    55                              <1> 
    56                              <1> 	struc DIRENTRY
    57 00000000 ????????????????    <1> deName:		resb 8
    58 00000008 ??????              <1> deExt:		resb 3
    59 0000000B ??                  <1> deAttrib:	resb 1
    60 0000000C ??                  <1> dePlusSize:	resb 1
    61 0000000D ??????????????      <1> 		resb 7
    62 00000014 ????                <1> deClusterHigh:	resw 1
    63 00000016 ????                <1> deTime:		resw 1
    64 00000018 ????                <1> deDate:		resw 1
    65 0000001A ????                <1> deClusterLow:	resw 1
    66 0000001C ????????            <1> deSize:		resd 1
    67                              <1> 	endstruc
    68                              <1> 
    69                              <1> ATTR_READONLY	equ 1
    70                              <1> ATTR_HIDDEN	equ 2
    71                              <1> ATTR_SYSTEM	equ 4
    72                              <1> ATTR_VOLLABEL	equ 8
    73                              <1> ATTR_DIRECTORY	equ 10h
    74                              <1> ATTR_ARCHIVE	equ 20h
    75                              <1> 
    76                              <1> lsvclSignature		equ "CL"
    77                              <1> lsvclBufferLength	equ 256
    78                              <1> 
    79                              <1> 	struc LOADSTACKVARS, -10h
    80 FFFFFFF0 ????????            <1> lsvFirstCluster:	resd 1
    81 FFFFFFF4 ????????            <1> lsvFATSector:		resd 1
    82 FFFFFFF8 ????                <1> lsvFATSeg:		resw 1
    83 FFFFFFFA ????                <1> lsvLoadSeg:		resw 1
    84 FFFFFFFC ????????            <1> lsvDataStart:		resd 1
    85                              <1> 	endstruc
    86                              <1> 
    87                              <1> 	struc LOADDATA, LOADSTACKVARS - 10h
    88 FFFFFFE0 ????                <1> ldMemoryTop:	resw 1
    89 FFFFFFE2 ????                <1> ldLoadTop:	resw 1
    90 FFFFFFE4 ????                <1> ldSectorSeg:	resw 1
    91 FFFFFFE6 ??                  <1> ldFATType:	resb 1
    92                              <1> ldFlags:
    93 FFFFFFE7 ??                  <1> ldHasLBA:	resb 1
    94 FFFFFFE8 ????                <1> ldClusterSize:	resw 1
    95 FFFFFFEA ????                <1> ldParaPerSector:resw 1
    96                              <1> ldDirCluster:			; dword
    97                              <1> ldLoadingSeg:		; word
    98                              <1> ldQueryPatchValue:	; word
    99                              <1> lsvCommandLine:		; word
   100                              <1> .start:		equ $ - lsvclBufferLength
   101 FFFFFFEC ????                <1> .signature:	resw 1
   102                              <1> ldLoadUntilSeg:		; word
   103                              <1> lsvExtra:		; word
   104 FFFFFFEE ??                  <1> .partition:	resb 1	; byte
   105 FFFFFFEF ??                  <1> .flags:		resb 1	; byte
   106                              <1> 	endstruc
   107                              <1> 
   108                              <1> lsvefNoDataStart	equ 1
   109                              <1> lsvefPartitionNumber	equ 2
   110                              <1> 
   111                              <1> 	struc LOADCMDLINE, LOADDATA - lsvclBufferLength
   112                              <1> ldCommandLine:
   113 FFFFFEE0 <res 100h>          <1> .start:		resb lsvclBufferLength
   114                              <1> 	endstruc
   115                              <1> 
   116                              <1> ldfHasLBA:	equ 1
   117                              <1> ldfFATInvalid:	equ 2
   118                              <1> ldfFATBuffered:	equ 4
   119                              <1> ldfDataBuffered: equ 8
   120                              <1> 
   121                              <1> 	struc LOADDATA2, LOADDATA - 10h
   122 FFFFFFD0 ????????            <1> ldRootSector:		resd 1
   123 FFFFFFD4 ????                <1> ldEntriesPerSector:	resw 1
   124                              <1> ldDataSegment:		; word
   125 FFFFFFD6 ????                <1> ldLastAvailableSector:	resw 1
   126                              <1> ldDataSector:		; dword
   127 FFFFFFD8 ????                <1> ldParasLeft:		resw 1
   128 FFFFFFDA ????                <1> ldParasDone:		resw 1
   129                              <1> 	endstruc
   130                              <1> 
   131                              <1> 	struc LOADDATA3, LOADDATA2 - 10h
   132 FFFFFFC0 ????????            <1> ldMaxCluster:		resd 1
   133 FFFFFFC4 ????????            <1> ldFileSize:		resd 1
   134 FFFFFFC8 ????????            <1> ldCurrentCluster:	resd 1
   135 FFFFFFCC ????????            <1> ldCurrentSeek:		resd 1
   136                              <1> 	endstruc
   137                              <1> 
   138                              <1> 	struc LBAPACKET
   139 00000000 ????                <1> lpSize:		resw 1
   140 00000002 ????                <1> lpCount:	resw 1
   141 00000004 ????????            <1> lpBuffer:	resd 1
   142 00000008 ????????????????    <1> lpSector:	resq 1
   143                              <1> 	endstruc
   144                              <1> 
   145                              <1> 	struc PARTINFO
   146 00000000 ??                  <1> piBoot:		resb 1
   147 00000001 ??????              <1> piStartCHS:	resb 3
   148 00000004 ??                  <1> piType:		resb 1
   149 00000005 ??????              <1> piEndCHS:	resb 3
   150 00000008 ????????            <1> piStart:	resd 1
   151 0000000C ????????            <1> piLength:	resd 1
   152                              <1> 	endstruc
   153                              <1> 
   154                              <1> ptEmpty:		equ 0
   155                              <1> ptFAT12:		equ 1
   156                              <1> ptFAT16_16BIT_CHS:	equ 4
   157                              <1> ptExtendedCHS:		equ 5
   158                              <1> ptFAT16_CHS:		equ 6
   159                              <1> ptFAT32_CHS:		equ 0Bh
   160                              <1> ptFAT32:		equ 0Ch
   161                              <1> ptFAT16:		equ 0Eh
   162                              <1> ptExtended:		equ 0Fh
   163                              <1> ptLinux:		equ 83h
   164                              <1> ptExtendedLinux:	equ 85h
   165                              <1> 
   166                              <1> 
   167                              <1> 		; Flags of load_unit_flags
   168                              <1> lufForceCHS:		equ 1
   169                              <1> lufForceLBA:		equ 2
   170                              <1> lufForceGeometry:	equ 4
   171                              <1> luf_mask_writable equ lufForceCHS | lufForceLBA | lufForceGeometry
    32                                  
    33                                  	cpu 8086
    34                                  
    35                                  	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
    36                                  relocateddata:
    37                                  
    38                                  	addsection HEADER, start=0
    39                                  
    40                                  	istruc ELD_HEADERX
    41                                  at eldhxHeader
    42                                  		; ELD executable header
    43                                  	istruc ELD_HEADER
    44 00000000 454C4431                at eldhSignature,	db "ELD1"
    45 00000004 000000                  			db 0,0,0
    46 00000007 1A                      			db 26
    47 00000008 60000000                at eldhCodeOffset,	dd CODEOFFSET
    48 0000000C 3012                    at eldhCodeImageLength,	dw code_size
    49 0000000E 0000                    at eldhCodeAllocLength,	dw 0
    50 00000010 90120000                at eldhDataOffset,	dd DATAOFFSET
    51 00000014 6004                    at eldhDataImageLength,	dw data_size
    52 00000016 2002                    at eldhDataAllocLength,	dw total_data_size - data_size
    53 00000018 2008                    at eldhCodeEntrypoint,	dw linker - code
    54                                  at eldhReserved
    55 0000001A 00<rep 4h>2800          at eldhExtensionSize,	dw header_extension_end - $$
    56                                  	iend
    57 00000020 [30000000]              at eldhxDescriptionOffset,	dd description
    58 00000024 C5140000                at eldhxHelpOffset,		dd DATAOFFSET + msg.help - datastart
    59                                  PUT_ELDHX_DATETIME_OFFSET
    60                                  header_extension_end:
    61 00000028 00<rep 8h>              	iend
    62                                  
    63                                  %if _BOOT
    64                                  description:		asciz "List files from directories, boot loaded."
    65                                  %else
    66 00000030 4C69737420444F5320-     description:		asciz "List DOS files from directories."
    66 00000039 66696C65732066726F-
    66 00000042 6D206469726563746F-
    66 0000004B 726965732E00       
    67                                  %endif
    68                                  
    69 00000051 00<rep Fh>              	align 16, db 0
    70                                  
    71                                  	eldstrict on
    72                                  
    73                                  CODEOFFSET equ $ - $$
    74                                  	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
    75                                  %define CODEFIXUP - code + 0
    76                                  code:
    77                                  		; ELD instance header
    78                                  	istruc ELD_INSTANCE
    79                                  at eldiStartCode
    80 00000000 00<rep 2h>              at eldiEndCode
    81 00000002 00<rep 2h>              at eldiStartData
    82 00000004 00<rep 2h>              at eldiEndData
    83                                  %if _BOOT
    84                                  at eldiIdentifier,	fill 8, 32, db "BOOT DIR"
    85                                  at eldiListing,		asciz _ELD_LISTING
    86                                  %else
    87 00000006 00<rep 2h>444F5320-     at eldiIdentifier,	fill 8, 32, db "DOS DIR"
    87 0000000C 44495220           
    88 00000010 00<rep 2h>646F7364-     at eldiListing,		asciz _ELD_LISTING
    88 00000016 69722E6C737400     
    89                                  %endif
    90 0000001D 00<rep 3h>              	iend
    91                                  
    92                                  
    93                                  run:
    94 00000020 16                      	push ss
    95 00000021 07                      	pop es
    96                                  
    97                                  %if _BOOT
    98                                  run_boot:
    99                                  reloc	testopt [relocateddata], nodosloaded
   100                                  linkdatarelocation internalflags, -3
   101                                  	jz error
   102                                  	extcallcall yy_boot_parse_name2
   103                                  	call parse_verbose
   104                                  reloc	mov word [pathname_start], bx
   105                                  internaldatarelocation
   106                                  
   107                                  	push bx
   108                                  	mov di, bx
   109                                  	call find_dir
   110                                  	pop bx
   111                                  	mov dx, di
   112                                   %if 0
   113                                  	db __TEST_IMM8			; (skip inc)
   114                                  @@:
   115                                  	inc di
   116                                  	cmp byte [di], 0
   117                                  	je boot_no_wild
   118                                  	cmp byte [di], '?'
   119                                  	je boot_wild
   120                                  	cmp byte [di], '*'
   121                                  	jne @B
   122                                  
   123                                  boot_no_wild:
   124                                  boot_wild:
   125                                   %endif
   126                                  reloc	mov word [wild_pattern], dx
   127                                  internaldatarelocation
   128                                  
   129                                  	extcallcall yy_boot_init_dir2
   130                                  
   131                                  	mov di, word [bp + bsBPB + bpbBytesPerSector]
   132                                  					; di = sector size
   133                                  					; = start of available auxbuff
   134                                  	cmp byte [bp + ldFATType], 12	; FAT12 ?
   135                                  	jne @F				; no -->
   136                                  	cmp di, 8192			; already enough for a full FAT ?
   137                                  	jae @F				; yes -->
   138                                  	add di, di			; reserve straddling sector
   139                                  @@:
   140                                  %else
   141                                  run_dos:
   142 00000022 E84307                  	extcallcall InDOS
   143 00000025 E84807                  	extcallcall yy_dos_parse_name
   144 00000028 E83905                  	call parse_verbose
   145                                  
   146                                  	houdini
   147 0000002B 891E[7004]              reloc	mov word [pathname_start], bx
   148                                  internaldatarelocation
   149 0000002F 53                      	push bx
   150                                  
   151 00000030 B42F                    	mov ah, 2Fh			; get DTA
   152 00000032 E84307                  	extcallcall ispm
   153 00000035 750F                    	jnz .rm
   154                                  
   155                                  subcpu 286
   156 00000037 6A00                    	push word 0
   157 00000039 6A21                    	push word 21h
   158 0000003B E8[0000]EB020000        	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
   159 00000042 5A                      	pop dx				; discard interrupt number
   160 00000043 5A                      	pop dx				; get es
   161                                  subcpureset
   162 00000044 EB04                    	jmp @F
   163                                  .rm:
   164 00000046 CD21                    	int 21h
   165 00000048 8CC2                    	mov dx, es
   166                                  @@:
   167                                  
   168 0000004A 891E[6004]              reloc	mov word [originaldta], bx
   169                                  internaldatarelocation
   170 0000004E 8916[6204]              reloc	mov word [originaldta + 2], dx
   171                                  internaldatarelocation
   172                                  
   173 00000052 A1[0000]                reloc	mov ax, word [relocateddata]
   174                                  linkdatarelocation ext_inject_handler
   175 00000055 A3[6404]                reloc	mov word [originalinject], ax
   176                                  internaldatarelocation
   177 00000058 C706[0000][BE06]        reloc2	mov word [relocateddata], inject
   178                                  linkdatarelocation ext_inject_handler, -4
   179                                  internalcoderelocation
   180 0000005E E8B306                  	call get_es_ext
   181 00000061 26800E[1000]01          reloc	setopt [es:code + eldiFlags], eldifResident
   182                                  internalcoderelocation -3	; mark block as resident
   183 00000067 16                      	 push ss
   184 00000068 07                      	 pop es
   185                                  
   186                                  	houdini
   187 00000069 BA[7804]                reloc	mov dx, dta
   188                                  internaldatarelocation
   189 0000006C B41A                    	mov ah, 1Ah		; set DTA
   190 0000006E E80F07                  	extcallcall _doscall
   191                                  
   192 00000071 5A                      	pop dx
   193                                  %endif
   194                                  
   195 00000072 D006[0900]              reloc	rol byte [sort], 1
   196                                  internaldatarelocation
   197 00000076 7352                    	jnc .no_sort_buffer
   198                                  
   199 00000078 A1[0000]                reloc	mov ax, word [relocateddata]
   200                                  linkdatarelocation extdata_size
   201 0000007B 2B06[0000]              reloc	sub ax, word [relocateddata]
   202                                  linkdatarelocation extdata_used
   203 0000007F 8B1E[0000]              reloc	mov bx, word [relocateddata]
   204                                  linkdatarelocation auxbuff_current_size
   205 00000083 83C008                  	add ax, (uinit_data_end_2 - buffer_end)
   206                                  %if _BOOT
   207                                  	sub bx, di
   208                                  	jbe .use_sort_buffer_eld_data_block
   209                                  %endif
   210 00000086 39D8                    	cmp ax, bx
   211 00000088 7307                    	jae .use_sort_buffer_eld_data_block
   212                                  
   213                                  %ifn _BOOT
   214 0000008A F606[0300]70            reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
   217                                  linkdatarelocation internalflags3, -3
   218 0000008F 741C                    	jz .use_sort_buffer_auxbuff
   219                                  %else
   220                                  	jmp .use_sort_buffer_auxbuff
   221                                  %endif
   222                                  
   223                                  .use_sort_buffer_eld_data_block:
   224 00000091 83E808                  	sub ax, (uinit_data_end_2 - buffer_end)
   225 00000094 E87D06                  	call get_es_ext
   226 00000097 260106[0600]            reloc	add word [es:code + eldiEndData], ax
   227                                  internalcoderelocation		; adjust size
   228 0000009C 0106[0000]              reloc	add word [relocateddata], ax
   229                                  linkdatarelocation extdata_used	; adjust size
   230 000000A0 26A1[0600]              reloc	mov ax, word [es:code + eldiEndData]
   231                                  internalcoderelocation		; -> end of sort buffer
   232 000000A4 16                      	push ss
   233 000000A5 07                      	pop es
   234                                  
   235 000000A6 BF[7806]                reloc	mov di, buffer_end	; -> start of sort buffer
   236                                  internaldatarelocation
   237 000000A9 8CD6                    	mov si, ss		; => sort buffer
   238 000000AB EB0A                    	jmp .sort_buffer_common
   239                                  
   240                                  .use_sort_buffer_auxbuff:
   241 000000AD 93                      	xchg ax, bx		; ax -> end of sort buffer
   242                                  %ifn _BOOT
   243 000000AE 31FF                    	xor di, di		; di -> start of sort buffer
   244                                  %endif
   245 000000B0 8B36[0000]              reloc	mov si, word [relocateddata]
   246                                  linkdatarelocation auxbuff_segorsel	; => sort buffer
   247                                  %ifn _BOOT
   248 000000B4 E8D106                  	extcallcall guard_auxbuff
   249                                  %endif
   250                                  
   251                                  		; INP:	si:di -> buffer
   252                                  		;	si:ax -> behind buffer
   253                                  .sort_buffer_common:
   254 000000B7 8936[6604]              reloc	mov word [sortsegsel], si
   255                                  internaldatarelocation
   256 000000BB 893E[6804]              reloc	mov word [sortstartoffset], di
   257                                  internaldatarelocation
   258 000000BF 893E[6C04]              reloc	mov word [sort_last], di
   259                                  internaldatarelocation
   260 000000C3 893E[6E04]              reloc	mov word [sort_next], di
   261                                  internaldatarelocation
   262 000000C7 A3[6A04]                reloc	mov word [sortendoffset], ax
   263                                  internaldatarelocation
   264                                  
   265                                  .no_sort_buffer:
   266                                  
   267                                  %ifn _BOOT
   268 000000CA E85304                  	call findfirst
   269 000000CD 7303E98001              	jc .notfound
   270 000000D2 BF[0000]                reloc	mov di, relocateddata
   271                                  linkdatarelocation line_out
   272                                  
   273                                  .loop:
   274                                  %else
   275                                  boot_scan:
   276                                  reloc	mov byte [relocateddata], 0
   277                                  linkdatarelocation load_check_dir_attr, -3
   278                                  reloc	mov si, word [relocateddata]
   279                                  linkdatarelocation load_yyname_input
   280                                  	cmp byte [si], '/'
   281                                  	jne @F
   282                                  	inc si
   283                                  @@:
   284                                  	cmp byte [si], 0
   285                                  	jne @F
   286                                  	extcall ..@yy_filename_empty
   287                                  @@:
   288                                  	 push ss
   289                                  	 pop es
   290                                  	call boot_parse_name
   291                                  	cmp al, '/'
   292                                  	jne @F
   293                                  reloc	mov byte [relocateddata], ATTR_DIRECTORY
   294                                  linkdatarelocation load_check_dir_attr, -3
   295                                  reloc	mov word [relocateddata], si
   296                                  linkdatarelocation load_yyname_next
   297                                  @@:
   298                                  
   299                                  	mov di, -1
   300                                  	mov si, di
   301                                  	mov [bp + lsvFATSector], di
   302                                  	mov [bp + lsvFATSector + 2], si
   303                                  
   304                                  	xor ax, ax
   305                                  	xor dx, dx
   306                                  
   307                                  scan_dir_yyname_loop:
   308                                  	mov word [bp + ldDirCluster], ax
   309                                  	mov word [bp + ldDirCluster + 2], dx
   310                                  
   311                                  	push ss
   312                                  	pop es
   313                                  reloc	mov bx, relocateddata
   314                                  linkdatarelocation load_yy_direntry
   315                                  
   316                                  reloc2	mov word [relocateddata], relocateddata
   317                                  linkdatarelocation handle_scan_dir_not_found, -4
   318                                  ;linkdatarelocation near_transfer_ext_entry
   319                                  linkdatarelocation dmycmd
   320                                  	extcall scan_dir_aux
   321                                  	jc end_of_directory
   322                                  
   323                                  reloc	cmp byte [relocateddata], ATTR_DIRECTORY
   324                                  linkdatarelocation load_check_dir_attr, -3
   325                                  	jne got_single_yyentry
   326                                  
   327                                  	push si
   328                                  	push di
   329                                  reloc	mov byte [relocateddata], 0
   330                                  linkdatarelocation load_check_dir_attr, -3
   331                                  reloc	mov si, word [relocateddata]
   332                                  linkdatarelocation load_yyname_next
   333                                  	cmp byte [si], 0
   334                                  	jne @F
   335                                  	extcall ..@yy_filename_empty
   336                                  @@:
   337                                  	push es
   338                                  	 push ss
   339                                  	 pop es
   340                                  	call boot_parse_name
   341                                  	pop es
   342                                  	cmp al, '/'
   343                                  	jne @F
   344                                  reloc	mov byte [relocateddata], ATTR_DIRECTORY
   345                                  linkdatarelocation load_check_dir_attr, -3
   346                                  reloc	mov word [relocateddata], si
   347                                  linkdatarelocation load_yyname_next
   348                                  @@:
   349                                  	pop di
   350                                  	pop si
   351                                  
   352                                  	xor dx, dx
   353                                  	mov ax, [es:bx + deClusterLow]
   354                                  				; = first cluster (not FAT32)
   355                                  	cmp byte [bp + ldFATType], 32
   356                                  	jne @F
   357                                  	mov dx, [es:bx + deClusterHigh]
   358                                  				; dx:ax = first cluster (FAT32)
   359                                  @@:
   360                                  
   361                                  	jmp scan_dir_yyname_loop
   362                                  
   363                                  boot_parse_name:
   364                                  reloc	cmp word [wild_pattern], si
   365                                  internaldatarelocation
   366                                  	je @F
   367                                  	extcallcall boot_parse_fn	; get next pathname
   368                                  
   369                                  reloc2	mov word [relocateddata], relocateddata
   370                                  linkdatarelocation handle_scan_dir_entry, -4
   371                                  linkdatarelocation scan_dir_entry
   372                                  
   373                                  	retn
   374                                  
   375                                  @@:
   376                                  	extcallcall boot_parse_fn	; get next pathname
   377                                  
   378                                  reloc2	mov word [relocateddata], match_wildcard
   379                                  linkdatarelocation near_transfer_ext_address, -4
   380                                  internalcoderelocation
   381                                  reloc2	mov word [relocateddata], relocateddata
   382                                  linkdatarelocation handle_scan_dir_entry, -4
   383                                  linkdatarelocation near_transfer_ext_entry
   384                                  
   385                                  	push ax
   386                                  reloc	mov di, relocateddata
   387                                  linkdatarelocation load_kernel_name
   388                                  	mov cx, 8
   389                                  	call .handle_asterisk		; handle in basename
   390                                  	mov cl, 3
   391                                  	call .handle_asterisk		; handle in extension
   392                                  	pop ax
   393                                  	retn
   394                                  
   395                                  .handle_asterisk:
   396                                  	mov al, '*'
   397                                  	repne scasb			; scan for asterisk
   398                                  	jne @F				; not found -->
   399                                  	mov al, '?'			; fill with question marks
   400                                  	dec di				; -> at the asterisk
   401                                  	inc cx				; = how many bytes remain
   402                                  	rep stosb			; fill this field
   403                                  @@:
   404                                  	retn
   405                                  
   406                                  
   407                                  		; INP:	es:di -> DIRENTRY
   408                                  		;	dx:ax - 1 = sector
   409                                  		;	cx, si in use
   410                                  		; OUT:	CY if end of directory
   411                                  		;	NC if to continue,
   412                                  		;	 ZR if match
   413                                  		;	 NZ if mismatch
   414                                  		; CHG:	bx
   415                                  match_wildcard:
   416                                  	cmp byte [es:di], 0
   417                                  	stc
   418                                  	je .ret
   419                                  	mov bl, byte [es:di + deAttrib]
   420                                  	test bl, ATTR_VOLLABEL
   421                                  	jnz .ret_NC		; skip volume labels (and LFNs) --> (NZ)
   422                                  	push si
   423                                  	push di
   424                                  	push cx
   425                                  reloc	mov si, relocateddata	; ds:si-> name to match
   426                                  linkdatarelocation load_kernel_name
   427                                  	mov cx, 11		; length of padded 8.3 FAT filename
   428                                  @@:
   429                                  	repe cmpsb		; check entry
   430                                  	je @F			; match -->
   431                                  	cmp byte [si - 1], '?'	; wildcard ?
   432                                  	je @B			; yes --> (ZR)
   433                                  				; no (NZ)
   434                                  @@:
   435                                  	pop cx
   436                                  	pop di
   437                                  	pop si
   438                                  	jne .ret_NC
   439                                  
   440                                  	push si
   441                                  	push es
   442                                  	push di
   443                                  	push dx
   444                                  	push ax
   445                                  	push cx
   446                                  
   447                                  	mov cx, DIRENTRY_size
   448                                  	push ds
   449                                  	 push es
   450                                  	 pop ds
   451                                  	mov si, di		; ds:si -> entry in directory buffer
   452                                  	push ss
   453                                  	pop es
   454                                  reloc	mov di, relocateddata	; es:di -> destination for entry
   455                                  linkdatarelocation load_yy_direntry
   456                                  	push di
   457                                  	rep movsb
   458                                  	pop si
   459                                  	pop ds
   460                                  
   461                                  reloc	mov di, pathnamebuffer - 1
   462                                  internaldatarelocation		; di -> buffer
   463                                  	mov al, 0
   464                                  	stosb
   465                                  	push di
   466                                  	mov cl, 8
   467                                  	cmp byte [si], 05h
   468                                  	jne @F
   469                                  	mov al, 0E5h
   470                                  	stosb
   471                                  	dec cx
   472                                  	inc si
   473                                  @@:
   474                                  	rep movsb
   475                                  	mov cl, 9
   476                                  	db __TEST_IMM8
   477                                  @@:
   478                                  	dec di
   479                                  	cmp byte [di - 1], 32
   480                                  	loope @B
   481                                  
   482                                  	cmp byte [di - 1], '.'
   483                                  	jne @F
   484                                  	cmp word [si], 2020h
   485                                  	jne @F
   486                                  	cmp byte [si + 2], 32
   487                                  	je .dotname
   488                                  @@:
   489                                  
   490                                  	mov al, '.'
   491                                  	stosb
   492                                  	mov cl, 3
   493                                  	rep movsb
   494                                  	mov cl, 4
   495                                  	db __TEST_IMM8
   496                                  @@:
   497                                  	dec di
   498                                  	cmp byte [di - 1], 32
   499                                  	loope @B
   500                                  	cmp byte [di - 1], '.'
   501                                  	jne @F
   502                                  	dec di
   503                                  @@:
   504                                  .dotname:
   505                                  	mov al, 0
   506                                  	stosb
   507                                  
   508                                  	 push ss
   509                                  	 pop es
   510                                  	pop dx
   511                                  
   512                                  		; get attrib byte
   513                                  reloc	mov al, byte [relocateddata + deAttrib]
   514                                  linkdatarelocation load_yy_direntry
   515                                  reloc	mov byte [finddata.attrib], al
   516                                  internaldatarelocation
   517                                  
   518                                  		; get time and date
   519                                  reloc	mov ax, word [relocateddata + deTime]
   520                                  linkdatarelocation load_yy_direntry
   521                                  reloc	mov word [finddata.time], ax
   522                                  internaldatarelocation
   523                                  reloc	mov ax, word [relocateddata + deDate]
   524                                  linkdatarelocation load_yy_direntry
   525                                  reloc	mov word [finddata.date], ax
   526                                  internaldatarelocation
   527                                  
   528                                  		; get size low
   529                                  reloc	mov ax, word [relocateddata + deSize]
   530                                  linkdatarelocation load_yy_direntry
   531                                  reloc	mov word [finddata.sizelow], ax
   532                                  internaldatarelocation
   533                                  reloc	mov ax, word [relocateddata + deSize + 2]
   534                                  linkdatarelocation load_yy_direntry
   535                                  reloc	mov word [finddata.sizelow + 2], ax
   536                                  internaldatarelocation
   537                                  
   538                                  		; zero unused fields
   539                                  	xor ax, ax
   540                                  reloc	mov word [finddata.sizehigh + 2], ax
   541                                  internaldatarelocation
   542                                  reloc	mov byte [finddata.shortname], al
   543                                  internaldatarelocation
   544                                  
   545                                  		; get FAT+ high 6 size bits
   546                                  reloc	mov al, byte [relocateddata + dePlusSize]
   547                                  linkdatarelocation load_yy_direntry
   548                                  	mov ah, al
   549                                  	and ax, 0E007h
   550                                  	shr ah, 1
   551                                  	shr ah, 1
   552                                  	or al, ah
   553                                  	mov ah, 0
   554                                  reloc	mov word [finddata.sizehigh], ax
   555                                  internaldatarelocation
   556                                  
   557                                  reloc	call near [matchfunction]
   558                                  internaldatarelocation		; NZ to continue search, ZR to end
   559                                  
   560                                  	pop cx
   561                                  	pop ax
   562                                  	pop dx
   563                                  	pop di
   564                                  	pop es
   565                                  	pop si			; restore registers
   566                                  
   567                                  %if 0
   568                                  	pushf
   569                                  	sub ax, 1
   570                                  	sbb dx, 0
   571                                  reloc	mov bx, [relocateddata]
   572                                  linkdatarelocation load_adr_dirbuf_segment
   573                                  	extcall read_sector	; restore sector
   574                                  	popf
   575                                  %endif
   576                                  
   577                                  .ret_NC:
   578                                  	clc
   579                                  .ret:
   580                                  	extcall near_transfer_ext_return, required ; must NOT be extcallcall
   581                                  
   582                                  
   583                                  got_single_yyentry:
   584                                  end_of_directory:
   585                                  reloc2	cmp word [matchfunction], display_ZR
   586                                  internaldatarelocation -4
   587                                  internalcoderelocation
   588                                  	jne ..@boot_scan_end
   589                                  	retn
   590                                  
   591                                  sort_or_display:
   592                                  %endif
   593 000000D5 D006[0900]              reloc	rol byte [sort], 1
   594                                  internaldatarelocation
   595 000000D9 7203E94101              	jnc .display
   596                                  
   597 000000DE E83C02                  	call populate_finddata
   598 000000E1 7503E93C01              	je .next
   599                                  
   600                                  %ifn _BOOT
   601 000000E6 D006[0A00]              reloc	rol byte [sortlfn], 1
   602                                  internaldatarelocation
   603 000000EA 7303                    	jnc @F
   604                                  
   605 000000EC BE[D004]                reloc	mov si, finddata.fullname
   606                                  internaldatarelocation
   607                                  @@:
   608                                  %endif
   609                                  
   610 000000EF 89F7                    	mov di, si
   611 000000F1 B000                    	mov al, 0
   612 000000F3 B90002                  	mov cx, 512
   613 000000F6 F2AE                    	repne scasb
   614 000000F8 7403E96401              	jne .error
   615                                  
   616 000000FD 89F9                    	mov cx, di
   617 000000FF 29F1                    	sub cx, si		; = length including NUL
   618                                  
   619 00000101 8B3E[6C04]              reloc	mov di, word [sort_last]
   620                                  internaldatarelocation
   621 00000105 89F8                    	mov ax, di
   622 00000107 01C8                    	add ax, cx
   623 00000109 7303E96301              	jc .toofull
   624 0000010E 0306[0000]              reloc	add ax, word [meta]
   625                                  internaldatarelocation
   626 00000112 7303E95A01              	jc .toofull
   627 00000117 3B06[6A04]              reloc	cmp ax, word [sortendoffset]
   628                                  internaldatarelocation
   629 0000011B 7603E95101              	ja .toofull
   630                                  
   631 00000120 8E06[6604]              reloc	mov es, word [sortsegsel]
   632                                  internaldatarelocation
   633 00000124 8B3E[6804]              reloc	mov di, word [sortstartoffset]
   634                                  internaldatarelocation
   635 00000128 89F2                    	mov dx, si
   636                                  
   637                                  .sort:
   638 0000012A 3B3E[6C04]              reloc	cmp di, word [sort_last]
   639                                  internaldatarelocation
   640 0000012E 7203E9DD00              	jae .sort_insert_last
   641                                  
   642 00000133 89FB                    	mov bx, di
   643                                  
   644 00000135 D006[0B00]              reloc	rol byte [dirfirst], 1
   645                                  internaldatarelocation
   646 00000139 730E                    	jnc .notdirfirst
   647 0000013B A0[A404]                reloc	mov al, byte [finddata.attrib]
   648                                  internaldatarelocation
   649 0000013E 268A25                  	mov ah, byte [es:di]
   650 00000141 251010                  	and ax, (ATTR_DIRECTORY << 8) | ATTR_DIRECTORY
   651 00000144 38E0                    	cmp al, ah
   652 00000146 755F                    	jne ..@compare_normal
   653 00000148 47                      	inc di
   654                                  .notdirfirst:
   655                                  
   656 00000149 D006[0C00]              reloc	rol byte [date], 1
   657                                  internaldatarelocation
   658 0000014D 7311                    	jnc .notdate
   659 0000014F A1[BA04]                reloc	mov ax, word [finddata.date]
   660                                  internaldatarelocation
   661 00000152 263B4502                	cmp ax, word [es:di + 2]
   662 00000156 7547                    	jne .sort_compare
   663 00000158 A1[B804]                reloc	mov ax, word [finddata.time]
   664                                  internaldatarelocation
   665 0000015B 263B05                  	cmp ax, word [es:di]
   666 0000015E 753F                    	jne .sort_compare
   667                                  	; scasw
   668                                  	; scasw
   669                                  .notdate:
   670                                  
   671 00000160 D006[0D00]              reloc	rol byte [size], 1
   672                                  internaldatarelocation
   673 00000164 731A                    	jnc .notsize
   674 00000166 A0[E605]                reloc	mov al, byte [size40bit + 4]
   675                                  internaldatarelocation
   676 00000169 263A4504                	cmp al, byte [es:di + 4]
   677 0000016D 7530                    	jne .sort_compare
   678 0000016F A1[E405]                reloc	mov ax, word [size40bit + 2]
   679                                  internaldatarelocation
   680 00000172 263B4502                	cmp ax, word [es:di + 2]
   681 00000176 7527                    	jne .sort_compare
   682 00000178 A1[E205]                reloc	mov ax, word [size40bit]
   683                                  internaldatarelocation
   684 0000017B 263B05                  	cmp ax, word [es:di]
   685 0000017E 751F                    	jne .sort_compare
   686                                  	; add di, 5
   687                                  .notsize:
   688                                  
   689 00000180 89DF                    	mov di, bx
   690 00000182 033E[0000]              reloc	add di, word [meta]
   691                                  internaldatarelocation
   692 00000186 89D6                    	mov si, dx
   693 00000188 B001                    	mov al, 1
   694                                  @@:
   695 0000018A 3C00                    	cmp al, 0
   696 0000018C 741B                    	je .sort_insert_skip_bx
   697 0000018E AC                      	lodsb
   698 0000018F 268A25                  	mov ah, byte [es:di]
   699 00000192 47                      	inc di
   700 00000193 E8FA05                  	extcallcall uppercase
   701 00000196 86C4                    	xchg al, ah
   702 00000198 E8F505                  	extcallcall uppercase
   703 0000019B 38E0                    	cmp al, ah
   704 0000019D 74EB                    	je @B
   705                                  .sort_compare:
   706 0000019F FF26[0200]              reloc	jmp near [compare]
   707                                  internaldatarelocation
   708                                  
   709                                  ..@compare_reverse:
   710 000001A3 7216                    	jb .sort_insert_before_bx
   711 000001A5 EB02                    	jmp .sort_insert_skip_bx
   712                                  
   713                                  ..@compare_normal:
   714 000001A7 7712                    	ja .sort_insert_before_bx
   715                                  .sort_insert_skip_bx:
   716 000001A9 51                      	push cx
   717 000001AA 89DF                    	mov di, bx
   718 000001AC 033E[0000]              reloc	add di, word [meta]
   719                                  internaldatarelocation
   720 000001B0 B000                    	mov al, 0
   721 000001B2 B90002                  	mov cx, 512
   722 000001B5 F2AE                    	repne scasb
   723 000001B7 59                      	pop cx
   724 000001B8 E96FFF                  	jmp .sort
   725                                  
   726                                  .sort_insert_before_bx:
   727                                  	houdini
   728 000001BB 8B3E[6C04]              reloc	mov di, word [sort_last]	; -> after last
   729                                  internaldatarelocation
   730 000001BF 89FE                    	mov si, di			; -> behind source
   731 000001C1 01CF                    	add di, cx			; -> behind target
   732 000001C3 033E[0000]              reloc	add di, word [meta]
   733                                  internaldatarelocation
   734 000001C7 51                      	push cx
   735 000001C8 89F1                    	mov cx, si			; -> behind source
   736 000001CA 29D9                    	sub cx, bx			; behind source minus start source
   737                                  					;  = length of source
   738 000001CC FD                      	std
   739 000001CD A6                      	cmpsb				; -> last bytes
   740                                  @@:
   741 000001CE 26A4                    	es movsb
   742 000001D0 E2FC                    	loop @B				; move up trailer
   743 000001D2 FC                      	cld
   744 000001D3 59                      	pop cx
   745 000001D4 010E[6C04]              reloc	add word [sort_last], cx
   746                                  internaldatarelocation
   747 000001D8 8B3E[0000]              reloc	mov di, word [meta]
   748                                  internaldatarelocation
   749 000001DC 013E[6C04]              reloc	add word [sort_last], di
   750                                  internaldatarelocation
   751 000001E0 89DF                    	mov di, bx
   752 000001E2 E80200                  	call .store_with_meta
   753 000001E5 EB34                    	jmp .sort_inserted
   754                                  
   755                                  .store_with_meta:
   756 000001E7 D006[0B00]              reloc	rol byte [dirfirst], 1
   757                                  internaldatarelocation
   758 000001EB 7304                    	jnc @F
   759 000001ED A0[A404]                reloc	mov al, byte [finddata.attrib]
   760                                  internaldatarelocation
   761 000001F0 AA                      	stosb
   762                                  @@:
   763                                  
   764 000001F1 D006[0D00]              reloc	rol byte [size], 1
   765                                  internaldatarelocation
   766 000001F5 7306                    	jnc @F
   767 000001F7 BE[E205]                reloc	mov si, size40bit
   768                                  internaldatarelocation
   769 000001FA A5                      	movsw
   770 000001FB A5                      	movsw
   771 000001FC A4                      	movsb
   772                                  @@:
   773                                  
   774 000001FD D006[0C00]              reloc	rol byte [date], 1
   775                                  internaldatarelocation
   776 00000201 7308                    	jnc @F
   777 00000203 A1[B804]                reloc	mov ax, word [finddata.time]
   778                                  internaldatarelocation
   779 00000206 AB                      	stosw
   780 00000207 A1[BA04]                reloc	mov ax, word [finddata.date]
   781                                  internaldatarelocation
   782 0000020A AB                      	stosw
   783                                  @@:
   784                                  
   785 0000020B 89D6                    	mov si, dx			; -> to insert, cx = length
   786 0000020D F3A4                    	rep movsb			; store new entry
   787 0000020F C3                      	retn
   788                                  
   789                                  .sort_insert_last:
   790 00000210 8B3E[6C04]              reloc	mov di, word [sort_last]	; -> after last
   791                                  internaldatarelocation
   792 00000214 E8D0FF                  	call .store_with_meta
   793 00000217 893E[6C04]              reloc	mov word [sort_last], di	; update -> after last
   794                                  internaldatarelocation
   795                                  
   796                                  .sort_inserted:
   797 0000021B 16                      	push ss
   798 0000021C 07                      	pop es
   799                                  
   800 0000021D EB03                    	jmp @F
   801                                  
   802                                  .display:
   803 0000021F E89701                  	call display_single
   804                                  @@:
   805                                  
   806                                  .next:
   807                                  %if _BOOT
   808                                  	test sp, sp		; NZ (continue search)
   809                                  	retn
   810                                  %else
   811 00000222 A1[7404]                reloc	mov ax, word [findnext_function_number]
   812                                  internaldatarelocation
   813 00000225 8B1E[7604]              reloc	mov bx, word [findhandle]
   814                                  internaldatarelocation
   815 00000229 57                      	push di
   816 0000022A BE0100                  	mov si, 1
   817 0000022D BF[A404]                reloc	mov di, finddata
   818                                  internaldatarelocation
   819 00000230 F9                      	stc
   820 00000231 E84C05                  	extcallcall _doscall
   821 00000234 5F                      	pop di
   822 00000235 7203E99BFE              	jnc .loop
   823                                  %endif
   824                                  
   825                                  %if _BOOT
   826                                  ..@boot_scan_end:
   827                                  %endif
   828                                  
   829 0000023A D006[0400]              reloc	rol byte [found], 1
   830                                  internaldatarelocation
   831 0000023E 7312                    	jnc .notfound
   832 00000240 D006[0900]              reloc	rol byte [sort], 1
   833                                  internaldatarelocation
   834 00000244 7233                    	jc sorted
   835 00000246 D006[0700]              reloc	rol byte [wide], 1
   836                                  internaldatarelocation
   837 0000024A 7303                    	jnc @F
   838                                  
   839                                  %if _BOOT
   840                                  reloc	mov di, [widecurrent]
   841                                  internaldatarelocation
   842                                  %endif
   843                                  
   844 0000024C E84905                  	extcallcall trimputs
   845                                  @@:
   846 0000024F E84E05                  	extcallcall cmd3
   847                                  
   848                                  
   849                                  .notfound:
   850 00000252 BA[2302]                reloc	mov dx, msg.notfound
   851                                  internaldatarelocation
   852 00000255 B8220E                  	mov ax, 0E22h
   853                                  @@:
   854 00000258 E84D05                  	extcallcall setrc
   855 0000025B E85205                  	extcallcall putsz
   856 0000025E E83F05                  	extcallcall cmd3
   857                                  
   858                                  .error:
   859 00000261 BA[9F01]                reloc	mov dx, msg.error
   860                                  internaldatarelocation
   861 00000264 B8230E                  	mov ax, 0E23h
   862 00000267 EBEF                    	jmp @B
   863                                  
   864                                  .error2:
   865 00000269 BA[C601]                reloc	mov dx, msg.error2
   866                                  internaldatarelocation
   867 0000026C B8240E                  	mov ax, 0E24h
   868 0000026F EBE7                    	jmp @B
   869                                  
   870                                  .toofull:
   871 00000271 BA[E801]                reloc	mov dx, msg.toofull
   872                                  internaldatarelocation
   873 00000274 B8250E                  	mov ax, 0E25h
   874 00000277 EBDF                    	jmp @B
   875                                  
   876                                  
   877                                  sorted:
   878                                  	houdini
   879                                  %ifn _BOOT
   880 00000279 E88304                  	call findclose
   881                                  %endif
   882                                  
   883 0000027C 8B3E[7004]              reloc	mov di, word [pathname_start]
   884                                  internaldatarelocation
   885                                  
   886                                  .find_dir:
   887 00000280 89FB                    	mov bx, di		; bx -> start of path
   888 00000282 B9FFFF                  	mov cx, -1
   889 00000285 B000                    	mov al, 0
   890 00000287 F2AE                    	repne scasb
   891 00000289 4F                      	dec di
   892                                  @@:
   893 0000028A 39DF                    	cmp di, bx
   894 0000028C 7611                    	jbe .di
   895 0000028E 4F                      	dec di
   896 0000028F 803D2F                  	cmp byte [di], '/'
   897 00000292 740A                    	je .di_plus_one
   898 00000294 803D5C                  	cmp byte [di], '\'
   899 00000297 7405                    	je .di_plus_one
   900 00000299 803D3A                  	cmp byte [di], ':'
   901 0000029C 75EC                    	jne @B
   902                                  .di_plus_one:
   903 0000029E 47                      	inc di
   904                                  .di:				; di -> end of path
   905 0000029F 89F9                    	mov cx, di
   906 000002A1 29D9                    	sub cx, bx		; = length of path
   907                                  
   908 000002A3 890E[7204]              reloc	mov word [pathname_length], cx
   909                                  internaldatarelocation
   910                                  
   911 000002A7 BF[0000]                reloc	mov di, relocateddata
   912                                  linkdatarelocation line_out
   913                                  
   914                                  .loop:
   915 000002AA 57                      	push di
   916 000002AB 8B1E[7204]              reloc	mov bx, word [pathname_length]
   917                                  internaldatarelocation
   918 000002AF 8B36[7004]              reloc	mov si, word [pathname_start]
   919                                  internaldatarelocation
   920 000002B3 89D9                    	mov cx, bx
   921 000002B5 81F90002                	cmp cx, buffer_end - buffer
   922 000002B9 73A6                    	jae .error
   923                                  
   924 000002BB BF[7804]                reloc	mov di, buffer
   925                                  internaldatarelocation
   926 000002BE F3A4                    	rep movsb
   927 000002C0 89FA                    	mov dx, di
   928                                  
   929 000002C2 8B3E[6E04]              reloc	mov di, word [sort_next]
   930                                  internaldatarelocation
   931 000002C6 3B3E[6C04]              reloc	cmp di, word [sort_last]
   932                                  internaldatarelocation
   933 000002CA 7344                    	jae .end
   934 000002CC 033E[0000]              reloc	add di, word [meta]
   935                                  internaldatarelocation
   936 000002D0 89FE                    	mov si, di
   937                                  
   938 000002D2 8E06[6604]              reloc	mov es, word [sortsegsel]
   939                                  internaldatarelocation
   940 000002D6 B000                    	mov al, 0
   941 000002D8 B90002                  	mov cx, 512
   942 000002DB F2AE                    	repne scasb
   943 000002DD 7582                    	jne .error
   944 000002DF 89F9                    	mov cx, di
   945 000002E1 29F1                    	sub cx, si
   946                                  
   947 000002E3 01CB                    	add bx, cx
   948 000002E5 81FB0002                	cmp bx, buffer_end - !!_BOOT - buffer
   949 000002E9 7603E973FF              	ja .error
   950                                  
   951 000002EE 89D7                    	mov di, dx
   952                                  %if _BOOT
   953                                  reloc	cmp di, strict word buffer
   954                                  internaldatarelocation
   955                                  	je .slash
   956                                  	cmp byte [di - 1], '/'
   957                                  	je .notslash
   958                                  	cmp byte [di - 1], '\'
   959                                  	je .notslash
   960                                  .slash:
   961                                  	mov byte [di], '/'
   962                                  	inc di
   963                                  .notslash:
   964                                  reloc	mov word [wild_pattern], di
   965                                  internaldatarelocation
   966                                  %endif
   967 000002F0 06                      	 push es
   968 000002F1 1E                      	 push ds
   969 000002F2 07                      	 pop es
   970 000002F3 1F                      	 pop ds				; swap
   971 000002F4 F3A4                    	rep movsb
   972 000002F6 16                      	 push ss
   973 000002F7 1F                      	 pop ds				; reset
   974 000002F8 8936[6E04]              reloc	mov word [sort_next], si
   975                                  internaldatarelocation
   976                                  
   977 000002FC BA[7804]                reloc	mov dx, buffer
   978                                  internaldatarelocation
   979                                  %if _BOOT
   980                                  	pop di
   981                                  
   982                                  	mov bx, dx
   983                                  reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   984                                  linkdatarelocation internalflags3, -3
   985                                  	extcallcall yy_boot_init_dir2
   986                                  
   987                                  reloc2	mov word [matchfunction], display_ZR
   988                                  internaldatarelocation -4
   989                                  internalcoderelocation
   990                                  
   991                                  	call boot_scan
   992                                  
   993                                  	jmp .loop
   994                                  
   995                                  .error equ sort_or_display.error
   996                                  .error2 equ sort_or_display.error2
   997                                  %else
   998 000002FF E81E02                  	call findfirst
   999 00000302 7303E962FF              	jc .error2
  1000                                  
  1001 00000307 E8F503                  	call findclose
  1002 0000030A 5F                      	pop di
  1003 0000030B E8AB00                  	call display_single
  1004 0000030E EB9A                    	jmp .loop
  1005                                  
  1006                                  .error equ run_dos.error
  1007                                  .error2 equ run_dos.error2
  1008                                  %endif
  1009                                  
  1010                                  .end:
  1011 00000310 5F                      	pop di
  1012 00000311 D006[0700]              reloc	rol byte [wide], 1
  1013                                  internaldatarelocation
  1014 00000315 7303                    	jnc @F
  1015                                  
  1016                                  %if _BOOT
  1017                                  reloc	mov di, [widecurrent]
  1018                                  internaldatarelocation
  1019                                  %endif
  1020                                  
  1021 00000317 E87E04                  	extcallcall trimputs
  1022                                  @@:
  1023 0000031A E88304                  	extcallcall cmd3
  1024                                  
  1025                                  
  1026                                  populate_finddata:
  1027                                  %ifn _BOOT
  1028 0000031D 803E[7504]71            reloc	cmp byte [findnext_function_number + 1], 71h
  1029                                  internaldatarelocation -3
  1030 00000322 7436                    	je .have_lfn
  1031                                  
  1032 00000324 A0[8D04]                reloc	mov al, byte [dta.attrib]
  1033                                  internaldatarelocation
  1034 00000327 A2[A404]                reloc	mov byte [finddata.attrib], al
  1035                                  internaldatarelocation
  1036                                  
  1037 0000032A A1[8E04]                reloc	mov ax, word [dta.time]
  1038                                  internaldatarelocation
  1039 0000032D A3[B804]                reloc	mov word [finddata.time], ax
  1040                                  internaldatarelocation
  1041                                  
  1042 00000330 A1[9004]                reloc	mov ax, word [dta.date]
  1043                                  internaldatarelocation
  1044 00000333 A3[BA04]                reloc	mov word [finddata.date], ax
  1045                                  internaldatarelocation
  1046                                  
  1047 00000336 A1[9204]                reloc	mov ax, word [dta.size]
  1048                                  internaldatarelocation
  1049 00000339 A3[C404]                reloc	mov word [finddata.sizelow], ax
  1050                                  internaldatarelocation
  1051                                  
  1052 0000033C A1[9404]                reloc	mov ax, word [dta.size + 2]
  1053                                  internaldatarelocation
  1054 0000033F A3[C604]                reloc	mov word [finddata.sizelow + 2], ax
  1055                                  internaldatarelocation
  1056                                  
  1057 00000342 31C0                    	xor ax, ax
  1058 00000344 A3[C004]                reloc	mov word [finddata.sizehigh], ax
  1059                                  internaldatarelocation
  1060 00000347 A3[C204]                reloc	mov word [finddata.sizehigh + 2], ax
  1061                                  internaldatarelocation
  1062                                  
  1063 0000034A 57                      	push di
  1064 0000034B BE[9604]                reloc	mov si, dta.name
  1065                                  internaldatarelocation
  1066 0000034E BF[D004]                reloc	mov di, finddata.fullname
  1067                                  internaldatarelocation
  1068 00000351 B90700                  	mov cx, words(14)
  1069 00000354 F3A5                    	rep movsw
  1070 00000356 5F                      	pop di
  1071                                  
  1072 00000357 A2[D405]                reloc	mov byte [finddata.shortname], al
  1073                                  internaldatarelocation
  1074                                  
  1075                                  .have_lfn:
  1076                                  %endif
  1077                                  
  1078 0000035A 57                      	push di
  1079 0000035B BF[E205]                reloc	mov di, size40bit
  1080                                  internaldatarelocation
  1081 0000035E F606[A404]10            reloc	test byte [finddata.attrib], ATTR_DIRECTORY
  1082                                  internaldatarelocation -3
  1083 00000363 740E                    	jz @F
  1084 00000365 31C0                    	xor ax, ax
  1085 00000367 A3[C404]                reloc	mov word [finddata.sizelow], ax
  1086                                  internaldatarelocation
  1087 0000036A A3[C604]                reloc	mov word [finddata.sizelow + 2], ax
  1088                                  internaldatarelocation
  1089 0000036D A3[C004]                reloc	mov word [finddata.sizehigh], ax
  1090                                  internaldatarelocation
  1091 00000370 A3[C204]                reloc	mov word [finddata.sizehigh + 2], ax
  1092                                  internaldatarelocation
  1093                                  @@:
  1094 00000373 833E[C204]00            reloc	cmp word [finddata.sizehigh + 2], strict byte 0
  1095                                  internaldatarelocation -3
  1096 00000378 7516                    	jne .sizelarge
  1097 0000037A 813E[C004]0001          reloc	cmp word [finddata.sizehigh], 256
  1098                                  internaldatarelocation -4
  1099 00000380 730E                    	jae .sizelarge
  1100 00000382 A1[C404]                reloc	mov ax, word [finddata.sizelow]
  1101                                  internaldatarelocation
  1102 00000385 AB                      	stosw
  1103 00000386 A1[C604]                reloc	mov ax, word [finddata.sizelow + 2]
  1104                                  internaldatarelocation
  1105 00000389 AB                      	stosw
  1106 0000038A A0[C004]                reloc	mov al, byte [finddata.sizehigh]
  1107                                  internaldatarelocation
  1108 0000038D AA                      	stosb
  1109 0000038E EB06                    	jmp @F
  1110                                  
  1111                                  .sizelarge:
  1112 00000390 B8FFFF                  	mov ax, 0FFFFh
  1113 00000393 AB                      	stosw
  1114 00000394 AB                      	stosw
  1115 00000395 AA                      	stosb
  1116                                  @@:
  1117 00000396 5F                      	pop di
  1118                                  
  1119 00000397 BE[D405]                reloc	mov si, finddata.shortname
  1120                                  internaldatarelocation
  1121 0000039A 803C00                  	cmp byte [si], 0
  1122 0000039D 7503                    	jne @F
  1123 0000039F BE[D004]                reloc	mov si, finddata.fullname
  1124                                  internaldatarelocation
  1125                                  @@:
  1126                                  
  1127 000003A2 803C2E                  	cmp byte [si], '.'	; dot ?
  1128 000003A5 750A                    	jne @F			; no --> NZ
  1129 000003A7 837C012E                	cmp word [si + 1], "."	; dot and NUL ?
  1130 000003AB 7404                    	je .next		; dotdot, skip --> ZR
  1131 000003AD 807C0100                	cmp byte [si + 1], 0	; NUL ?
  1132                                  	; je .next		; dot, skip --> ZR
  1133                                  .next:
  1134                                  @@:
  1135 000003B1 7405                    	je @F
  1136 000003B3 800E[0400]FF            reloc	or byte [found], -1
  1137                                  internaldatarelocation -3	; NZ
  1138                                  @@:
  1139 000003B8 C3                      	retn
  1140                                  
  1141                                  
  1142                                  %if _BOOT
  1143                                  display_ZR:
  1144                                  %endif
  1145                                  display_single:
  1146 000003B9 E861FF                  	call populate_finddata
  1147 000003BC 7503E95E01              	je .next
  1148                                  
  1149 000003C1 D006[0700]              reloc	rol byte [wide], 1
  1150                                  internaldatarelocation
  1151 000003C5 7338                    	jnc .notwide
  1152                                  
  1153                                  .wide:
  1154                                  	houdini
  1155                                  %if _BOOT
  1156                                  reloc	mov di, [widecurrent]
  1157                                  internaldatarelocation
  1158                                  %endif
  1159                                  
  1160 000003C7 FE06[0800]              reloc	inc byte [widecounter]
  1161                                  internaldatarelocation
  1162 000003CB 803E[0800]06            reloc	cmp byte [widecounter], 6
  1163                                  internaldatarelocation -3
  1164 000003D0 720B                    	jb @F
  1165 000003D2 E8C303                  	extcallcall trimputs
  1166 000003D5 BF[0000]                reloc	mov di, relocateddata
  1167                                  linkdatarelocation line_out
  1168 000003D8 C606[0800]01            reloc	mov byte [widecounter], 1
  1169                                  internaldatarelocation -3
  1170                                  @@:
  1171                                  
  1172 000003DD B420                    	mov ah, 32
  1173 000003DF B90F00                  	mov cx, 15		; width of column: 8 + 1 + 3 + 2 + 1
  1174 000003E2 F606[A404]10            reloc	test byte [finddata.attrib], ATTR_DIRECTORY
  1175                                  internaldatarelocation -3
  1176 000003E7 7405                    	jz @FF			; skip brackets and first iter stosb -->
  1177 000003E9 B85B5D                  	mov ax, "[]"		; use brackets
  1178 000003EC 49                      	dec cx			; decrement remaining width
  1179                                  @@:
  1180 000003ED AA                      	stosb			; dir first iter: store opening square bracket
  1181                                  				; file first iter: skipped
  1182                                  				; subsequent iter: store text byte
  1183                                  @@:
  1184 000003EE AC                      	lodsb			; load from name
  1185 000003EF 84C0                    	test al, al		; got a NUL ? do not loop if so
  1186 000003F1 E0FA                    	loopnz @BB		; decrements width once per text byte
  1187                                  				;  and finally once more for the NUL
  1188 000003F3 88E0                    	mov al, ah		; get blank or closing square bracket
  1189 000003F5 AA                      	stosb			; store blank or closing square bracket
  1190                                  				; (this store does not decrement the width)
  1191 000003F6 B020                    	mov al, 32		; pad with blanks
  1192 000003F8 E301                    	jcxz @F			; (error?) only once -->
  1193 000003FA F3                      	rep
  1194                                  @@:
  1195 000003FB AA                      	stosb			; store separator blanks
  1196                                  
  1197                                  %if _BOOT
  1198                                  reloc	mov [widecurrent], di
  1199                                  internaldatarelocation
  1200                                  %endif
  1201 000003FC E92001                  	jmp .next
  1202                                  
  1203                                  
  1204                                  .notwide:
  1205 000003FF BF[0000]                reloc	mov di, relocateddata
  1206                                  linkdatarelocation line_out
  1207 00000402 B90800                  	mov cx, 8
  1208                                  
  1209                                  @@:
  1210 00000405 AC                      	lodsb
  1211 00000406 3C2E                    	cmp al, '.'
  1212 00000408 740D                    	je @F
  1213 0000040A 3C00                    	cmp al, 0
  1214 0000040C 741A                    	je .no_ext
  1215 0000040E AA                      	stosb
  1216 0000040F E2F4                    	loop @B
  1217 00000411 AC                      	lodsb
  1218 00000412 3C2E                    	cmp al, '.'
  1219 00000414 7401                    	je @F
  1220 00000416 4E                      	dec si			; doesn't fit, nothing sensible here
  1221                                  
  1222                                  @@:
  1223 00000417 41                      	inc cx
  1224 00000418 B020                    	mov al, 32
  1225 0000041A F3AA                    	rep stosb
  1226                                  
  1227 0000041C B103                    	mov cl, 3
  1228                                  @@:
  1229 0000041E AC                      	lodsb
  1230 0000041F 3C00                    	cmp al, 0
  1231 00000421 7408                    	je @F
  1232 00000423 AA                      	stosb
  1233 00000424 E2F8                    	loop @B
  1234 00000426 EB03                    	jmp @F
  1235                                  
  1236                                  .no_ext:
  1237 00000428 83C104                  	add cx, 1 + 3
  1238                                  
  1239                                  @@:
  1240 0000042B 41                      	inc cx
  1241 0000042C 41                      	inc cx
  1242 0000042D B020                    	mov al, 32
  1243 0000042F F3AA                    	rep stosb
  1244                                  
  1245                                  
  1246 00000431 8A1E[A404]              reloc	mov bl, byte [finddata.attrib]
  1247                                  internaldatarelocation
  1248                                  
  1249 00000435 B02D                    	mov al, '-'
  1250 00000437 F6C320                  	test bl, ATTR_ARCHIVE
  1251 0000043A 7402                    	jz @F
  1252 0000043C B041                    	mov al, 'A'
  1253                                  @@:
  1254 0000043E AA                      	stosb
  1255 0000043F B02D                    	mov al, '-'
  1256 00000441 F6C302                  	test bl, ATTR_HIDDEN
  1257 00000444 7402                    	jz @F
  1258 00000446 B048                    	mov al, 'H'
  1259                                  @@:
  1260 00000448 AA                      	stosb
  1261 00000449 B02D                    	mov al, '-'
  1262 0000044B F6C301                  	test bl, ATTR_READONLY
  1263 0000044E 7402                    	jz @F
  1264 00000450 B052                    	mov al, 'R'
  1265                                  @@:
  1266 00000452 AA                      	stosb
  1267 00000453 B02D                    	mov al, '-'
  1268 00000455 F6C304                  	test bl, ATTR_SYSTEM
  1269 00000458 7402                    	jz @F
  1270 0000045A B053                    	mov al, 'S'
  1271                                  @@:
  1272 0000045C AA                      	stosb
  1273 0000045D B82020                  	mov ax, 2020h
  1274 00000460 AB                      	stosw
  1275                                  
  1276 00000461 F6C310                  	test bl, ATTR_DIRECTORY
  1277 00000464 7408                    	jz @F
  1278 00000466 BE[1102]                reloc	mov si, msg.dirinsteadsize
  1279                                  internaldatarelocation
  1280                                  .nosize:
  1281 00000469 E84C03                  	extcallcall copy_single_counted_string
  1282 0000046C EB1F                    	jmp @FF
  1283                                  
  1284                                  @@:
  1285 0000046E 833E[C204]00            reloc	cmp word [finddata.sizehigh + 2], strict byte 0
  1286                                  internaldatarelocation -3
  1287 00000473 7405                    	je .sizefits
  1288                                  
  1289 00000475 BE[1A02]                reloc	mov si, msg.sizetoolarge
  1290                                  internaldatarelocation
  1291 00000478 EBEF                    	jmp .nosize
  1292                                  
  1293                                  .sizefits:
  1294 0000047A 8B36[C004]              reloc	mov si, word [finddata.sizehigh] 	; from FAT+ upper size bits
  1295                                  internaldatarelocation
  1296 0000047E 8B16[C604]              reloc	mov dx, word [finddata.sizelow + 2]
  1297                                  internaldatarelocation
  1298 00000482 A1[C404]                reloc	mov ax, word [finddata.sizelow]
  1299                                  internaldatarelocation
  1300 00000485 31C9                    	xor cx, cx
  1301 00000487 BB0800                  	mov bx, 4+4
  1302 0000048A E83303                  	extcallcall disp_dxax_times_cx_width_bx_size.store
  1303                                  
  1304                                  @@:
  1305 0000048D B82020                  	mov ax, 2020h
  1306 00000490 AB                      	stosw
  1307 00000491 8B1E[BA04]              reloc	mov bx, word [finddata.date]
  1308                                  internaldatarelocation
  1309 00000495 8B36[B804]              reloc	mov si, word [finddata.time]
  1310                                  internaldatarelocation
  1311                                  
  1312 00000499 31D2                    	xor dx, dx
  1313 0000049B 85DB                    	test bx, bx
  1314 0000049D 750A                    	jnz @F
  1315 0000049F B82020                  	mov ax, 2020h
  1316 000004A2 B90500                  	mov cx, 5
  1317 000004A5 F3AB                    	rep stosw
  1318 000004A7 EB2B                    	jmp .nodate
  1319                                  
  1320                                  @@:
  1321 000004A9 89D8                    	mov ax, bx
  1322 000004AB B90900                  	mov cx, 9
  1323 000004AE D3E8                    	shr ax, cl
  1324 000004B0 05BC07                  	add ax, 1980
  1325 000004B3 B104                    	mov cl, 4
  1326 000004B5 E81003                  	extcallcall dec_dword_minwidth
  1327 000004B8 B02D                    	mov al, '-'
  1328 000004BA AA                      	stosb
  1329 000004BB 89D8                    	mov ax, bx
  1330 000004BD B105                    	mov cl, 5
  1331 000004BF D3E8                    	shr ax, cl
  1332 000004C1 83E00F                  	and ax, 15
  1333 000004C4 B102                    	mov cl, 2
  1334 000004C6 E8FF02                  	extcallcall dec_dword_minwidth
  1335 000004C9 B02D                    	mov al, '-'
  1336 000004CB AA                      	stosb
  1337 000004CC 89D8                    	mov ax, bx
  1338 000004CE 83E01F                  	and ax, 31
  1339 000004D1 E8F402                  	extcallcall dec_dword_minwidth
  1340                                  .nodate:
  1341 000004D4 B020                    	mov al, 32
  1342 000004D6 AA                      	stosb
  1343 000004D7 89F0                    	mov ax, si
  1344 000004D9 B10B                    	mov cl, 11
  1345 000004DB D3E8                    	shr ax, cl
  1346 000004DD B102                    	mov cl, 2
  1347 000004DF E8E602                  	extcallcall dec_dword_minwidth
  1348 000004E2 B03A                    	mov al, ':'
  1349 000004E4 AA                      	stosb
  1350 000004E5 89F0                    	mov ax, si
  1351 000004E7 B105                    	mov cl, 5
  1352 000004E9 D3E8                    	shr ax, cl
  1353 000004EB 83E03F                  	and ax, 63
  1354 000004EE B102                    	mov cl, 2
  1355 000004F0 E8D502                  	extcallcall dec_dword_minwidth
  1356 000004F3 B03A                    	mov al, ':'
  1357 000004F5 AA                      	stosb
  1358 000004F6 89F0                    	mov ax, si
  1359 000004F8 83E01F                  	and ax, 31
  1360 000004FB D1E0                    	shl ax, 1
  1361 000004FD E8C802                  	extcallcall dec_dword_minwidth
  1362                                  
  1363 00000500 803E[D405]00            reloc	cmp byte [finddata.shortname], 0
  1364                                  internaldatarelocation -3
  1365 00000505 7415                    	je @F
  1366 00000507 B82020                  	mov ax, 2020h
  1367 0000050A AB                      	stosw
  1368 0000050B E8C202                  	extcallcall putsline
  1369 0000050E BA[D004]                reloc	mov dx, finddata.fullname
  1370                                  internaldatarelocation
  1371 00000511 E89C02                  	extcallcall putsz
  1372 00000514 BA[3202]                reloc	mov dx, msg.linebreak
  1373                                  internaldatarelocation
  1374 00000517 E89602                  	extcallcall putsz
  1375 0000051A EB03                    	jmp .next
  1376                                  
  1377                                  @@:
  1378 0000051C E8B902                  	extcallcall putsline_crlf
  1379                                  
  1380                                  .next:
  1381                                  %if _BOOT
  1382                                  	cmp al, al		; ZR
  1383                                  %endif
  1384 0000051F C3                      	retn
  1385                                  
  1386                                  
  1387                                  %ifn _BOOT
  1388                                  findfirst:
  1389 00000520 C706[7404]4F71          reloc	mov word [findnext_function_number], 714Fh
  1390                                  internaldatarelocation -4
  1391 00000526 B84E71                  	mov ax, 714Eh
  1392 00000529 B91600                  	mov cx, 16h		; find all files and directories
  1393 0000052C BE0100                  	mov si, 1
  1394 0000052F BF[A404]                reloc	mov di, finddata
  1395                                  internaldatarelocation
  1396 00000532 D006[0600]              reloc	rol byte [prefersfn], 1
  1397                                  internaldatarelocation
  1398 00000536 721B                    	jc .sfn_try
  1399 00000538 F9                      	stc
  1400 00000539 E84402                  	extcallcall _doscall
  1401 0000053C 730C                    	jnc .lfn_found
  1402 0000053E 83F801                  	cmp ax, 1
  1403 00000541 7410                    	je .sfn_try
  1404 00000543 3D0071                  	cmp ax, 7100h
  1405 00000546 740B                    	je .sfn_try
  1406 00000548 F9                      	stc	; CY
  1407 00000549 C3                      	retn
  1408                                  
  1409                                  .lfn_found:
  1410 0000054A A3[7604]                reloc	mov word [findhandle], ax
  1411                                  internaldatarelocation
  1412 0000054D C606[0500]FF            reloc	mov byte [findhandle_set], 0FFh
  1413                                  internaldatarelocation -3
  1414                                  		; NC
  1415 00000552 C3                      	retn
  1416                                  
  1417                                  .sfn_try:
  1418 00000553 C706[7404]004F          reloc	mov word [findnext_function_number], 4F00h
  1419                                  internaldatarelocation -4
  1420 00000559 B8004E                  	mov ax, 4E00h
  1421 0000055C B91600                  	mov cx, 16h		; find all files and directories
  1422 0000055F E81E02                  	extcallcall _doscall
  1423                                  		; CY if not found
  1424 00000562 C3                      	retn
  1425                                  %endif
  1426                                  
  1427                                  
  1428                                  %if _BOOT
  1429                                  find_dir:
  1430                                  	mov bx, di		; bx -> start of path
  1431                                  	mov cx, -1
  1432                                  	mov al, 0
  1433                                  	repne scasb
  1434                                  	dec di
  1435                                  @@:
  1436                                  	cmp di, bx
  1437                                  	jbe .di
  1438                                  	dec di
  1439                                  	cmp byte [di], '/'
  1440                                  	je .di_plus_one
  1441                                  	cmp byte [di], '\'
  1442                                  	je .di_plus_one
  1443                                  	cmp byte [di], ':'
  1444                                  	jne @B
  1445                                  .di_plus_one:
  1446                                  	inc di
  1447                                  .di:				; di -> end of path
  1448                                  	retn
  1449                                  %endif
  1450                                  
  1451                                  
  1452                                  parse_verbose.loop:
  1453 00000563 AC                      	lodsb
  1454                                  parse_verbose:
  1455 00000564 E87902                  	extcallcall skipcomm0
  1456 00000567 E87E02                  	extcallcall iseol?
  1457 0000056A 7526                    	jne .parse
  1458                                  
  1459                                  .meta:
  1460 0000056C D006[0C00]              reloc	rol byte [date], 1
  1461                                  internaldatarelocation
  1462 00000570 730A                    	jnc @F
  1463 00000572 C606[0D00]00            reloc	mov byte [size], 0
  1464                                  internaldatarelocation -3
  1465 00000577 8006[0000]04            reloc	add byte [meta], 4
  1466                                  internaldatarelocation -3
  1467                                  @@:
  1468                                  
  1469 0000057C D006[0D00]              reloc	rol byte [size], 1
  1470                                  internaldatarelocation
  1471 00000580 7305                    	jnc @F
  1472 00000582 8006[0000]05            reloc	add byte [meta], 5
  1473                                  internaldatarelocation -3
  1474                                  @@:
  1475                                  
  1476 00000587 D006[0B00]              reloc	rol byte [dirfirst], 1
  1477                                  internaldatarelocation
  1478 0000058B 7304                    	jnc @F
  1479 0000058D FE06[0000]              reloc	inc byte [meta]
  1480                                  internaldatarelocation
  1481                                  @@:
  1482 00000591 C3                      	retn
  1483                                  
  1484                                  .parse:
  1485 00000592 4E                      	dec si
  1486                                  %ifn _BOOT
  1487 00000593 BA[0E00]                reloc	mov dx, msg.string_sfn
  1488                                  internaldatarelocation
  1489 00000596 E85702                  	extcallcall isstring?
  1490 00000599 7507                    	jne @F
  1491 0000059B C606[0600]FF            reloc	mov byte [prefersfn], 0FFh
  1492                                  internaldatarelocation -3
  1493 000005A0 EBC1                    	jmp .loop
  1494                                  
  1495                                  @@:
  1496                                  %endif
  1497 000005A2 BA[1200]                reloc	mov dx, msg.string_wide
  1498                                  internaldatarelocation
  1499 000005A5 E84802                  	extcallcall isstring?
  1500 000005A8 7507                    	jne @F
  1501 000005AA C606[0700]FF            reloc	mov byte [wide], 0FFh
  1502                                  internaldatarelocation -3
  1503 000005AF EBB2                    	jmp .loop
  1504                                  
  1505                                  @@:
  1506 000005B1 BA[1700]                reloc	mov dx, msg.string_sort
  1507                                  internaldatarelocation
  1508 000005B4 E83902                  	extcallcall isstring?
  1509 000005B7 7507                    	jne @F
  1510                                  .loop_sort:
  1511 000005B9 C606[0900]FF            reloc	mov byte [sort], 0FFh
  1512                                  internaldatarelocation -3
  1513 000005BE EBA3                    	jmp .loop
  1514                                  @@:
  1515 000005C0 BA[1C00]                reloc	mov dx, msg.string_dirfirst
  1516                                  internaldatarelocation
  1517 000005C3 E82A02                  	extcallcall isstring?
  1518 000005C6 7507                    	jne @F
  1519 000005C8 C606[0B00]FF            reloc	mov byte [dirfirst], 0FFh
  1520                                  internaldatarelocation -3
  1521 000005CD EB94                    	jmp .loop
  1522                                  
  1523                                  @@:
  1524 000005CF BA[2500]                reloc	mov dx, msg.string_date
  1525                                  internaldatarelocation
  1526 000005D2 E81B02                  	extcallcall isstring?
  1527 000005D5 7507                    	jne @F
  1528 000005D7 C606[0C00]FF            reloc	mov byte [date], 0FFh
  1529                                  internaldatarelocation -3
  1530 000005DC EB85                    	jmp .loop
  1531                                  @@:
  1532 000005DE BA[2A00]                reloc	mov dx, msg.string_size
  1533                                  internaldatarelocation
  1534 000005E1 E80C02                  	extcallcall isstring?
  1535 000005E4 7508                    	jne @F
  1536 000005E6 C606[0D00]FF            reloc	mov byte [size], 0FFh
  1537                                  internaldatarelocation -3
  1538 000005EB E975FF                  	jmp .loop
  1539                                  
  1540                                  @@:
  1541 000005EE BA[2F00]                reloc	mov dx, msg.string_reverse
  1542                                  internaldatarelocation
  1543 000005F1 E8FC01                  	extcallcall isstring?
  1544 000005F4 7509                    	jne @F
  1545 000005F6 C706[0200][A301]        reloc2	mov word [compare], ..@compare_reverse
  1546                                  internaldatarelocation -4
  1547                                  internalcoderelocation
  1548 000005FC E964FF                  	jmp .loop
  1549                                  
  1550                                  @@:
  1551                                  %ifn _BOOT
  1552 000005FF BA[3700]                reloc	mov dx, msg.string_sortlfn
  1553                                  internaldatarelocation
  1554 00000602 E8EB01                  	extcallcall isstring?
  1555 00000605 7507                    	jne @F
  1556 00000607 C606[0A00]FF            reloc	mov byte [sortlfn], 0FFh
  1557                                  internaldatarelocation -3
  1558 0000060C EBAB                    	jmp .loop_sort
  1559                                  
  1560                                  @@:
  1561 0000060E BA[3F00]                reloc	mov dx, msg.string_sortsfn
  1562                                  internaldatarelocation
  1563 00000611 E8DC01                  	extcallcall isstring?
  1564 00000614 7507                    	jne @F
  1565 00000616 C606[0A00]00            reloc	mov byte [sortlfn], 0
  1566                                  internaldatarelocation -3
  1567 0000061B EB9C                    	jmp .loop_sort
  1568                                  
  1569                                  @@:
  1570                                  %endif
  1571                                  %if _DEBUG
  1572 0000061D BA[4700]                reloc	mov dx, msg.string_sortdebug
  1573                                  internaldatarelocation
  1574 00000620 E8CD01                  	extcallcall isstring?
  1575 00000623 7403                    	je @F
  1576                                  %endif
  1577 00000625 E8D001                  	extcallcall error
  1578                                  
  1579                                  %if _DEBUG
  1580                                  @@:
  1581 00000628 AC                      	lodsb
  1582 00000629 E8D401                  	extcallcall chkeol
  1583                                  
  1584 0000062C E83DFF                  	call .meta
  1585                                  
  1586                                  %if _BOOT
  1587                                  	extcallcall yy_boot_init_dir2
  1588                                  
  1589                                  	mov dx, word [bp + bsBPB + bpbBytesPerSector]
  1590                                  					; di = sector size
  1591                                  					; = start of available auxbuff
  1592                                  	cmp byte [bp + ldFATType], 12	; FAT12 ?
  1593                                  	jne @F				; no -->
  1594                                  	cmp dx, 8192			; already enough for a full FAT ?
  1595                                  	jae @F				; yes -->
  1596                                  	add dx, dx			; reserve straddling sector
  1597                                  @@:
  1598                                  %endif
  1599                                  
  1600 0000062F BF[0000]                reloc	mov di, relocateddata
  1601                                  linkdatarelocation line_out
  1602                                  
  1603 00000632 BE[5100]                reloc	mov si, msg.debug.1
  1604                                  internaldatarelocation
  1605 00000635 E88001                  	extcallcall copy_single_counted_string
  1606                                  
  1607 00000638 8CD0                    	mov ax, ss
  1608 0000063A E8CB01                  	extcallcall hexword
  1609 0000063D B03A                    	mov al, ':'
  1610 0000063F AA                      	stosb
  1611 00000640 B8[7806]                reloc	mov ax, buffer_end
  1612                                  internaldatarelocation
  1613 00000643 E8C201                  	extcallcall hexword
  1614                                  
  1615 00000646 A1[0000]                reloc	mov ax, word [relocateddata]
  1616                                  linkdatarelocation extdata_size
  1617 00000649 2B06[0000]              reloc	sub ax, word [relocateddata]
  1618                                  linkdatarelocation extdata_used
  1619 0000064D 8B1E[0000]              reloc	mov bx, word [relocateddata]
  1620                                  linkdatarelocation auxbuff_current_size
  1621                                  %if _BOOT
  1622                                  	sub bx, dx
  1623                                  	push dx
  1624                                  %endif
  1625                                  
  1626 00000651 BE[6B00]                reloc	mov si, msg.debug.2
  1627                                  internaldatarelocation
  1628 00000654 E86101                  	extcallcall copy_single_counted_string
  1629                                  
  1630 00000657 83C008                  	add ax, (uinit_data_end_2 - buffer_end)
  1631 0000065A E84500                  	call display_buffer_size
  1632                                  
  1633 0000065D BE[7E00]                reloc	mov si, msg.debug.3
  1634                                  internaldatarelocation
  1635 00000660 E85501                  	extcallcall copy_single_counted_string
  1636                                  
  1637 00000663 BA[DD00]                reloc	mov dx, msg.debug.larger_data_block
  1638                                  internaldatarelocation
  1639                                  
  1640 00000666 39D8                    	cmp ax, bx
  1641 00000668 730D                    	jae .use_sort_buffer_eld_data_block
  1642                                  
  1643 0000066A BA[1D01]                reloc	mov dx, msg.debug.smaller_data_block
  1644                                  internaldatarelocation
  1645                                  
  1646                                  %ifn _BOOT
  1647 0000066D F606[0300]70            reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
  1650                                  linkdatarelocation internalflags3, -3
  1651 00000672 7403                    	jz .use_sort_buffer_auxbuff
  1652                                  
  1653 00000674 BA[5B01]                reloc	mov dx, msg.debug.smaller_data_block_forced
  1654                                  internaldatarelocation
  1655                                  %endif
  1656                                  
  1657                                  .use_sort_buffer_eld_data_block:
  1658                                  .use_sort_buffer_auxbuff:
  1659                                  
  1660 00000677 A1[0000]                reloc	mov ax, word [relocateddata]
  1661                                  linkdatarelocation auxbuff_segorsel	; => sort buffer
  1662 0000067A E88B01                  	extcallcall hexword
  1663                                  
  1664                                  %if _BOOT
  1665                                  	mov al, ':'
  1666                                  	stosb
  1667                                  	pop ax
  1668                                  	extcallcall hexword
  1669                                  %endif
  1670                                  
  1671 0000067D 93                      	xchg ax, bx
  1672 0000067E BE[A100]                reloc	mov si, msg.debug.5
  1673                                  internaldatarelocation
  1674 00000681 E83401                  	extcallcall copy_single_counted_string
  1675 00000684 E81B00                  	call display_buffer_size
  1676                                  
  1677 00000687 BE[AE00]                reloc	mov si, msg.debug.6.available
  1678                                  internaldatarelocation
  1679                                  
  1680 0000068A F606[0300]70            reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
  1683                                  linkdatarelocation internalflags3, -3
  1684 0000068F 7403                    	jz @F
  1685                                  
  1686 00000691 BE[C700]                reloc	mov si, msg.debug.6.inuse
  1687                                  internaldatarelocation
  1688                                  @@:
  1689                                  
  1690 00000694 E82101                  	extcallcall copy_single_counted_string
  1691 00000697 52                      	push dx
  1692 00000698 E83D01                  	extcallcall putsline_crlf
  1693 0000069B 5A                      	pop dx
  1694                                  
  1695 0000069C E81101                  	extcallcall putsz
  1696 0000069F E8FE00                  	extcallcall cmd3
  1697                                  
  1698                                  
  1699                                  display_buffer_size:
  1700 000006A2 E86B01                  	extcallcall decword
  1701 000006A5 BE[7300]                reloc	mov si, msg.debug.bytes
  1702                                  internaldatarelocation
  1703 000006A8 E80D01                  	extcallcall copy_single_counted_string
  1704 000006AB 50                      	push ax
  1705 000006AC 52                      	push dx
  1706 000006AD 31D2                    	xor dx, dx
  1707 000006AF BE0D00                  	mov si, 8 + 1 + 3 + 1		; ASCIZ SFN maximum length
  1708 000006B2 0336[0000]              reloc	add si, word [meta]
  1709                                  internaldatarelocation
  1710 000006B6 F7F6                    	div si
  1711 000006B8 E85501                  	extcallcall decword
  1712 000006BB 5A                      	pop dx
  1713 000006BC 58                      	pop ax
  1714 000006BD C3                      	retn
  1715                                  %endif
  1716                                  
  1717                                  
  1718                                  %ifn _BOOT
  1719                                  inject:
  1720 000006BE 8B16[6004]              reloc	mov dx, word [originaldta]	; dx -> original DTA
  1721                                  internaldatarelocation
  1722 000006C2 B41A                    	mov ah, 1Ah			; set DTA (restoring)
  1723 000006C4 E8B100                  	extcallcall ispm
  1724 000006C7 7511                    	jnz .rm
  1725                                  
  1726                                  subcpu 286
  1727 000006C9 FF36[6204]              reloc	push word [originaldta + 2]
  1728                                  internaldatarelocation			; ds => original DTA (86M segment)
  1729 000006CD 6A21                    	push word 21h
  1730 000006CF E8[0000]EB020000        	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
  1731 000006D6 5A                      	pop dx				; discard interrupt number
  1732 000006D7 5A                      	pop dx				; discard es
  1733                                  subcpureset
  1734 000006D8 EB08                    	jmp @F
  1735                                  .rm:
  1736 000006DA 8E1E[6204]              reloc	mov ds, word [originaldta + 2]	; ds => original DTA
  1737                                  internaldatarelocation
  1738 000006DE CD21                    	int 21h
  1739 000006E0 16                      	 push ss
  1740 000006E1 1F                      	 pop ds
  1741                                  @@:
  1742                                  
  1743 000006E2 E81A00                  	call findclose
  1744                                  
  1745 000006E5 8B0E[6404]              reloc	mov cx, word [originalinject]
  1746                                  internaldatarelocation
  1747 000006E9 E82800                  	call get_es_ext
  1748 000006EC 268026[1000]FE          reloc	clropt [es:code + eldiFlags], eldifResident
  1749                                  internalcoderelocation -3		; mark block as no longer resident
  1750 000006F2 16                      	 push ss
  1751 000006F3 07                      	 pop es
  1752 000006F4 E302                    	jcxz @F
  1753 000006F6 FFE1                    	jmp cx
  1754                                  
  1755                                  @@:
  1756 000006F8 E8[0000]EB020000        	extcall cmd3_not_inject
  1757                                  
  1758                                  
  1759                                  findclose:
  1760 000006FF 8B1E[7604]              reloc	mov bx, word [findhandle]	; bx = find handle, if any
  1761                                  internaldatarelocation
  1762 00000703 D006[0500]              reloc	rol byte [findhandle_set], 1	; find handle set ?
  1763                                  internaldatarelocation
  1764 00000707 730A                    	jnc @F				; no -->
  1765 00000709 F616[0500]              reloc	not byte [findhandle_set]
  1766                                  internaldatarelocation
  1767 0000070D B8A171                  	mov ax, 71A1h
  1768 00000710 E86D00                  	extcallcall _doscall		; LFN find close
  1769                                  @@:
  1770 00000713 C3                      	retn
  1771                                  %endif
  1772                                  
  1773                                  
  1774                                  get_es_ext:
  1775 00000714 8E06[0000]              reloc	mov es, word [relocateddata]
  1776                                  linkdatarelocation extdssel
  1777 00000718 E85D00                  	extcallcall ispm
  1778 0000071B 7404                    	jz @F
  1779 0000071D 8E06[0000]              reloc	mov es, word [relocateddata]
  1780                                  linkdatarelocation extseg
  1781                                  @@:
  1782 00000721 C3                      	retn
  1783                                  
  1784                                  
  1785                                  start:
  1786 00000722 8CC3                    	mov bx, es
  1787 00000724 16                      	 push ss
  1788 00000725 07                      	 pop es
  1789 00000726 E8EF00                  	extcallcall skipcomma
  1790 00000729 E8BC00                  	extcallcall iseol?
  1791 0000072C 7409                    	je .help
  1792 0000072E E8EFF8                  	call run
  1793                                  @@:
  1794 00000731 E80B00                  	call uninstall_oneshot
  1795 00000734 31C0                    	xor ax, ax
  1796 00000736 CB                      	retf
  1797                                  
  1798                                  .help:
  1799 00000737 BA[3502]                reloc	mov dx, msg.help
  1800                                  internaldatarelocation
  1801 0000073A E87300                  	extcallcall putsz
  1802 0000073D EBF2                    	jmp @B
  1803                                  
  1804                                  
  1805                                  uninstall_oneshot:
  1806 0000073F 36F606[0000]01          reloc	testopt [ss:relocateddata], 1
  1807                                  linkdatarelocation options7, -3
  1808 00000745 751A                    	jnz @F
  1809                                  
  1810 00000747 2EA1[0200]              reloc	mov ax, word [cs:code + eldiEndCode]
  1811                                  internalcoderelocation
  1812 0000074B 2E2B06[0000]            reloc	sub ax, word [cs:code + eldiStartCode]
  1813                                  internalcoderelocation
  1814 00000750 2906[0000]              reloc	sub word [relocateddata], ax
  1815                                  linkdatarelocation extseg_used
  1816                                  
  1817 00000754 2EA1[0600]              reloc	mov ax, word [cs:code + eldiEndData]
  1818                                  internalcoderelocation
  1819 00000758 2E2B06[0400]            reloc	sub ax, word [cs:code + eldiStartData]
  1820                                  internalcoderelocation
  1821 0000075D 2906[0000]              reloc	sub word [relocateddata], ax
  1822                                  linkdatarelocation extdata_used
  1823                                  @@:
  1824 00000761 C3                      	retn
  1825                                  
  1826                                  
  1827                                  DATAOFFSET equ CODEOFFSET + code_size
  1828                                  	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
  1829                                  %define DATAFIXUP - datastart + 0
  1830                                  datastart:
  1831                                  PUT_ELD_DATETIME
  1832                                  
  1833                                  %if _BOOT
  1834                                  reloc matchfunction:	dw sort_or_display
  1835                                  internalcoderelocation
  1836                                  reloc widecurrent:	dw relocateddata
  1837                                  linkdatarelocation line_out
  1838                                  %endif
  1839 00000000 0000                    meta:			dw 0
  1840 00000002 [A701]                  reloc compare:		dw ..@compare_normal
  1841                                  internalcoderelocation
  1842 00000004 00                      found:			db 0
  1843                                  %ifn _BOOT
  1844 00000005 00                      findhandle_set:		db 0
  1845 00000006 00                      prefersfn:		db 0
  1846                                  %endif
  1847 00000007 00                      wide:			db 0
  1848 00000008 00                      widecounter:		db 0
  1849 00000009 00                      sort:			db 0
  1850                                  %ifn _BOOT
  1851 0000000A 00                      sortlfn:		db 0
  1852                                  %endif
  1853 0000000B 00                      dirfirst:		db 0
  1854 0000000C 00                      date:			db 0
  1855 0000000D 00                      size:			db 0
  1856                                  
  1857                                  msg:
  1858                                  %ifn _BOOT
  1859 0000000E 53464E00                .string_sfn:		asciz "SFN"
  1860                                  %endif
  1861 00000012 5749444500              .string_wide:		asciz "WIDE"
  1862 00000017 534F525400              .string_sort:		asciz "SORT"
  1863 0000001C 444952464952535400      .string_dirfirst:	asciz "DIRFIRST"
  1864 00000025 4441544500              .string_date:		asciz "DATE"
  1865 0000002A 53495A4500              .string_size:		asciz "SIZE"
  1866 0000002F 5245564552534500        .string_reverse:	asciz "REVERSE"
  1867                                  %ifn _BOOT
  1868 00000037 534F52544C464E00        .string_sortlfn:	asciz "SORTLFN"
  1869 0000003F 534F525453464E00        .string_sortsfn:	asciz "SORTSFN"
  1870                                  %endif
  1871                                  %if _DEBUG
  1872 00000047 534F52544445425547-     .string_sortdebug:	asciz "SORTDEBUG"
  1872 00000050 00                 
  1873 00000051 19454C442064617461-     .debug.1:			counted "ELD data block buffer at "
  1873 0000005A 20626C6F636B206275-
  1873 00000063 6666657220617420   
  1874 0000006B 072C2073697A6520        .debug.2:			counted ", size "
  1875 00000073 0A2062797465732C20-     .debug.bytes:			counted " bytes, >="
  1875 0000007C 3E3D               
  1876 0000007E 222053464E20656E74-     .debug.3:			counted " SFN entries",13,10,"Auxiliary buffer at "
  1876 00000087 726965730D0A417578-
  1876 00000090 696C69617279206275-
  1876 00000099 6666657220617420   
  1877                                  %if _BOOT
  1878                                  .debug.5 equ .debug.2
  1879                                  %else
  1880 000000A1 0C3A303030302C2073-     .debug.5:			counted ":0000, size "
  1880 000000AA 697A6520           
  1881                                  %endif
  1882 000000AE 182053464E20656E74-     .debug.6.available:		counted " SFN entries (available)"
  1882 000000B7 726965732028617661-
  1882 000000C0 696C61626C6529     
  1883 000000C7 152053464E20656E74-     .debug.6.inuse:			counted " SFN entries (in use)"
  1883 000000D0 726965732028696E20-
  1883 000000D9 75736529           
  1884 000000DD 4461746120626C6F63-     .debug.larger_data_block:	asciz "Data block chosen because it is larger (above-or-equal size).",13,10
  1884 000000E6 6B2063686F73656E20-
  1884 000000EF 626563617573652069-
  1884 000000F8 74206973206C617267-
  1884 00000101 6572202861626F7665-
  1884 0000010A 2D6F722D657175616C-
  1884 00000113 2073697A65292E0D0A-
  1884 0000011C 00                 
  1885 0000011D 417578696C69617279-     .debug.smaller_data_block:	asciz "Auxiliary buffer chosen because it is larger and available.",13,10
  1885 00000126 206275666665722063-
  1885 0000012F 686F73656E20626563-
  1885 00000138 617573652069742069-
  1885 00000141 73206C617267657220-
  1885 0000014A 616E6420617661696C-
  1885 00000153 61626C652E0D0A00   
  1886                                   %ifn _BOOT
  1887 0000015B 536D616C6C65722064-     .debug.smaller_data_block_forced:asciz "Smaller data block chosen because auxiliary buffer not available.",13,10
  1887 00000164 61746120626C6F636B-
  1887 0000016D 2063686F73656E2062-
  1887 00000176 656361757365206175-
  1887 0000017F 78696C696172792062-
  1887 00000188 7566666572206E6F74-
  1887 00000191 20617661696C61626C-
  1887 0000019A 652E0D0A00         
  1888                                   %endif
  1889                                  %endif
  1890 0000019F 546F6F206C6F6E6720-     .error:			asciz "Too long short name, internal error!",13,10
  1890 000001A8 73686F7274206E616D-
  1890 000001B1 652C20696E7465726E-
  1890 000001BA 616C206572726F7221-
  1890 000001C3 0D0A00             
  1891 000001C6 46696C65206E6F7420-     .error2:		asciz "File not found, internal error!",13,10
  1891 000001CF 666F756E642C20696E-
  1891 000001D8 7465726E616C206572-
  1891 000001E1 726F72210D0A00     
  1892 000001E8 46696C656E616D6573-     .toofull:		asciz "Filenames list does not fit in buffer!",13,10
  1892 000001F1 206C69737420646F65-
  1892 000001FA 73206E6F7420666974-
  1892 00000203 20696E206275666665-
  1892 0000020C 72210D0A00         
  1893 00000211 082020205B4449525D      .dirinsteadsize:	countedb "   [DIR]"
  1894 0000021A 083E32353620546942      .sizetoolarge:		countedb ">256 TiB"
  1895 00000223 46696C65206E6F7420-     .notfound:		db "File not found."
  1895 0000022C 666F756E642E       
  1896 00000232 0D0A00                  .linebreak:		asciz 13,10
  1897 00000235 52756E207769746820-     .help:		db "Run with a pathname as parameter.",13,10
  1897 0000023E 6120706174686E616D-
  1897 00000247 652061732070617261-
  1897 00000250 6D657465722E0D0A   
  1898 00000258 4C61737420636F6D70-     		db "Last component may include wildcards.",13,10
  1898 00000261 6F6E656E74206D6179-
  1898 0000026A 20696E636C75646520-
  1898 00000273 77696C646361726473-
  1898 0000027C 2E0D0A             
  1899 0000027F 0D0A                    		db 13,10
  1900 00000281 416674657220746865-     		db "After the pathname, keywords may follow:",13,10
  1900 0000028A 20706174686E616D65-
  1900 00000293 2C206B6579776F7264-
  1900 0000029C 73206D617920666F6C-
  1900 000002A5 6C6F773A0D0A       
  1901                                  %ifn _BOOT
  1902 000002AB 0953464E0955736520-     		db 9,"SFN",9,"Use DOS SFN search even if LFN available",13,10
  1902 000002B4 444F532053464E2073-
  1902 000002BD 656172636820657665-
  1902 000002C6 6E206966204C464E20-
  1902 000002CF 617661696C61626C65-
  1902 000002D8 0D0A               
  1903 000002DA 095749444509446973-     		db 9,"WIDE",9,"Display in wide mode, up to 5 SFNs per line",13,10
  1903 000002E3 706C617920696E2077-
  1903 000002EC 696465206D6F64652C-
  1903 000002F5 20757020746F203520-
  1903 000002FE 53464E732070657220-
  1903 00000307 6C696E650D0A       
  1904 0000030D 09534F525409536F72-     		db 9,"SORT",9,"Sort filenames, default is SFNs. Must fit in buffer!",13,10
  1904 00000316 742066696C656E616D-
  1904 0000031F 65732C206465666175-
  1904 00000328 6C742069732053464E-
  1904 00000331 732E204D7573742066-
  1904 0000033A 697420696E20627566-
  1904 00000343 666572210D0A       
  1905 00000349 09534F525453464E09-     		db 9,"SORTSFN",9,"Same as SORT, but explicitly sort SFNs",13,10
  1905 00000352 53616D652061732053-
  1905 0000035B 4F52542C2062757420-
  1905 00000364 6578706C696369746C-
  1905 0000036D 7920736F7274205346-
  1905 00000376 4E730D0A           
  1906 0000037A 09534F52544C464E09-     		db 9,"SORTLFN",9,"Sort filenames using their LFNs",13,10
  1906 00000383 536F72742066696C65-
  1906 0000038C 6E616D657320757369-
  1906 00000395 6E6720746865697220-
  1906 0000039E 4C464E730D0A       
  1907                                  %else
  1908                                  		db 9,"WIDE",9,"Display in wide mode, up to 5 SFNs per line",13,10
  1909                                  		db 9,"SORT",9,"Sort filenames. Must fit in buffer!",13,10
  1910                                  %endif
  1911 000003A4 094441544509576865-     		db 9,"DATE",9,"When sorting, sort by date first",13,10
  1911 000003AD 6E20736F7274696E67-
  1911 000003B6 2C20736F7274206279-
  1911 000003BF 206461746520666972-
  1911 000003C8 73740D0A           
  1912 000003CC 0953495A4509576865-     		db 9,"SIZE",9,"When sorting, sort by size first",13,10
  1912 000003D5 6E20736F7274696E67-
  1912 000003DE 2C20736F7274206279-
  1912 000003E7 2073697A6520666972-
  1912 000003F0 73740D0A           
  1913 000003F4 095245564552534509-     		db 9,"REVERSE",9,"When sorting, reverse name/DATE/SIZE sort order",13,10
  1913 000003FD 5768656E20736F7274-
  1913 00000406 696E672C2072657665-
  1913 0000040F 727365206E616D652F-
  1913 00000418 444154452F53495A45-
  1913 00000421 20736F7274206F7264-
  1913 0000042A 65720D0A           
  1914 0000042E 094449524649525354-     		db 9,"DIRFIRST",9,"When sorting, sort directories first",13,10
  1914 00000437 095768656E20736F72-
  1914 00000440 74696E672C20736F72-
  1914 00000449 74206469726563746F-
  1914 00000452 726965732066697273-
  1914 0000045B 740D0A             
  1915 0000045E 00                      		asciz
  1916                                  
  1917                                  uinit_data: equ $
  1918                                  
  1919 0000045F 00                      	align 16, db 0
  1920                                  data_size equ $ - datastart
  1921                                  
  1922                                  	absolute uinit_data
  1923                                  
  1924 0000045F ??                      	alignb 2
  1925                                  %if _BOOT
  1926                                  wild_pattern:	resw 1
  1927                                  %else
  1928 00000460 ????????                originaldta:	resd 1
  1929 00000464 ????                    originalinject:	resw 1
  1930                                  %endif
  1931                                  
  1932 00000466 ????                    sortsegsel:	resw 1
  1933 00000468 ????                    sortstartoffset:resw 1
  1934 0000046A ????                    sortendoffset:	resw 1
  1935 0000046C ????                    sort_last:	resw 1
  1936 0000046E ????                    sort_next:	resw 1
  1937                                  
  1938 00000470 ????                    pathname_start:	resw 1
  1939 00000472 ????                    pathname_length:resw 1
  1940                                  %ifn _BOOT
  1941                                  findnext_function_number:
  1942 00000474 ????                    		resw 1
  1943 00000476 ????                    findhandle:	resw 1
  1944                                  %endif
  1945                                  
  1946                                  buffer:
  1947                                  %ifn _BOOT
  1948 00000478 <res 15h>               dta:		resb 15h
  1949 0000048D ??                      .attrib:	resb 1
  1950 0000048E ????                    .time:		resw 1
  1951 00000490 ????                    .date:		resw 1
  1952 00000492 ????????                .size:		resd 1
  1953 00000496 <res Dh>                .name:		resb 13
  1954                                  %endif
  1955                                  
  1956 000004A3 ??                      	alignb 2
  1957                                  finddata:
  1958 000004A4 ????????                .attrib:	resd 1
  1959 000004A8 <res 10h>               		resq 2
  1960 000004B8 ????                    .time:		resw 1
  1961 000004BA ????                    .date:		resw 1
  1962 000004BC ????????                		resd 1
  1963 000004C0 ????????                .sizehigh:	resd 1
  1964 000004C4 ????????                .sizelow:	resd 1
  1965 000004C8 ????????????????        		resb 8
  1966                                  pathnamebuffer equ $
  1967 000004D0 <res 104h>              .fullname:	resb 260
  1968 000005D4 <res Eh>                .shortname:	resb 14
  1969 000005E2 ??????????              size40bit:	resb 5
  1970                                  
  1971 000005E7 <res 9h>                	alignb 16
  1972                                  uinit_data_end_1:
  1973                                  
  1974                                  	absolute buffer
  1975 00000478 <res 200h>              		resb 512
  1976                                  buffer_end:
  1977                                  
  1978 00000678 ????????????????        	alignb 16
  1979                                  uinit_data_end_2:
  1980                                  
  1981                                  %if uinit_data_end_2 > uinit_data_end_1
  1982                                   uinit_data_end equ uinit_data_end_2
  1983                                  %else
  1984                                   uinit_data_end equ uinit_data_end_1
  1985                                  %endif
  1986                                  
  1987                                  
  1988                                  total_data_size equ uinit_data_end - datastart
  1989                                  %assign _DATA_SIZE total_data_size
  1990                                  
  1991                                  	usesection CODE
  1992                                  
  1993                                  %include "eldlink.asm"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug linker
     4                              <1> 
     5                              <1> Copyright (C) 2008-2025 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    16                              <1> %include "eld.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2025 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef ELD_MAC
    16                              <2> %define ELD_MAC 1
    17                              <2> 
    18                              <2> %include "lmacros3.mac"
    19                              <2> 
    20                              <2> 		; ELD executable header
    21                              <2> 	struc ELD_HEADER
    22                              <2> eldhSignature:		resb 4	; "ELD1"
    23                              <2> 			resb 3	; reserved
    24                              <2> 			resb 1	; 26 (Ctrl-Z)
    25                              <2> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26                              <2> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27                              <2> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28                              <2> eldhDataOffset:		resd 1
    29                              <2> eldhDataImageLength:	resw 1	; (zero allowed)
    30                              <2> eldhDataAllocLength:	resw 1	; (zero allowed)
    31                              <2> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32                              <2> eldhReserved:		resb 4	; reserved
    33                              <2> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <2> 	endstruc
    35                              <2> 	endarea ELD_HEADER, 1
    36                              <2> 
    37                              <2> 	struc ELD_HEADERX
    38                              <2> eldhxHeader:		resb ELD_HEADER_size
    39                              <2> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40                              <2> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41                              <2> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42                              <2> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <2> 	alignb 16
    44                              <2> 	endstruc
    45                              <2> 
    46                              <2> 	struc ELD_TRAILER_HEADER
    47                              <2> eldthSignature:		resb 8	; "ELD1TAIL"
    48                              <2> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <2> 				;  add this dword to the seek offset
    50                              <2> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51                              <2> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <2> 	endstruc
    53                              <2> 	endarea ELD_TRAILER_HEADER, 1
    54                              <2> 
    55                              <2> 	struc ELD_LIBTABLE
    56                              <2> eldltFormat:		resw 1
    57                              <2> 	; 0 = uncompressed
    58                              <2> 	; 2 = heatshrink compressed
    59                              <2> 	; 3 = lzexedat -4 compressed
    60                              <2> 	; 4 = lzexedat -4 -l compressed
    61                              <2> eldltAmount:		resw 1
    62                              <2> eldltOffset:		resd 1	; from eldhxHeader
    63                              <2> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <2> 	endstruc
    65                              <2> 	endarea ELD_LIBTABLE, 1
    66                              <2> 
    67                              <2> 		; ELD instance header
    68                              <2> 	struc ELD_INSTANCE
    69                              <2> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70                              <2> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71                              <2> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72                              <2> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73                              <2> eldiIdentifier:		resb 8	; blank-filled text
    74                              <2> eldiFlags:		resw 1	; flags
    75                              <2> eldiListing_size equ 14
    76                              <2> eldiListing:		resb eldiListing_size
    77                              <2> 				; ASCIZ listing file name
    78                              <2> 	endstruc
    79                              <2> 		; flags for eldiFlags:
    80                              <2> eldifResident:		equ 1
    81                              <2> 
    82                              <2> 		; ELD link info header
    83                              <2> 	struc ELD_LINKINFO
    84                              <2> eldlSignature:		resw 1	; 0E1D1h
    85                              <2> eldlReserved:		resw 2
    86                              <2> eldlUseLinkHash:	resw 1
    87                              <2> eldlDataAmount:		resw 1
    88                              <2> eldlDataPrefixes:	resw 1
    89                              <2> eldlDataEntries:	resw 1
    90                              <2> eldlDataAddresses:	resw 1
    91                              <2> eldlCodeAmount:		resw 1
    92                              <2> eldlCodePrefixes:	resw 1
    93                              <2> eldlCodeEntries:	resw 1
    94                              <2> eldlCodeAddresses:	resw 1
    95                              <2> 	endstruc
    96                              <2> 
    97                              <2> 	numdef ELD_CODE_VSTART, 9001h
    98                              <2> 	numdef ELD_DATA_VSTART, 8000h
    99                              <2> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <2> 
   101                              <2> 	numdef ELD_RECLAIM_HINT, 0
   102                              <2> 	strdef ELD_LISTING, ""
   103                              <2> 	numdef ELD_DATETIME, 0
   104                              <2> 
   105                              <2> %if _ELD_DATETIME
   106                              <2>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <2>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <2> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <2> 		asciz		; for future extension
   110                              <2>  %endmacro
   111                              <2> %else
   112                              <2>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <2>  %define PUT_ELD_DATETIME
   114                              <2> %endif
   115                              <2> 
   116                              <2> %endif
    17                              <1> 
    18                              <1> 	cpu 8086
    19                              <1> 
    20                              <1> %if ELDSTRICT
    21                              <1>  %if ELDSTRICTCOUNTER
    22                              <1>   %error Missing relocation
    23                              <1>  %endif
    24                              <1> %endif
    25                              <1> 	eldstrict off		; linker does some relocations
    26                              <1> 
    27                              <1> %ifn ELDCALLCALL_DUMPED
    28 00000762 90<rep 6h>E8[0000]- <1> 	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
    28 0000076B EB020000C3E8[0000]- <1>
    28 00000773 EB020000C3E8[0000]- <1>
    28 0000077B EB020000C3E8[0000]- <1>
    28 00000783 EB020000C3E8[0000]- <1>
    28 0000078B EB020000C3E8[0000]- <1>
    28 00000793 EB020000C3E8[0000]- <1>
    28 0000079B EB020000C3E8[0000]- <1>
    28 000007A3 EB020000C3E8[0000]- <1>
    28 000007AB EB020000C3E8[0000]- <1>
    28 000007B3 EB020000C3E8[0000]- <1>
    28 000007BB EB020000C3E8[0000]- <1>
    28 000007C3 EB020000C3E8[0000]- <1>
    28 000007CB EB020000C3E8[0000]- <1>
    28 000007D3 EB020000C3E8[0000]- <1>
    28 000007DB EB020000C3E8[0000]- <1>
    28 000007E3 EB020000C3E8[0000]- <1>
    28 000007EB EB020000C3E8[0000]- <1>
    28 000007F3 EB020000C3E8[0000]- <1>
    28 000007FB EB020000C3E8[0000]- <1>
    28 00000803 EB020000C3E8[0000]- <1>
    28 0000080B EB020000C3E8[0000]- <1>
    28 00000813 EB020000C3E8[0000]- <1>
    28 0000081B EB020000C3          <1>
    29                              <1> %endif
    30                              <1> 
    31                              <1> 	numdef ELD_IDENTICALISE, 0
    32                              <1> 	numdef ELD_DEBUG, 0
    33                              <1> 	numdef ELD_LINKER_PASSES, 1
    34                              <1> 	strdef LISTING, _ELD_LISTING
    35                              <1> 	numdef ELDCALL_OPTIONAL, ELDCALL_OPTIONAL_STATUS
    36                              <1> 	numdef ELDDATA_OPTIONAL, ELDDATA_OPTIONAL_STATUS
    37                              <1> %if _ELD_IDENTICALISE
    38                              <1>  ;%assign _ELDCALL_OPTIONAL 1
    39                              <1> %endif
    40                              <1> %ifn _ELDCALL_OPTIONAL
    41                              <1> %assign ELDCALL_OPTIONAL_STATUS 2		; not allowed
    42                              <1> %endif
    43                              <1> ;%ifn _ELDDATA_OPTIONAL
    44                              <1> ;%assign ELDDATA_OPTIONAL_STATUS 2		; not allowed
    45                              <1> ;%endif
    46                              <1> 	gendef MAP, ""
    47                              <1> 
    48                              <1> %ifnidni _MAP, ""
    49                              <1>  [map all _MAP]
    50                              <1> %endif
    51                              <1> 
    52                              <1> 
    53                              <1> endresident: equ ($ + _CURRENT_SECTION %+ FIXUP + 15) & ~15
    54                              <1> 
    55                              <1> %if _ELD_LINKER_PASSES
    56                              <1> %assign ELDLINKER 1
    57                              <1> 
    58                              <1> 	struc LINKTABLE
    59 00000000 ????????            <1> ltCodeToCode:	resw 2
    60 00000004 ????????            <1> ltCodeToData:	resw 2
    61 00000008 ????????            <1> ltDataToCode:	resw 2
    62 0000000C ????????            <1> ltDataToData:	resw 2
    63 00000010 ????????            <1> ltLinkData:	resw 2
    64 00000014 ????????            <1> ltLinkCode:	resw 2
    65                              <1> 	endstruc
    66                              <1> %endif
    67                              <1> 
    68                              <1> 
    69                              <1> linker:
    70                              <1> 		; The first 15 Bytes of the linker should be
    71                              <1> 		;  the same regardless of the linker options
    72                              <1> 		;  used (debug, passes, vstart). This allows
    73                              <1> 		;  the eldcomp ELD to match even if up to 15
    74                              <1> 		;  Bytes of the linker are trailing in the
    75                              <1> 		;  resident part of the ELD.
    76                              <1> 	lframe
    77                              <1>  %if ELDOTHER
    78                              <1> 	lvar dword, linkinfo_other
    79                              <1> 	lvar word, use_hash_other
    80                              <1>  %endif
    81 00000820 5589E5              <1> 	lenter
    82                              <1> 	lvar dword, instance
    83 00000823 06                  <1> 	 push es
    84 00000824 52                  <1> 	 push dx
    85                              <1> 	lvar word, targetsection_low_optional_high
    86 00000825 50                  <1> 	 push ax
    87                              <1> 	lequ ?targetsection_low_optional_high, targetsection
    88                              <1> 	lequ ?targetsection_low_optional_high + 1, optional
    89                              <1> 	lvar dword, linkinfo
    90 00000826 1E                  <1> 	 push ds
    91 00000827 57                  <1> 	 push di
    92                              <1> 	lvar dword, nextreloc
    93 00000828 06                  <1> 	 push es
    94 00000829 52                  <1> 	 push dx
    95                              <1> 	lvar dword, entry
    96 0000082A 06                  <1> 	 push es
    97 0000082B 50                  <1> 	 push ax		; placeholder
    98 0000082C 31C0                <1> 	xor ax, ax
    99 0000082E 813DD1E1            <1> 	cmp word [di + eldlSignature], 0E1D1h
   100                              <1> %if ($ - linker) < 16
   101                              <1>  %error Expected invariant first paragraph of linker
   102                              <1> %endif
   103 00000832 7403E98C02          <1> 	jne .error_j
   104 00000837 837D0601            <1> 	cmp word [di + eldlUseLinkHash], 1
   105 0000083B 7603E98302          <1> 	ja .error_j
   106 00000840 7201                <1> 	jb @F
   107 00000842 48                  <1> 	dec ax
   108                              <1> @@:
   109                              <1> 	lvar word, use_hash
   110 00000843 50                  <1> 	 push ax
   111                              <1> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   112                              <1> 	mov ax, linktable - code
   113                              <1> 	lvar word, lt
   114                              <1> 	 push ax
   115                              <1> %endif
   116                              <1> %if _ELD_LINKER_PASSES || ELDOTHER
   117 00000844 31C0                <1> 	xor ax, ax
   118                              <1>  %if _ELD_LINKER_PASSES
   119                              <1> 	lvar word, pass
   120 00000846 50                  <1> 	 push ax
   121                              <1> 	lvar word, amounterrors
   122 00000847 50                  <1> 	 push ax
   123                              <1> 	lvar word, name
   124 00000848 50                  <1> 	 push ax
   125                              <1>  %endif
   126                              <1>  %if ELDOTHER
   127                              <1> 	lvar word, other
   128                              <1> 	 push ax
   129                              <1>  %endif
   130                              <1> %endif
   131 00000849 56                  <1> 	push si
   132 0000084A 53                  <1> 	push bx
   133                              <1> 
   134                              <1> 			; simple: add instance base (dx) to code
   135 0000084B 06                  <1> 	push es
   136 0000084C 1F                  <1> 	pop ds
   137                              <1> %if _ELD_LINKER_PASSES
   138                              <1> .pass:
   139 0000084D 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   140 00000850 01D3                <1> 	add bx, dx
   141                              <1>  %if _ELD_IDENTICALISE
   142                              <1> 	add bx, word [bp + ?lt]
   143                              <1> 	mov si, word [ltCodeToCode + bx]
   144                              <1>  %else
   145 00000852 8BB7660C            <1> 	mov si, word [linktable - code + ltCodeToCode + bx]
   146                              <1>  %endif
   147                              <1> %else
   148                              <1> 	mov si, internalcodetocoderelocations - code
   149                              <1> %endif
   150 00000856 01D6                <1> 	add si, dx
   151                              <1> @@:
   152 00000858 AD                  <1> 	lodsw
   153 00000859 85C0                <1> 	test ax, ax		; was last ?
   154 0000085B 740B                <1> 	jz @F			; yes -->
   155 0000085D 93                  <1> 	xchg bx, ax		; bx = entry
   156 0000085E 01D3                <1> 	add bx, dx		; relocate the entry itself
   157                              <1> %if _ELD_CODE_VSTART
   158 00000860 812F[0000]          <1> 	sub word [bx], code	; undo adjustment
   159                              <1> %endif
   160 00000864 0117                <1> 	add word [bx], dx	; relocate word referenced by entry
   161 00000866 EBF0                <1> 	jmp @B
   162                              <1> 
   163                              <1> @@:
   164                              <1> 			; next, add heap data base (on stack) to code
   165                              <1> %if _ELD_LINKER_PASSES
   166 00000868 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   167 0000086B 01D3                <1> 	add bx, dx
   168                              <1>  %if _ELD_IDENTICALISE
   169                              <1> 	add bx, word [bp + ?lt]
   170                              <1> 	mov si, word [ltCodeToData + bx]
   171                              <1>  %else
   172 0000086D 8BB76A0C            <1> 	mov si, word [linktable - code + ltCodeToData + bx]
   173                              <1>  %endif
   174                              <1> %else
   175                              <1> 	mov si, internalcodetodatarelocations - code
   176                              <1> %endif
   177 00000871 01D6                <1> 	add si, dx
   178                              <1> @@:
   179 00000873 AD                  <1> 	lodsw
   180 00000874 85C0                <1> 	test ax, ax		; was last ?
   181 00000876 740C                <1> 	jz @F			; yes -->
   182 00000878 93                  <1> 	xchg bx, ax		; bx = entry
   183 00000879 01D3                <1> 	add bx, dx		; relocate the entry itself
   184 0000087B 58                  <1> 	pop ax			; ax -> heap data
   185 0000087C 50                  <1> 	push ax
   186                              <1> %if _ELD_DATA_VSTART
   187 0000087D 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   188                              <1> %endif
   189 00000880 0107                <1> 	add word [bx], ax	; relocate word referenced by entry
   190 00000882 EBEF                <1> 	jmp @B
   191                              <1> 
   192                              <1> @@:
   193                              <1> 
   194                              <1> 			; add instance base (dx) to data
   195                              <1> %if _ELD_LINKER_PASSES
   196 00000884 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   197 00000887 01D3                <1> 	add bx, dx
   198                              <1>  %if _ELD_IDENTICALISE
   199                              <1> 	add bx, word [bp + ?lt]
   200                              <1> 	mov si, word [ltDataToCode + bx]
   201                              <1>  %else
   202 00000889 8BB76E0C            <1> 	mov si, word [linktable - code + ltDataToCode + bx]
   203                              <1>  %endif
   204                              <1> %else
   205                              <1> 	mov si, internaldatatocoderelocations - code
   206                              <1> %endif
   207 0000088D 01D6                <1> 	add si, dx
   208                              <1> @@:
   209 0000088F AD                  <1> 	lodsw
   210 00000890 83F8FF              <1> 	cmp ax, -1		; was last ?
   211 00000893 740F                <1> 	je @F			; yes -->
   212 00000895 93                  <1> 	xchg bx, ax		; bx = entry
   213 00000896 58                  <1> 	pop ax
   214 00000897 50                  <1> 	push ax
   215 00000898 01C3                <1> 	add bx, ax		; relocate the entry itself
   216                              <1> %if _ELD_CODE_VSTART
   217 0000089A 36812F[0000]        <1> 	sub word [ss:bx], code	; undo adjustment
   218                              <1> %endif
   219 0000089F 360117              <1> 	add word [ss:bx], dx	; relocate word referenced by entry
   220 000008A2 EBEB                <1> 	jmp @B
   221                              <1> 
   222                              <1> @@:
   223                              <1> 			; next, add heap data base (on stack) to data
   224                              <1> %if _ELD_LINKER_PASSES
   225 000008A4 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   226 000008A7 01D3                <1> 	add bx, dx
   227                              <1>  %if _ELD_IDENTICALISE
   228                              <1> 	add bx, word [bp + ?lt]
   229                              <1> 	mov si, word [ltDataToData + bx]
   230                              <1>  %else
   231 000008A9 8BB7720C            <1> 	mov si, word [linktable - code + ltDataToData + bx]
   232                              <1>  %endif
   233                              <1> %else
   234                              <1> 	mov si, internaldatatodatarelocations - code
   235                              <1> %endif
   236 000008AD 01D6                <1> 	add si, dx
   237                              <1> @@:
   238 000008AF AD                  <1> 	lodsw
   239 000008B0 83F8FF              <1> 	cmp ax, -1		; was last ?
   240 000008B3 740D                <1> 	je @F			; yes -->
   241 000008B5 93                  <1> 	xchg bx, ax		; bx = entry
   242 000008B6 58                  <1> 	pop ax			; ax -> heap data
   243 000008B7 50                  <1> 	push ax
   244 000008B8 01C3                <1> 	add bx, ax		; relocate the entry itself
   245                              <1> %if _ELD_DATA_VSTART
   246 000008BA 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   247                              <1> %endif
   248 000008BD 360107              <1> 	add word [ss:bx], ax	; relocate word referenced by entry
   249 000008C0 EBED                <1> 	jmp @B
   250                              <1> 
   251                              <1> @@:
   252 000008C2 8B56FC              <1> 	mov dx, word [bp + ?instance]
   253                              <1> %if _ELD_LINKER_PASSES
   254 000008C5 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   255 000008C8 01D3                <1> 	add bx, dx
   256                              <1>  %if _ELD_IDENTICALISE
   257                              <1> 	add bx, word [bp + ?lt]
   258                              <1> 	add dx, word [ltLinkData + bx]
   259                              <1>  %else
   260 000008CA 0397760C            <1> 	add dx, word [linktable - code + ltLinkData + bx]
   261                              <1>  %endif
   262                              <1> %else
   263                              <1> 	add dx, linkerdatarelocations - code
   264                              <1> %endif
   265                              <1> .otherloop:
   266 000008CE 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   267                              <1> 
   268                              <1> .datarelocloop:		; must be done before further relocs
   269 000008D1 C576F2              <1> 	lds si, [bp + ?nextreloc]
   270 000008D4 AD                  <1> 	lodsw			; ax = section indicator
   271 000008D5 85C0                <1> 	test ax, ax		; end of table ?
   272 000008D7 7503E95401          <1> 	jz .donedatareloc
   273 000008DC 48                  <1> 	dec ax			; al = 1 if data, 0 if code
   274 000008DD 5B                  <1> 	pop bx
   275 000008DE 53                  <1> 	push bx			; bx -> ELD data block
   276 000008DF 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   277 000008E2 84C0                <1> 	test al, al		; data ?
   278 000008E4 AD                  <1> 	lodsw
   279 000008E5 7504                <1> 	jnz @F			; yes -->
   280 000008E7 0346FC              <1> 	add ax, word [bp + ?instance]
   281                              <1> 				; relocate entry into code
   282 000008EA A9                  <1> 	db __TEST_IMM16		; (skip add)
   283                              <1> @@:
   284 000008EB 01D8                <1> 	add ax, bx		; relocate entry into data
   285 000008ED 8946EE              <1> 	mov word [bp + ?entry], ax
   286 000008F0 AD                  <1> 	lodsw
   287 000008F1 8976F2              <1> 	mov word [bp + ?nextreloc], si
   288 000008F4 E80D01              <1> 	call .build_match
   289                              <1> %if _ELD_LINKER_PASSES
   290 000008F7 73D8                <1> 	jnc .datarelocloop
   291                              <1> %endif
   292 000008F9 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   293                              <1> %if ELDOTHER
   294                              <1> 	rol byte [bp + ?other], 1
   295                              <1> 	jnc @F
   296                              <1> 	les bx, [bp + ?linkinfo_other]
   297                              <1> @@:
   298                              <1> %endif
   299 000008FC 268B4F08            <1> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   300 00000900 268B7F0A            <1> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   301                              <1> .datarelocfind:
   302 00000904 F2AF                <1> 	repne scasw			; scan initial
   303 00000906 7541                <1> 	jne .datarelocnotfound
   304 00000908 57                  <1> 	push di
   305 00000909 51                  <1> 	push cx
   306 0000090A 56                  <1> 	push si
   307 0000090B 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   308 0000090F 4F                  <1> 	dec di
   309 00000910 4F                  <1> 	dec di				; 0-based
   310 00000911 26037F0C            <1> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   311 00000915 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   312 00000918 B500                <1> 	mov ch, 0
   313 0000091A 8A0C                <1> 	mov cl, byte [si]		; cx = length
   314 0000091C 41                  <1> 	inc cx
   315                              <1> 	; cmp al, al			; ZR if length is zero
   316 0000091D F3A6                <1> 	repe cmpsb			; match ?
   317 0000091F 5E                  <1> 	pop si
   318 00000920 59                  <1> 	pop cx
   319 00000921 5F                  <1> 	pop di
   320 00000922 75E0                <1> 	jne .datarelocfind
   321 00000924 8814                <1> 	mov byte [si], dl
   322 00000926 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   323 0000092A 4F                  <1> 	dec di
   324 0000092B 4F                  <1> 	dec di				; 0-based
   325 0000092C 26037F0E            <1> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   326 00000930 268B05              <1> 	mov ax, word [es:di]
   327 00000933 E80700              <1> 	call .address_data_reloc
   328                              <1> %if _ELD_RELOC_VSTART
   329 00000936 2D[0000]            <1> 	sub ax, relocateddata		; *not* a relocation
   330                              <1> %endif
   331 00000939 0104                <1> 	add word [si], ax		; relocate
   332 0000093B EB94                <1> 	jmp .datarelocloop
   333                              <1> 
   334                              <1> .address_data_reloc:
   335 0000093D C576EE              <1> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   336 00000940 807EFA00            <1> 	cmp byte [bp + ?targetsection], 0
   337                              <1> 					; relocation in code ?
   338 00000944 7402                <1> 	je @F				; yes -->
   339 00000946 16                  <1> 	push ss
   340 00000947 1F                  <1> 	pop ds				; => our ELD data block
   341                              <1> @@:
   342 00000948 C3                  <1> 	retn
   343                              <1> 
   344                              <1> .datarelocnotfound:
   345 00000949 8814                <1> 	mov byte [si], dl
   346 0000094B 807EFB00            <1> 	cmp byte [bp + ?optional], 0
   347                              <1> %if _ELD_DEBUG
   348                              <1> 	jne @F
   349                              <1>  %ifn _ELD_LINKER_PASSES
   350                              <1> 	mov si, 0			; (invalid link)
   351                              <1> linkdatarelocation internalflags6
   352                              <1> 	test si, si
   353                              <1> 	jz .datanotfound
   354                              <1> 	mov si, 0			; (invalid link)
   355                              <1> linkdatarelocation options7
   356                              <1> 	test si, si
   357                              <1> 	jz .datanotfound
   358                              <1>  %else
   359                              <1> 	cmp byte [bp + ?pass], 0
   360                              <1> 	je .datanotfound
   361                              <1>  %endif
   362                              <1> 	houdini
   363                              <1> 	jmp .datanotfound
   364                              <1> @@:
   365                              <1> %else
   366 0000094F 7448                <1> 	je .datanotfound
   367                              <1> %endif
   368                              <1> 
   369                              <1> %if ELDDATA_PMREQUIRED_STATUS
   370                              <1> 	mov si, relocateddata
   371                              <1> linkdatarelocation build_option_PM
   372                              <1> 	test si, si
   373                              <1> 	jz @F
   374                              <1> 	test byte [bp + ?optional], 2
   375                              <1> 	jnz .datanotfound
   376                              <1> @@:
   377                              <1> %endif
   378                              <1> 
   379                              <1> %if _ELD_LINKER_PASSES
   380 00000951 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2
   381                              <1> linkdatarelocation options7, -3
   382 00000957 7406                <1> 	jz @F
   383 00000959 BE[C811]            <1> 	mov si, lmsg.warning_data_optional
   384                              <1> internalcoderelocation
   385 0000095C E85C00              <1> 	call .notfound
   386                              <1> @@:
   387                              <1> %endif
   388 0000095F E8DBFF              <1> 	call .address_data_reloc
   389 00000962 832400              <1> 	and word [si], 0		; indicate optional data link failed
   390 00000965 E969FF              <1> 	jmp .datarelocloop
   391                              <1> 
   392                              <1> 
   393                              <1> %if _ELDCALL_OPTIONAL
   394                              <1> .coderelocnotfound:
   395 00000968 8814                <1> 	mov byte [si], dl
   396 0000096A 807EFB00            <1> 	cmp byte [bp + ?optional], 0
   397                              <1> %if _ELD_DEBUG
   398                              <1> 	jne @F
   399                              <1>  %ifn _ELD_LINKER_PASSES
   400                              <1> 	mov si, 0			; (invalid link)
   401                              <1> linkdatarelocation internalflags6
   402                              <1> 	test si, si
   403                              <1> 	jz .codenotfound
   404                              <1> 	mov si, 0			; (invalid link)
   405                              <1> linkdatarelocation options7
   406                              <1> 	test si, si
   407                              <1> 	jz .codenotfound
   408                              <1>  %else
   409                              <1> 	cmp byte [bp + ?pass], 0
   410                              <1> 	je .codenotfound
   411                              <1>  %endif
   412                              <1> 	houdini
   413                              <1> 	jmp .codenotfound
   414                              <1> @@:
   415                              <1> %else
   416 0000096E 743A                <1> 	je .codenotfound
   417                              <1> %endif
   418                              <1> 
   419                              <1> %if ELDCALL_PMREQUIRED_STATUS
   420                              <1>  %if _ELD_LINKER_PASSES
   421                              <1>   %assign ELDLINKER 0
   422                              <1>  %endif
   423 00000970 BE[0000]            <1> 	mov si, relocateddata
   424                              <1> linkdatarelocation build_option_PM
   425                              <1>  %if _ELD_LINKER_PASSES
   426                              <1>   %assign ELDLINKER 1
   427                              <1>  %endif
   428 00000973 85F6                <1> 	test si, si
   429 00000975 7406                <1> 	jz @F
   430 00000977 F646FB02            <1> 	test byte [bp + ?optional], 2
   431 0000097B 752D                <1> 	jnz .codenotfound
   432                              <1> @@:
   433                              <1> %endif
   434                              <1> 
   435                              <1> %if _ELD_LINKER_PASSES
   436 0000097D 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2
   437                              <1> linkdatarelocation options7, -3
   438 00000983 7406                <1> 	jz @F
   439 00000985 BE[A611]            <1> 	mov si, lmsg.warning_code_optional
   440                              <1> internalcoderelocation
   441 00000988 E83000              <1> 	call .notfound
   442                              <1> @@:
   443                              <1> %endif
   444 0000098B C576EE              <1> 	lds si, [bp + ?entry]
   445 0000098E C7049090            <1> 	mov word [si], 9090h
   446 00000992 C6440290            <1> 	mov byte [si + 2], 90h		; indicate optional code link failed
   447 00000996 E9A600              <1> 	jmp .coderelocloop
   448                              <1> %endif
   449                              <1> 
   450                              <1> 
   451                              <1> %if _ELD_LINKER_PASSES
   452                              <1> .datanotfound:
   453 00000999 BE[EA11]            <1> 	mov si, lmsg.error_data
   454                              <1> internalcoderelocation
   455 0000099C E81C00              <1> 	call .notfound
   456 0000099F 7203E91F01          <1> 	jnc .error_j
   457 000009A4 FF46E8              <1> 	inc word [bp + ?amounterrors]
   458 000009A7 E927FF              <1> 	jmp .datarelocloop
   459                              <1> 
   460                              <1> .codenotfound:
   461 000009AA BE[0312]            <1> 	mov si, lmsg.error_code
   462                              <1> internalcoderelocation
   463 000009AD E80B00              <1> 	call .notfound
   464 000009B0 7203E90E01          <1> 	jnc .error_j
   465 000009B5 FF46E8              <1> 	inc word [bp + ?amounterrors]
   466 000009B8 E98400              <1> 	jmp .coderelocloop
   467                              <1> 
   468                              <1> .notfound:
   469 000009BB 807EEA00            <1> 	cmp byte [bp + ?pass], 0
   470 000009BF 743A                <1> 	je @F				; --> (NC)
   471 000009C1 16                  <1> 	 push ss
   472 000009C2 07                  <1> 	 pop es
   473 000009C3 BF[0000]            <1> 	mov di, relocateddata
   474                              <1> linkdatarelocation line_out
   475 000009C6 E83300              <1> 	call .copy
   476 000009C9 8B76E6              <1> 	mov si, word [bp + ?name]
   477 000009CC AD                  <1> 	lodsw
   478 000009CD E8[0000]EB020000    <1> 	extcall hexword
   479 000009D4 56                  <1> 	push si
   480 000009D5 BE[1C12]            <1> 	mov si, lmsg.error.2
   481                              <1> internalcoderelocation
   482 000009D8 E82100              <1> 	call .copy
   483 000009DB 5E                  <1> 	pop si
   484                              <1> %if _ELD_LINKER_PASSES
   485 000009DC 56                  <1> 	push si
   486 000009DD E81C00              <1> 	call .copy
   487 000009E0 5E                  <1> 	pop si
   488 000009E1 C60400              <1> 	mov byte [si], 0		; mark as failed
   489                              <1> %else
   490                              <1> 	call .copy
   491                              <1> %endif
   492 000009E4 B022                <1> 	mov al, '"'
   493 000009E6 AA                  <1> 	stosb
   494 000009E7 16                  <1> 	 push ss
   495 000009E8 1F                  <1> 	 pop ds
   496 000009E9 E8[0000]EB020000    <1> 	extcall putsline_crlf
   497 000009F0 B8350E              <1> 	mov ax, 0E35h
   498 000009F3 E8[0000]EB020000    <1> 	extcall setrc
   499 000009FA F9                  <1> 	stc				; CY, diagnostic displayed
   500                              <1> @@:
   501 000009FB C3                  <1> 	retn
   502                              <1> 
   503                              <1> .copy:
   504 000009FC E8[0000]EB020000    <1> 	extcall copy_single_counted_string
   505 00000A03 C3                  <1> 	retn
   506                              <1> %else
   507                              <1> .datanotfound: equ .error_j
   508                              <1> .codenotfound: equ .error_j
   509                              <1> %endif
   510                              <1> 
   511                              <1> .build_match:
   512                              <1> %if _ELD_CODE_VSTART
   513 00000A04 2D[0000]            <1> 	sub ax, code
   514                              <1> %endif
   515 00000A07 0346FC              <1> 	add ax, word [bp + ?instance]
   516 00000A0A 96                  <1> 	xchg si, ax
   517                              <1> %if _ELD_LINKER_PASSES
   518 00000A0B 8976E6              <1> 	mov word [bp + ?name], si
   519                              <1> %endif
   520 00000A0E AD                  <1> 	lodsw			; = hash, si -> counted string
   521 00000A0F 8A14                <1> 	mov dl, byte [si]
   522                              <1> %if _ELD_LINKER_PASSES
   523 00000A11 84D2                <1> 	test dl, dl		; marked as already failed ?
   524 00000A13 750A                <1> 	jnz @F
   525 00000A15 837EE800            <1> 	cmp word [bp + ?amounterrors], 0
   526 00000A19 7503E9A500          <1> 	je .error_j
   527 00000A1E C3                  <1> 	retn			; (NC)
   528                              <1> 
   529                              <1> @@:
   530                              <1> %endif
   531                              <1> %if ELDOTHER
   532                              <1> 	rol byte [bp + ?other], 1
   533                              <1> 	jnc @F
   534                              <1> 	rol byte [bp + ?use_hash_other], 1
   535                              <1> 	jmp @FF
   536                              <1> 
   537                              <1> @@:
   538                              <1> %endif
   539 00000A1F D046EC              <1> 	rol byte [bp + ?use_hash], 1
   540                              <1> @@:
   541 00000A22 720A                <1> 	jc @F
   542 00000A24 AC                  <1> 	lodsb
   543 00000A25 91                  <1> 	xchg cx, ax		; cl = length
   544 00000A26 AD                  <1> 	lodsw			; ax = prefix
   545 00000A27 49                  <1> 	dec cx
   546 00000A28 49                  <1> 	dec cx
   547 00000A29 4E                  <1> 	dec si
   548 00000A2A 8A14                <1> 	mov dl, byte [si]
   549 00000A2C 880C                <1> 	mov byte [si], cl	; si -> counted string suffix
   550                              <1> @@:
   551                              <1> %if _ELD_LINKER_PASSES
   552 00000A2E F9                  <1> 	stc			; CY
   553                              <1> %endif
   554 00000A2F C3                  <1> 	retn
   555                              <1> 
   556                              <1> 
   557                              <1> .donedatareloc:
   558                              <1> %if ELDOTHER
   559                              <1> 	rol byte [bp + ?other], 1
   560                              <1> 	jc .otherdone
   561                              <1> %endif
   562                              <1> 
   563 00000A30 8B56FC              <1> 	mov dx, word [bp + ?instance]
   564                              <1> %if _ELD_LINKER_PASSES
   565 00000A33 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   566 00000A36 01D3                <1> 	add bx, dx
   567                              <1>  %if _ELD_IDENTICALISE
   568                              <1> 	add bx, word [bp + ?lt]
   569                              <1> 	add dx, word [ltLinkCode + bx]
   570                              <1>  %else
   571 00000A38 03977A0C            <1> 	add dx, word [linktable - code + ltLinkCode + bx]
   572                              <1>  %endif
   573                              <1> %else
   574                              <1> 	add dx, linkercoderelocations - code
   575                              <1> %endif
   576 00000A3C 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   577                              <1> 
   578                              <1> .coderelocloop:
   579 00000A3F C576F2              <1> 	lds si, [bp + ?nextreloc]
   580 00000A42 AD                  <1> 	lodsw
   581                              <1> %if _ELDCALL_OPTIONAL
   582 00000A43 48                  <1> 	dec ax
   583 00000A44 7903E98C00          <1> 	js .donecodereloc
   584 00000A49 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   585 00000A4C AD                  <1> 	lodsw
   586                              <1> %endif
   587 00000A4D 0346FC              <1> 	add ax, word [bp + ?instance]
   588 00000A50 8946EE              <1> 	mov word [bp + ?entry], ax
   589 00000A53 AD                  <1> 	lodsw
   590 00000A54 8976F2              <1> 	mov word [bp + ?nextreloc], si
   591                              <1> %ifn _ELDCALL_OPTIONAL
   592                              <1> 	test ax, ax
   593                              <1> 	jz .donecodereloc
   594                              <1> %endif
   595 00000A57 E8AAFF              <1> 	call .build_match
   596                              <1> %if _ELD_LINKER_PASSES
   597 00000A5A 73E3                <1> 	jnc .coderelocloop
   598                              <1> %endif
   599 00000A5C C45EF6              <1> 	les bx, [bp + ?linkinfo]
   600 00000A5F 268B4F10            <1> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   601 00000A63 268B7F12            <1> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   602                              <1> .coderelocfind:
   603 00000A67 F2AF                <1> 	repne scasw			; scan initial
   604                              <1> %if _ELDCALL_OPTIONAL
   605 00000A69 7403E9FAFE          <1> 	jne .coderelocnotfound
   606                              <1> %else
   607                              <1>  %if _ELD_DEBUG
   608                              <1> 	je @F
   609                              <1> 	houdini
   610                              <1> 	jmp .codenotfound
   611                              <1> @@:
   612                              <1>  %else
   613                              <1> 	jne .codenotfound
   614                              <1>  %endif
   615                              <1> %endif
   616 00000A6E 57                  <1> 	push di
   617 00000A6F 51                  <1> 	push cx
   618 00000A70 56                  <1> 	push si
   619 00000A71 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   620 00000A75 4F                  <1> 	dec di
   621 00000A76 4F                  <1> 	dec di				; 0-based
   622 00000A77 26037F14            <1> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   623 00000A7B 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   624 00000A7E B500                <1> 	mov ch, 0
   625 00000A80 8A0C                <1> 	mov cl, byte [si]		; cx = length
   626 00000A82 41                  <1> 	inc cx
   627                              <1> 	; cmp al, al			; ZR if length is zero
   628 00000A83 F3A6                <1> 	repe cmpsb			; match ?
   629 00000A85 5E                  <1> 	pop si
   630 00000A86 59                  <1> 	pop cx
   631 00000A87 5F                  <1> 	pop di
   632 00000A88 75DD                <1> 	jne .coderelocfind
   633 00000A8A 8814                <1> 	mov byte [si], dl
   634 00000A8C 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   635 00000A90 4F                  <1> 	dec di
   636 00000A91 4F                  <1> 	dec di				; 0-based
   637 00000A92 01FF                <1> 	add di, di			; quadruple index
   638 00000A94 26037F16            <1> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   639 00000A98 26FF35              <1> 	push word [es:di]
   640 00000A9B C576EE              <1> 	lds si, [bp + ?entry]
   641 00000A9E 8F4405              <1> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   642                              <1> 					;  patch the destination address
   643 00000AA1 803CE8              <1> 	cmp byte [si], 0E8h		; is it as expected ?
   644 00000AA4 751D                <1> 	jne .error_j
   645 00000AA6 268B7D02            <1> 	mov di, word [es:di + 2]
   646 00000AAA BB[0000]            <1> 	mov bx, relocateddata
   647                              <1> linkdatarelocation linkcall_table	; ss:bx -> link call table
   648 00000AAD 36833F01            <1> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   649 00000AB1 7510                <1> 	jne .error_j			; no -->
   650 00000AB3 368B4F02            <1> 	mov cx, word [ss:bx + 2]	; get amount of segments
   651 00000AB7 E30A                <1> 	jcxz .error_j			; none -->
   652                              <1> @@:
   653 00000AB9 83C304              <1> 	add bx, 4			; -> next segment
   654 00000ABC 36393F              <1> 	cmp word [ss:bx], di		; value matches ?
   655 00000ABF 7405                <1> 	je @F				; yes, found -->
   656 00000AC1 E2F6                <1> 	loop @B				; try remaining segments
   657                              <1> .error_j:
   658 00000AC3 E98A00              <1> 	jmp .error
   659                              <1> 
   660                              <1> @@:
   661 00000AC6 368B5F02            <1> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   662                              <1> 		; si + 3 + delta = bx
   663                              <1> 		; delta = bx - si - 3
   664 00000ACA 29F3                <1> 	sub bx, si
   665 00000ACC 83EB03              <1> 	sub bx, 3
   666 00000ACF 895C01              <1> 	mov word [si + 1], bx		; patch the call instruction
   667 00000AD2 E96AFF              <1> 	jmp .coderelocloop
   668                              <1> 
   669                              <1> .donecodereloc:
   670                              <1> %if _ELD_LINKER_PASSES
   671 00000AD5 8B46E8              <1> 	mov ax, word [bp + ?amounterrors]
   672 00000AD8 85C0                <1> 	test ax, ax
   673 00000ADA 75E7                <1> 	jnz .error_j
   674 00000ADC 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   675 00000ADF 85DB                <1> 	test bx, bx
   676 00000AE1 750B                <1> 	jnz @F
   677 00000AE3 43                  <1> 	inc bx
   678 00000AE4 43                  <1> 	inc bx
   679 00000AE5 895EEA              <1> 	mov word [bp + ?pass], bx
   680 00000AE8 8B56FC              <1> 	mov dx, word [bp + ?instance]
   681 00000AEB E95FFD              <1> 	jmp .pass
   682                              <1> 
   683                              <1> @@:
   684                              <1> %endif
   685                              <1> 
   686                              <1> %ifnidni _LISTING, ""
   687                              <1> %assign ELDLINKER 0
   688                              <1> .hint:
   689 00000AEE 16                  <1> 	push ss
   690 00000AEF 1F                  <1> 	pop ds
   691 00000AF0 B02D                <1> 	mov al, 2Dh
   692 00000AF2 E8[0000]EB020000    <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   693                              <1> 					; CHG: ax, dx, bx
   694 00000AF9 7437                <1> 	jz .no_hint
   695                              <1> 
   696 00000AFB 8A26[0000]          <1> 	mov ah, byte [relocateddata]
   697                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   698 00000AFF E85500              <1> 	call plex_check
   699 00000B02 7305                <1> 	jnc @F
   700                              <1> 
   701 00000B04 B4FF                <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   702                              <1> .loop_hint:
   703 00000B06 E84E00              <1> 	call plex_check
   704                              <1> @@:
   705 00000B09 7307                <1> 	jnc .end_hint		; if found --> (NC)
   706 00000B0B 80EC01              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   707 00000B0E 73F6                <1> 	jnc .loop_hint		; try next if we didn't check all yet -->
   708 00000B10 EB20                <1> 	jmp .no_hint
   709                              <1> 
   710                              <1> .end_hint:
   711 00000B12 50                  <1> 	push ax
   712 00000B13 C446FC              <1> 	les ax, [bp + ?instance]
   713 00000B16 BF[080F]            <1> 	mov di, listmsg.hint.offset
   714                              <1> internalcoderelocation
   715 00000B19 E8[0000]EB020000    <1> 	extcall hexword
   716 00000B20 BB[E80E]            <1> 	mov bx, listmsg.hint
   717                              <1> internalcoderelocation
   718 00000B23 368B16[0000]        <1> 	mov dx, [ss:relocateddata]
   719                              <1> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   720 00000B28 58                  <1> 	pop ax
   721 00000B29 B040                <1> 	mov al, 40h		; AMIS message display service
   722 00000B2B E8[0000]EB020000    <1> 	extcall call_int2D
   723                              <1> .no_hint:
   724                              <1> %endif
   725                              <1> 
   726                              <1> %if ELDOTHER
   727                              <1> %assign ELDLINKER 0
   728                              <1> 	not byte [bp + ?other]
   729                              <1> 
   730                              <1> 	push ss
   731                              <1> 	pop ds
   732                              <1> 	mov al, 2Dh
   733                              <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   734                              <1> 					; CHG: ax, dx, bx
   735                              <1> 	jz .no_other
   736                              <1> 
   737                              <1> 	mov ah, byte [relocateddata]
   738                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   739                              <1> 	call plex_check
   740                              <1> 	jnc @F
   741                              <1> 
   742                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   743                              <1> .loop_other:
   744                              <1> 	call plex_check
   745                              <1> @@:
   746                              <1> 	jnc .end_other		; if found --> (NC)
   747                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   748                              <1> 	jnc .loop_other		; try next if we didn't check all yet -->
   749                              <1> 	jmp .no_other
   750                              <1> 
   751                              <1> .end_other:
   752                              <1> 	mov al, 42h		; AMIS get other link info service
   753                              <1> 	extcall call_int2D
   754                              <1> 	cmp al, 0FFh
   755                              <1> 	jne .no_other
   756                              <1> 
   757                              <1> 	mov ax, si		; selector => PSP
   758                              <1> 	extcall ispm
   759                              <1> 	jz @F
   760                              <1> 	mov ax, dx		; segment => PSP
   761                              <1> @@:
   762                              <1> 	 push ss
   763                              <1> 	 pop ds
   764                              <1> 	mov word [otherds], ax
   765                              <1> internaldatarelocation		; current mode sel/seg
   766                              <1> 	mov word [otherseg], dx
   767                              <1> internaldatarelocation		; remember segment
   768                              <1> 
   769                              <1> 	mov ax, cx		; selector => link info
   770                              <1> 	extcall ispm
   771                              <1> 	jz @F
   772                              <1> 	mov ax, bx		; segment => link info
   773                              <1> @@:
   774                              <1> 	mov word [bp + ?linkinfo_other], di
   775                              <1> 	mov word [bp + ?linkinfo_other + 2], ax
   776                              <1> 
   777                              <1> 	mov ds, ax		; => link info
   778                              <1> 	xor ax, ax
   779                              <1> 	cmp word [di + eldlSignature], 0E1D1h
   780                              <1> 	jne .error_other
   781                              <1> 	cmp word [di + eldlUseLinkHash], 1
   782                              <1> 	ja .error_other
   783                              <1> 	jb @F
   784                              <1> 	dec ax
   785                              <1> @@:
   786                              <1> 	mov word [bp + ?use_hash_other], ax
   787                              <1> 
   788                              <1> 	mov dx, word [bp + ?instance]
   789                              <1> 	add dx, linkerotherdatarelocations - code
   790                              <1> 	jmp .otherloop
   791                              <1> 
   792                              <1> .error_other:
   793                              <1> 	push cs
   794                              <1> 	pop ds
   795                              <1> 	mov ax, 0E33h
   796                              <1> 	extcall setrc
   797                              <1> 	mov dx, lmsg.error_other
   798                              <1> internalcoderelocation
   799                              <1> 	jmp @F
   800                              <1> 
   801                              <1> .no_other:
   802                              <1> 	push cs
   803                              <1> 	pop ds
   804                              <1> 	mov ax, 0E34h
   805                              <1> 	extcall setrc
   806                              <1> 	mov dx, lmsg.no_other
   807                              <1> internalcoderelocation
   808                              <1> @@:
   809                              <1> 	extcall putsz
   810                              <1> 	jmp .error
   811                              <1> 
   812                              <1> .otherdone:
   813                              <1> %endif
   814                              <1> 
   815 00000B32 5B                  <1> 	pop bx				; -> our heap data
   816 00000B33 5E                  <1> 	pop si				; -> our command line tail
   817 00000B34 16                  <1> 	 push ss
   818 00000B35 1F                  <1> 	 pop ds
   819 00000B36 C47EFC              <1> 	les di, [bp + ?instance]
   820 00000B39 268B4502            <1> 	mov ax, word [es:di + eldiEndCode]
   821                              <1> houdini
   822 00000B3D 2D[2008]            <1> 	sub ax, strict word endresident + code
   823                              <1> internalcoderelocation
   824 00000B40 26C74502[2008]      <1> 	mov word [es:di + eldiEndCode], endresident + code
   825                              <1> internalcoderelocation
   826 00000B46 2906[0000]          <1> 	sub word [relocateddata], ax
   827                              <1> linkdatarelocation extseg_used
   828                              <1> %if _DATA_SIZE == 0
   829                              <1> 	xor ax, ax
   830                              <1> 	mov word [es:di + eldiStartData], ax
   831                              <1> 	mov word [es:di + eldiEndData], ax
   832                              <1> %endif
   833 00000B4A 89EC5D              <1> 	lleave code
   834                              <1> 		; INP:	es => ELD code segment
   835                              <1> 		;	ds:si -> command line tail
   836                              <1> 		;	ds:bx -> ELD data block
   837                              <1> 		;	ss:sp -> far return address for current mode
   838                              <1> 		; STT:	ds = ss, UP, EI
   839 00000B4D E9D2FB              <1> 	jmp start
   840                              <1> 
   841                              <1> .error:
   842 00000B50 89EC5D              <1> 	lleave
   843 00000B53 B8FFFF              <1> 	mov ax, -1
   844 00000B56 CB                  <1> 	retf
   845                              <1> 
   846                              <1> 
   847                              <1> %ifnidni _LISTING, ""
   848                              <1>  %assign ELDHINT 1
   849                              <1> %else
   850                              <1>  %assign ELDHINT 0
   851                              <1> %endif
   852                              <1> 
   853                              <1> %if ELDOTHER || ELDHINT
   854                              <1> 		; INP:	ah = multiplex number to check
   855                              <1> 		; OUT:	CY if multiplex number unused or no signature match,
   856                              <1> 		;	 bp, ah, ds unmodified
   857                              <1> 		;	NC if match found,
   858                              <1> 		;	 ah = multiplex number (unmodified)
   859                              <1> 		; CHG:	si, di, es, cx, dx
   860                              <1> plex_check:
   861 00000B57 16                  <1> 	push ss
   862 00000B58 1F                  <1> 	pop ds
   863 00000B59 F606[0000]08        <1> 	testopt [relocateddata], 8
   864                              <1> linkdatarelocation internalflags4, -3
   865 00000B5E 740B                <1> 	jz @F
   866 00000B60 BE[0000]            <1> 	mov si, relocateddata
   867                              <1> linkdatarelocation amis_multiplex_number, -2, optional
   868 00000B63 85F6                <1> 	test si, si
   869 00000B65 7404                <1> 	jz @F
   870 00000B67 3A24                <1> 	cmp ah, byte [si]
   871 00000B69 7420                <1> 	je .notfound		; do not use our own multiplexer -->
   872                              <1> @@:
   873 00000B6B B000                <1> 	mov al, 00h		; AMIS installation check
   874 00000B6D E8[0000]EB020000    <1> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
   875 00000B74 3CFF                <1> 	cmp al, 0FFh
   876 00000B76 7513                <1> 	jne .notfound
   877 00000B78 0E                  <1> 	push cs
   878 00000B79 1F                  <1> 	pop ds
   879 00000B7A BE[D80E]            <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   880                              <1> internalcoderelocation
   881 00000B7D E8[0000]EB020000    <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
   882 00000B84 B90800              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
   883 00000B87 F3A7                <1> 	repe cmpsw
   884 00000B89 7401                <1> 	je .checkret		; ZR, NC = match -->
   885                              <1> .notfound:
   886 00000B8B F9                  <1> 	stc			; CY no match
   887                              <1> .checkret:
   888 00000B8C C3                  <1> 	retn
   889                              <1> %endif
   890                              <1> 
   891                              <1> 
   892 00000B8D 00<rep 3h>          <1> 	align 4, db 0
   893                              <1> linkercoderelocations:
   894                              <1> %if _ELDCALL_OPTIONAL
   895 00000B90 01033B00[100F]0103- <1> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   895 00000B98 CF06[100F]0100F806- <1>
   895 00000BA0 [280F]01006807-     <1>
   895 00000BA6 [3A0F]01007007-     <1>
   895 00000BAC [420F]01007807-     <1>
   895 00000BB2 [560F]01008007-     <1>
   895 00000BB8 [5D0F]01008807-     <1>
   895 00000BBE [680F]01009007-     <1>
   895 00000BC4 [780F]01009807-     <1>
   895 00000BCA [840F]0100A007-     <1>
   895 00000BD0 [8F0F]0100A807-     <1>
   895 00000BD6 [960F]0100B007-     <1>
   895 00000BDC [9E0F]0100B807-     <1>
   895 00000BE2 [A60F]0100C007-     <1>
   895 00000BE8 [C30F]0100C807-     <1>
   895 00000BEE [EC0F]0100D007-     <1>
   895 00000BF4 [0110]0100D807-     <1>
   895 00000BFA [0C10]0100E007-     <1>
   895 00000C00 [1C10]0100E807-     <1>
   895 00000C06 [2810]0100F007-     <1>
   895 00000C0C [3110]0100F807-     <1>
   895 00000C12 [3D10]01000008-     <1>
   895 00000C18 [4510]01000808-     <1>
   895 00000C1E [4E10]01001008-     <1>
   895 00000C24 [5810]01001808-     <1>
   895 00000C2A [6210]0100F20A-     <1>
   895 00000C30 [6E10]0100190B-     <1>
   895 00000C36 [4E10]01002B0B-     <1>
   895 00000C3C [7710]01006D0B-     <1>
   895 00000C42 [7710]01007D0B-     <1>
   895 00000C48 [8410]0000          <1>
   896                              <1> %else
   897                              <1> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
   898                              <1> %endif
   899                              <1> 
   900                              <1> %if _ELD_LINKER_PASSES
   901                              <1> linkerlinkercoderelocations:
   902                              <1> %if _ELDCALL_OPTIONAL
   903 00000C4C 0100CD09[4E10]0100- <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   903 00000C54 E909[0C10]0100F309- <1>
   903 00000C5C [960F]0100FC09-     <1>
   903 00000C62 [A60F]0000          <1>
   904                              <1> %else
   905                              <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   906                              <1> %endif
   907                              <1> 
   908                              <1> 	align 2, db 0
   909                              <1> linktable:
   910                              <1> 	istruc LINKTABLE
   911                              <1> at ltCodeToCode
   912 00000C66 C60E                <1> 	dw internallinkercodetocoderelocations - code
   913 00000C68 340D                <1> 	dw internalcodetocoderelocations - code
   914                              <1> at ltCodeToData
   915 00000C6A D20E                <1> 	dw internallinkercodetodatarelocations - code
   916 00000C6C 540D                <1> 	dw internalcodetodatarelocations - code
   917                              <1> at ltDataToCode
   918 00000C6E D40E                <1> 	dw internallinkerdatatocoderelocations - code
   919 00000C70 A60E                <1> 	dw internaldatatocoderelocations - code
   920                              <1> at ltDataToData
   921 00000C72 D60E                <1> 	dw internallinkerdatatodatarelocations - code
   922 00000C74 AA0E                <1> 	dw internaldatatodatarelocations - code
   923                              <1> at ltLinkData
   924 00000C76 AC0E                <1> 	dw linkerlinkerdatarelocations - code
   925 00000C78 7E0C                <1> 	dw linkerdatarelocations - code
   926                              <1> at ltLinkCode
   927 00000C7A 4C0C                <1> 	dw linkerlinkercoderelocations - code
   928 00000C7C 900B                <1> 	dw linkercoderelocations - code
   929                              <1> 	iend
   930                              <1> %endif
   931                              <1> 
   932                              <1> 	align 2, db 0
   933                              <1> linkerdatarelocations:
   934 00000C7E 01005300[8F10]0100- <1> 	dw LINK_DATA_RELOCATIONS, 0
   934 00000C86 5A00[8F10]01007900- <1>
   934 00000C8E [A410]01007D00-     <1>
   934 00000C94 [B310]01008100-     <1>
   934 00000C9A [C210]01008C00-     <1>
   934 00000CA0 [D910]01009E00-     <1>
   934 00000CA6 [B310]0100B200-     <1>
   934 00000CAC [EA10]0100D300-     <1>
   934 00000CB2 [FD10]0100A802-     <1>
   934 00000CB8 [FD10]0100D603-     <1>
   934 00000CBE [FD10]01000004-     <1>
   934 00000CC4 [FD10]01003006-     <1>
   934 00000CCA [FD10]01004706-     <1>
   934 00000CD0 [A410]01004B06-     <1>
   934 00000CD6 [B310]01004F06-     <1>
   934 00000CDC [C210]01006F06-     <1>
   934 00000CE2 [D910]01007806-     <1>
   934 00000CE8 [EA10]01008C06-     <1>
   934 00000CEE [D910]01001607-     <1>
   934 00000CF4 [0811]01001F07-     <1>
   934 00000CFA [1311]01004207-     <1>
   934 00000D00 [1C11]01005207-     <1>
   934 00000D06 [2711]01005F07-     <1>
   934 00000D0C [B310]01007109-     <1>
   934 00000D12 [3511]0100FD0A-     <1>
   934 00000D18 [5811]0100260B-     <1>
   934 00000D1E [1311]0100480B-     <1>
   934 00000D24 [2711]01005B0B-     <1>
   934 00000D2A [7D11]0101610B-     <1>
   934 00000D30 [8E11]0000          <1>
   935                              <1> 
   936                              <1> 	align 2, db 0
   937                              <1> internalcodetocoderelocations:
   938 00000D34 5C0064009A00A200FA- <1> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
   938 00000D3D 05EF0649074E075607- <1>
   938 00000D46 5B07170B210B3E0B44- <1>
   938 00000D4F 0B7B0B0000          <1>
   939                              <1> 
   940                              <1> 	align 2, db 0
   941                              <1> internalcodetodatarelocations:
   942 00000D54 2D004C00500056006A- <1> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
   942 00000D5D 007400A700B900BD00- <1>
   942 00000D66 C100C500C800D700E8- <1>
   942 00000D6F 00ED00030110011901- <1>
   942 00000D78 220126012C0137013C- <1>
   942 00000D81 014B01500159016201- <1>
   942 00000D8A 6701700179018401A1- <1>
   942 00000D93 01AE01BD01C501D601- <1>
   942 00000D9C DA01DE01E901EE01F3- <1>
   942 00000DA5 01F801FF0104020802- <1>
   942 00000DAE 12021902230227022E- <1>
   942 00000DB7 023C02420248025302- <1>
   942 00000DC0 62026A0272027E02A5- <1>
   942 00000DC9 02AD02B102BC02C402- <1>
   942 00000DD2 C802CE02D402FA02FD- <1>
   942 00000DDB 0213031F0325032803- <1>
   942 00000DE4 2B032E033103340337- <1>
   942 00000DED 033A033D0340034503- <1>
   942 00000DF6 48034C034F0358035C- <1>
   942 00000DFF 03600368036B036E03- <1>
   942 00000E08 710375037C03830387- <1>
   942 00000E11 038B039803A003B503- <1>
   942 00000E1A C303C903CD03DA03E4- <1>
   942 00000E23 033304670470047604- <1>
   942 00000E2C 7C0480048304930497- <1>
   942 00000E35 0402050F0515052205- <1>
   942 00000E3E 300534054B054F0555- <1>
   942 00000E47 056E05740579057E05- <1>
   942 00000E50 840589058F0594059D- <1>
   942 00000E59 05A305AC05B205BB05- <1>
   942 00000E62 C105CA05D005D905DF- <1>
   942 00000E6B 05E805EF05F8050006- <1>
   942 00000E74 09060F0618061E0633- <1>
   942 00000E7D 06410652065E066406- <1>
   942 00000E86 6B0675067F06880692- <1>
   942 00000E8F 06A606B406C006CB06- <1>
   942 00000E98 DC06E706010705070B- <1>
   942 00000EA1 0738070000          <1>
   943                              <1> 
   944                              <1> 	align 2, db 0
   945                              <1> internaldatatocoderelocations:
   946 00000EA6 0200FFFF            <1> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
   947                              <1> 
   948                              <1> 	align 2, db 0
   949                              <1> internaldatatodatarelocations:
   950 00000EAA FFFF                <1> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
   951                              <1> 
   952                              <1> %if _ELD_LINKER_PASSES
   953                              <1> 	align 2, db 0
   954                              <1> linkerlinkerdatarelocations:
   955 00000EAC 01005409[1C11]0100- <1> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
   955 00000EB4 8009[1C11]0100C409- <1>
   955 00000EBC [FD10]0100AB0A-     <1>
   955 00000EC2 [4711]0000          <1>
   956                              <1> 
   957                              <1> 	align 2, db 0
   958                              <1> internallinkercodetocoderelocations:
   959 00000EC6 5A0986099A09AB09D6- <1> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
   959 00000ECF 090000              <1>
   960                              <1> 
   961                              <1> 	align 2, db 0
   962                              <1> internallinkercodetodatarelocations:
   963 00000ED2 0000                <1> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
   964                              <1> 
   965                              <1> 	align 2, db 0
   966                              <1> internallinkerdatatocoderelocations:
   967 00000ED4 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
   968                              <1> 
   969                              <1> 	align 2, db 0
   970                              <1> internallinkerdatatodatarelocations:
   971 00000ED6 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
   972                              <1> %endif
   973                              <1> 
   974                              <1> %if ELDOTHER
   975                              <1> 	align 2, db 0
   976                              <1> linkerotherdatarelocations:
   977                              <1> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
   978                              <1> 
   979                              <1>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
   980                              <1>   %error Other linker data links not supported
   981                              <1>  %endif
   982                              <1> %endif
   983                              <1> 
   984                              <1> %if ELDOTHER || ELDHINT
   985                              <1> 	align 2, db 0
   986                              <1> debuggeramissig:
   987 00000ED8 65636D20<rep 5h>    <1> 		fill 8, 32, db "ecm"
   988 00000EE0 6C446562756720-     <1> 		fill 8, 32, db "lDebug"
   988 00000EE0 <rep 2h>            <1>
   989                              <1> %endif
   990                              <1> 
   991                              <1> %ifnidni _LISTING, ""
   992                              <1> listmsg:
   993 00000EE8 547261634C6973742D- <1> .hint:		db "TracList-add-offset=",_LISTING,"::"
   993 00000EF1 6164642D6F66667365- <1>
   993 00000EFA 743D646F736469722E- <1>
   993 00000F03 6C73743A3A          <1>
   994 00000F08 2D2D2D2D680D0A00    <1> .hint.offset:	asciz "----h",13,10
   995                              <1> %endif
   996                              <1> 
   997 00000F10 2C9A15696E7463616C- <1> 	eldcall_dump_names ELDCALL_CODE_NAMES
   997 00000F19 6C5F6578745F726574- <1>
   997 00000F22 75726E5F657322580F- <1>
   997 00000F2B 636D64335F6E6F745F- <1>
   997 00000F34 696E6A656374629605- <1>
   997 00000F3D 496E444F530C211179- <1>
   997 00000F46 795F646F735F706172- <1>
   997 00000F4F 73655F6E616D652890- <1>
   997 00000F58 046973706D6831085F- <1>
   997 00000F61 646F7363616C6C1CE3- <1>
   997 00000F6A 0D67756172645F6175- <1>
   997 00000F73 7862756666F1230975- <1>
   997 00000F7C 707065726361736567- <1>
   997 00000F85 B1087472696D707574- <1>
   997 00000F8E 73BABD04636D6433B2- <1>
   997 00000F97 120573657472635512- <1>
   997 00000FA0 05707574737AD0BB1A- <1>
   997 00000FA9 636F70795F73696E67- <1>
   997 00000FB2 6C655F636F756E7465- <1>
   997 00000FBB 645F737472696E67AB- <1>
   997 00000FC4 FF26646973705F6478- <1>
   997 00000FCD 61785F74696D65735F- <1>
   997 00000FD6 63785F77696474685F- <1>
   997 00000FDF 62785F73697A652E73- <1>
   997 00000FE8 746F726503AA126465- <1>
   997 00000FF1 635F64776F72645F6D- <1>
   997 00000FFA 696E7769647468398C- <1>
   997 00001003 08707574736C696E65- <1>
   997 0000100C 6FA20D707574736C69- <1>
   997 00001015 6E655F63726C66A455- <1>
   997 0000101E 09736B6970636F6D6D- <1>
   997 00001027 30E83A066973656F6C- <1>
   997 00001030 3F03C3096973737472- <1>
   997 00001039 696E673FA7AA056572- <1>
   997 00001042 726F72DDB90663686B- <1>
   997 0000104B 656F6C848107686578- <1>
   997 00001054 776F7264EBA6076465- <1>
   997 0000105D 63776F7264D5550973- <1>
   997 00001066 6B6970636F6D6D6198- <1>
   997 0000106F 6906696E7463686B21- <1>
   997 00001078 300A63616C6C5F696E- <1>
   997 00001081 743244B77408736574- <1>
   997 0000108A 6573326478          <1>
   998 0000108F 3B26126578745F696E- <1> 	link_data_dump_names LINK_DATA_NAMES
   998 00001098 6A6563745F68616E64- <1>
   998 000010A1 6C6572F6340C657874- <1>
   998 000010AA 646174615F73697A65- <1>
   998 000010B3 B2400C657874646174- <1>
   998 000010BC 615F75736564B0B214- <1>
   998 000010C5 617578627566665F63- <1>
   998 000010CE 757272656E745F7369- <1>
   998 000010D7 7A65CA510E696E7465- <1>
   998 000010E0 726E616C666C616773- <1>
   998 000010E9 338B00106175786275- <1>
   998 000010F2 66665F7365676F7273- <1>
   998 000010FB 656C84E3086C696E65- <1>
   998 00001104 5F6F7574EB42086578- <1>
   998 0000110D 74647373656CD52D06- <1>
   998 00001116 6578747365675ABC08- <1>
   998 0000111F 6F7074696F6E7337E7- <1>
   998 00001128 D30B6578747365675F- <1>
   998 00001131 7573656455030F6275- <1>
   998 0000113A 696C645F6F7074696F- <1>
   998 00001143 6E5F504D68440E6C69- <1>
   998 0000114C 6E6B63616C6C5F7461- <1>
   998 00001155 626C65F09E22747279- <1>
   998 0000115E 5F6465627567676572- <1>
   998 00001167 5F616D69735F6D756C- <1>
   998 00001170 7469706C65785F6E75- <1>
   998 00001179 6D626572CB510E696E- <1>
   998 00001182 7465726E616C666C61- <1>
   998 0000118B 677334688C15616D69- <1>
   998 00001194 735F6D756C7469706C- <1>
   998 0000119D 65785F6E756D626572  <1>
   999                              <1> %if ELDOTHER
  1000                              <1> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1001                              <1> %endif
  1002                              <1> 
  1003                              <1> lmsg:
  1004                              <1> %if _ELD_LINKER_PASSES
  1005                              <1> %if _ELDCALL_OPTIONAL
  1006 000011A6 214F7074696F6E616C- <1> .warning_code_optional:		counted "Optional code link missing, hash="
  1006 000011AF 20636F6465206C696E- <1>
  1006 000011B8 6B206D697373696E67- <1>
  1006 000011C1 2C20686173683D      <1>
  1007                              <1> %endif
  1008 000011C8 214F7074696F6E616C- <1> .warning_data_optional:		counted "Optional data link missing, hash="
  1008 000011D1 2064617461206C696E- <1>
  1008 000011DA 6B206D697373696E67- <1>
  1008 000011E3 2C20686173683D      <1>
  1009 000011EA 1844617461206C696E- <1> .error_data:			counted "Data link missing, hash="
  1009 000011F3 6B206D697373696E67- <1>
  1009 000011FC 2C20686173683D      <1>
  1010 00001203 18436F6465206C696E- <1> .error_code:			counted "Code link missing, hash="
  1010 0000120C 6B206D697373696E67- <1>
  1010 00001215 2C20686173683D      <1>
  1011 0000121C 0A682C206C6162656C- <1> .error.2:			counted "h, label ",'"'
  1011 00001225 2022                <1>
  1012                              <1> %endif
  1013                              <1> %if ELDOTHER
  1014                              <1> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1015                              <1> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1016                              <1> %endif
  1017                              <1> 
  1018 00001227 00<rep 9h>          <1> 	align 16, db 0
  1994                                  
  1995                                  	align 16
  1996                                  code_size equ $ - code
