     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                                  
     8                                  %assign _BOOT 1
     9                                  
    10                                  %include "dosdir.asm"
     1                              <1> 
     2                              <1> ; Public Domain
     3                              <1> 
     4                              <1> ; test run command: *.com; .; .
     5                              <1> 
     6                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
     7                              <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"
     1                              <3> [list -]
    19                              <2> 
    20                              <2> 		; ELD executable header
    21                              <2> 	struc ELD_HEADER
    22 00000000 ????????            <2> eldhSignature:		resb 4	; "ELD1"
    23 00000004 ??????              <2> 			resb 3	; reserved
    24 00000007 ??                  <2> 			resb 1	; 26 (Ctrl-Z)
    25 00000008 ????????            <2> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26 0000000C ????                <2> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27 0000000E ????                <2> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28 00000010 ????????            <2> eldhDataOffset:		resd 1
    29 00000014 ????                <2> eldhDataImageLength:	resw 1	; (zero allowed)
    30 00000016 ????                <2> eldhDataAllocLength:	resw 1	; (zero allowed)
    31 00000018 ????                <2> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32 0000001A ????????            <2> eldhReserved:		resb 4	; reserved
    33 0000001E ????                <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 00000000 <res 20h>           <2> eldhxHeader:		resb ELD_HEADER_size
    39 00000020 ????????            <2> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40 00000024 ????????            <2> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41 00000028 ????????            <2> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42 0000002C ????????            <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 00000000 ????????????????    <2> eldthSignature:		resb 8	; "ELD1TAIL"
    48 00000008 ????????            <2> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <2> 				;  add this dword to the seek offset
    50 0000000C ????                <2> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51 0000000E ????                <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 00000000 ????                <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 00000002 ????                <2> eldltAmount:		resw 1
    62 00000004 ????????            <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 00000000 ????                <2> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70 00000002 ????                <2> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71 00000004 ????                <2> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72 00000006 ????                <2> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73 00000008 ????????????????    <2> eldiIdentifier:		resb 8	; blank-filled text
    74 00000010 ????                <2> eldiFlags:		resw 1	; flags
    75                              <2> eldiListing_size equ 14
    76 00000012 <res Eh>            <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 00000000 ????                <2> eldlSignature:		resw 1	; 0E1D1h
    85 00000002 ????????            <2> eldlReserved:		resw 2
    86 00000006 ????                <2> eldlUseLinkHash:	resw 1
    87 00000008 ????                <2> eldlDataAmount:		resw 1
    88 0000000A ????                <2> eldlDataPrefixes:	resw 1
    89 0000000C ????                <2> eldlDataEntries:	resw 1
    90 0000000E ????                <2> eldlDataAddresses:	resw 1
    91 00000010 ????                <2> eldlCodeAmount:		resw 1
    92 00000012 ????                <2> eldlCodePrefixes:	resw 1
    93 00000014 ????                <2> eldlCodeEntries:	resw 1
    94 00000016 ????                <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
     8                              <1> %include "eldcall.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug call 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 ELDCALL_MAC
    16                              <2> %define ELDCALL_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 "elddata.mac"
     1                              <3> %if 0
     2                              <3> 
     3                              <3> Extensions for lDebug data relocation macros
     4                              <3> 
     5                              <3> Copyright (C) 2008-2024 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 ELDDATA_MAC
    16                              <3> %define ELDDATA_MAC 1
    17                              <3> 
    18                              <3> %include "lmacros3.mac"
     1                              <4> [list -]
    19                              <3> %include "nasmhash.mac"
     1                              <4> 
     2                              <4> %if 0
     3                              <4> 
     4                              <4> Hashing macros
     5                              <4>  by E. C. Masloch, 2019
     6                              <4> 
     7                              <4> Usage of the works is permitted provided that this
     8                              <4> instrument is retained with the works, so that any entity
     9                              <4> that uses the works is notified of this instrument.
    10                              <4> 
    11                              <4> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <4> 
    13                              <4> %endif
    14                              <4> 
    15                              <4> %ifndef __NASMHASH_MAC__
    16                              <4> %assign __NASMHASH_MAC__ 1
    17                              <4> 
    18                              <4> 
    19                              <4> 	%macro hashdef 2+.nolist
    20                              <4> %ifempty %2
    21                              <4>  %assign _%1 1
    22                              <4> %else
    23                              <4> %ifstr %2
    24                              <4>  %define %%string %2
    25                              <4> %elifid %2
    26                              <4>  %defstr %%string %2
    27                              <4> %elifnum %2
    28                              <4>  %defstr %%string %2
    29                              <4> %eliftok %2
    30                              <4>  %defstr %%string %2
    31                              <4> %else
    32                              <4>  %error Unknown input
    33                              <4> %endif
    34                              <4> %strlen %%length %%string
    35                              <4> %assign %%hash 1
    36                              <4> %assign %%index 1
    37                              <4> %rep %%length
    38                              <4>  %substr %%char %%string %%index
    39                              <4>  %assign %%hash (%%hash * 31 + %%char) & 0FFFFh
    40                              <4>  %assign %%index %%index + 1
    41                              <4> %endrep
    42                              <4> %assign _%1 %%hash
    43                              <4> %endif
    44                              <4> 	%endmacro
    45                              <4> 
    46                              <4> 
    47                              <4> %endif
    20                              <3> %include "eldcheck.mac"
     1                              <4> %if 0
     2                              <4> 
     3                              <4> Extensions for lDebug relocation check macros
     4                              <4> 
     5                              <4> Copyright (C) 2008-2023 E. C. Masloch
     6                              <4> 
     7                              <4> Usage of the works is permitted provided that this
     8                              <4> instrument is retained with the works, so that any entity
     9                              <4> that uses the works is notified of this instrument.
    10                              <4> 
    11                              <4> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <4> 
    13                              <4> %endif
    14                              <4> 
    15                              <4> %ifndef ELDCHECK_MAC
    16                              <4> %define ELDCHECK_MAC 1
    17                              <4> 
    18                              <4> %assign ELDSTRICT 0
    19                              <4> %assign ELDSTRICTCOUNTER 0
    20                              <4> 
    21                              <4> 	%imacro eldstrict 1.nolist
    22                              <4> %ifidni %1, on
    23                              <4>  %assign ELDSTRICT 1
    24                              <4>  [warning +error=reloc-abs]
    25                              <4>  [warning +reloc-abs]
    26                              <4> %elifidni %1, off
    27                              <4>  %assign ELDSTRICT 0
    28                              <4>  [warning -reloc-abs]
    29                              <4> %else
    30                              <4>  %error Unknown keyword
    31                              <4> %endif
    32                              <4> 	%endmacro
    33                              <4> 
    34                              <4> 	%imacro reloc 1+.nolist
    35                              <4> %if ELDSTRICT
    36                              <4>  %if ELDSTRICTCOUNTER
    37                              <4>   %error Missing relocation
    38                              <4>  %endif
    39                              <4>  [warning -reloc-abs]
    40                              <4>  %assign ELDSTRICTCOUNTER 1
    41                              <4> %endif
    42                              <4> %1
    43                              <4> 	%endmacro
    44                              <4> 
    45                              <4> 	%imacro reloc2 1+.nolist
    46                              <4> %if ELDSTRICT
    47                              <4>  %if ELDSTRICTCOUNTER
    48                              <4>   %error Missing relocation
    49                              <4>  %endif
    50                              <4>  [warning -reloc-abs]
    51                              <4>  %assign ELDSTRICTCOUNTER 2
    52                              <4> %endif
    53                              <4> %1
    54                              <4> 	%endmacro
    55                              <4> 
    56                              <4> 	%imacro eldstrictcheck 0.nolist
    57                              <4> %if ELDSTRICT
    58                              <4>  %ifn ELDSTRICTCOUNTER
    59                              <4>   %error Unexpected relocation
    60                              <4>  %else
    61                              <4>   %assign ELDSTRICTCOUNTER ELDSTRICTCOUNTER - 1
    62                              <4>   %ifn ELDSTRICTCOUNTER
    63                              <4>    [warning +reloc-abs]
    64                              <4>   %endif
    65                              <4>  %endif
    66                              <4> %endif
    67                              <4> 	%endmacro
    68                              <4> 
    69                              <4> %endif
    70                              <4> 
    21                              <3> 
    22                              <3> 
    23                              <3> %assign ELDLINKER 0
    24                              <3> 
    25                              <3> %define INTERNAL_CODE_TO_CODE_RELOCATIONS ""
    26                              <3> %define INTERNAL_CODE_TO_DATA_RELOCATIONS ""
    27                              <3> %define INTERNAL_DATA_TO_CODE_RELOCATIONS ""
    28                              <3> %define INTERNAL_DATA_TO_DATA_RELOCATIONS ""
    29                              <3> %define INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS ""
    30                              <3> %define INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS ""
    31                              <3> %define INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS ""
    32                              <3> %define INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS ""
    33                              <3> %assign ELDDATA_OPTIONAL_STATUS 0		; not any seen yet
    34                              <3> %assign ELDDATA_PMREQUIRED_STATUS 0		; not any seen yet
    35                              <3> 
    36                              <3> 	%imacro internalcoderelocation 0-1.nolist -2
    37                              <3> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    38                              <3> %if ELDLINKER
    39                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    40                              <3>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    41                              <3>  %else
    42                              <3>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    43                              <3>  %endif
    44                              <3> %else
    45                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    46                              <3>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    47                              <3>  %else
    48                              <3>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    49                              <3>  %endif
    50                              <3> %endif
    51                              <3> 	eldstrictcheck
    52                              <3> 	%endmacro
    53                              <3> 
    54                              <3> 	%imacro internaldatarelocation 0-1.nolist -2
    55                              <3> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    56                              <3> %if ELDLINKER
    57                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    58                              <3>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    59                              <3>  %else
    60                              <3>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    61                              <3>  %endif
    62                              <3> %else
    63                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    64                              <3>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    65                              <3>  %else
    66                              <3>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    67                              <3>  %endif
    68                              <3> %endif
    69                              <3> 	eldstrictcheck
    70                              <3> 	%endmacro
    71                              <3> 
    72                              <3> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    73                              <3> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    74                              <3> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    75                              <3> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    76                              <3> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    77                              <3> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    78                              <3> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    79                              <3> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    80                              <3> 
    81                              <3> 
    82                              <3> %define LINK_DATA_RELOCATIONS ""
    83                              <3> %define LINK_LINKER_DATA_RELOCATIONS ""
    84                              <3> %define LINK_DATA_NAMES db ""
    85                              <3> %define LINK_DATA_DETECTION none, none
    86                              <3> 
    87                              <3> %define LINK_OTHER_DATA_RELOCATIONS ""
    88                              <3> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    89                              <3> %define LINK_OTHER_DATA_NAMES db ""
    90                              <3> %define LINK_OTHER_DATA_DETECTION none, none
    91                              <3> 
    92                              <3> %ifndef ELDOTHER
    93                              <3>  %assign ELDOTHER 0
    94                              <3> %endif
    95                              <3> %assign ELDOTHERLINK 0
    96                              <3> 
    97                              <3> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
    98                              <3> %if ELDOTHER
    99                              <3>  %assign ELDOTHERLINK 1
   100                              <3> %endif
   101                              <3> 	linkdatarelocation %1, %2, %3
   102                              <3> %assign ELDOTHERLINK 0
   103                              <3> 	%endmacro
   104                              <3> 
   105                              <3> 	%imacro linkdatarelocation 1-3.nolist -2, required
   106                              <3> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   107                              <3> %ifidni %3, required
   108                              <3>  %assign %%optional 0
   109                              <3> %elifidni %3, optional
   110                              <3>  %assign %%optional 100h
   111                              <3>  %if ELDDATA_OPTIONAL_STATUS == 0
   112                              <3>   %assign ELDDATA_OPTIONAL_STATUS 1
   113                              <3>  %elif ELDDATA_OPTIONAL_STATUS == 1
   114                              <3>  %else
   115                              <3>   %error Optional data link not allowed here
   116                              <3>  %endif
   117                              <3> %elifidni %3, PM required
   118                              <3>  %assign %%optional 300h
   119                              <3>  %assign ELDDATA_PMREQUIRED_STATUS 1
   120                              <3>  %if ELDDATA_OPTIONAL_STATUS == 0
   121                              <3>   %assign ELDDATA_OPTIONAL_STATUS 1
   122                              <3>  %elif ELDDATA_OPTIONAL_STATUS == 1
   123                              <3>  %else
   124                              <3>   %error Optional data link not allowed here
   125                              <3>  %endif
   126                              <3> %else
   127                              <3>  %fatal Unknown optional keyword
   128                              <3> %endif
   129                              <3> %ifidni _CURRENT_SECTION_TYPE, DATA
   130                              <3>  %assign %%DATASECTION 1
   131                              <3> %else
   132                              <3>  %assign %%DATASECTION 0
   133                              <3> %endif
   134                              <3> 	%if ELDOTHERLINK
   135                              <3> %if ELDLINKER
   136                              <3>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   137                              <3> %else
   138                              <3>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   139                              <3> %endif
   140                              <3> 	%else
   141                              <3> %if ELDLINKER
   142                              <3>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   143                              <3> %else
   144                              <3>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   145                              <3> %endif
   146                              <3> 	%endif
   147                              <3> %defstr %%string %1
   148                              <3> %strlen %%length %%string
   149                              <3> %if %%length > 64
   150                              <3>  %error Too long link name: %1
   151                              <3> %endif
   152                              <3> %define LINK_DATA_CHECK %1
   153                              <3> 	%if ELDOTHERLINK
   154                              <3> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   155                              <3> %if LINK_DATA_NEW
   156                              <3>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   157                              <3> 	hashdef HASH, %%string
   158                              <3>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   160                              <3> %else
   161                              <3>  %%name equ LINK_DATA_DUPLICATE
   162                              <3> %endif
   163                              <3> 	%else
   164                              <3> 	linkdata_detect LINK_DATA_DETECTION
   165                              <3> %if LINK_DATA_NEW
   166                              <3>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   167                              <3> 	hashdef HASH, %%string
   168                              <3>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   170                              <3> %else
   171                              <3>  %%name equ LINK_DATA_DUPLICATE
   172                              <3> %endif
   173                              <3> 	%endif
   174                              <3> 	eldstrictcheck
   175                              <3> 	%endmacro
   176                              <3> 
   177                              <3> 	%imacro linkdata_detect 2-*.nolist
   178                              <3> %assign LINK_DATA_NEW 1
   179                              <3> %rep (%0 - 2) / 2
   180                              <3>  %rotate 2
   181                              <3>  %ifidni %1, LINK_DATA_CHECK
   182                              <3>   %assign LINK_DATA_NEW 0
   183                              <3>   %xdefine LINK_DATA_DUPLICATE %2
   184                              <3>   %exitrep
   185                              <3>  %endif
   186                              <3> %endrep
   187                              <3> 	%endmacro
   188                              <3> 
   189                              <3> 	%imacro link_data_dump_names 1-*.nolist
   190                              <3> %rep %0
   191                              <3> 	%1
   192                              <3>  %rotate 1
   193                              <3> %endrep
   194                              <3> 	%endmacro
   195                              <3> 
   196                              <3> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   197                              <3> ; dw LINK_DATA_RELOCATIONS, 0, 0
   198                              <3> ; link_data_dump_names ELDCALL_CODE_NAMES
   199                              <3> 
   200                              <3> %endif
    21                              <2> 
    22                              <2> %assign ELDLINKER 0
    23                              <2> 
    24                              <2> [section relocatedzero nobits vstart=0]
    25                              <2> relocatedzero:
    26                              <2> __SECT__
    27                              <2> 
    28                              <2> 	numdef HOUDINI, 1
    29                              <2> 	numdef HOUDINI_CONDITIONAL, 1
    30                              <2> 
    31                              <2> %imacro houdini 0.nolist
    32                              <2> %if _HOUDINI
    33                              <2>  %if _HOUDINI_CONDITIONAL
    34                              <2> reloc	testopt [ss:relocateddata], 100h
    35                              <2> linkdatarelocation options7, -3
    36                              <2> 	jz %%skip
    37                              <2>  %endif
    38                              <2> reloc	testopt [ss:relocateddata], 100h
    39                              <2> linkdatarelocation internalflags6, -3
    40                              <2> 	jz %%skip
    41                              <2> 	int3
    42                              <2> %%skip:
    43                              <2> %endif
    44                              <2> %endmacro
    45                              <2> 
    46                              <2> %define ELDCALL_CODE_RELOCATIONS ""
    47                              <2> %define ELDCALL_LINKER_CODE_RELOCATIONS ""
    48                              <2> %define ELDCALL_CODE_RELOCATIONS_OPTIONAL ""
    49                              <2> %define ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ""
    50                              <2> %define ELDCALL_CODE_NAMES db ""
    51                              <2> %define ELDCALL_CODE_DETECTION none, none
    52                              <2> %assign ELDCALL_OPTIONAL_STATUS 0		; not any seen yet
    53                              <2> %assign ELDCALL_PMREQUIRED_STATUS 0		; not any seen yet
    54                              <2> 
    55                              <2> 	%imacro extcall 1-2.nolist required
    56                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
    57                              <2>  %error "ELD call cannot be used in ELD data block"
    58                              <2> %endif
    59                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP
    60                              <2> %ifidni %2, required
    61                              <2>  %assign %%optional 0
    62                              <2> %elifidni %2, optional
    63                              <2>  %assign %%optional 100h
    64                              <2>  %if ELDCALL_OPTIONAL_STATUS == 0
    65                              <2>   %assign ELDCALL_OPTIONAL_STATUS 1
    66                              <2>  %elif ELDCALL_OPTIONAL_STATUS == 1
    67                              <2>  %else
    68                              <2>   %error Optional code link not allowed here
    69                              <2>  %endif
    70                              <2> %elifidni %2, PM required
    71                              <2>  %assign %%optional 300h
    72                              <2>  %assign ELDCALL_PMREQUIRED_STATUS 1
    73                              <2>  %if ELDCALL_OPTIONAL_STATUS == 0
    74                              <2>   %assign ELDCALL_OPTIONAL_STATUS 1
    75                              <2>  %elif ELDCALL_OPTIONAL_STATUS == 1
    76                              <2>  %else
    77                              <2>   %error Optional code link not allowed here
    78                              <2>  %endif
    79                              <2> %else
    80                              <2>  %fatal Unknown optional keyword
    81                              <2> %endif
    82                              <2> %if 0
    83                              <2> [warning -reloc-rel-word]
    84                              <2> 	call near relocatedzero
    85                              <2> [warning +reloc-rel-word]
    86                              <2> %else
    87                              <2> 	db 0E8h
    88                              <2> reloc	dw relocatedzero
    89                              <2> 	eldstrictcheck
    90                              <2> %endif
    91                              <2> 	jmp strict short %%skipparameter
    92                              <2> 	dw 0
    93                              <2> %%skipparameter:
    94                              <2> %if ELDLINKER
    95                              <2>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS ELDCALL_LINKER_CODE_RELOCATIONS, %%entry, %%name
    96                              <2>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
    97                              <2> %else
    98                              <2>  %xdefine ELDCALL_CODE_RELOCATIONS ELDCALL_CODE_RELOCATIONS, %%entry, %%name
    99                              <2>  %xdefine ELDCALL_CODE_RELOCATIONS_OPTIONAL ELDCALL_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
   100                              <2> %endif
   101                              <2> %defstr %%string %1
   102                              <2> %strlen %%length %%string
   103                              <2> %if %%length > 64
   104                              <2>  %error Too long link name: %1
   105                              <2> %endif
   106                              <2> %define ELDCALL_CODE_CHECK %1
   107                              <2> 	linkcode_detect ELDCALL_CODE_DETECTION
   108                              <2> %if ELDCALL_CODE_NEW
   109                              <2>  %xdefine ELDCALL_CODE_DETECTION ELDCALL_CODE_DETECTION, %1, %%name
   110                              <2> 	hashdef HASH, %%string
   111                              <2> %xdefine ELDCALL_CODE_NAMES 	ELDCALL_CODE_NAMES, %%name:, dw _HASH, {counted %%string}
   113                              <2> %else
   114                              <2>  %%name equ ELDCALL_CODE_DUPLICATE
   115                              <2> %endif
   116                              <2> 	%endmacro
   117                              <2> 
   118                              <2> 	%imacro linkcode_detect 2-*.nolist
   119                              <2> %assign ELDCALL_CODE_NEW 1
   120                              <2> %rep (%0 - 2) / 2
   121                              <2>  %rotate 2
   122                              <2>  %ifidni %1, ELDCALL_CODE_CHECK
   123                              <2>   %assign ELDCALL_CODE_NEW 0
   124                              <2>   %xdefine ELDCALL_CODE_DUPLICATE %2
   125                              <2>   %exitrep
   126                              <2>  %endif
   127                              <2> %endrep
   128                              <2> 	%endmacro
   129                              <2> 
   130                              <2> 
   131                              <2> %define ELDCALL_CALLCALL_LIST none
   132                              <2> 
   133                              <2> 	%imacro extcallcall 1.nolist
   134                              <2> 	call %1
   135                              <2> %xdefine ELDCALL_CALLCALL_LIST ELDCALL_CALLCALL_LIST, %1
   136                              <2> 	%endmacro
   137                              <2> 
   138                              <2> %assign ELDCALLCALL_DUMPED 0
   139                              <2> 
   140                              <2> 	%imacro eldcall_dump_callcall 1-*.nolist
   141                              <2> %define ELDCALL_CALLCALL_PROCESSED none
   142                              <2>  %rep %0 - 1
   143                              <2>   %rotate 1
   144                              <2>   %define ELDCALL_CHECK %1
   145                              <2> 	eldcall_callcall_detect ELDCALL_CALLCALL_PROCESSED
   146                              <2>   %if ELDCALL_NEW
   147                              <2>    %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED, %1
   148                              <2> 	align 8, nop
   149                              <2> %1:
   150                              <2> 	extcall %1
   151                              <2> 	retn
   152                              <2>   %endif
   153                              <2>  %endrep
   154                              <2> %unimacro extcallcall 1.nolist
   155                              <2> %assign ELDCALLCALL_DUMPED 1
   156                              <2> %define ELDCALL_CALLCALL_LIST none
   157                              <2> 	%endmacro
   158                              <2> 
   159                              <2> 	%imacro eldcall_callcall_detect 1-*.nolist
   160                              <2> %assign ELDCALL_NEW 1
   161                              <2> %rep %0 - 1
   162                              <2>  %rotate 1
   163                              <2>  %ifidni %1, ELDCALL_CHECK
   164                              <2>   %assign ELDCALL_NEW 0
   165                              <2>   %exitrep
   166                              <2>  %endif
   167                              <2> %endrep
   168                              <2> 	%endmacro
   169                              <2> 
   170                              <2> 	%imacro eldcall_dump_names 1-*.nolist
   171                              <2> %rep %0
   172                              <2> 	%1
   173                              <2>  %rotate 1
   174                              <2> %endrep
   175                              <2> 	%endmacro
   176                              <2> 
   177                              <2> ; eldcall_dump_callcall ELDCALL_CALLCALL_LIST
   178                              <2> ; if using optional code links:
   179                              <2> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   180                              <2> ;  dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   181                              <2> ; if not using optional code links:
   182                              <2> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   183                              <2> ;  dw ELDCALL_CODE_RELOCATIONS, 0, 0
   184                              <2> ; eldcall_dump_names ELDCALL_CODE_NAMES
   185                              <2> 
   186                              <2> %endif
     9                              <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"
    19                              <2> %include "nasmhash.mac"
    20                              <2> %include "eldcheck.mac"
    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
    10                              <1> 
    11                              <1> 	numdef DEBUG, 1
    12                              <1> 	numdef BOOT, 0
    13                              <1> 
    14                              <1> %assign _CATCHINT0C 0
    15                              <1> %assign _CATCHINT0D 0
    16                              <1> %assign _CATCHINTFAULTCOND 0
    17                              <1> %assign _DEBUG_COND 1
    18                              <1> %assign _DELAY_BEFORE_BP 0
    19                              <1> %assign _DHIGHLIGHT 0
    20                              <1> %assign _GETLINEHIGHLIGHT 0
    21                              <1> %assign _IMMASM 0
    22                              <1> %assign _INPUT_FILE_BOOT 0
    23                              <1> %assign _INPUT_FILE_HANDLES 0
    24                              <1> %assign _MS_0RANGE_COMPAT 0
    25                              <1> %assign _PM 0
    26                              <1> %assign _RH 0
    27                              <1> %assign _SYMBOLIC 0
    28                              <1> %assign _VXCHG 0
    29                              <1> %include "options.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> lDebug options and internal flags
     5                              <2> 
     6                              <2> Copyright (C) 2008-2023 E. C. Masloch
     7                              <2> 
     8                              <2> Usage of the works is permitted provided that this
     9                              <2> instrument is retained with the works, so that any entity
    10                              <2> that uses the works is notified of this instrument.
    11                              <2> 
    12                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <2> 
    14                              <2> %endif
    15                              <2> 
    16                              <2> 
    17                              <2> dispregs32	equ	  1	; RX: 32-bit register display (R, T/P/G)
    18                              <2> traceints	equ	  2	; TM: trace into interrupts (T)
    19                              <2> cpdepchars	equ	  4	; allow dumping of CP-dependent characters (D, DX)
    20                              <2> fakeindos	equ	  8	; always assume InDOS flag non-zero (all)
    21                              <2> nonpagingdevice	equ	 10h	; disallow paged output with [more] prompt (all exc. P, T)
    22                              <2> 	; This option was never used anywhere:
    23                              <2> ; pagingdevice	equ	 20h	; allow paged output with [more] prompt (all exc. P, T)
    24                              <2> 				; paged output is by default on if the output device is StdOut, else off
    25                              <2> hexrn		equ	 40h	; display raw hexadecimal content of FPU registers (RN)
    26                              <2> ;novdd		equ	 80h	; don't use a registered NTVDM VDD (L, W)
    27                              <2> nondospaging	equ	100h	; paging: don't use DOS for input when waiting for a key
    28                              <2> opt1_86mnohlt	equ	200h	; (86 Mode:) HLT doesn't work, don't use it
    29                              <2> biosidles	equ	400h	; don't idle with HLT or Int2F.1680, only call BIOS Int16.00
    30                              <2> opt_usegetinput	equ	800h	; use getinput for int 21h interactive input
    31                              <2> use_si_units	equ    1000h	; in disp_*_size use SI units (kB = 1000, etc)
    32                              <2> use_jedec_units	equ    2000h	; in disp_*_size use JEDEC units (kB = 1024)
    33                              <2> enable_serial	equ    4000h	; enable serial I/O (preferred over DOS or BIOS terminal)
    34                              <2> int8_disable_serial equ	   8000h	; disable serial I/O when breaking due to intr8
    35                              <2> gg_do_not_skip_bp equ	 1_0000h	; gg: do not skip a breakpoint (bb or gg)
    36                              <2> gg_no_autorepeat equ	 2_0000h	; gg: do not auto-repeat
    37                              <2> tp_do_not_skip_bp equ	 4_0000h	; T/TP/P: do not skip a (bb) breakpoint
    38                              <2> gg_bb_hit_no_repeat equ	 8_0000h	; gg: do not auto-repeat after bb hit
    39                              <2> tp_bb_hit_no_repeat equ	10_0000h	; T/TP/P: do not auto-repeat after bb hit
    40                              <2> gg_unexpected_no_repeat equ 20_0000h	; gg: do not auto-repeat after unexpectedinterrupt
    41                              <2> tp_unexpected_no_repeat equ 40_0000h	; T/TP/P
    42                              <2> ss_no_dump:		equ 80_0000h
    43                              <2> %if _SYMBOLIC
    44                              <2> dd_no_blanks_sym:	equ 100_0000h
    45                              <2> zz_no_pm_xms:		equ 200_0000h
    46                              <2> %endif
    47                              <2> rr_disasm_no_rept:	equ 1000_0000h
    48                              <2> rr_disasm_no_show:	equ 2000_0000h
    49                              <2> opt_cmdline_quiet_input:equ 4000_0000h
    50                              <2> opt_cmdline_quiet_output:equ 8000_0000h
    51                              <2> %if _SYMBOLIC
    52                              <2> DEFAULTOPTIONS	equ zz_no_pm_xms
    53                              <2> %else
    54                              <2> DEFAULTOPTIONS	equ 0
    55                              <2> %endif
    56                              <2> 
    57                              <2> 
    58                              <2> opt2_db_header:		equ 1
    59                              <2> opt2_db_trailer:	equ 2
    60                              <2> opt2_dw_header:		equ 10h
    61                              <2> opt2_dw_trailer:	equ 20h
    62                              <2> opt2_dd_header:		equ 100h
    63                              <2> opt2_dd_trailer:	equ 200h
    64                              <2> opt2_getinput_dpmi:	equ 800h
    65                              <2> opt2_hh_compat:		equ 1000h
    66                              <2> opt2_getc_idle:		equ 2000h
    67                              <2> opt2_getc_idle_dpmi:	equ 4000h
    68                              <2> opt2_re_cancel_tpg:	equ 8000h
    69                              <2> opt2_nn_compat:		equ 1_0000h
    70                              <2> opt2_nn_capitalise:	equ 2_0000h
    71                              <2> %if _MS_0RANGE_COMPAT
    72                              <2> opt2_0range_compat:	equ 4_0000h
    73                              <2> %endif
    74                              <2> opt2_rr16_compat:	equ 8_0000h
    75                              <2> opt2_r_prompt_compat:	equ 10_0000h
    76                              <2> opt2_r_separate:	equ 20_0000h
    77                              <2> opt2_r_linebreak_always:equ 40_0000h
    78                              <2> opt2_dpminohlt:		equ 8000_0000h	; DPMI doesn't like hlt
    79                              <2> DEFAULTOPTIONS2	equ opt2_dw_header | opt2_dd_header | opt2_getc_idle_dpmi | opt2_dpminohlt
    80                              <2> 
    81                              <2> 
    82                              <2> opt3_tt_no_paging:	equ 1
    83                              <2> opt3_tp_no_paging:	equ 2
    84                              <2> opt3_pp_no_paging:	equ 4
    85                              <2> opt3_gg_no_paging:	equ 8
    86                              <2> opt3_silence_paging_set:equ 100h
    87                              <2> opt3_silence_paging_on:	equ 200h
    88                              <2> opt3_paging_rc:		equ 1000h
    89                              <2> opt3_paging_yy:		equ 2000h
    90                              <2> opt3_paging_re:		equ 4000h
    91                              <2> opt3_r_highlight_diff:	equ 10000h
    92                              <2> opt3_r_highlight_dumb:	equ 20000h
    93                              <2> opt3_r_highlight_full:	equ 40000h
    94                              <2> opt3_r_highlight_eip:	equ 80000h
    95                              <2> %if _PM
    96                              <2> opt3_ss_b_bit_set:	equ   10_0000h
    97                              <2>  %if _BREAK_INSTALLDPMI
    98                              <2> opt3_break_installdpmi:	equ   20_0000h
    99                              <2>  %endif
   100                              <2> %endif
   101                              <2> %if _DHIGHLIGHT
   102                              <2> opt3_d_highlight:	equ   80_0000h
   103                              <2> %endif
   104                              <2> %if _GETLINEHIGHLIGHT
   105                              <2> opt3_getline_highlight:	equ  100_0000h
   106                              <2> %endif
   107                              <2> opt3_no_idle_2F:	equ  200_0000h
   108                              <2> %if _DELAY_BEFORE_BP
   109                              <2> opt3_delay_before_bp:	equ  400_0000h
   110                              <2> %endif
   111                              <2> opt3_no_call_amis:	equ  800_0000h
   112                              <2> opt3_disable_autorepeat:equ 1000_0000h
   113                              <2> opt3_check_ctrlc_keyb:	equ 2000_0000h
   114                              <2> opt3_check_ctrlc_0bh:	equ 4000_0000h
   115                              <2> opt3_tsr_quit_leave_tf:	equ 8000_0000h
   116                              <2> 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                              <2> 
   120                              <2> 
   121                              <2> opt4_int_2F_hook:	equ 2
   122                              <2> opt4_int_08_hook:	equ 4
   123                              <2> opt4_int_2D_hook:	equ 8
   124                              <2> %if _CATCHINTFAULTCOND
   125                              <2> opt4_int_fault_hook:	equ 10h
   126                              <2> %endif
   127                              <2> opt4_int_serial_force:	equ 1_0000h
   128                              <2> opt4_int_2F_force:	equ 2_0000h
   129                              <2> opt4_int_08_force:	equ 4_0000h
   130                              <2> opt4_int_2D_force:	equ 8_0000h
   131                              <2> %if _CATCHINT0D
   132                              <2> opt4_int_0D_force:	equ   10_0000h
   133                              <2> %endif
   134                              <2> %if _CATCHINT0C
   135                              <2> opt4_int_0C_force:	equ   20_0000h
   136                              <2> %endif
   137                              <2> opt4_int_00_force:	equ  100_0000h
   138                              <2> opt4_int_01_force:	equ  200_0000h
   139                              <2> opt4_int_03_force:	equ  400_0000h
   140                              <2> opt4_int_06_force:	equ  800_0000h
   141                              <2> opt4_int_18_force:	equ 1000_0000h
   142                              <2> opt4_int_19_force:	equ 2000_0000h
   143                              <2> opt4_int_09_force:	equ 4000_0000h	; not used at the same time as 15h
   144                              <2> opt4_int_15_force:	equ 4000_0000h	; not used at the same time as 09h
   145                              <2> opt4_int_07_force:	equ 8000_0000h
   146                              <2> DEFAULTOPTIONS4 equ opt4_int_2F_hook
   147                              <2> 
   148                              <2> 
   149                              <2> %if _VXCHG
   150                              <2> opt6_vv_mode:		equ 1
   151                              <2> opt6_vv_keep:		equ 2
   152                              <2> opt6_vv_int16:		equ 10h
   153                              <2>  %if _VXCHG_DEFAULT_ON
   154                              <2> DEFAULTOPTIONS6 equ opt6_share_serial_irq | opt6_vv_mode
   155                              <2>  %else
   156                              <2> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   157                              <2>  %endif
   158                              <2> %else
   159                              <2> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   160                              <2> %endif
   161                              <2> %if _DEBUG
   162                              <2> opt6_debug_exception_late:	equ  20h
   163                              <2> opt6_debug_exception_early:	equ  40h
   164                              <2>  %if _DEBUG_COND
   165                              <2> opt6_debug_exception:	equ  80h
   166                              <2> opt6_debug_mode:	equ 100h
   167                              <2>  %endif
   168                              <2> %endif
   169                              <2> opt6_bios_output:	equ 200h
   170                              <2> opt6_flat_binary:	equ 400h
   171                              <2> opt6_big_stack:		equ 800h
   172                              <2> opt6_40_columns:	equ 1000h
   173                              <2> opt6_40_indent_odd:	equ 2000h
   174                              <2> opt6_40_dash:		equ 4000h
   175                              <2> opt6_share_serial_irq:	equ 1_0000h
   176                              <2> opt6_serial_EOI_call:	equ 2_0000h
   177                              <2> %if _RH
   178                              <2> opt6_rh_mode:		equ 10_0000h
   179                              <2> %endif
   180                              <2> %if _DEBUG
   181                              <2> opt6_debug_putrunint_early:	equ  40_0000h
   182                              <2>  %if _DEBUG_COND
   183                              <2> opt6_debug_putrunint:		equ  80_0000h
   184                              <2>  %endif
   185                              <2> %endif
   186                              <2> opt6_bios_io:		equ 100_0000h
   187                              <2> opt6_immasm_display_uu:	equ 200_0000h
   188                              <2> opt6_immasm_debug:	equ 400_0000h
   189                              <2> opt6_immasm_flag:	equ 800_0000h
   190                              <2> opt6_immasm_nobranch:	equ 1000_0000h
   191                              <2> opt6_r_flags_style2:	equ 2000_0000h
   192                              <2> opt6_r_flags_style3:	equ 4000_0000h
   193                              <2> opt6_r_linebreak_conditional:	equ 8000_0000h
   194                              <2> 
   195                              <2> 
   196                              <2> DEFAULTOPTIONS7 equ opt7_no_tsr_ll
   197                              <2> opt7_no_free_oneshot_eld:	equ 1
   198                              <2> opt7_debug_optional_link:	equ 2
   199                              <2> opt7_quiet_install:		equ 4
   200                              <2> opt7_quick_run:			equ 8
   201                              <2> opt7_houdini:			equ 100h
   202                              <2> opt7_no_ensure:			equ 1000h
   203                              <2> opt7_no_tsr_ll:			equ 2000h
   204                              <2> 
   205                              <2> 
   206                              <2> oldpacket	equ	  1	; Int25/Int26 packet method available (L, W)
   207                              <2> newpacket	equ	  2	; Int21.7305 packet method available (L, W)
   208                              <2> ntpacket	equ	  4	; VDD registered and usable (L, W)
   209                              <2> pagedcommand	equ	  8	; allows paging in puts
   210                              <2> notstdinput	equ	 10h	; DEBUG's StdIn isn't a device with StdIn bit (is file or other device)
   211                              <2> inputfile	equ	 20h	; DEBUG's StdIn is a file, notstdinput also set
   212                              <2> notstdoutput	equ	 40h	; DEBUG's StdOut isn't a device with StdOut bit (is file or other device)
   213                              <2> outputfile	equ	  80h	; DEBUG's StdOut is a file, notstdoutput also set
   214                              <2> hooked2F	equ	 100h	; Int2F hooked
   215                              <2> nohook2F	equ	 200h	; don't hook Int2F.1687 (required for Win9x, DosEmu?)
   216                              <2> unused_dif1_dpminohlt equ 400h	; DPMI doesn't like hlt
   217                              <2> protectedmode	equ	 800h	; in (DPMI) protected mode
   218                              <2> debuggeeA20	equ	1000h	; state of debuggee's A20
   219                              <2> debuggerA20	equ	2000h	; state of debugger's A20 (will be on if possible)
   220                              <2> nodosloaded	equ	4000h	; No DOS loaded currently (Boot loader mode)
   221                              <2> has386		equ	8000h	; CPU is a 386
   222                              <2> usecharcounter	equ    1_0000h	; don't reset charcounter between calls to puts
   223                              <2> runningnt	equ    2_0000h	; running in NTVDM
   224                              <2> canswitchmode	equ    4_0000h	; can switch modes (auxbuff large enough, DPMI mode switch set up)
   225                              <2> modeswitched	equ    8_0000h	; switched mode (now in the mode that we weren't entered in)
   226                              <2> promptwaiting	equ   10_0000h	; puts: any more output needs to display a prompt first
   227                              <2> switchbuffer	equ   20_0000h	; mode switch needs a buffer (auxbuff)
   228                              <2> tsrmode		equ   40_0000h	; in TSR mode; DPI and DPP not valid
   229                              <2> attachedterm	equ   80_0000h	; the attached process terminated
   230                              <2> runningdosemu	equ  100_0000h	; running in dosemu
   231                              <2> ; load_is_ldp	equ  200_0000h	; boot load: partition specified as "ldp"
   232                              <2> tt_while:	equ  400_0000h	; tt: while condition specified
   233                              <2> tt_p:		equ  800_0000h	; tt: proceed past repeated string instructions
   234                              <2> tt_silent_mode:	equ 1000_0000h	; tt: run should be silent (dump at end)
   235                              <2> tt_silence:	equ 2000_0000h	; tt: silent writing (write to auxbuff instead)
   236                              <2> tt_no_bb:	equ 4000_0000h	; tt: do not use bb breakpoints
   237                              <2> tt_no_bb_first:	equ 8000_0000h	; tt: do not use bb breakpoints at first
   238                              <2> 
   239                              <2> 
   240                              <2> dif2_gg_is_first:	equ   1
   241                              <2> dif2_gg_skip_non_cseip:	equ   2
   242                              <2> dif2_gg_skip_cseip:	equ   4
   243                              <2> dif2_gg_is_gg:		equ   8
   244                              <2> dif2_gg_first_detected:	equ  10h
   245                              <2> dif2_gg_again:		equ  20h
   246                              <2> dif2_tpg_proceed_bp_set:equ  40h
   247                              <2> dif2_tpg_keep_proceed_bp: equ 80h
   248                              <2> dif2_tpg_have_bp:	equ 100h
   249                              <2> dif2_tpg_adjusted_cseip:equ 200h
   250                              <2> dif2_tpg_do_not_adjust:	equ 400h
   251                              <2> dif2_bp_failure:	equ 800h
   252                              <2> dif2_is_pp:		equ 1000h
   253                              <2> %if _SYMBOLIC
   254                              <2> dif2_createdprocess:	equ 800_0000h	; created empty debuggee process
   255                              <2> dif2_sym_req_xms:	equ 2000h
   256                              <2> dif2_sym_req_86mm:	equ 4000h
   257                              <2> dif2_sym_req_mask equ dif2_sym_req_86mm | dif2_sym_req_xms
   258                              <2> dif2_no_pm_xms:		equ 1_0000h
   259                              <2> dif2_xms_detection_done:equ 2_0000h
   260                              <2> %endif
   261                              <2> %if _INPUT_FILE_HANDLES
   262                              <2> dif2_input_file:	equ 10_0000h
   263                              <2> dif2_closed_input_file:	equ 20_0000h
   264                              <2> %endif
   265                              <2> dif2_did_getline_file:	equ 40_0000h
   266                              <2> %if _SYMBOLIC
   267                              <2> dif2_poison:		equ 80_0000h
   268                              <2> %endif
   269                              <2> dif2_boot_loaded_kernel:equ 100_0000h
   270                              <2> %if _INPUT_FILE_BOOT
   271                              <2> dif2_input_file_boot:	equ 200_0000h
   272                              <2> dif2_closed_input_file_boot:	equ 400_0000h
   273                              <2> %endif
   274                              <2> dif2_in_silence_dump:	equ 1000_0000h
   275                              <2> dif2_int31_segment:	equ 2000_0000h
   276                              <2> dif2_nn_compat:		equ 4000_0000h
   277                              <2> dif2_nn_capitalise:	equ 8000_0000h
   278                              <2> 
   279                              <2> 
   280                              <2> dif3_load_is_ldp:	equ 1	; boot load: partition specified as "ldp"
   281                              <2> dif3_load_is_sdp:	equ 2	; boot load: partition specified as "sdp"
   282                              <2> dif3_load_is_ydp:	equ 4	; boot load: partition specified as "ydp"
   283                              <2> dif3_load_is_dp:	equ dif3_load_is_ldp 				| dif3_load_is_sdp 				| dif3_load_is_ydp
   286                              <2> dif3_load_dir_dir:	equ 8
   287                              <2> dif3_input_terminal_override:	equ 10h
   288                              <2> dif3_input_serial_override:	equ 20h
   289                              <2> dif3_if_not:		equ 40h
   290                              <2> dif3_partition_changed:	equ 80h
   291                              <2> ;
   292                              <2> dif3_input_cmdline:	equ 100h; input reading from cmdline_buffer
   293                              <2> dif3_input_cmdline_closed: equ 200h
   294                              <2> dif3_at_line_end:	equ 400h
   295                              <2> dif3_quiet_input_single:equ 800h
   296                              <2> dif3_quiet_output:	equ 1000h
   297                              <2> dif3_unquiet_error:	equ 2000h
   298                              <2> dif3_unquiet_prompt:	equ 4000h
   299                              <2> dif3_unquiet:		equ dif3_unquiet_error | dif3_unquiet_prompt
   300                              <2> dif3_return_eof:	equ 8000h
   301                              <2> dif3_highlighting:	equ 1_0000h
   302                              <2> dif3_do_not_highlight:	equ 2_0000h
   303                              <2> dif3_int10_highlight:	equ 2_0000h
   304                              <2> dif3_nosymbols_1:	equ 4_0000h
   305                              <2> dif3_nosymbols_2:	equ 8_0000h
   306                              <2> %if _PM
   307                              <2> dif3_ss_b_bit_set:	equ  10_0000h
   308                              <2> %endif
   309                              <2> dif3_gotint19:		equ  20_0000h
   310                              <2> dif3_prior_pm:		equ  40_0000h
   311                              <2> %if _DELAY_BEFORE_BP
   312                              <2> dif3_delayed		equ  80_0000h
   313                              <2> %endif
   314                              <2> dif3_input_re:		equ 100_0000h	; input reading from re_buffer
   315                              <2> dif3_input_re_closed:	equ 200_0000h
   316                              <2> dif3_accept_getrange_0:	equ 400_0000h
   317                              <2> %if _INPUT_FILE_HANDLES || _INPUT_FILE_BOOT
   318                              <2> dif3_in_if:		equ 800_0000h
   319                              <2> %endif
   320                              <2> dif3_auxbuff_guarded_1:	equ 1000_0000h
   321                              <2> dif3_auxbuff_guarded_2:	equ 2000_0000h
   322                              <2> dif3_auxbuff_guarded_3:	equ 4000_0000h
   323                              <2> dif3_sss_is_reverse:	equ 8000_0000h
   324                              <2> 
   325                              <2> 
   326                              <2> dif4_int_serial_hooked:	equ 1
   327                              <2> dif4_int_2F_hooked:	equ 2
   328                              <2> dif4_int_08_hooked:	equ 4
   329                              <2> dif4_int_2D_hooked:	equ 8
   330                              <2> %if _CATCHINTFAULTCOND && _CATCHINT0D
   331                              <2> dif4_int_0D_hooked:	equ 10h
   332                              <2> %endif
   333                              <2> %if _CATCHINTFAULTCOND && _CATCHINT0C
   334                              <2> dif4_int_0C_hooked:	equ 20h
   335                              <2> %endif
   336                              <2> 
   337                              <2> 
   338                              <2> %if _VXCHG
   339                              <2> dif6_vv_mode:		equ 1
   340                              <2> %endif
   341                              <2> dif6_in_hook2F:		equ 2
   342                              <2> dif6_in_amis_hook2F:	equ 4
   343                              <2> dif6_debug_mode:	equ 100h
   344                              <2> dif6_locked:		equ 200h
   345                              <2> %if _RH
   346                              <2> dif6_rh_mode_was:	equ  8_0000h
   347                              <2> dif6_rh_mode:		equ 10_0000h
   348                              <2> dif6_rh_mode_2:		equ 20_0000h
   349                              <2> %endif
   350                              <2> dif6_device_mode:	equ 40_0000h
   351                              <2> dif6_cpdepchars:	equ 80_0000h
   352                              <2> %if _IMMASM
   353                              <2> dif6_immasm_no_output:	equ 100_0000h
   354                              <2> dif6_immasm:		equ 200_0000h
   355                              <2> dif6_immasm_rel8:	equ 400_0000h
   356                              <2> %endif
   357                              <2> 
   358                              <2> 
   359                              <2> disasm_lowercase	equ 1
   360                              <2> disasm_commablank	equ 2
   361                              <2> disasm_nasm		equ 4
   362                              <2> disasm_lowercase_refmem:equ 8
   363                              <2> disasm_show_short:	equ 10h
   364                              <2> disasm_show_near:	equ 20h
   365                              <2> disasm_show_far:	equ 40h
   366                              <2> disasm_nec:		equ 80h
   367                              <2> disasm_40_columns:	equ 100h
   368                              <2> disasm_no_indent:	equ 200h
   369                              <2> disasm_msdebug_mnemonofs: equ 400h
   370                              <2> disasm_a16_memref:	equ 1000h
   371                              <2> disasm_a32_memref:	equ 2000h
   372                              <2> disasm_a16_string:	equ 4000h
   373                              <2> disasm_a32_string:	equ 8000h
   374                              <2> disasm_hide_modrm:	equ 10000h
   375                              <2> disasm_asize_loop_nasm:	equ 20000h
   376                              <2> disasm_modrm_always:	equ 40000h
   377                              <2> DEFAULTASMOPTIONS equ disasm_lowercase|disasm_commablank|disasm_nasm 	| disasm_a16_memref | disasm_a32_memref 	| disasm_a16_string | disasm_a32_string
    30                              <1> 
    31                              <1> %include "iniload.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> lDebug iniload/boot interfacing structs and macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2023 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> 
    16                              <2> 	struc BS
    17 00000000 ??????              <2> bsJump:	resb 3
    18 00000003 ????????????????    <2> bsOEM:	resb 8
    19                              <2> bsBPB:
    20                              <2> 	endstruc
    21                              <2> 
    22                              <2> 	struc EBPB		;        BPB sec
    23 00000000 ????                <2> bpbBytesPerSector:	resw 1	; offset 00h 0Bh
    24 00000002 ??                  <2> bpbSectorsPerCluster:	resb 1	; offset 02h 0Dh
    25 00000003 ????                <2> bpbReservedSectors:	resw 1	; offset 03h 0Eh
    26 00000005 ??                  <2> bpbNumFATs:		resb 1	; offset 05h 10h
    27 00000006 ????                <2> bpbNumRootDirEnts:	resw 1	; offset 06h 11h -- 0 for FAT32
    28 00000008 ????                <2> bpbTotalSectors:	resw 1	; offset 08h 13h
    29 0000000A ??                  <2> bpbMediaID:		resb 1	; offset 0Ah 15h
    30 0000000B ????                <2> bpbSectorsPerFAT:	resw 1	; offset 0Bh 16h -- 0 for FAT32
    31 0000000D ????                <2> bpbCHSSectors:		resw 1	; offset 0Dh 18h
    32 0000000F ????                <2> bpbCHSHeads:		resw 1	; offset 0Fh 1Ah
    33 00000011 ????????            <2> bpbHiddenSectors:	resd 1	; offset 11h 1Ch
    34 00000015 ????????            <2> bpbTotalSectorsLarge:	resd 1	; offset 15h 20h
    35                              <2> bpbNew:				; offset 19h 24h
    36                              <2> 
    37 00000019 ????????            <2> ebpbSectorsPerFATLarge:	resd 1	; offset 19h 24h
    38 0000001D ????                <2> ebpbFSFlags:		resw 1	; offset 1Dh 28h
    39 0000001F ????                <2> ebpbFSVersion:		resw 1	; offset 1Fh 2Ah
    40 00000021 ????????            <2> ebpbRootCluster:	resd 1	; offset 21h 2Ch
    41 00000025 ????                <2> ebpbFSINFOSector:	resw 1	; offset 25h 30h
    42 00000027 ????                <2> ebpbBackupSector:	resw 1	; offset 27h 32h
    43 00000029 <res Ch>            <2> ebpbReserved:		resb 12	; offset 29h 34h
    44                              <2> ebpbNew:			; offset 35h 40h
    45                              <2> 	endstruc
    46                              <2> 
    47                              <2> 	struc BPBN		; ofs B16 S16 B32 S32
    48 00000000 ??                  <2> bpbnBootUnit:		resb 1	; 00h 19h 24h 35h 40h
    49 00000001 ??                  <2> 			resb 1	; 01h 1Ah 25h 36h 41h
    50 00000002 ??                  <2> bpbnExtBPBSignature:	resb 1	; 02h 1Bh 26h 37h 42h -- 29h for valid BPBN
    51 00000003 ????????            <2> bpbnSerialNumber:	resd 1	; 03h 1Ch 27h 38h 43h
    52 00000007 <res Bh>            <2> bpbnVolumeLabel:	resb 11	; 07h 20h 2Bh 3Ch 47h
    53 00000012 ????????????????    <2> bpbnFilesystemID:	resb 8	; 12h 2Bh 36h 47h 52h
    54                              <2> 	endstruc		; 1Ah 33h 3Eh 4Fh 5Ah
    55                              <2> 
    56                              <2> 	struc DIRENTRY
    57 00000000 ????????????????    <2> deName:		resb 8
    58 00000008 ??????              <2> deExt:		resb 3
    59 0000000B ??                  <2> deAttrib:	resb 1
    60 0000000C ??                  <2> dePlusSize:	resb 1
    61 0000000D ??????????????      <2> 		resb 7
    62 00000014 ????                <2> deClusterHigh:	resw 1
    63 00000016 ????                <2> deTime:		resw 1
    64 00000018 ????                <2> deDate:		resw 1
    65 0000001A ????                <2> deClusterLow:	resw 1
    66 0000001C ????????            <2> deSize:		resd 1
    67                              <2> 	endstruc
    68                              <2> 
    69                              <2> ATTR_READONLY	equ 1
    70                              <2> ATTR_HIDDEN	equ 2
    71                              <2> ATTR_SYSTEM	equ 4
    72                              <2> ATTR_VOLLABEL	equ 8
    73                              <2> ATTR_DIRECTORY	equ 10h
    74                              <2> ATTR_ARCHIVE	equ 20h
    75                              <2> 
    76                              <2> lsvclSignature		equ "CL"
    77                              <2> lsvclBufferLength	equ 256
    78                              <2> 
    79                              <2> 	struc LOADSTACKVARS, -10h
    80 FFFFFFF0 ????????            <2> lsvFirstCluster:	resd 1
    81 FFFFFFF4 ????????            <2> lsvFATSector:		resd 1
    82 FFFFFFF8 ????                <2> lsvFATSeg:		resw 1
    83 FFFFFFFA ????                <2> lsvLoadSeg:		resw 1
    84 FFFFFFFC ????????            <2> lsvDataStart:		resd 1
    85                              <2> 	endstruc
    86                              <2> 
    87                              <2> 	struc LOADDATA, LOADSTACKVARS - 10h
    88 FFFFFFE0 ????                <2> ldMemoryTop:	resw 1
    89 FFFFFFE2 ????                <2> ldLoadTop:	resw 1
    90 FFFFFFE4 ????                <2> ldSectorSeg:	resw 1
    91 FFFFFFE6 ??                  <2> ldFATType:	resb 1
    92                              <2> ldFlags:
    93 FFFFFFE7 ??                  <2> ldHasLBA:	resb 1
    94 FFFFFFE8 ????                <2> ldClusterSize:	resw 1
    95 FFFFFFEA ????                <2> ldParaPerSector:resw 1
    96                              <2> ldDirCluster:			; dword
    97                              <2> ldLoadingSeg:		; word
    98                              <2> ldQueryPatchValue:	; word
    99                              <2> lsvCommandLine:		; word
   100                              <2> .start:		equ $ - lsvclBufferLength
   101 FFFFFFEC ????                <2> .signature:	resw 1
   102                              <2> ldLoadUntilSeg:		; word
   103                              <2> lsvExtra:		; word
   104 FFFFFFEE ??                  <2> .partition:	resb 1	; byte
   105 FFFFFFEF ??                  <2> .flags:		resb 1	; byte
   106                              <2> 	endstruc
   107                              <2> 
   108                              <2> lsvefNoDataStart	equ 1
   109                              <2> lsvefPartitionNumber	equ 2
   110                              <2> 
   111                              <2> 	struc LOADCMDLINE, LOADDATA - lsvclBufferLength
   112                              <2> ldCommandLine:
   113 FFFFFEE0 <res 100h>          <2> .start:		resb lsvclBufferLength
   114                              <2> 	endstruc
   115                              <2> 
   116                              <2> ldfHasLBA:	equ 1
   117                              <2> ldfFATInvalid:	equ 2
   118                              <2> ldfFATBuffered:	equ 4
   119                              <2> 
   120                              <2> 	struc LOADDATA2, LOADDATA - 10h
   121 FFFFFFD0 ????????            <2> ldRootSector:		resd 1
   122 FFFFFFD4 ????                <2> ldEntriesPerSector:	resw 1
   123 FFFFFFD6 ????                <2> ldLastAvailableSector:	resw 1
   124 FFFFFFD8 ????                <2> ldParasLeft:		resw 1
   125 FFFFFFDA ????                <2> ldParasDone:		resw 1
   126                              <2> 	endstruc
   127                              <2> 
   128                              <2> 	struc LOADDATA3, LOADDATA2 - 10h
   129 FFFFFFC0 ????????            <2> ldMaxCluster:		resd 1
   130 FFFFFFC4 ????????            <2> ldFileSize:		resd 1
   131 FFFFFFC8 ????????            <2> ldCurrentCluster:	resd 1
   132 FFFFFFCC ????????            <2> ldCurrentSeek:		resd 1
   133                              <2> 	endstruc
   134                              <2> 
   135                              <2> 	struc LBAPACKET
   136 00000000 ????                <2> lpSize:		resw 1
   137 00000002 ????                <2> lpCount:	resw 1
   138 00000004 ????????            <2> lpBuffer:	resd 1
   139 00000008 ????????????????    <2> lpSector:	resq 1
   140                              <2> 	endstruc
   141                              <2> 
   142                              <2> 	struc PARTINFO
   143 00000000 ??                  <2> piBoot:		resb 1
   144 00000001 ??????              <2> piStartCHS:	resb 3
   145 00000004 ??                  <2> piType:		resb 1
   146 00000005 ??????              <2> piEndCHS:	resb 3
   147 00000008 ????????            <2> piStart:	resd 1
   148 0000000C ????????            <2> piLength:	resd 1
   149                              <2> 	endstruc
   150                              <2> 
   151                              <2> ptEmpty:		equ 0
   152                              <2> ptFAT12:		equ 1
   153                              <2> ptFAT16_16BIT_CHS:	equ 4
   154                              <2> ptExtendedCHS:		equ 5
   155                              <2> ptFAT16_CHS:		equ 6
   156                              <2> ptFAT32_CHS:		equ 0Bh
   157                              <2> ptFAT32:		equ 0Ch
   158                              <2> ptFAT16:		equ 0Eh
   159                              <2> ptExtended:		equ 0Fh
   160                              <2> ptLinux:		equ 83h
   161                              <2> ptExtendedLinux:	equ 85h
   162                              <2> 
   163                              <2> 
   164                              <2> 		; Flags of load_unit_flags
   165                              <2> lufForceCHS:		equ 1
   166                              <2> lufForceLBA:		equ 2
   167                              <2> lufForceGeometry:	equ 4
   168                              <2> luf_mask_writable equ lufForceCHS | lufForceLBA | lufForceGeometry
    32                              <1> 
    33                              <1> 	cpu 8086
    34                              <1> 
    35                              <1> 	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
    36                              <1> relocateddata:
    37                              <1> 
    38                              <1> 	addsection HEADER, start=0
    39                              <1> 
    40                              <1> 	istruc ELD_HEADERX
    41                              <1> at eldhxHeader
    42                              <1> 		; ELD executable header
    43                              <1> 	istruc ELD_HEADER
    44 00000000 454C4431            <1> at eldhSignature,	db "ELD1"
    45 00000004 000000              <1> 			db 0,0,0
    46 00000007 1A                  <1> 			db 26
    47 00000008 60000000            <1> at eldhCodeOffset,	dd CODEOFFSET
    48 0000000C B013                <1> at eldhCodeImageLength,	dw code_size
    49 0000000E 0000                <1> at eldhCodeAllocLength,	dw 0
    50 00000010 10140000            <1> at eldhDataOffset,	dd DATAOFFSET
    51 00000014 6003                <1> at eldhDataImageLength,	dw data_size
    52 00000016 1002                <1> at eldhDataAllocLength,	dw total_data_size - data_size
    53 00000018 F808                <1> at eldhCodeEntrypoint,	dw linker - code
    54                              <1> at eldhReserved
    55 0000001A 00<rep 4h>2800      <1> at eldhExtensionSize,	dw header_extension_end - $$
    56                              <1> 	iend
    57 00000020 [30000000]          <1> at eldhxDescriptionOffset,	dd description
    58 00000024 E1150000            <1> at eldhxHelpOffset,		dd DATAOFFSET + msg.help - datastart
    59                              <1> PUT_ELDHX_DATETIME_OFFSET
    60                              <1> header_extension_end:
    61 00000028 00<rep 8h>          <1> 	iend
    62                              <1> 
    63                              <1> %if _BOOT
    64 00000030 4C6973742066696C65- <1> description:		asciz "List files from directories, boot loaded."
    64 00000039 732066726F6D206469- <1>
    64 00000042 726563746F72696573- <1>
    64 0000004B 2C20626F6F74206C6F- <1>
    64 00000054 616465642E00        <1>
    65                              <1> %else
    66                              <1> description:		asciz "List DOS files from directories."
    67                              <1> %endif
    68                              <1> 
    69 0000005A 00<rep 6h>          <1> 	align 16, db 0
    70                              <1> 
    71                              <1> 	eldstrict on
    72                              <1> 
    73                              <1> CODEOFFSET equ $ - $$
    74                              <1> 	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
    75                              <1> %define CODEFIXUP - code + 0
    76                              <1> code:
    77                              <1> 		; ELD instance header
    78                              <1> 	istruc ELD_INSTANCE
    79                              <1> at eldiStartCode
    80 00000000 00<rep 2h>          <1> at eldiEndCode
    81 00000002 00<rep 2h>          <1> at eldiStartData
    82 00000004 00<rep 2h>          <1> at eldiEndData
    83                              <1> %if _BOOT
    84 00000006 00<rep 2h>424F4F54- <1> at eldiIdentifier,	fill 8, 32, db "BOOT DIR"
    84 0000000C 20444952            <1>
    85 00000010 00<rep 2h>626F6F74- <1> at eldiListing,		asciz _ELD_LISTING
    85 00000016 6469722E6C737400    <1>
    86                              <1> %else
    87                              <1> at eldiIdentifier,	fill 8, 32, db "DOS DIR"
    88                              <1> at eldiListing,		asciz _ELD_LISTING
    89                              <1> %endif
    90 0000001E 00<rep 2h>          <1> 	iend
    91                              <1> 
    92                              <1> 
    93                              <1> run:
    94 00000020 16                  <1> 	push ss
    95 00000021 07                  <1> 	pop es
    96                              <1> 
    97                              <1> %if _BOOT
    98                              <1> run_boot:
    99 00000022 F606[0100]40        <1> reloc	testopt [relocateddata], nodosloaded
   100                              <1> linkdatarelocation internalflags, -3
   101 00000027 7503E99C08          <1> 	jz error
   102 0000002C E81908              <1> 	extcallcall yy_boot_parse_name2
   103 0000002F E88506              <1> 	call parse_verbose
   104 00000032 891E[6C03]          <1> reloc	mov word [pathname_start], bx
   105                              <1> internaldatarelocation
   106                              <1> 
   107 00000036 53                  <1> 	push bx
   108 00000037 89DF                <1> 	mov di, bx
   109 00000039 E85A06              <1> 	call find_dir
   110 0000003C 5B                  <1> 	pop bx
   111 0000003D 89FA                <1> 	mov dx, di
   112                              <1>  %if 0
   113                              <1> 	db __TEST_IMM8			; (skip inc)
   114                              <1> @@:
   115                              <1> 	inc di
   116                              <1> 	cmp byte [di], 0
   117                              <1> 	je boot_no_wild
   118                              <1> 	cmp byte [di], '?'
   119                              <1> 	je boot_wild
   120                              <1> 	cmp byte [di], '*'
   121                              <1> 	jne @B
   122                              <1> 
   123                              <1> boot_no_wild:
   124                              <1> boot_wild:
   125                              <1>  %endif
   126 0000003F 8916[6003]          <1> reloc	mov word [wild_pattern], dx
   127                              <1> internaldatarelocation
   128                              <1> 
   129 00000043 E80A08              <1> 	extcallcall yy_boot_init_dir2
   130                              <1> 
   131 00000046 8B7E0B              <1> 	mov di, word [bp + bsBPB + bpbBytesPerSector]
   132                              <1> 					; di = sector size
   133                              <1> 					; = start of available auxbuff
   134 00000049 807EE60C            <1> 	cmp byte [bp + ldFATType], 12	; FAT12 ?
   135 0000004D 7508                <1> 	jne @F				; no -->
   136 0000004F 81FF0020            <1> 	cmp di, 8192			; already enough for a full FAT ?
   137 00000053 7302                <1> 	jae @F				; yes -->
   138 00000055 01FF                <1> 	add di, di			; reserve straddling sector
   139                              <1> @@:
   140                              <1> %else
   141                              <1> run_dos:
   142                              <1> 	extcallcall InDOS
   143                              <1> 	extcallcall yy_dos_parse_name
   144                              <1> 	call parse_verbose
   145                              <1> 
   146                              <1> 	houdini
   147                              <1> reloc	mov word [pathname_start], bx
   148                              <1> internaldatarelocation
   149                              <1> 	push bx
   150                              <1> 
   151                              <1> 	mov ah, 2Fh			; get DTA
   152                              <1> 	extcallcall ispm
   153                              <1> 	jnz .rm
   154                              <1> 
   155                              <1> subcpu 286
   156                              <1> 	push word 0
   157                              <1> 	push word 21h
   158                              <1> 	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
   159                              <1> 	pop dx				; discard interrupt number
   160                              <1> 	pop dx				; get es
   161                              <1> subcpureset
   162                              <1> 	jmp @F
   163                              <1> .rm:
   164                              <1> 	int 21h
   165                              <1> 	mov dx, es
   166                              <1> @@:
   167                              <1> 
   168                              <1> reloc	mov word [originaldta], bx
   169                              <1> internaldatarelocation
   170                              <1> reloc	mov word [originaldta + 2], dx
   171                              <1> internaldatarelocation
   172                              <1> 
   173                              <1> reloc	mov ax, word [relocateddata]
   174                              <1> linkdatarelocation ext_inject_handler
   175                              <1> reloc	mov word [originalinject], ax
   176                              <1> internaldatarelocation
   177                              <1> reloc2	mov word [relocateddata], inject
   178                              <1> linkdatarelocation ext_inject_handler, -4
   179                              <1> internalcoderelocation
   180                              <1> 	call get_es_ext
   181                              <1> reloc	setopt [es:code + eldiFlags], eldifResident
   182                              <1> internalcoderelocation -3	; mark block as resident
   183                              <1> 	 push ss
   184                              <1> 	 pop es
   185                              <1> 
   186                              <1> 	houdini
   187                              <1> reloc	mov dx, dta
   188                              <1> internaldatarelocation
   189                              <1> 	mov ah, 1Ah		; set DTA
   190                              <1> 	extcallcall _doscall
   191                              <1> 
   192                              <1> 	pop dx
   193                              <1> %endif
   194                              <1> 
   195 00000057 D006[0B00]          <1> reloc	rol byte [sort], 1
   196                              <1> internaldatarelocation
   197 0000005B 734C                <1> 	jnc .no_sort_buffer
   198                              <1> 
   199 0000005D A1[0000]            <1> reloc	mov ax, word [relocateddata]
   200                              <1> linkdatarelocation extdata_size
   201 00000060 2B06[0000]          <1> reloc	sub ax, word [relocateddata]
   202                              <1> linkdatarelocation extdata_used
   203 00000064 8B1E[0000]          <1> reloc	mov bx, word [relocateddata]
   204                              <1> linkdatarelocation auxbuff_current_size
   205 00000068 83C000              <1> 	add ax, (uinit_data_end_2 - buffer_end)
   206                              <1> %if _BOOT
   207 0000006B 29FB                <1> 	sub bx, di
   208 0000006D 7606                <1> 	jbe .use_sort_buffer_eld_data_block
   209                              <1> %endif
   210 0000006F 39D8                <1> 	cmp ax, bx
   211 00000071 7302                <1> 	jae .use_sort_buffer_eld_data_block
   212                              <1> 
   213                              <1> %ifn _BOOT
   214                              <1> reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
   217                              <1> linkdatarelocation internalflags3, -3
   218                              <1> 	jz .use_sort_buffer_auxbuff
   219                              <1> %else
   220 00000073 EB1C                <1> 	jmp .use_sort_buffer_auxbuff
   221                              <1> %endif
   222                              <1> 
   223                              <1> .use_sort_buffer_eld_data_block:
   224 00000075 83E800              <1> 	sub ax, (uinit_data_end_2 - buffer_end)
   225 00000078 E87C07              <1> 	call get_es_ext
   226 0000007B 260106[0600]        <1> reloc	add word [es:code + eldiEndData], ax
   227                              <1> internalcoderelocation		; adjust size
   228 00000080 0106[0000]          <1> reloc	add word [relocateddata], ax
   229                              <1> linkdatarelocation extdata_used	; adjust size
   230 00000084 26A1[0600]          <1> reloc	mov ax, word [es:code + eldiEndData]
   231                              <1> internalcoderelocation		; -> end of sort buffer
   232 00000088 16                  <1> 	push ss
   233 00000089 07                  <1> 	pop es
   234                              <1> 
   235 0000008A BF[7005]            <1> reloc	mov di, buffer_end	; -> start of sort buffer
   236                              <1> internaldatarelocation
   237 0000008D 8CD6                <1> 	mov si, ss		; => sort buffer
   238 0000008F EB05                <1> 	jmp .sort_buffer_common
   239                              <1> 
   240                              <1> .use_sort_buffer_auxbuff:
   241 00000091 93                  <1> 	xchg ax, bx		; ax -> end of sort buffer
   242                              <1> %ifn _BOOT
   243                              <1> 	xor di, di		; di -> start of sort buffer
   244                              <1> %endif
   245 00000092 8B36[0000]          <1> reloc	mov si, word [relocateddata]
   246                              <1> linkdatarelocation auxbuff_segorsel	; => sort buffer
   247                              <1> %ifn _BOOT
   248                              <1> 	extcallcall guard_auxbuff
   249                              <1> %endif
   250                              <1> 
   251                              <1> 		; INP:	si:di -> buffer
   252                              <1> 		;	si:ax -> behind buffer
   253                              <1> .sort_buffer_common:
   254 00000096 8936[6203]          <1> reloc	mov word [sortsegsel], si
   255                              <1> internaldatarelocation
   256 0000009A 893E[6403]          <1> reloc	mov word [sortstartoffset], di
   257                              <1> internaldatarelocation
   258 0000009E 893E[6803]          <1> reloc	mov word [sort_last], di
   259                              <1> internaldatarelocation
   260 000000A2 893E[6A03]          <1> reloc	mov word [sort_next], di
   261                              <1> internaldatarelocation
   262 000000A6 A3[6603]            <1> reloc	mov word [sortendoffset], ax
   263                              <1> internaldatarelocation
   264                              <1> 
   265                              <1> .no_sort_buffer:
   266                              <1> 
   267                              <1> %ifn _BOOT
   268                              <1> 	call findfirst
   269                              <1> 	jc .notfound
   270                              <1> reloc	mov di, relocateddata
   271                              <1> linkdatarelocation line_out
   272                              <1> 
   273                              <1> .loop:
   274                              <1> %else
   275                              <1> boot_scan:
   276 000000A9 C606[0000]00        <1> reloc	mov byte [relocateddata], 0
   277                              <1> linkdatarelocation load_check_dir_attr, -3
   278 000000AE 8B36[0000]          <1> reloc	mov si, word [relocateddata]
   279                              <1> linkdatarelocation load_yyname_input
   280 000000B2 803C2F              <1> 	cmp byte [si], '/'
   281 000000B5 7501                <1> 	jne @F
   282 000000B7 46                  <1> 	inc si
   283                              <1> @@:
   284 000000B8 803C00              <1> 	cmp byte [si], 0
   285 000000BB 7507                <1> 	jne @F
   286 000000BD E8[0000]EB020000    <1> 	extcall ..@yy_filename_empty
   287                              <1> @@:
   288 000000C4 16                  <1> 	 push ss
   289 000000C5 07                  <1> 	 pop es
   290 000000C6 E88200              <1> 	call boot_parse_name
   291 000000C9 3C2F                <1> 	cmp al, '/'
   292 000000CB 7509                <1> 	jne @F
   293 000000CD C606[0000]10        <1> reloc	mov byte [relocateddata], ATTR_DIRECTORY
   294                              <1> linkdatarelocation load_check_dir_attr, -3
   295 000000D2 8936[0000]          <1> reloc	mov word [relocateddata], si
   296                              <1> linkdatarelocation load_yyname_next
   297                              <1> @@:
   298                              <1> 
   299 000000D6 BFFFFF              <1> 	mov di, -1
   300 000000D9 89FE                <1> 	mov si, di
   301 000000DB 897EF4              <1> 	mov [bp + lsvFATSector], di
   302 000000DE 8976F6              <1> 	mov [bp + lsvFATSector + 2], si
   303                              <1> 
   304 000000E1 31C0                <1> 	xor ax, ax
   305 000000E3 31D2                <1> 	xor dx, dx
   306                              <1> 
   307                              <1> scan_dir_yyname_loop:
   308 000000E5 8946EC              <1> 	mov word [bp + ldDirCluster], ax
   309 000000E8 8956EE              <1> 	mov word [bp + ldDirCluster + 2], dx
   310                              <1> 
   311 000000EB 16                  <1> 	push ss
   312 000000EC 07                  <1> 	pop es
   313 000000ED BB[0000]            <1> reloc	mov bx, relocateddata
   314                              <1> linkdatarelocation load_yy_direntry
   315                              <1> 
   316 000000F0 C706[0000][0000]    <1> reloc2	mov word [relocateddata], relocateddata
   317                              <1> linkdatarelocation handle_scan_dir_not_found, -4
   318                              <1> ;linkdatarelocation near_transfer_ext_entry
   319                              <1> linkdatarelocation dmycmd
   320 000000F6 E8[0000]EB020000    <1> 	extcall scan_dir_aux
   321 000000FD 7303E96901          <1> 	jc end_of_directory
   322                              <1> 
   323 00000102 803E[0000]10        <1> reloc	cmp byte [relocateddata], ATTR_DIRECTORY
   324                              <1> linkdatarelocation load_check_dir_attr, -3
   325 00000107 7403E95F01          <1> 	jne got_single_yyentry
   326                              <1> 
   327 0000010C 56                  <1> 	push si
   328 0000010D 57                  <1> 	push di
   329 0000010E C606[0000]00        <1> reloc	mov byte [relocateddata], 0
   330                              <1> linkdatarelocation load_check_dir_attr, -3
   331 00000113 8B36[0000]          <1> reloc	mov si, word [relocateddata]
   332                              <1> linkdatarelocation load_yyname_next
   333 00000117 803C00              <1> 	cmp byte [si], 0
   334 0000011A 7507                <1> 	jne @F
   335 0000011C E8[0000]EB020000    <1> 	extcall ..@yy_filename_empty
   336                              <1> @@:
   337 00000123 06                  <1> 	push es
   338 00000124 16                  <1> 	 push ss
   339 00000125 07                  <1> 	 pop es
   340 00000126 E82200              <1> 	call boot_parse_name
   341 00000129 07                  <1> 	pop es
   342 0000012A 3C2F                <1> 	cmp al, '/'
   343 0000012C 7509                <1> 	jne @F
   344 0000012E C606[0000]10        <1> reloc	mov byte [relocateddata], ATTR_DIRECTORY
   345                              <1> linkdatarelocation load_check_dir_attr, -3
   346 00000133 8936[0000]          <1> reloc	mov word [relocateddata], si
   347                              <1> linkdatarelocation load_yyname_next
   348                              <1> @@:
   349 00000137 5F                  <1> 	pop di
   350 00000138 5E                  <1> 	pop si
   351                              <1> 
   352 00000139 31D2                <1> 	xor dx, dx
   353 0000013B 268B471A            <1> 	mov ax, [es:bx + deClusterLow]
   354                              <1> 				; = first cluster (not FAT32)
   355 0000013F 807EE620            <1> 	cmp byte [bp + ldFATType], 32
   356 00000143 7504                <1> 	jne @F
   357 00000145 268B5714            <1> 	mov dx, [es:bx + deClusterHigh]
   358                              <1> 				; dx:ax = first cluster (FAT32)
   359                              <1> @@:
   360                              <1> 
   361 00000149 EB9A                <1> 	jmp scan_dir_yyname_loop
   362                              <1> 
   363                              <1> boot_parse_name:
   364 0000014B 3936[6003]          <1> reloc	cmp word [wild_pattern], si
   365                              <1> internaldatarelocation
   366 0000014F 740A                <1> 	je @F
   367 00000151 E80407              <1> 	extcallcall boot_parse_fn	; get next pathname
   368                              <1> 
   369 00000154 C706[0000][0000]    <1> reloc2	mov word [relocateddata], relocateddata
   370                              <1> linkdatarelocation handle_scan_dir_entry, -4
   371                              <1> linkdatarelocation scan_dir_entry
   372                              <1> 
   373 0000015A C3                  <1> 	retn
   374                              <1> 
   375                              <1> @@:
   376 0000015B E8FA06              <1> 	extcallcall boot_parse_fn	; get next pathname
   377                              <1> 
   378 0000015E C706[0000][8801]    <1> reloc2	mov word [relocateddata], match_wildcard
   379                              <1> linkdatarelocation near_transfer_ext_address, -4
   380                              <1> internalcoderelocation
   381 00000164 C706[0000][0000]    <1> reloc2	mov word [relocateddata], relocateddata
   382                              <1> linkdatarelocation handle_scan_dir_entry, -4
   383                              <1> linkdatarelocation near_transfer_ext_entry
   384                              <1> 
   385 0000016A 50                  <1> 	push ax
   386 0000016B BF[0000]            <1> reloc	mov di, relocateddata
   387                              <1> linkdatarelocation load_kernel_name
   388 0000016E B90800              <1> 	mov cx, 8
   389 00000171 E80700              <1> 	call .handle_asterisk		; handle in basename
   390 00000174 B103                <1> 	mov cl, 3
   391 00000176 E80200              <1> 	call .handle_asterisk		; handle in extension
   392 00000179 58                  <1> 	pop ax
   393 0000017A C3                  <1> 	retn
   394                              <1> 
   395                              <1> .handle_asterisk:
   396 0000017B B02A                <1> 	mov al, '*'
   397 0000017D F2AE                <1> 	repne scasb			; scan for asterisk
   398 0000017F 7506                <1> 	jne @F				; not found -->
   399 00000181 B03F                <1> 	mov al, '?'			; fill with question marks
   400 00000183 4F                  <1> 	dec di				; -> at the asterisk
   401 00000184 41                  <1> 	inc cx				; = how many bytes remain
   402 00000185 F3AA                <1> 	rep stosb			; fill this field
   403                              <1> @@:
   404 00000187 C3                  <1> 	retn
   405                              <1> 
   406                              <1> 
   407                              <1> 		; INP:	es:di -> DIRENTRY
   408                              <1> 		;	dx:ax - 1 = sector
   409                              <1> 		;	cx, si in use
   410                              <1> 		; OUT:	CY if end of directory
   411                              <1> 		;	NC if to continue,
   412                              <1> 		;	 ZR if match
   413                              <1> 		;	 NZ if mismatch
   414                              <1> 		; CHG:	bx
   415                              <1> match_wildcard:
   416 00000188 26803D00            <1> 	cmp byte [es:di], 0
   417 0000018C F9                  <1> 	stc
   418 0000018D 7503E9D200          <1> 	je .ret
   419 00000192 268A5D0B            <1> 	mov bl, byte [es:di + deAttrib]
   420 00000196 F6C308              <1> 	test bl, ATTR_VOLLABEL
   421 00000199 7403E9C500          <1> 	jnz .ret_NC		; skip volume labels (and LFNs) --> (NZ)
   422 0000019E 56                  <1> 	push si
   423 0000019F 57                  <1> 	push di
   424 000001A0 51                  <1> 	push cx
   425 000001A1 BE[0000]            <1> reloc	mov si, relocateddata	; ds:si-> name to match
   426                              <1> linkdatarelocation load_kernel_name
   427 000001A4 B90B00              <1> 	mov cx, 11		; length of padded 8.3 FAT filename
   428                              <1> @@:
   429 000001A7 F3A6                <1> 	repe cmpsb		; check entry
   430 000001A9 7406                <1> 	je @F			; match -->
   431 000001AB 807CFF3F            <1> 	cmp byte [si - 1], '?'	; wildcard ?
   432 000001AF 74F6                <1> 	je @B			; yes --> (ZR)
   433                              <1> 				; no (NZ)
   434                              <1> @@:
   435 000001B1 59                  <1> 	pop cx
   436 000001B2 5F                  <1> 	pop di
   437 000001B3 5E                  <1> 	pop si
   438 000001B4 7403E9AA00          <1> 	jne .ret_NC
   439                              <1> 
   440 000001B9 56                  <1> 	push si
   441 000001BA 06                  <1> 	push es
   442 000001BB 57                  <1> 	push di
   443 000001BC 52                  <1> 	push dx
   444 000001BD 50                  <1> 	push ax
   445 000001BE 51                  <1> 	push cx
   446                              <1> 
   447 000001BF B92000              <1> 	mov cx, DIRENTRY_size
   448 000001C2 1E                  <1> 	push ds
   449 000001C3 06                  <1> 	 push es
   450 000001C4 1F                  <1> 	 pop ds
   451 000001C5 89FE                <1> 	mov si, di		; ds:si -> entry in directory buffer
   452 000001C7 16                  <1> 	push ss
   453 000001C8 07                  <1> 	pop es
   454 000001C9 BF[0000]            <1> reloc	mov di, relocateddata	; es:di -> destination for entry
   455                              <1> linkdatarelocation load_yy_direntry
   456 000001CC 57                  <1> 	push di
   457 000001CD F3A4                <1> 	rep movsb
   458 000001CF 5E                  <1> 	pop si
   459 000001D0 1F                  <1> 	pop ds
   460                              <1> 
   461 000001D1 BF[9B03]            <1> reloc	mov di, pathnamebuffer - 1
   462                              <1> internaldatarelocation		; di -> buffer
   463 000001D4 B000                <1> 	mov al, 0
   464 000001D6 AA                  <1> 	stosb
   465 000001D7 57                  <1> 	push di
   466 000001D8 B108                <1> 	mov cl, 8
   467 000001DA 803C05              <1> 	cmp byte [si], 05h
   468 000001DD 7505                <1> 	jne @F
   469 000001DF B0E5                <1> 	mov al, 0E5h
   470 000001E1 AA                  <1> 	stosb
   471 000001E2 49                  <1> 	dec cx
   472 000001E3 46                  <1> 	inc si
   473                              <1> @@:
   474 000001E4 F3A4                <1> 	rep movsb
   475 000001E6 B109                <1> 	mov cl, 9
   476 000001E8 A8                  <1> 	db __TEST_IMM8
   477                              <1> @@:
   478 000001E9 4F                  <1> 	dec di
   479 000001EA 807DFF20            <1> 	cmp byte [di - 1], 32
   480 000001EE E1F9                <1> 	loope @B
   481                              <1> 
   482 000001F0 807DFF2E            <1> 	cmp byte [di - 1], '.'
   483 000001F4 750C                <1> 	jne @F
   484 000001F6 813C2020            <1> 	cmp word [si], 2020h
   485 000001FA 7506                <1> 	jne @F
   486 000001FC 807C0220            <1> 	cmp byte [si + 2], 32
   487 00000200 7418                <1> 	je .dotname
   488                              <1> @@:
   489                              <1> 
   490 00000202 B02E                <1> 	mov al, '.'
   491 00000204 AA                  <1> 	stosb
   492 00000205 B103                <1> 	mov cl, 3
   493 00000207 F3A4                <1> 	rep movsb
   494 00000209 B104                <1> 	mov cl, 4
   495 0000020B A8                  <1> 	db __TEST_IMM8
   496                              <1> @@:
   497 0000020C 4F                  <1> 	dec di
   498 0000020D 807DFF20            <1> 	cmp byte [di - 1], 32
   499 00000211 E1F9                <1> 	loope @B
   500 00000213 807DFF2E            <1> 	cmp byte [di - 1], '.'
   501 00000217 7501                <1> 	jne @F
   502 00000219 4F                  <1> 	dec di
   503                              <1> @@:
   504                              <1> .dotname:
   505 0000021A B000                <1> 	mov al, 0
   506 0000021C AA                  <1> 	stosb
   507                              <1> 
   508 0000021D 16                  <1> 	 push ss
   509 0000021E 07                  <1> 	 pop es
   510 0000021F 5A                  <1> 	pop dx
   511                              <1> 
   512                              <1> 		; get attrib byte
   513 00000220 A0[0B00]            <1> reloc	mov al, byte [relocateddata + deAttrib]
   514                              <1> linkdatarelocation load_yy_direntry
   515 00000223 A2[7003]            <1> reloc	mov byte [finddata.attrib], al
   516                              <1> internaldatarelocation
   517                              <1> 
   518                              <1> 		; get time and date
   519 00000226 A1[1600]            <1> reloc	mov ax, word [relocateddata + deTime]
   520                              <1> linkdatarelocation load_yy_direntry
   521 00000229 A3[8403]            <1> reloc	mov word [finddata.time], ax
   522                              <1> internaldatarelocation
   523 0000022C A1[1800]            <1> reloc	mov ax, word [relocateddata + deDate]
   524                              <1> linkdatarelocation load_yy_direntry
   525 0000022F A3[8603]            <1> reloc	mov word [finddata.date], ax
   526                              <1> internaldatarelocation
   527                              <1> 
   528                              <1> 		; get size low
   529 00000232 A1[1C00]            <1> reloc	mov ax, word [relocateddata + deSize]
   530                              <1> linkdatarelocation load_yy_direntry
   531 00000235 A3[9003]            <1> reloc	mov word [finddata.sizelow], ax
   532                              <1> internaldatarelocation
   533 00000238 A1[1E00]            <1> reloc	mov ax, word [relocateddata + deSize + 2]
   534                              <1> linkdatarelocation load_yy_direntry
   535 0000023B A3[9203]            <1> reloc	mov word [finddata.sizelow + 2], ax
   536                              <1> internaldatarelocation
   537                              <1> 
   538                              <1> 		; zero unused fields
   539 0000023E 31C0                <1> 	xor ax, ax
   540 00000240 A3[8E03]            <1> reloc	mov word [finddata.sizehigh + 2], ax
   541                              <1> internaldatarelocation
   542 00000243 A2[A004]            <1> reloc	mov byte [finddata.shortname], al
   543                              <1> internaldatarelocation
   544                              <1> 
   545                              <1> 		; get FAT+ high 6 size bits
   546 00000246 A0[0C00]            <1> reloc	mov al, byte [relocateddata + dePlusSize]
   547                              <1> linkdatarelocation load_yy_direntry
   548 00000249 88C4                <1> 	mov ah, al
   549 0000024B 2507E0              <1> 	and ax, 0E007h
   550 0000024E D0EC                <1> 	shr ah, 1
   551 00000250 D0EC                <1> 	shr ah, 1
   552 00000252 08E0                <1> 	or al, ah
   553 00000254 B400                <1> 	mov ah, 0
   554 00000256 A3[8C03]            <1> reloc	mov word [finddata.sizehigh], ax
   555                              <1> internaldatarelocation
   556                              <1> 
   557 00000259 FF16[0000]          <1> reloc	call near [matchfunction]
   558                              <1> internaldatarelocation		; NZ to continue search, ZR to end
   559                              <1> 
   560 0000025D 59                  <1> 	pop cx
   561 0000025E 58                  <1> 	pop ax
   562 0000025F 5A                  <1> 	pop dx
   563 00000260 5F                  <1> 	pop di
   564 00000261 07                  <1> 	pop es
   565 00000262 5E                  <1> 	pop si			; restore registers
   566                              <1> 
   567                              <1> %if 0
   568                              <1> 	pushf
   569                              <1> 	sub ax, 1
   570                              <1> 	sbb dx, 0
   571                              <1> reloc	mov bx, [relocateddata]
   572                              <1> linkdatarelocation load_adr_dirbuf_segment
   573                              <1> 	extcall read_sector	; restore sector
   574                              <1> 	popf
   575                              <1> %endif
   576                              <1> 
   577                              <1> .ret_NC:
   578 00000263 F8                  <1> 	clc
   579                              <1> .ret:
   580 00000264 E8[0000]EB020000    <1> 	extcall near_transfer_ext_return, required ; must NOT be extcallcall
   581                              <1> 
   582                              <1> 
   583                              <1> got_single_yyentry:
   584                              <1> end_of_directory:
   585 0000026B 813E[0000][2505]    <1> reloc2	cmp word [matchfunction], display_ZR
   586                              <1> internaldatarelocation -4
   587                              <1> internalcoderelocation
   588 00000271 7403E94801          <1> 	jne ..@boot_scan_end
   589 00000276 C3                  <1> 	retn
   590                              <1> 
   591                              <1> sort_or_display:
   592                              <1> %endif
   593 00000277 D006[0B00]          <1> reloc	rol byte [sort], 1
   594                              <1> internaldatarelocation
   595 0000027B 7203E93801          <1> 	jnc .display
   596                              <1> 
   597 00000280 E84302              <1> 	call populate_finddata
   598 00000283 7503E93301          <1> 	je .next
   599                              <1> 
   600                              <1> %ifn _BOOT
   601                              <1> reloc	rol byte [sortlfn], 1
   602                              <1> internaldatarelocation
   603                              <1> 	jnc @F
   604                              <1> 
   605                              <1> reloc	mov si, finddata.fullname
   606                              <1> internaldatarelocation
   607                              <1> @@:
   608                              <1> %endif
   609                              <1> 
   610 00000288 89F7                <1> 	mov di, si
   611 0000028A B000                <1> 	mov al, 0
   612 0000028C B90002              <1> 	mov cx, 512
   613 0000028F F2AE                <1> 	repne scasb
   614 00000291 7403E95301          <1> 	jne .error
   615                              <1> 
   616 00000296 89F9                <1> 	mov cx, di
   617 00000298 29F1                <1> 	sub cx, si		; = length including NUL
   618                              <1> 
   619 0000029A 8B3E[6803]          <1> reloc	mov di, word [sort_last]
   620                              <1> internaldatarelocation
   621 0000029E 89F8                <1> 	mov ax, di
   622 000002A0 01C8                <1> 	add ax, cx
   623 000002A2 7303E95201          <1> 	jc .toofull
   624 000002A7 0306[0400]          <1> reloc	add ax, word [meta]
   625                              <1> internaldatarelocation
   626 000002AB 7303E94901          <1> 	jc .toofull
   627 000002B0 3B06[6603]          <1> reloc	cmp ax, word [sortendoffset]
   628                              <1> internaldatarelocation
   629 000002B4 7603E94001          <1> 	ja .toofull
   630                              <1> 
   631 000002B9 8E06[6203]          <1> reloc	mov es, word [sortsegsel]
   632                              <1> internaldatarelocation
   633 000002BD 8B3E[6403]          <1> reloc	mov di, word [sortstartoffset]
   634                              <1> internaldatarelocation
   635 000002C1 89F2                <1> 	mov dx, si
   636                              <1> 
   637                              <1> .sort:
   638 000002C3 3B3E[6803]          <1> reloc	cmp di, word [sort_last]
   639                              <1> internaldatarelocation
   640 000002C7 7203E9DD00          <1> 	jae .sort_insert_last
   641                              <1> 
   642 000002CC 89FB                <1> 	mov bx, di
   643                              <1> 
   644 000002CE D006[0C00]          <1> reloc	rol byte [dirfirst], 1
   645                              <1> internaldatarelocation
   646 000002D2 730E                <1> 	jnc .notdirfirst
   647 000002D4 A0[7003]            <1> reloc	mov al, byte [finddata.attrib]
   648                              <1> internaldatarelocation
   649 000002D7 268A25              <1> 	mov ah, byte [es:di]
   650 000002DA 251010              <1> 	and ax, (ATTR_DIRECTORY << 8) | ATTR_DIRECTORY
   651 000002DD 38E0                <1> 	cmp al, ah
   652 000002DF 755F                <1> 	jne ..@compare_normal
   653 000002E1 47                  <1> 	inc di
   654                              <1> .notdirfirst:
   655                              <1> 
   656 000002E2 D006[0D00]          <1> reloc	rol byte [date], 1
   657                              <1> internaldatarelocation
   658 000002E6 7311                <1> 	jnc .notdate
   659 000002E8 A1[8603]            <1> reloc	mov ax, word [finddata.date]
   660                              <1> internaldatarelocation
   661 000002EB 263B4502            <1> 	cmp ax, word [es:di + 2]
   662 000002EF 7547                <1> 	jne .sort_compare
   663 000002F1 A1[8403]            <1> reloc	mov ax, word [finddata.time]
   664                              <1> internaldatarelocation
   665 000002F4 263B05              <1> 	cmp ax, word [es:di]
   666 000002F7 753F                <1> 	jne .sort_compare
   667                              <1> 	; scasw
   668                              <1> 	; scasw
   669                              <1> .notdate:
   670                              <1> 
   671 000002F9 D006[0E00]          <1> reloc	rol byte [size], 1
   672                              <1> internaldatarelocation
   673 000002FD 731A                <1> 	jnc .notsize
   674 000002FF A0[B204]            <1> reloc	mov al, byte [size40bit + 4]
   675                              <1> internaldatarelocation
   676 00000302 263A4504            <1> 	cmp al, byte [es:di + 4]
   677 00000306 7530                <1> 	jne .sort_compare
   678 00000308 A1[B004]            <1> reloc	mov ax, word [size40bit + 2]
   679                              <1> internaldatarelocation
   680 0000030B 263B4502            <1> 	cmp ax, word [es:di + 2]
   681 0000030F 7527                <1> 	jne .sort_compare
   682 00000311 A1[AE04]            <1> reloc	mov ax, word [size40bit]
   683                              <1> internaldatarelocation
   684 00000314 263B05              <1> 	cmp ax, word [es:di]
   685 00000317 751F                <1> 	jne .sort_compare
   686                              <1> 	; add di, 5
   687                              <1> .notsize:
   688                              <1> 
   689 00000319 89DF                <1> 	mov di, bx
   690 0000031B 033E[0400]          <1> reloc	add di, word [meta]
   691                              <1> internaldatarelocation
   692 0000031F 89D6                <1> 	mov si, dx
   693 00000321 B001                <1> 	mov al, 1
   694                              <1> @@:
   695 00000323 3C00                <1> 	cmp al, 0
   696 00000325 741B                <1> 	je .sort_insert_skip_bx
   697 00000327 AC                  <1> 	lodsb
   698 00000328 268A25              <1> 	mov ah, byte [es:di]
   699 0000032B 47                  <1> 	inc di
   700 0000032C E83105              <1> 	extcallcall uppercase
   701 0000032F 86C4                <1> 	xchg al, ah
   702 00000331 E82C05              <1> 	extcallcall uppercase
   703 00000334 38E0                <1> 	cmp al, ah
   704 00000336 74EB                <1> 	je @B
   705                              <1> .sort_compare:
   706 00000338 FF26[0600]          <1> reloc	jmp near [compare]
   707                              <1> internaldatarelocation
   708                              <1> 
   709                              <1> ..@compare_reverse:
   710 0000033C 7216                <1> 	jb .sort_insert_before_bx
   711 0000033E EB02                <1> 	jmp .sort_insert_skip_bx
   712                              <1> 
   713                              <1> ..@compare_normal:
   714 00000340 7712                <1> 	ja .sort_insert_before_bx
   715                              <1> .sort_insert_skip_bx:
   716 00000342 51                  <1> 	push cx
   717 00000343 89DF                <1> 	mov di, bx
   718 00000345 033E[0400]          <1> reloc	add di, word [meta]
   719                              <1> internaldatarelocation
   720 00000349 B000                <1> 	mov al, 0
   721 0000034B B90002              <1> 	mov cx, 512
   722 0000034E F2AE                <1> 	repne scasb
   723 00000350 59                  <1> 	pop cx
   724 00000351 E96FFF              <1> 	jmp .sort
   725                              <1> 
   726                              <1> .sort_insert_before_bx:
   727                              <1> 	houdini
   728 00000354 8B3E[6803]          <1> reloc	mov di, word [sort_last]	; -> after last
   729                              <1> internaldatarelocation
   730 00000358 89FE                <1> 	mov si, di			; -> behind source
   731 0000035A 01CF                <1> 	add di, cx			; -> behind target
   732 0000035C 033E[0400]          <1> reloc	add di, word [meta]
   733                              <1> internaldatarelocation
   734 00000360 51                  <1> 	push cx
   735 00000361 89F1                <1> 	mov cx, si			; -> behind source
   736 00000363 29D9                <1> 	sub cx, bx			; behind source minus start source
   737                              <1> 					;  = length of source
   738 00000365 FD                  <1> 	std
   739 00000366 A6                  <1> 	cmpsb				; -> last bytes
   740                              <1> @@:
   741 00000367 26A4                <1> 	es movsb
   742 00000369 E2FC                <1> 	loop @B				; move up trailer
   743 0000036B FC                  <1> 	cld
   744 0000036C 59                  <1> 	pop cx
   745 0000036D 010E[6803]          <1> reloc	add word [sort_last], cx
   746                              <1> internaldatarelocation
   747 00000371 8B3E[0400]          <1> reloc	mov di, word [meta]
   748                              <1> internaldatarelocation
   749 00000375 013E[6803]          <1> reloc	add word [sort_last], di
   750                              <1> internaldatarelocation
   751 00000379 89DF                <1> 	mov di, bx
   752 0000037B E80200              <1> 	call .store_with_meta
   753 0000037E EB34                <1> 	jmp .sort_inserted
   754                              <1> 
   755                              <1> .store_with_meta:
   756 00000380 D006[0C00]          <1> reloc	rol byte [dirfirst], 1
   757                              <1> internaldatarelocation
   758 00000384 7304                <1> 	jnc @F
   759 00000386 A0[7003]            <1> reloc	mov al, byte [finddata.attrib]
   760                              <1> internaldatarelocation
   761 00000389 AA                  <1> 	stosb
   762                              <1> @@:
   763                              <1> 
   764 0000038A D006[0E00]          <1> reloc	rol byte [size], 1
   765                              <1> internaldatarelocation
   766 0000038E 7306                <1> 	jnc @F
   767 00000390 BE[AE04]            <1> reloc	mov si, size40bit
   768                              <1> internaldatarelocation
   769 00000393 A5                  <1> 	movsw
   770 00000394 A5                  <1> 	movsw
   771 00000395 A4                  <1> 	movsb
   772                              <1> @@:
   773                              <1> 
   774 00000396 D006[0D00]          <1> reloc	rol byte [date], 1
   775                              <1> internaldatarelocation
   776 0000039A 7308                <1> 	jnc @F
   777 0000039C A1[8403]            <1> reloc	mov ax, word [finddata.time]
   778                              <1> internaldatarelocation
   779 0000039F AB                  <1> 	stosw
   780 000003A0 A1[8603]            <1> reloc	mov ax, word [finddata.date]
   781                              <1> internaldatarelocation
   782 000003A3 AB                  <1> 	stosw
   783                              <1> @@:
   784                              <1> 
   785 000003A4 89D6                <1> 	mov si, dx			; -> to insert, cx = length
   786 000003A6 F3A4                <1> 	rep movsb			; store new entry
   787 000003A8 C3                  <1> 	retn
   788                              <1> 
   789                              <1> .sort_insert_last:
   790 000003A9 8B3E[6803]          <1> reloc	mov di, word [sort_last]	; -> after last
   791                              <1> internaldatarelocation
   792 000003AD E8D0FF              <1> 	call .store_with_meta
   793 000003B0 893E[6803]          <1> reloc	mov word [sort_last], di	; update -> after last
   794                              <1> internaldatarelocation
   795                              <1> 
   796                              <1> .sort_inserted:
   797 000003B4 16                  <1> 	push ss
   798 000003B5 07                  <1> 	pop es
   799                              <1> 
   800 000003B6 EB03                <1> 	jmp @F
   801                              <1> 
   802                              <1> .display:
   803 000003B8 E86A01              <1> 	call display_single
   804                              <1> @@:
   805                              <1> 
   806                              <1> .next:
   807                              <1> %if _BOOT
   808 000003BB 85E4                <1> 	test sp, sp		; NZ (continue search)
   809 000003BD C3                  <1> 	retn
   810                              <1> %else
   811                              <1> reloc	mov ax, word [findnext_function_number]
   812                              <1> internaldatarelocation
   813                              <1> reloc	mov bx, word [findhandle]
   814                              <1> internaldatarelocation
   815                              <1> 	push di
   816                              <1> 	mov si, 1
   817                              <1> reloc	mov di, finddata
   818                              <1> internaldatarelocation
   819                              <1> 	stc
   820                              <1> 	extcallcall _doscall
   821                              <1> 	pop di
   822                              <1> 	jnc .loop
   823                              <1> %endif
   824                              <1> 
   825                              <1> %if _BOOT
   826                              <1> ..@boot_scan_end:
   827                              <1> %endif
   828                              <1> 
   829 000003BE D006[0800]          <1> reloc	rol byte [found], 1
   830                              <1> internaldatarelocation
   831 000003C2 7316                <1> 	jnc .notfound
   832 000003C4 D006[0B00]          <1> reloc	rol byte [sort], 1
   833                              <1> internaldatarelocation
   834 000003C8 7237                <1> 	jc sorted
   835 000003CA D006[0900]          <1> reloc	rol byte [wide], 1
   836                              <1> internaldatarelocation
   837 000003CE 7307                <1> 	jnc @F
   838                              <1> 
   839                              <1> %if _BOOT
   840 000003D0 8B3E[0200]          <1> reloc	mov di, [widecurrent]
   841                              <1> internaldatarelocation
   842                              <1> %endif
   843                              <1> 
   844 000003D4 E89104              <1> 	extcallcall trimputs
   845                              <1> @@:
   846 000003D7 E89604              <1> 	extcallcall cmd3
   847                              <1> 
   848                              <1> 
   849                              <1> .notfound:
   850 000003DA BA[BF01]            <1> reloc	mov dx, msg.notfound
   851                              <1> internaldatarelocation
   852 000003DD B8220E              <1> 	mov ax, 0E22h
   853                              <1> @@:
   854 000003E0 E89504              <1> 	extcallcall setrc
   855 000003E3 E89A04              <1> 	extcallcall putsz
   856 000003E6 E88704              <1> 	extcallcall cmd3
   857                              <1> 
   858                              <1> .error:
   859 000003E9 BA[3B01]            <1> reloc	mov dx, msg.error
   860                              <1> internaldatarelocation
   861 000003EC B8230E              <1> 	mov ax, 0E23h
   862 000003EF EBEF                <1> 	jmp @B
   863                              <1> 
   864                              <1> .error2:
   865 000003F1 BA[6201]            <1> reloc	mov dx, msg.error2
   866                              <1> internaldatarelocation
   867 000003F4 B8240E              <1> 	mov ax, 0E24h
   868 000003F7 EBE7                <1> 	jmp @B
   869                              <1> 
   870                              <1> .toofull:
   871 000003F9 BA[8401]            <1> reloc	mov dx, msg.toofull
   872                              <1> internaldatarelocation
   873 000003FC B8250E              <1> 	mov ax, 0E25h
   874 000003FF EBDF                <1> 	jmp @B
   875                              <1> 
   876                              <1> 
   877                              <1> sorted:
   878                              <1> 	houdini
   879                              <1> %ifn _BOOT
   880                              <1> 	call findclose
   881                              <1> %endif
   882                              <1> 
   883 00000401 8B3E[6C03]          <1> reloc	mov di, word [pathname_start]
   884                              <1> internaldatarelocation
   885                              <1> 
   886                              <1> .find_dir:
   887 00000405 89FB                <1> 	mov bx, di		; bx -> start of path
   888 00000407 B9FFFF              <1> 	mov cx, -1
   889 0000040A B000                <1> 	mov al, 0
   890 0000040C F2AE                <1> 	repne scasb
   891 0000040E 4F                  <1> 	dec di
   892                              <1> @@:
   893 0000040F 39DF                <1> 	cmp di, bx
   894 00000411 7611                <1> 	jbe .di
   895 00000413 4F                  <1> 	dec di
   896 00000414 803D2F              <1> 	cmp byte [di], '/'
   897 00000417 740A                <1> 	je .di_plus_one
   898 00000419 803D5C              <1> 	cmp byte [di], '\'
   899 0000041C 7405                <1> 	je .di_plus_one
   900 0000041E 803D3A              <1> 	cmp byte [di], ':'
   901 00000421 75EC                <1> 	jne @B
   902                              <1> .di_plus_one:
   903 00000423 47                  <1> 	inc di
   904                              <1> .di:				; di -> end of path
   905 00000424 89F9                <1> 	mov cx, di
   906 00000426 29D9                <1> 	sub cx, bx		; = length of path
   907                              <1> 
   908 00000428 890E[6E03]          <1> reloc	mov word [pathname_length], cx
   909                              <1> internaldatarelocation
   910                              <1> 
   911 0000042C BF[0000]            <1> reloc	mov di, relocateddata
   912                              <1> linkdatarelocation line_out
   913                              <1> 
   914                              <1> .loop:
   915 0000042F 57                  <1> 	push di
   916 00000430 8B1E[6E03]          <1> reloc	mov bx, word [pathname_length]
   917                              <1> internaldatarelocation
   918 00000434 8B36[6C03]          <1> reloc	mov si, word [pathname_start]
   919                              <1> internaldatarelocation
   920 00000438 89D9                <1> 	mov cx, bx
   921 0000043A 81F90002            <1> 	cmp cx, buffer_end - buffer
   922 0000043E 73A9                <1> 	jae .error
   923                              <1> 
   924 00000440 BF[7003]            <1> reloc	mov di, buffer
   925                              <1> internaldatarelocation
   926 00000443 F3A4                <1> 	rep movsb
   927 00000445 89FA                <1> 	mov dx, di
   928                              <1> 
   929 00000447 8B3E[6A03]          <1> reloc	mov di, word [sort_next]
   930                              <1> internaldatarelocation
   931 0000044B 3B3E[6803]          <1> reloc	cmp di, word [sort_last]
   932                              <1> internaldatarelocation
   933 0000044F 7364                <1> 	jae .end
   934 00000451 033E[0400]          <1> reloc	add di, word [meta]
   935                              <1> internaldatarelocation
   936 00000455 89FE                <1> 	mov si, di
   937                              <1> 
   938 00000457 8E06[6203]          <1> reloc	mov es, word [sortsegsel]
   939                              <1> internaldatarelocation
   940 0000045B B000                <1> 	mov al, 0
   941 0000045D B90002              <1> 	mov cx, 512
   942 00000460 F2AE                <1> 	repne scasb
   943 00000462 7585                <1> 	jne .error
   944 00000464 89F9                <1> 	mov cx, di
   945 00000466 29F1                <1> 	sub cx, si
   946                              <1> 
   947 00000468 01CB                <1> 	add bx, cx
   948 0000046A 81FBFF01            <1> 	cmp bx, buffer_end - !!_BOOT - buffer
   949 0000046E 7603E976FF          <1> 	ja .error
   950                              <1> 
   951 00000473 89D7                <1> 	mov di, dx
   952                              <1> %if _BOOT
   953 00000475 81FF[7003]          <1> reloc	cmp di, strict word buffer
   954                              <1> internaldatarelocation
   955 00000479 740C                <1> 	je .slash
   956 0000047B 807DFF2F            <1> 	cmp byte [di - 1], '/'
   957 0000047F 740A                <1> 	je .notslash
   958 00000481 807DFF5C            <1> 	cmp byte [di - 1], '\'
   959 00000485 7404                <1> 	je .notslash
   960                              <1> .slash:
   961 00000487 C6052F              <1> 	mov byte [di], '/'
   962 0000048A 47                  <1> 	inc di
   963                              <1> .notslash:
   964 0000048B 893E[6003]          <1> reloc	mov word [wild_pattern], di
   965                              <1> internaldatarelocation
   966                              <1> %endif
   967 0000048F 06                  <1> 	 push es
   968 00000490 1E                  <1> 	 push ds
   969 00000491 07                  <1> 	 pop es
   970 00000492 1F                  <1> 	 pop ds				; swap
   971 00000493 F3A4                <1> 	rep movsb
   972 00000495 16                  <1> 	 push ss
   973 00000496 1F                  <1> 	 pop ds				; reset
   974 00000497 8936[6A03]          <1> reloc	mov word [sort_next], si
   975                              <1> internaldatarelocation
   976                              <1> 
   977 0000049B BA[7003]            <1> reloc	mov dx, buffer
   978                              <1> internaldatarelocation
   979                              <1> %if _BOOT
   980 0000049E 5F                  <1> 	pop di
   981                              <1> 
   982 0000049F 89D3                <1> 	mov bx, dx
   983 000004A1 8026[0300]EF        <1> reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   984                              <1> linkdatarelocation internalflags3, -3
   985 000004A6 E8A703              <1> 	extcallcall yy_boot_init_dir2
   986                              <1> 
   987 000004A9 C706[0000][2505]    <1> reloc2	mov word [matchfunction], display_ZR
   988                              <1> internaldatarelocation -4
   989                              <1> internalcoderelocation
   990                              <1> 
   991 000004AF E8F7FB              <1> 	call boot_scan
   992                              <1> 
   993 000004B2 E97AFF              <1> 	jmp .loop
   994                              <1> 
   995                              <1> .error equ sort_or_display.error
   996                              <1> .error2 equ sort_or_display.error2
   997                              <1> %else
   998                              <1> 	call findfirst
   999                              <1> 	jc .error2
  1000                              <1> 
  1001                              <1> 	call findclose
  1002                              <1> 	pop di
  1003                              <1> 	call display_single
  1004                              <1> 	jmp .loop
  1005                              <1> 
  1006                              <1> .error equ run_dos.error
  1007                              <1> .error2 equ run_dos.error2
  1008                              <1> %endif
  1009                              <1> 
  1010                              <1> .end:
  1011 000004B5 5F                  <1> 	pop di
  1012 000004B6 D006[0900]          <1> reloc	rol byte [wide], 1
  1013                              <1> internaldatarelocation
  1014 000004BA 7307                <1> 	jnc @F
  1015                              <1> 
  1016                              <1> %if _BOOT
  1017 000004BC 8B3E[0200]          <1> reloc	mov di, [widecurrent]
  1018                              <1> internaldatarelocation
  1019                              <1> %endif
  1020                              <1> 
  1021 000004C0 E8A503              <1> 	extcallcall trimputs
  1022                              <1> @@:
  1023 000004C3 E8AA03              <1> 	extcallcall cmd3
  1024                              <1> 
  1025                              <1> 
  1026                              <1> populate_finddata:
  1027                              <1> %ifn _BOOT
  1028                              <1> reloc	cmp byte [findnext_function_number + 1], 71h
  1029                              <1> internaldatarelocation -3
  1030                              <1> 	je .have_lfn
  1031                              <1> 
  1032                              <1> reloc	mov al, byte [dta.attrib]
  1033                              <1> internaldatarelocation
  1034                              <1> reloc	mov byte [finddata.attrib], al
  1035                              <1> internaldatarelocation
  1036                              <1> 
  1037                              <1> reloc	mov ax, word [dta.time]
  1038                              <1> internaldatarelocation
  1039                              <1> reloc	mov word [finddata.time], ax
  1040                              <1> internaldatarelocation
  1041                              <1> 
  1042                              <1> reloc	mov ax, word [dta.date]
  1043                              <1> internaldatarelocation
  1044                              <1> reloc	mov word [finddata.date], ax
  1045                              <1> internaldatarelocation
  1046                              <1> 
  1047                              <1> reloc	mov ax, word [dta.size]
  1048                              <1> internaldatarelocation
  1049                              <1> reloc	mov word [finddata.sizelow], ax
  1050                              <1> internaldatarelocation
  1051                              <1> 
  1052                              <1> reloc	mov ax, word [dta.size + 2]
  1053                              <1> internaldatarelocation
  1054                              <1> reloc	mov word [finddata.sizelow + 2], ax
  1055                              <1> internaldatarelocation
  1056                              <1> 
  1057                              <1> 	xor ax, ax
  1058                              <1> reloc	mov word [finddata.sizehigh], ax
  1059                              <1> internaldatarelocation
  1060                              <1> reloc	mov word [finddata.sizehigh + 2], ax
  1061                              <1> internaldatarelocation
  1062                              <1> 
  1063                              <1> 	push di
  1064                              <1> reloc	mov si, dta.name
  1065                              <1> internaldatarelocation
  1066                              <1> reloc	mov di, finddata.fullname
  1067                              <1> internaldatarelocation
  1068                              <1> 	mov cx, words(14)
  1069                              <1> 	rep movsw
  1070                              <1> 	pop di
  1071                              <1> 
  1072                              <1> reloc	mov byte [finddata.shortname], al
  1073                              <1> internaldatarelocation
  1074                              <1> 
  1075                              <1> .have_lfn:
  1076                              <1> %endif
  1077                              <1> 
  1078 000004C6 57                  <1> 	push di
  1079 000004C7 BF[AE04]            <1> reloc	mov di, size40bit
  1080                              <1> internaldatarelocation
  1081 000004CA F606[7003]10        <1> reloc	test byte [finddata.attrib], ATTR_DIRECTORY
  1082                              <1> internaldatarelocation -3
  1083 000004CF 740E                <1> 	jz @F
  1084 000004D1 31C0                <1> 	xor ax, ax
  1085 000004D3 A3[9003]            <1> reloc	mov word [finddata.sizelow], ax
  1086                              <1> internaldatarelocation
  1087 000004D6 A3[9203]            <1> reloc	mov word [finddata.sizelow + 2], ax
  1088                              <1> internaldatarelocation
  1089 000004D9 A3[8C03]            <1> reloc	mov word [finddata.sizehigh], ax
  1090                              <1> internaldatarelocation
  1091 000004DC A3[8E03]            <1> reloc	mov word [finddata.sizehigh + 2], ax
  1092                              <1> internaldatarelocation
  1093                              <1> @@:
  1094 000004DF 833E[8E03]00        <1> reloc	cmp word [finddata.sizehigh + 2], strict byte 0
  1095                              <1> internaldatarelocation -3
  1096 000004E4 7516                <1> 	jne .sizelarge
  1097 000004E6 813E[8C03]0001      <1> reloc	cmp word [finddata.sizehigh], 256
  1098                              <1> internaldatarelocation -4
  1099 000004EC 730E                <1> 	jae .sizelarge
  1100 000004EE A1[9003]            <1> reloc	mov ax, word [finddata.sizelow]
  1101                              <1> internaldatarelocation
  1102 000004F1 AB                  <1> 	stosw
  1103 000004F2 A1[9203]            <1> reloc	mov ax, word [finddata.sizelow + 2]
  1104                              <1> internaldatarelocation
  1105 000004F5 AB                  <1> 	stosw
  1106 000004F6 A0[8C03]            <1> reloc	mov al, byte [finddata.sizehigh]
  1107                              <1> internaldatarelocation
  1108 000004F9 AA                  <1> 	stosb
  1109 000004FA EB06                <1> 	jmp @F
  1110                              <1> 
  1111                              <1> .sizelarge:
  1112 000004FC B8FFFF              <1> 	mov ax, 0FFFFh
  1113 000004FF AB                  <1> 	stosw
  1114 00000500 AB                  <1> 	stosw
  1115 00000501 AA                  <1> 	stosb
  1116                              <1> @@:
  1117 00000502 5F                  <1> 	pop di
  1118                              <1> 
  1119 00000503 BE[A004]            <1> reloc	mov si, finddata.shortname
  1120                              <1> internaldatarelocation
  1121 00000506 803C00              <1> 	cmp byte [si], 0
  1122 00000509 7503                <1> 	jne @F
  1123 0000050B BE[9C03]            <1> reloc	mov si, finddata.fullname
  1124                              <1> internaldatarelocation
  1125                              <1> @@:
  1126                              <1> 
  1127 0000050E 803C2E              <1> 	cmp byte [si], '.'	; dot ?
  1128 00000511 750A                <1> 	jne @F			; no --> NZ
  1129 00000513 837C012E            <1> 	cmp word [si + 1], "."	; dot and NUL ?
  1130 00000517 7404                <1> 	je .next		; dotdot, skip --> ZR
  1131 00000519 807C0100            <1> 	cmp byte [si + 1], 0	; NUL ?
  1132                              <1> 	; je .next		; dot, skip --> ZR
  1133                              <1> .next:
  1134                              <1> @@:
  1135 0000051D 7405                <1> 	je @F
  1136 0000051F 800E[0800]FF        <1> reloc	or byte [found], -1
  1137                              <1> internaldatarelocation -3	; NZ
  1138                              <1> @@:
  1139 00000524 C3                  <1> 	retn
  1140                              <1> 
  1141                              <1> 
  1142                              <1> %if _BOOT
  1143                              <1> display_ZR:
  1144                              <1> %endif
  1145                              <1> display_single:
  1146 00000525 E89EFF              <1> 	call populate_finddata
  1147 00000528 7503E96601          <1> 	je .next
  1148                              <1> 
  1149 0000052D D006[0900]          <1> reloc	rol byte [wide], 1
  1150                              <1> internaldatarelocation
  1151 00000531 7340                <1> 	jnc .notwide
  1152                              <1> 
  1153                              <1> .wide:
  1154                              <1> 	houdini
  1155                              <1> %if _BOOT
  1156 00000533 8B3E[0200]          <1> reloc	mov di, [widecurrent]
  1157                              <1> internaldatarelocation
  1158                              <1> %endif
  1159                              <1> 
  1160 00000537 FE06[0A00]          <1> reloc	inc byte [widecounter]
  1161                              <1> internaldatarelocation
  1162 0000053B 803E[0A00]06        <1> reloc	cmp byte [widecounter], 6
  1163                              <1> internaldatarelocation -3
  1164 00000540 720B                <1> 	jb @F
  1165 00000542 E82303              <1> 	extcallcall trimputs
  1166 00000545 BF[0000]            <1> reloc	mov di, relocateddata
  1167                              <1> linkdatarelocation line_out
  1168 00000548 C606[0A00]01        <1> reloc	mov byte [widecounter], 1
  1169                              <1> internaldatarelocation -3
  1170                              <1> @@:
  1171                              <1> 
  1172 0000054D B420                <1> 	mov ah, 32
  1173 0000054F B90F00              <1> 	mov cx, 15		; width of column: 8 + 1 + 3 + 2 + 1
  1174 00000552 F606[7003]10        <1> reloc	test byte [finddata.attrib], ATTR_DIRECTORY
  1175                              <1> internaldatarelocation -3
  1176 00000557 7405                <1> 	jz @FF			; skip brackets and first iter stosb -->
  1177 00000559 B85B5D              <1> 	mov ax, "[]"		; use brackets
  1178 0000055C 49                  <1> 	dec cx			; decrement remaining width
  1179                              <1> @@:
  1180 0000055D AA                  <1> 	stosb			; dir first iter: store opening square bracket
  1181                              <1> 				; file first iter: skipped
  1182                              <1> 				; subsequent iter: store text byte
  1183                              <1> @@:
  1184 0000055E AC                  <1> 	lodsb			; load from name
  1185 0000055F 84C0                <1> 	test al, al		; got a NUL ? do not loop if so
  1186 00000561 E0FA                <1> 	loopnz @BB		; decrements width once per text byte
  1187                              <1> 				;  and finally once more for the NUL
  1188 00000563 88E0                <1> 	mov al, ah		; get blank or closing square bracket
  1189 00000565 AA                  <1> 	stosb			; store blank or closing square bracket
  1190                              <1> 				; (this store does not decrement the width)
  1191 00000566 B020                <1> 	mov al, 32		; pad with blanks
  1192 00000568 E301                <1> 	jcxz @F			; (error?) only once -->
  1193 0000056A F3                  <1> 	rep
  1194                              <1> @@:
  1195 0000056B AA                  <1> 	stosb			; store separator blanks
  1196                              <1> 
  1197                              <1> %if _BOOT
  1198 0000056C 893E[0200]          <1> reloc	mov [widecurrent], di
  1199                              <1> internaldatarelocation
  1200                              <1> %endif
  1201 00000570 E92001              <1> 	jmp .next
  1202                              <1> 
  1203                              <1> 
  1204                              <1> .notwide:
  1205 00000573 BF[0000]            <1> reloc	mov di, relocateddata
  1206                              <1> linkdatarelocation line_out
  1207 00000576 B90800              <1> 	mov cx, 8
  1208                              <1> 
  1209                              <1> @@:
  1210 00000579 AC                  <1> 	lodsb
  1211 0000057A 3C2E                <1> 	cmp al, '.'
  1212 0000057C 740D                <1> 	je @F
  1213 0000057E 3C00                <1> 	cmp al, 0
  1214 00000580 741A                <1> 	je .no_ext
  1215 00000582 AA                  <1> 	stosb
  1216 00000583 E2F4                <1> 	loop @B
  1217 00000585 AC                  <1> 	lodsb
  1218 00000586 3C2E                <1> 	cmp al, '.'
  1219 00000588 7401                <1> 	je @F
  1220 0000058A 4E                  <1> 	dec si			; doesn't fit, nothing sensible here
  1221                              <1> 
  1222                              <1> @@:
  1223 0000058B 41                  <1> 	inc cx
  1224 0000058C B020                <1> 	mov al, 32
  1225 0000058E F3AA                <1> 	rep stosb
  1226                              <1> 
  1227 00000590 B103                <1> 	mov cl, 3
  1228                              <1> @@:
  1229 00000592 AC                  <1> 	lodsb
  1230 00000593 3C00                <1> 	cmp al, 0
  1231 00000595 7408                <1> 	je @F
  1232 00000597 AA                  <1> 	stosb
  1233 00000598 E2F8                <1> 	loop @B
  1234 0000059A EB03                <1> 	jmp @F
  1235                              <1> 
  1236                              <1> .no_ext:
  1237 0000059C 83C104              <1> 	add cx, 1 + 3
  1238                              <1> 
  1239                              <1> @@:
  1240 0000059F 41                  <1> 	inc cx
  1241 000005A0 41                  <1> 	inc cx
  1242 000005A1 B020                <1> 	mov al, 32
  1243 000005A3 F3AA                <1> 	rep stosb
  1244                              <1> 
  1245                              <1> 
  1246 000005A5 8A1E[7003]          <1> reloc	mov bl, byte [finddata.attrib]
  1247                              <1> internaldatarelocation
  1248                              <1> 
  1249 000005A9 B02D                <1> 	mov al, '-'
  1250 000005AB F6C320              <1> 	test bl, ATTR_ARCHIVE
  1251 000005AE 7402                <1> 	jz @F
  1252 000005B0 B041                <1> 	mov al, 'A'
  1253                              <1> @@:
  1254 000005B2 AA                  <1> 	stosb
  1255 000005B3 B02D                <1> 	mov al, '-'
  1256 000005B5 F6C302              <1> 	test bl, ATTR_HIDDEN
  1257 000005B8 7402                <1> 	jz @F
  1258 000005BA B048                <1> 	mov al, 'H'
  1259                              <1> @@:
  1260 000005BC AA                  <1> 	stosb
  1261 000005BD B02D                <1> 	mov al, '-'
  1262 000005BF F6C301              <1> 	test bl, ATTR_READONLY
  1263 000005C2 7402                <1> 	jz @F
  1264 000005C4 B052                <1> 	mov al, 'R'
  1265                              <1> @@:
  1266 000005C6 AA                  <1> 	stosb
  1267 000005C7 B02D                <1> 	mov al, '-'
  1268 000005C9 F6C304              <1> 	test bl, ATTR_SYSTEM
  1269 000005CC 7402                <1> 	jz @F
  1270 000005CE B053                <1> 	mov al, 'S'
  1271                              <1> @@:
  1272 000005D0 AA                  <1> 	stosb
  1273 000005D1 B82020              <1> 	mov ax, 2020h
  1274 000005D4 AB                  <1> 	stosw
  1275                              <1> 
  1276 000005D5 F6C310              <1> 	test bl, ATTR_DIRECTORY
  1277 000005D8 7408                <1> 	jz @F
  1278 000005DA BE[AD01]            <1> reloc	mov si, msg.dirinsteadsize
  1279                              <1> internaldatarelocation
  1280                              <1> .nosize:
  1281 000005DD E8A802              <1> 	extcallcall copy_single_counted_string
  1282 000005E0 EB1F                <1> 	jmp @FF
  1283                              <1> 
  1284                              <1> @@:
  1285 000005E2 833E[8E03]00        <1> reloc	cmp word [finddata.sizehigh + 2], strict byte 0
  1286                              <1> internaldatarelocation -3
  1287 000005E7 7405                <1> 	je .sizefits
  1288                              <1> 
  1289 000005E9 BE[B601]            <1> reloc	mov si, msg.sizetoolarge
  1290                              <1> internaldatarelocation
  1291 000005EC EBEF                <1> 	jmp .nosize
  1292                              <1> 
  1293                              <1> .sizefits:
  1294 000005EE 8B36[8C03]          <1> reloc	mov si, word [finddata.sizehigh] 	; from FAT+ upper size bits
  1295                              <1> internaldatarelocation
  1296 000005F2 8B16[9203]          <1> reloc	mov dx, word [finddata.sizelow + 2]
  1297                              <1> internaldatarelocation
  1298 000005F6 A1[9003]            <1> reloc	mov ax, word [finddata.sizelow]
  1299                              <1> internaldatarelocation
  1300 000005F9 31C9                <1> 	xor cx, cx
  1301 000005FB BB0800              <1> 	mov bx, 4+4
  1302 000005FE E88F02              <1> 	extcallcall disp_dxax_times_cx_width_bx_size.store
  1303                              <1> 
  1304                              <1> @@:
  1305 00000601 B82020              <1> 	mov ax, 2020h
  1306 00000604 AB                  <1> 	stosw
  1307 00000605 8B1E[8603]          <1> reloc	mov bx, word [finddata.date]
  1308                              <1> internaldatarelocation
  1309 00000609 8B36[8403]          <1> reloc	mov si, word [finddata.time]
  1310                              <1> internaldatarelocation
  1311                              <1> 
  1312 0000060D 31D2                <1> 	xor dx, dx
  1313 0000060F 85DB                <1> 	test bx, bx
  1314 00000611 750A                <1> 	jnz @F
  1315 00000613 B82020              <1> 	mov ax, 2020h
  1316 00000616 B90500              <1> 	mov cx, 5
  1317 00000619 F3AB                <1> 	rep stosw
  1318 0000061B EB2B                <1> 	jmp .nodate
  1319                              <1> 
  1320                              <1> @@:
  1321 0000061D 89D8                <1> 	mov ax, bx
  1322 0000061F B90900              <1> 	mov cx, 9
  1323 00000622 D3E8                <1> 	shr ax, cl
  1324 00000624 05BC07              <1> 	add ax, 1980
  1325 00000627 B104                <1> 	mov cl, 4
  1326 00000629 E86C02              <1> 	extcallcall dec_dword_minwidth
  1327 0000062C B02D                <1> 	mov al, '-'
  1328 0000062E AA                  <1> 	stosb
  1329 0000062F 89D8                <1> 	mov ax, bx
  1330 00000631 B105                <1> 	mov cl, 5
  1331 00000633 D3E8                <1> 	shr ax, cl
  1332 00000635 83E00F              <1> 	and ax, 15
  1333 00000638 B102                <1> 	mov cl, 2
  1334 0000063A E85B02              <1> 	extcallcall dec_dword_minwidth
  1335 0000063D B02D                <1> 	mov al, '-'
  1336 0000063F AA                  <1> 	stosb
  1337 00000640 89D8                <1> 	mov ax, bx
  1338 00000642 83E01F              <1> 	and ax, 31
  1339 00000645 E85002              <1> 	extcallcall dec_dword_minwidth
  1340                              <1> .nodate:
  1341 00000648 B020                <1> 	mov al, 32
  1342 0000064A AA                  <1> 	stosb
  1343 0000064B 89F0                <1> 	mov ax, si
  1344 0000064D B10B                <1> 	mov cl, 11
  1345 0000064F D3E8                <1> 	shr ax, cl
  1346 00000651 B102                <1> 	mov cl, 2
  1347 00000653 E84202              <1> 	extcallcall dec_dword_minwidth
  1348 00000656 B03A                <1> 	mov al, ':'
  1349 00000658 AA                  <1> 	stosb
  1350 00000659 89F0                <1> 	mov ax, si
  1351 0000065B B105                <1> 	mov cl, 5
  1352 0000065D D3E8                <1> 	shr ax, cl
  1353 0000065F 83E03F              <1> 	and ax, 63
  1354 00000662 B102                <1> 	mov cl, 2
  1355 00000664 E83102              <1> 	extcallcall dec_dword_minwidth
  1356 00000667 B03A                <1> 	mov al, ':'
  1357 00000669 AA                  <1> 	stosb
  1358 0000066A 89F0                <1> 	mov ax, si
  1359 0000066C 83E01F              <1> 	and ax, 31
  1360 0000066F D1E0                <1> 	shl ax, 1
  1361 00000671 E82402              <1> 	extcallcall dec_dword_minwidth
  1362                              <1> 
  1363 00000674 803E[A004]00        <1> reloc	cmp byte [finddata.shortname], 0
  1364                              <1> internaldatarelocation -3
  1365 00000679 7415                <1> 	je @F
  1366 0000067B B82020              <1> 	mov ax, 2020h
  1367 0000067E AB                  <1> 	stosw
  1368 0000067F E81E02              <1> 	extcallcall putsline
  1369 00000682 BA[9C03]            <1> reloc	mov dx, finddata.fullname
  1370                              <1> internaldatarelocation
  1371 00000685 E8F801              <1> 	extcallcall putsz
  1372 00000688 BA[CE01]            <1> reloc	mov dx, msg.linebreak
  1373                              <1> internaldatarelocation
  1374 0000068B E8F201              <1> 	extcallcall putsz
  1375 0000068E EB03                <1> 	jmp .next
  1376                              <1> 
  1377                              <1> @@:
  1378 00000690 E81502              <1> 	extcallcall putsline_crlf
  1379                              <1> 
  1380                              <1> .next:
  1381                              <1> %if _BOOT
  1382 00000693 38C0                <1> 	cmp al, al		; ZR
  1383                              <1> %endif
  1384 00000695 C3                  <1> 	retn
  1385                              <1> 
  1386                              <1> 
  1387                              <1> %ifn _BOOT
  1388                              <1> findfirst:
  1389                              <1> reloc	mov word [findnext_function_number], 714Fh
  1390                              <1> internaldatarelocation -4
  1391                              <1> 	mov ax, 714Eh
  1392                              <1> 	mov cx, 16h		; find all files and directories
  1393                              <1> 	mov si, 1
  1394                              <1> reloc	mov di, finddata
  1395                              <1> internaldatarelocation
  1396                              <1> reloc	rol byte [prefersfn], 1
  1397                              <1> internaldatarelocation
  1398                              <1> 	jc .sfn_try
  1399                              <1> 	stc
  1400                              <1> 	extcallcall _doscall
  1401                              <1> 	jnc .lfn_found
  1402                              <1> 	cmp ax, 1
  1403                              <1> 	je .sfn_try
  1404                              <1> 	cmp ax, 7100h
  1405                              <1> 	je .sfn_try
  1406                              <1> 	stc	; CY
  1407                              <1> 	retn
  1408                              <1> 
  1409                              <1> .lfn_found:
  1410                              <1> reloc	mov word [findhandle], ax
  1411                              <1> internaldatarelocation
  1412                              <1> reloc	mov byte [findhandle_set], 0FFh
  1413                              <1> internaldatarelocation -3
  1414                              <1> 		; NC
  1415                              <1> 	retn
  1416                              <1> 
  1417                              <1> .sfn_try:
  1418                              <1> reloc	mov word [findnext_function_number], 4F00h
  1419                              <1> internaldatarelocation -4
  1420                              <1> 	mov ax, 4E00h
  1421                              <1> 	mov cx, 16h		; find all files and directories
  1422                              <1> 	extcallcall _doscall
  1423                              <1> 		; CY if not found
  1424                              <1> 	retn
  1425                              <1> %endif
  1426                              <1> 
  1427                              <1> 
  1428                              <1> %if _BOOT
  1429                              <1> find_dir:
  1430 00000696 89FB                <1> 	mov bx, di		; bx -> start of path
  1431 00000698 B9FFFF              <1> 	mov cx, -1
  1432 0000069B B000                <1> 	mov al, 0
  1433 0000069D F2AE                <1> 	repne scasb
  1434 0000069F 4F                  <1> 	dec di
  1435                              <1> @@:
  1436 000006A0 39DF                <1> 	cmp di, bx
  1437 000006A2 7611                <1> 	jbe .di
  1438 000006A4 4F                  <1> 	dec di
  1439 000006A5 803D2F              <1> 	cmp byte [di], '/'
  1440 000006A8 740A                <1> 	je .di_plus_one
  1441 000006AA 803D5C              <1> 	cmp byte [di], '\'
  1442 000006AD 7405                <1> 	je .di_plus_one
  1443 000006AF 803D3A              <1> 	cmp byte [di], ':'
  1444 000006B2 75EC                <1> 	jne @B
  1445                              <1> .di_plus_one:
  1446 000006B4 47                  <1> 	inc di
  1447                              <1> .di:				; di -> end of path
  1448 000006B5 C3                  <1> 	retn
  1449                              <1> %endif
  1450                              <1> 
  1451                              <1> 
  1452                              <1> parse_verbose.loop:
  1453 000006B6 AC                  <1> 	lodsb
  1454                              <1> parse_verbose:
  1455 000006B7 E8F601              <1> 	extcallcall skipcomm0
  1456 000006BA E8FB01              <1> 	extcallcall iseol?
  1457 000006BD 7526                <1> 	jne .parse
  1458                              <1> 
  1459                              <1> .meta:
  1460 000006BF D006[0D00]          <1> reloc	rol byte [date], 1
  1461                              <1> internaldatarelocation
  1462 000006C3 730A                <1> 	jnc @F
  1463 000006C5 C606[0E00]00        <1> reloc	mov byte [size], 0
  1464                              <1> internaldatarelocation -3
  1465 000006CA 8006[0400]04        <1> reloc	add byte [meta], 4
  1466                              <1> internaldatarelocation -3
  1467                              <1> @@:
  1468                              <1> 
  1469 000006CF D006[0E00]          <1> reloc	rol byte [size], 1
  1470                              <1> internaldatarelocation
  1471 000006D3 7305                <1> 	jnc @F
  1472 000006D5 8006[0400]05        <1> reloc	add byte [meta], 5
  1473                              <1> internaldatarelocation -3
  1474                              <1> @@:
  1475                              <1> 
  1476 000006DA D006[0C00]          <1> reloc	rol byte [dirfirst], 1
  1477                              <1> internaldatarelocation
  1478 000006DE 7304                <1> 	jnc @F
  1479 000006E0 FE06[0400]          <1> reloc	inc byte [meta]
  1480                              <1> internaldatarelocation
  1481                              <1> @@:
  1482 000006E4 C3                  <1> 	retn
  1483                              <1> 
  1484                              <1> .parse:
  1485 000006E5 4E                  <1> 	dec si
  1486                              <1> %ifn _BOOT
  1487                              <1> reloc	mov dx, msg.string_sfn
  1488                              <1> internaldatarelocation
  1489                              <1> 	extcallcall isstring?
  1490                              <1> 	jne @F
  1491                              <1> reloc	mov byte [prefersfn], 0FFh
  1492                              <1> internaldatarelocation -3
  1493                              <1> 	jmp .loop
  1494                              <1> 
  1495                              <1> @@:
  1496                              <1> %endif
  1497 000006E6 BA[0F00]            <1> reloc	mov dx, msg.string_wide
  1498                              <1> internaldatarelocation
  1499 000006E9 E8D401              <1> 	extcallcall isstring?
  1500 000006EC 7507                <1> 	jne @F
  1501 000006EE C606[0900]FF        <1> reloc	mov byte [wide], 0FFh
  1502                              <1> internaldatarelocation -3
  1503 000006F3 EBC1                <1> 	jmp .loop
  1504                              <1> 
  1505                              <1> @@:
  1506 000006F5 BA[1400]            <1> reloc	mov dx, msg.string_sort
  1507                              <1> internaldatarelocation
  1508 000006F8 E8C501              <1> 	extcallcall isstring?
  1509 000006FB 7507                <1> 	jne @F
  1510                              <1> .loop_sort:
  1511 000006FD C606[0B00]FF        <1> reloc	mov byte [sort], 0FFh
  1512                              <1> internaldatarelocation -3
  1513 00000702 EBB2                <1> 	jmp .loop
  1514                              <1> @@:
  1515 00000704 BA[1900]            <1> reloc	mov dx, msg.string_dirfirst
  1516                              <1> internaldatarelocation
  1517 00000707 E8B601              <1> 	extcallcall isstring?
  1518 0000070A 7507                <1> 	jne @F
  1519 0000070C C606[0C00]FF        <1> reloc	mov byte [dirfirst], 0FFh
  1520                              <1> internaldatarelocation -3
  1521 00000711 EBA3                <1> 	jmp .loop
  1522                              <1> 
  1523                              <1> @@:
  1524 00000713 BA[2200]            <1> reloc	mov dx, msg.string_date
  1525                              <1> internaldatarelocation
  1526 00000716 E8A701              <1> 	extcallcall isstring?
  1527 00000719 7507                <1> 	jne @F
  1528 0000071B C606[0D00]FF        <1> reloc	mov byte [date], 0FFh
  1529                              <1> internaldatarelocation -3
  1530 00000720 EB94                <1> 	jmp .loop
  1531                              <1> @@:
  1532 00000722 BA[2700]            <1> reloc	mov dx, msg.string_size
  1533                              <1> internaldatarelocation
  1534 00000725 E89801              <1> 	extcallcall isstring?
  1535 00000728 7507                <1> 	jne @F
  1536 0000072A C606[0E00]FF        <1> reloc	mov byte [size], 0FFh
  1537                              <1> internaldatarelocation -3
  1538 0000072F EB85                <1> 	jmp .loop
  1539                              <1> 
  1540                              <1> @@:
  1541 00000731 BA[2C00]            <1> reloc	mov dx, msg.string_reverse
  1542                              <1> internaldatarelocation
  1543 00000734 E88901              <1> 	extcallcall isstring?
  1544 00000737 7509                <1> 	jne @F
  1545 00000739 C706[0600][3C03]    <1> reloc2	mov word [compare], ..@compare_reverse
  1546                              <1> internaldatarelocation -4
  1547                              <1> internalcoderelocation
  1548 0000073F E974FF              <1> 	jmp .loop
  1549                              <1> 
  1550                              <1> @@:
  1551                              <1> %ifn _BOOT
  1552                              <1> reloc	mov dx, msg.string_sortlfn
  1553                              <1> internaldatarelocation
  1554                              <1> 	extcallcall isstring?
  1555                              <1> 	jne @F
  1556                              <1> reloc	mov byte [sortlfn], 0FFh
  1557                              <1> internaldatarelocation -3
  1558                              <1> 	jmp .loop_sort
  1559                              <1> 
  1560                              <1> @@:
  1561                              <1> reloc	mov dx, msg.string_sortsfn
  1562                              <1> internaldatarelocation
  1563                              <1> 	extcallcall isstring?
  1564                              <1> 	jne @F
  1565                              <1> reloc	mov byte [sortlfn], 0
  1566                              <1> internaldatarelocation -3
  1567                              <1> 	jmp .loop_sort
  1568                              <1> 
  1569                              <1> @@:
  1570                              <1> %endif
  1571                              <1> %if _DEBUG
  1572 00000742 BA[3400]            <1> reloc	mov dx, msg.string_sortdebug
  1573                              <1> internaldatarelocation
  1574 00000745 E87801              <1> 	extcallcall isstring?
  1575 00000748 7403                <1> 	je @F
  1576                              <1> %endif
  1577 0000074A E87B01              <1> 	extcallcall error
  1578                              <1> 
  1579                              <1> %if _DEBUG
  1580                              <1> @@:
  1581 0000074D AC                  <1> 	lodsb
  1582 0000074E E87F01              <1> 	extcallcall chkeol
  1583                              <1> 
  1584 00000751 E86BFF              <1> 	call .meta
  1585                              <1> 
  1586                              <1> %if _BOOT
  1587 00000754 E8F900              <1> 	extcallcall yy_boot_init_dir2
  1588                              <1> 
  1589 00000757 8B560B              <1> 	mov dx, word [bp + bsBPB + bpbBytesPerSector]
  1590                              <1> 					; di = sector size
  1591                              <1> 					; = start of available auxbuff
  1592 0000075A 807EE60C            <1> 	cmp byte [bp + ldFATType], 12	; FAT12 ?
  1593 0000075E 7508                <1> 	jne @F				; no -->
  1594 00000760 81FA0020            <1> 	cmp dx, 8192			; already enough for a full FAT ?
  1595 00000764 7302                <1> 	jae @F				; yes -->
  1596 00000766 01D2                <1> 	add dx, dx			; reserve straddling sector
  1597                              <1> @@:
  1598                              <1> %endif
  1599                              <1> 
  1600 00000768 BF[0000]            <1> reloc	mov di, relocateddata
  1601                              <1> linkdatarelocation line_out
  1602                              <1> 
  1603 0000076B BE[3E00]            <1> reloc	mov si, msg.debug.1
  1604                              <1> internaldatarelocation
  1605 0000076E E81701              <1> 	extcallcall copy_single_counted_string
  1606                              <1> 
  1607 00000771 8CD0                <1> 	mov ax, ss
  1608 00000773 E86201              <1> 	extcallcall hexword
  1609 00000776 B03A                <1> 	mov al, ':'
  1610 00000778 AA                  <1> 	stosb
  1611 00000779 B8[7005]            <1> reloc	mov ax, buffer_end
  1612                              <1> internaldatarelocation
  1613 0000077C E85901              <1> 	extcallcall hexword
  1614                              <1> 
  1615 0000077F A1[0000]            <1> reloc	mov ax, word [relocateddata]
  1616                              <1> linkdatarelocation extdata_size
  1617 00000782 2B06[0000]          <1> reloc	sub ax, word [relocateddata]
  1618                              <1> linkdatarelocation extdata_used
  1619 00000786 8B1E[0000]          <1> reloc	mov bx, word [relocateddata]
  1620                              <1> linkdatarelocation auxbuff_current_size
  1621                              <1> %if _BOOT
  1622 0000078A 29D3                <1> 	sub bx, dx
  1623 0000078C 52                  <1> 	push dx
  1624                              <1> %endif
  1625                              <1> 
  1626 0000078D BE[5800]            <1> reloc	mov si, msg.debug.2
  1627                              <1> internaldatarelocation
  1628 00000790 E8F500              <1> 	extcallcall copy_single_counted_string
  1629                              <1> 
  1630 00000793 83C000              <1> 	add ax, (uinit_data_end_2 - buffer_end)
  1631 00000796 E84200              <1> 	call display_buffer_size
  1632                              <1> 
  1633 00000799 BE[6B00]            <1> reloc	mov si, msg.debug.3
  1634                              <1> internaldatarelocation
  1635 0000079C E8E900              <1> 	extcallcall copy_single_counted_string
  1636                              <1> 
  1637 0000079F BA[BD00]            <1> reloc	mov dx, msg.debug.larger_data_block
  1638                              <1> internaldatarelocation
  1639                              <1> 
  1640 000007A2 39D8                <1> 	cmp ax, bx
  1641 000007A4 7303                <1> 	jae .use_sort_buffer_eld_data_block
  1642                              <1> 
  1643 000007A6 BA[FD00]            <1> reloc	mov dx, msg.debug.smaller_data_block
  1644                              <1> internaldatarelocation
  1645                              <1> 
  1646                              <1> %ifn _BOOT
  1647                              <1> reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
  1650                              <1> linkdatarelocation internalflags3, -3
  1651                              <1> 	jz .use_sort_buffer_auxbuff
  1652                              <1> 
  1653                              <1> reloc	mov dx, msg.debug.smaller_data_block_forced
  1654                              <1> internaldatarelocation
  1655                              <1> %endif
  1656                              <1> 
  1657                              <1> .use_sort_buffer_eld_data_block:
  1658                              <1> .use_sort_buffer_auxbuff:
  1659                              <1> 
  1660 000007A9 A1[0000]            <1> reloc	mov ax, word [relocateddata]
  1661                              <1> linkdatarelocation auxbuff_segorsel	; => sort buffer
  1662 000007AC E82901              <1> 	extcallcall hexword
  1663                              <1> 
  1664                              <1> %if _BOOT
  1665 000007AF B03A                <1> 	mov al, ':'
  1666 000007B1 AA                  <1> 	stosb
  1667 000007B2 58                  <1> 	pop ax
  1668 000007B3 E82201              <1> 	extcallcall hexword
  1669                              <1> %endif
  1670                              <1> 
  1671 000007B6 93                  <1> 	xchg ax, bx
  1672 000007B7 BE[5800]            <1> reloc	mov si, msg.debug.5
  1673                              <1> internaldatarelocation
  1674 000007BA E8CB00              <1> 	extcallcall copy_single_counted_string
  1675 000007BD E81B00              <1> 	call display_buffer_size
  1676                              <1> 
  1677 000007C0 BE[8E00]            <1> reloc	mov si, msg.debug.6.available
  1678                              <1> internaldatarelocation
  1679                              <1> 
  1680 000007C3 F606[0300]70        <1> reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
  1683                              <1> linkdatarelocation internalflags3, -3
  1684 000007C8 7403                <1> 	jz @F
  1685                              <1> 
  1686 000007CA BE[A700]            <1> reloc	mov si, msg.debug.6.inuse
  1687                              <1> internaldatarelocation
  1688                              <1> @@:
  1689                              <1> 
  1690 000007CD E8B800              <1> 	extcallcall copy_single_counted_string
  1691 000007D0 52                  <1> 	push dx
  1692 000007D1 E8D400              <1> 	extcallcall putsline_crlf
  1693 000007D4 5A                  <1> 	pop dx
  1694                              <1> 
  1695 000007D5 E8A800              <1> 	extcallcall putsz
  1696 000007D8 E89500              <1> 	extcallcall cmd3
  1697                              <1> 
  1698                              <1> 
  1699                              <1> display_buffer_size:
  1700 000007DB E80201              <1> 	extcallcall decword
  1701 000007DE BE[6000]            <1> reloc	mov si, msg.debug.bytes
  1702                              <1> internaldatarelocation
  1703 000007E1 E8A400              <1> 	extcallcall copy_single_counted_string
  1704 000007E4 50                  <1> 	push ax
  1705 000007E5 52                  <1> 	push dx
  1706 000007E6 31D2                <1> 	xor dx, dx
  1707 000007E8 BE0D00              <1> 	mov si, 8 + 1 + 3 + 1		; ASCIZ SFN maximum length
  1708 000007EB 0336[0400]          <1> reloc	add si, word [meta]
  1709                              <1> internaldatarelocation
  1710 000007EF F7F6                <1> 	div si
  1711 000007F1 E8EC00              <1> 	extcallcall decword
  1712 000007F4 5A                  <1> 	pop dx
  1713 000007F5 58                  <1> 	pop ax
  1714 000007F6 C3                  <1> 	retn
  1715                              <1> %endif
  1716                              <1> 
  1717                              <1> 
  1718                              <1> %ifn _BOOT
  1719                              <1> inject:
  1720                              <1> reloc	mov dx, word [originaldta]	; dx -> original DTA
  1721                              <1> internaldatarelocation
  1722                              <1> 	mov ah, 1Ah			; set DTA (restoring)
  1723                              <1> 	extcallcall ispm
  1724                              <1> 	jnz .rm
  1725                              <1> 
  1726                              <1> subcpu 286
  1727                              <1> reloc	push word [originaldta + 2]
  1728                              <1> internaldatarelocation			; ds => original DTA (86M segment)
  1729                              <1> 	push word 21h
  1730                              <1> 	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
  1731                              <1> 	pop dx				; discard interrupt number
  1732                              <1> 	pop dx				; discard es
  1733                              <1> subcpureset
  1734                              <1> 	jmp @F
  1735                              <1> .rm:
  1736                              <1> reloc	mov ds, word [originaldta + 2]	; ds => original DTA
  1737                              <1> internaldatarelocation
  1738                              <1> 	int 21h
  1739                              <1> 	 push ss
  1740                              <1> 	 pop ds
  1741                              <1> @@:
  1742                              <1> 
  1743                              <1> 	call findclose
  1744                              <1> 
  1745                              <1> reloc	mov cx, word [originalinject]
  1746                              <1> internaldatarelocation
  1747                              <1> 	call get_es_ext
  1748                              <1> reloc	clropt [es:code + eldiFlags], eldifResident
  1749                              <1> internalcoderelocation -3		; mark block as no longer resident
  1750                              <1> 	 push ss
  1751                              <1> 	 pop es
  1752                              <1> 	jcxz @F
  1753                              <1> 	jmp cx
  1754                              <1> 
  1755                              <1> @@:
  1756                              <1> 	extcall cmd3_not_inject
  1757                              <1> 
  1758                              <1> 
  1759                              <1> findclose:
  1760                              <1> reloc	mov bx, word [findhandle]	; bx = find handle, if any
  1761                              <1> internaldatarelocation
  1762                              <1> reloc	rol byte [findhandle_set], 1	; find handle set ?
  1763                              <1> internaldatarelocation
  1764                              <1> 	jnc @F				; no -->
  1765                              <1> reloc	not byte [findhandle_set]
  1766                              <1> internaldatarelocation
  1767                              <1> 	mov ax, 71A1h
  1768                              <1> 	extcallcall _doscall		; LFN find close
  1769                              <1> @@:
  1770                              <1> 	retn
  1771                              <1> %endif
  1772                              <1> 
  1773                              <1> 
  1774                              <1> get_es_ext:
  1775 000007F7 8E06[0000]          <1> reloc	mov es, word [relocateddata]
  1776                              <1> linkdatarelocation extdssel
  1777 000007FB E8EA00              <1> 	extcallcall ispm
  1778 000007FE 7404                <1> 	jz @F
  1779 00000800 8E06[0000]          <1> reloc	mov es, word [relocateddata]
  1780                              <1> linkdatarelocation extseg
  1781                              <1> @@:
  1782 00000804 C3                  <1> 	retn
  1783                              <1> 
  1784                              <1> 
  1785                              <1> start:
  1786 00000805 8CC3                <1> 	mov bx, es
  1787 00000807 16                  <1> 	 push ss
  1788 00000808 07                  <1> 	 pop es
  1789 00000809 E8E400              <1> 	extcallcall skipcomma
  1790 0000080C E8A900              <1> 	extcallcall iseol?
  1791 0000080F 7409                <1> 	je .help
  1792 00000811 E80CF8              <1> 	call run
  1793                              <1> @@:
  1794 00000814 E80B00              <1> 	call uninstall_oneshot
  1795 00000817 31C0                <1> 	xor ax, ax
  1796 00000819 CB                  <1> 	retf
  1797                              <1> 
  1798                              <1> .help:
  1799 0000081A BA[D101]            <1> reloc	mov dx, msg.help
  1800                              <1> internaldatarelocation
  1801 0000081D E86000              <1> 	extcallcall putsz
  1802 00000820 EBF2                <1> 	jmp @B
  1803                              <1> 
  1804                              <1> 
  1805                              <1> uninstall_oneshot:
  1806 00000822 36F606[0000]01      <1> reloc	testopt [ss:relocateddata], 1
  1807                              <1> linkdatarelocation options7, -3
  1808 00000828 751A                <1> 	jnz @F
  1809                              <1> 
  1810 0000082A 2EA1[0200]          <1> reloc	mov ax, word [cs:code + eldiEndCode]
  1811                              <1> internalcoderelocation
  1812 0000082E 2E2B06[0000]        <1> reloc	sub ax, word [cs:code + eldiStartCode]
  1813                              <1> internalcoderelocation
  1814 00000833 2906[0000]          <1> reloc	sub word [relocateddata], ax
  1815                              <1> linkdatarelocation extseg_used
  1816                              <1> 
  1817 00000837 2EA1[0600]          <1> reloc	mov ax, word [cs:code + eldiEndData]
  1818                              <1> internalcoderelocation
  1819 0000083B 2E2B06[0400]        <1> reloc	sub ax, word [cs:code + eldiStartData]
  1820                              <1> internalcoderelocation
  1821 00000840 2906[0000]          <1> reloc	sub word [relocateddata], ax
  1822                              <1> linkdatarelocation extdata_used
  1823                              <1> @@:
  1824 00000844 C3                  <1> 	retn
  1825                              <1> 
  1826                              <1> 
  1827                              <1> DATAOFFSET equ CODEOFFSET + code_size
  1828                              <1> 	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
  1829                              <1> %define DATAFIXUP - datastart + 0
  1830                              <1> datastart:
  1831                              <1> PUT_ELD_DATETIME
  1832                              <1> 
  1833                              <1> %if _BOOT
  1834 00000000 [7702]              <1> reloc matchfunction:	dw sort_or_display
  1835                              <1> internalcoderelocation
  1836 00000002 [0000]              <1> reloc widecurrent:	dw relocateddata
  1837                              <1> linkdatarelocation line_out
  1838                              <1> %endif
  1839 00000004 0000                <1> meta:			dw 0
  1840 00000006 [4003]              <1> reloc compare:		dw ..@compare_normal
  1841                              <1> internalcoderelocation
  1842 00000008 00                  <1> found:			db 0
  1843                              <1> %ifn _BOOT
  1844                              <1> findhandle_set:		db 0
  1845                              <1> prefersfn:		db 0
  1846                              <1> %endif
  1847 00000009 00                  <1> wide:			db 0
  1848 0000000A 00                  <1> widecounter:		db 0
  1849 0000000B 00                  <1> sort:			db 0
  1850                              <1> %ifn _BOOT
  1851                              <1> sortlfn:		db 0
  1852                              <1> %endif
  1853 0000000C 00                  <1> dirfirst:		db 0
  1854 0000000D 00                  <1> date:			db 0
  1855 0000000E 00                  <1> size:			db 0
  1856                              <1> 
  1857                              <1> msg:
  1858                              <1> %ifn _BOOT
  1859                              <1> .string_sfn:		asciz "SFN"
  1860                              <1> %endif
  1861 0000000F 5749444500          <1> .string_wide:		asciz "WIDE"
  1862 00000014 534F525400          <1> .string_sort:		asciz "SORT"
  1863 00000019 444952464952535400  <1> .string_dirfirst:	asciz "DIRFIRST"
  1864 00000022 4441544500          <1> .string_date:		asciz "DATE"
  1865 00000027 53495A4500          <1> .string_size:		asciz "SIZE"
  1866 0000002C 5245564552534500    <1> .string_reverse:	asciz "REVERSE"
  1867                              <1> %ifn _BOOT
  1868                              <1> .string_sortlfn:	asciz "SORTLFN"
  1869                              <1> .string_sortsfn:	asciz "SORTSFN"
  1870                              <1> %endif
  1871                              <1> %if _DEBUG
  1872 00000034 534F52544445425547- <1> .string_sortdebug:	asciz "SORTDEBUG"
  1872 0000003D 00                  <1>
  1873 0000003E 19454C442064617461- <1> .debug.1:			counted "ELD data block buffer at "
  1873 00000047 20626C6F636B206275- <1>
  1873 00000050 6666657220617420    <1>
  1874 00000058 072C2073697A6520    <1> .debug.2:			counted ", size "
  1875 00000060 0A2062797465732C20- <1> .debug.bytes:			counted " bytes, >="
  1875 00000069 3E3D                <1>
  1876 0000006B 222053464E20656E74- <1> .debug.3:			counted " SFN entries",13,10,"Auxiliary buffer at "
  1876 00000074 726965730D0A417578- <1>
  1876 0000007D 696C69617279206275- <1>
  1876 00000086 6666657220617420    <1>
  1877                              <1> %if _BOOT
  1878                              <1> .debug.5 equ .debug.2
  1879                              <1> %else
  1880                              <1> .debug.5:			counted ":0000, size "
  1881                              <1> %endif
  1882 0000008E 182053464E20656E74- <1> .debug.6.available:		counted " SFN entries (available)"
  1882 00000097 726965732028617661- <1>
  1882 000000A0 696C61626C6529      <1>
  1883 000000A7 152053464E20656E74- <1> .debug.6.inuse:			counted " SFN entries (in use)"
  1883 000000B0 726965732028696E20- <1>
  1883 000000B9 75736529            <1>
  1884 000000BD 4461746120626C6F63- <1> .debug.larger_data_block:	asciz "Data block chosen because it is larger (above-or-equal size).",13,10
  1884 000000C6 6B2063686F73656E20- <1>
  1884 000000CF 626563617573652069- <1>
  1884 000000D8 74206973206C617267- <1>
  1884 000000E1 6572202861626F7665- <1>
  1884 000000EA 2D6F722D657175616C- <1>
  1884 000000F3 2073697A65292E0D0A- <1>
  1884 000000FC 00                  <1>
  1885 000000FD 417578696C69617279- <1> .debug.smaller_data_block:	asciz "Auxiliary buffer chosen because it is larger and available.",13,10
  1885 00000106 206275666665722063- <1>
  1885 0000010F 686F73656E20626563- <1>
  1885 00000118 617573652069742069- <1>
  1885 00000121 73206C617267657220- <1>
  1885 0000012A 616E6420617661696C- <1>
  1885 00000133 61626C652E0D0A00    <1>
  1886                              <1>  %ifn _BOOT
  1887                              <1> .debug.smaller_data_block_forced:asciz "Smaller data block chosen because auxiliary buffer not available.",13,10
  1888                              <1>  %endif
  1889                              <1> %endif
  1890 0000013B 546F6F206C6F6E6720- <1> .error:			asciz "Too long short name, internal error!",13,10
  1890 00000144 73686F7274206E616D- <1>
  1890 0000014D 652C20696E7465726E- <1>
  1890 00000156 616C206572726F7221- <1>
  1890 0000015F 0D0A00              <1>
  1891 00000162 46696C65206E6F7420- <1> .error2:		asciz "File not found, internal error!",13,10
  1891 0000016B 666F756E642C20696E- <1>
  1891 00000174 7465726E616C206572- <1>
  1891 0000017D 726F72210D0A00      <1>
  1892 00000184 46696C656E616D6573- <1> .toofull:		asciz "Filenames list does not fit in buffer!",13,10
  1892 0000018D 206C69737420646F65- <1>
  1892 00000196 73206E6F7420666974- <1>
  1892 0000019F 20696E206275666665- <1>
  1892 000001A8 72210D0A00          <1>
  1893 000001AD 082020205B4449525D  <1> .dirinsteadsize:	countedb "   [DIR]"
  1894 000001B6 083E32353620546942  <1> .sizetoolarge:		countedb ">256 TiB"
  1895 000001BF 46696C65206E6F7420- <1> .notfound:		db "File not found."
  1895 000001C8 666F756E642E        <1>
  1896 000001CE 0D0A00              <1> .linebreak:		asciz 13,10
  1897 000001D1 52756E207769746820- <1> .help:		db "Run with a pathname as parameter.",13,10
  1897 000001DA 6120706174686E616D- <1>
  1897 000001E3 652061732070617261- <1>
  1897 000001EC 6D657465722E0D0A    <1>
  1898 000001F4 4C61737420636F6D70- <1> 		db "Last component may include wildcards.",13,10
  1898 000001FD 6F6E656E74206D6179- <1>
  1898 00000206 20696E636C75646520- <1>
  1898 0000020F 77696C646361726473- <1>
  1898 00000218 2E0D0A              <1>
  1899 0000021B 0D0A                <1> 		db 13,10
  1900 0000021D 416674657220746865- <1> 		db "After the pathname, keywords may follow:",13,10
  1900 00000226 20706174686E616D65- <1>
  1900 0000022F 2C206B6579776F7264- <1>
  1900 00000238 73206D617920666F6C- <1>
  1900 00000241 6C6F773A0D0A        <1>
  1901                              <1> %ifn _BOOT
  1902                              <1> 		db 9,"SFN",9,"Use DOS SFN search even if LFN available",13,10
  1903                              <1> 		db 9,"WIDE",9,"Display in wide mode, up to 5 SFNs per line",13,10
  1904                              <1> 		db 9,"SORT",9,"Sort filenames, default is SFNs. Must fit in buffer!",13,10
  1905                              <1> 		db 9,"SORTSFN",9,"Same as SORT, but explicitly sort SFNs",13,10
  1906                              <1> 		db 9,"SORTLFN",9,"Sort filenames using their LFNs",13,10
  1907                              <1> %else
  1908 00000247 095749444509446973- <1> 		db 9,"WIDE",9,"Display in wide mode, up to 5 SFNs per line",13,10
  1908 00000250 706C617920696E2077- <1>
  1908 00000259 696465206D6F64652C- <1>
  1908 00000262 20757020746F203520- <1>
  1908 0000026B 53464E732070657220- <1>
  1908 00000274 6C696E650D0A        <1>
  1909 0000027A 09534F525409536F72- <1> 		db 9,"SORT",9,"Sort filenames. Must fit in buffer!",13,10
  1909 00000283 742066696C656E616D- <1>
  1909 0000028C 65732E204D75737420- <1>
  1909 00000295 66697420696E206275- <1>
  1909 0000029E 66666572210D0A      <1>
  1910                              <1> %endif
  1911 000002A5 094441544509576865- <1> 		db 9,"DATE",9,"When sorting, sort by date first",13,10
  1911 000002AE 6E20736F7274696E67- <1>
  1911 000002B7 2C20736F7274206279- <1>
  1911 000002C0 206461746520666972- <1>
  1911 000002C9 73740D0A            <1>
  1912 000002CD 0953495A4509576865- <1> 		db 9,"SIZE",9,"When sorting, sort by size first",13,10
  1912 000002D6 6E20736F7274696E67- <1>
  1912 000002DF 2C20736F7274206279- <1>
  1912 000002E8 2073697A6520666972- <1>
  1912 000002F1 73740D0A            <1>
  1913 000002F5 095245564552534509- <1> 		db 9,"REVERSE",9,"When sorting, reverse name/DATE/SIZE sort order",13,10
  1913 000002FE 5768656E20736F7274- <1>
  1913 00000307 696E672C2072657665- <1>
  1913 00000310 727365206E616D652F- <1>
  1913 00000319 444154452F53495A45- <1>
  1913 00000322 20736F7274206F7264- <1>
  1913 0000032B 65720D0A            <1>
  1914 0000032F 094449524649525354- <1> 		db 9,"DIRFIRST",9,"When sorting, sort directories first",13,10
  1914 00000338 095768656E20736F72- <1>
  1914 00000341 74696E672C20736F72- <1>
  1914 0000034A 74206469726563746F- <1>
  1914 00000353 726965732066697273- <1>
  1914 0000035C 740D0A              <1>
  1915 0000035F 00                  <1> 		asciz
  1916                              <1> 
  1917                              <1> uinit_data: equ $
  1918                              <1> 
  1919                              <1> 	align 16, db 0
  1920                              <1> data_size equ $ - datastart
  1921                              <1> 
  1922                              <1> 	absolute uinit_data
  1923                              <1> 
  1924                              <1> 	alignb 2
  1925                              <1> %if _BOOT
  1926 00000360 ????                <1> wild_pattern:	resw 1
  1927                              <1> %else
  1928                              <1> originaldta:	resd 1
  1929                              <1> originalinject:	resw 1
  1930                              <1> %endif
  1931                              <1> 
  1932 00000362 ????                <1> sortsegsel:	resw 1
  1933 00000364 ????                <1> sortstartoffset:resw 1
  1934 00000366 ????                <1> sortendoffset:	resw 1
  1935 00000368 ????                <1> sort_last:	resw 1
  1936 0000036A ????                <1> sort_next:	resw 1
  1937                              <1> 
  1938 0000036C ????                <1> pathname_start:	resw 1
  1939 0000036E ????                <1> pathname_length:resw 1
  1940                              <1> %ifn _BOOT
  1941                              <1> findnext_function_number:
  1942                              <1> 		resw 1
  1943                              <1> findhandle:	resw 1
  1944                              <1> %endif
  1945                              <1> 
  1946                              <1> buffer:
  1947                              <1> %ifn _BOOT
  1948                              <1> dta:		resb 15h
  1949                              <1> .attrib:	resb 1
  1950                              <1> .time:		resw 1
  1951                              <1> .date:		resw 1
  1952                              <1> .size:		resd 1
  1953                              <1> .name:		resb 13
  1954                              <1> %endif
  1955                              <1> 
  1956                              <1> 	alignb 2
  1957                              <1> finddata:
  1958 00000370 ????????            <1> .attrib:	resd 1
  1959 00000374 <res 10h>           <1> 		resq 2
  1960 00000384 ????                <1> .time:		resw 1
  1961 00000386 ????                <1> .date:		resw 1
  1962 00000388 ????????            <1> 		resd 1
  1963 0000038C ????????            <1> .sizehigh:	resd 1
  1964 00000390 ????????            <1> .sizelow:	resd 1
  1965 00000394 ????????????????    <1> 		resb 8
  1966                              <1> pathnamebuffer equ $
  1967 0000039C <res 104h>          <1> .fullname:	resb 260
  1968 000004A0 <res Eh>            <1> .shortname:	resb 14
  1969 000004AE ??????????          <1> size40bit:	resb 5
  1970                              <1> 
  1971 000004B3 <res Dh>            <1> 	alignb 16
  1972                              <1> uinit_data_end_1:
  1973                              <1> 
  1974                              <1> 	absolute buffer
  1975 00000370 <res 200h>          <1> 		resb 512
  1976                              <1> buffer_end:
  1977                              <1> 
  1978                              <1> 	alignb 16
  1979                              <1> uinit_data_end_2:
  1980                              <1> 
  1981                              <1> %if uinit_data_end_2 > uinit_data_end_1
  1982                              <1>  uinit_data_end equ uinit_data_end_2
  1983                              <1> %else
  1984                              <1>  uinit_data_end equ uinit_data_end_1
  1985                              <1> %endif
  1986                              <1> 
  1987                              <1> 
  1988                              <1> total_data_size equ uinit_data_end - datastart
  1989                              <1> %assign _DATA_SIZE total_data_size
  1990                              <1> 
  1991                              <1> 	usesection CODE
  1992                              <1> 
  1993                              <1> %include "eldlink.asm"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug linker
     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> %include "lmacros3.mac"
     1                              <3> [list -]
    16                              <2> %include "eld.mac"
     1                              <3> %if 0
     2                              <3> 
     3                              <3> Extensions for lDebug macros
     4                              <3> 
     5                              <3> Copyright (C) 2008-2025 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 ELD_MAC
    16                              <3> %define ELD_MAC 1
    17                              <3> 
    18                              <3> %include "lmacros3.mac"
    19                              <3> 
    20                              <3> 		; ELD executable header
    21                              <3> 	struc ELD_HEADER
    22                              <3> eldhSignature:		resb 4	; "ELD1"
    23                              <3> 			resb 3	; reserved
    24                              <3> 			resb 1	; 26 (Ctrl-Z)
    25                              <3> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26                              <3> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27                              <3> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28                              <3> eldhDataOffset:		resd 1
    29                              <3> eldhDataImageLength:	resw 1	; (zero allowed)
    30                              <3> eldhDataAllocLength:	resw 1	; (zero allowed)
    31                              <3> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32                              <3> eldhReserved:		resb 4	; reserved
    33                              <3> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <3> 	endstruc
    35                              <3> 	endarea ELD_HEADER, 1
    36                              <3> 
    37                              <3> 	struc ELD_HEADERX
    38                              <3> eldhxHeader:		resb ELD_HEADER_size
    39                              <3> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40                              <3> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41                              <3> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42                              <3> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <3> 	alignb 16
    44                              <3> 	endstruc
    45                              <3> 
    46                              <3> 	struc ELD_TRAILER_HEADER
    47                              <3> eldthSignature:		resb 8	; "ELD1TAIL"
    48                              <3> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <3> 				;  add this dword to the seek offset
    50                              <3> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51                              <3> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <3> 	endstruc
    53                              <3> 	endarea ELD_TRAILER_HEADER, 1
    54                              <3> 
    55                              <3> 	struc ELD_LIBTABLE
    56                              <3> eldltFormat:		resw 1
    57                              <3> 	; 0 = uncompressed
    58                              <3> 	; 2 = heatshrink compressed
    59                              <3> 	; 3 = lzexedat -4 compressed
    60                              <3> 	; 4 = lzexedat -4 -l compressed
    61                              <3> eldltAmount:		resw 1
    62                              <3> eldltOffset:		resd 1	; from eldhxHeader
    63                              <3> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <3> 	endstruc
    65                              <3> 	endarea ELD_LIBTABLE, 1
    66                              <3> 
    67                              <3> 		; ELD instance header
    68                              <3> 	struc ELD_INSTANCE
    69                              <3> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70                              <3> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71                              <3> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72                              <3> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73                              <3> eldiIdentifier:		resb 8	; blank-filled text
    74                              <3> eldiFlags:		resw 1	; flags
    75                              <3> eldiListing_size equ 14
    76                              <3> eldiListing:		resb eldiListing_size
    77                              <3> 				; ASCIZ listing file name
    78                              <3> 	endstruc
    79                              <3> 		; flags for eldiFlags:
    80                              <3> eldifResident:		equ 1
    81                              <3> 
    82                              <3> 		; ELD link info header
    83                              <3> 	struc ELD_LINKINFO
    84                              <3> eldlSignature:		resw 1	; 0E1D1h
    85                              <3> eldlReserved:		resw 2
    86                              <3> eldlUseLinkHash:	resw 1
    87                              <3> eldlDataAmount:		resw 1
    88                              <3> eldlDataPrefixes:	resw 1
    89                              <3> eldlDataEntries:	resw 1
    90                              <3> eldlDataAddresses:	resw 1
    91                              <3> eldlCodeAmount:		resw 1
    92                              <3> eldlCodePrefixes:	resw 1
    93                              <3> eldlCodeEntries:	resw 1
    94                              <3> eldlCodeAddresses:	resw 1
    95                              <3> 	endstruc
    96                              <3> 
    97                              <3> 	numdef ELD_CODE_VSTART, 9001h
    98                              <3> 	numdef ELD_DATA_VSTART, 8000h
    99                              <3> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <3> 
   101                              <3> 	numdef ELD_RECLAIM_HINT, 0
   102                              <3> 	strdef ELD_LISTING, ""
   103                              <3> 	numdef ELD_DATETIME, 0
   104                              <3> 
   105                              <3> %if _ELD_DATETIME
   106                              <3>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <3>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <3> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <3> 		asciz		; for future extension
   110                              <3>  %endmacro
   111                              <3> %else
   112                              <3>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <3>  %define PUT_ELD_DATETIME
   114                              <3> %endif
   115                              <3> 
   116                              <3> %endif
    17                              <2> 
    18                              <2> 	cpu 8086
    19                              <2> 
    20                              <2> %if ELDSTRICT
    21                              <2>  %if ELDSTRICTCOUNTER
    22                              <2>   %error Missing relocation
    23                              <2>  %endif
    24                              <2> %endif
    25                              <2> 	eldstrict off		; linker does some relocations
    26                              <2> 
    27                              <2> %ifn ELDCALLCALL_DUMPED
    28 00000845 90<rep 3h>E8[0000]- <2> 	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
    28 0000084B EB020000C3E8[0000]- <2>
    28 00000853 EB020000C3E8[0000]- <2>
    28 0000085B EB020000C3E8[0000]- <2>
    28 00000863 EB020000C3E8[0000]- <2>
    28 0000086B EB020000C3E8[0000]- <2>
    28 00000873 EB020000C3E8[0000]- <2>
    28 0000087B EB020000C3E8[0000]- <2>
    28 00000883 EB020000C3E8[0000]- <2>
    28 0000088B EB020000C3E8[0000]- <2>
    28 00000893 EB020000C3E8[0000]- <2>
    28 0000089B EB020000C3E8[0000]- <2>
    28 000008A3 EB020000C3E8[0000]- <2>
    28 000008AB EB020000C3E8[0000]- <2>
    28 000008B3 EB020000C3E8[0000]- <2>
    28 000008BB EB020000C3E8[0000]- <2>
    28 000008C3 EB020000C3E8[0000]- <2>
    28 000008CB EB020000C3E8[0000]- <2>
    28 000008D3 EB020000C3E8[0000]- <2>
    28 000008DB EB020000C3E8[0000]- <2>
    28 000008E3 EB020000C3E8[0000]- <2>
    28 000008EB EB020000C3E8[0000]- <2>
    28 000008F3 EB020000C3          <2>
    29                              <2> %endif
    30                              <2> 
    31                              <2> 	numdef ELD_IDENTICALISE, 0
    32                              <2> 	numdef ELD_DEBUG, 0
    33                              <2> 	numdef ELD_LINKER_PASSES, 1
    34                              <2> 	strdef LISTING, _ELD_LISTING
    35                              <2> 	numdef ELDCALL_OPTIONAL, ELDCALL_OPTIONAL_STATUS
    36                              <2> 	numdef ELDDATA_OPTIONAL, ELDDATA_OPTIONAL_STATUS
    37                              <2> %if _ELD_IDENTICALISE
    38                              <2>  ;%assign _ELDCALL_OPTIONAL 1
    39                              <2> %endif
    40                              <2> %ifn _ELDCALL_OPTIONAL
    41                              <2> %assign ELDCALL_OPTIONAL_STATUS 2		; not allowed
    42                              <2> %endif
    43                              <2> ;%ifn _ELDDATA_OPTIONAL
    44                              <2> ;%assign ELDDATA_OPTIONAL_STATUS 2		; not allowed
    45                              <2> ;%endif
    46                              <2> 	gendef MAP, ""
    47                              <2> 
    48                              <2> %ifnidni _MAP, ""
    49                              <2>  [map all _MAP]
    50                              <2> %endif
    51                              <2> 
    52                              <2> 
    53                              <2> endresident: equ ($ + _CURRENT_SECTION %+ FIXUP + 15) & ~15
    54                              <2> 
    55                              <2> %if _ELD_LINKER_PASSES
    56                              <2> %assign ELDLINKER 1
    57                              <2> 
    58                              <2> 	struc LINKTABLE
    59 00000000 ????????            <2> ltCodeToCode:	resw 2
    60 00000004 ????????            <2> ltCodeToData:	resw 2
    61 00000008 ????????            <2> ltDataToCode:	resw 2
    62 0000000C ????????            <2> ltDataToData:	resw 2
    63 00000010 ????????            <2> ltLinkData:	resw 2
    64 00000014 ????????            <2> ltLinkCode:	resw 2
    65                              <2> 	endstruc
    66                              <2> %endif
    67                              <2> 
    68                              <2> 
    69                              <2> linker:
    70                              <2> 		; The first 15 Bytes of the linker should be
    71                              <2> 		;  the same regardless of the linker options
    72                              <2> 		;  used (debug, passes, vstart). This allows
    73                              <2> 		;  the eldcomp ELD to match even if up to 15
    74                              <2> 		;  Bytes of the linker are trailing in the
    75                              <2> 		;  resident part of the ELD.
    76                              <2> 	lframe
    77                              <2>  %if ELDOTHER
    78                              <2> 	lvar dword, linkinfo_other
    79                              <2> 	lvar word, use_hash_other
    80                              <2>  %endif
    81 000008F8 5589E5              <2> 	lenter
    82                              <2> 	lvar dword, instance
    83 000008FB 06                  <2> 	 push es
    84 000008FC 52                  <2> 	 push dx
    85                              <2> 	lvar word, targetsection_low_optional_high
    86 000008FD 50                  <2> 	 push ax
    87                              <2> 	lequ ?targetsection_low_optional_high, targetsection
    88                              <2> 	lequ ?targetsection_low_optional_high + 1, optional
    89                              <2> 	lvar dword, linkinfo
    90 000008FE 1E                  <2> 	 push ds
    91 000008FF 57                  <2> 	 push di
    92                              <2> 	lvar dword, nextreloc
    93 00000900 06                  <2> 	 push es
    94 00000901 52                  <2> 	 push dx
    95                              <2> 	lvar dword, entry
    96 00000902 06                  <2> 	 push es
    97 00000903 50                  <2> 	 push ax		; placeholder
    98 00000904 31C0                <2> 	xor ax, ax
    99 00000906 813DD1E1            <2> 	cmp word [di + eldlSignature], 0E1D1h
   100                              <2> %if ($ - linker) < 16
   101                              <2>  %error Expected invariant first paragraph of linker
   102                              <2> %endif
   103 0000090A 7403E95802          <2> 	jne .error_j
   104 0000090F 837D0601            <2> 	cmp word [di + eldlUseLinkHash], 1
   105 00000913 7603E94F02          <2> 	ja .error_j
   106 00000918 7201                <2> 	jb @F
   107 0000091A 48                  <2> 	dec ax
   108                              <2> @@:
   109                              <2> 	lvar word, use_hash
   110 0000091B 50                  <2> 	 push ax
   111                              <2> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   112                              <2> 	mov ax, linktable - code
   113                              <2> 	lvar word, lt
   114                              <2> 	 push ax
   115                              <2> %endif
   116                              <2> %if _ELD_LINKER_PASSES || ELDOTHER
   117 0000091C 31C0                <2> 	xor ax, ax
   118                              <2>  %if _ELD_LINKER_PASSES
   119                              <2> 	lvar word, pass
   120 0000091E 50                  <2> 	 push ax
   121                              <2> 	lvar word, amounterrors
   122 0000091F 50                  <2> 	 push ax
   123                              <2> 	lvar word, name
   124 00000920 50                  <2> 	 push ax
   125                              <2>  %endif
   126                              <2>  %if ELDOTHER
   127                              <2> 	lvar word, other
   128                              <2> 	 push ax
   129                              <2>  %endif
   130                              <2> %endif
   131 00000921 56                  <2> 	push si
   132 00000922 53                  <2> 	push bx
   133                              <2> 
   134                              <2> 			; simple: add instance base (dx) to code
   135 00000923 06                  <2> 	push es
   136 00000924 1F                  <2> 	pop ds
   137                              <2> %if _ELD_LINKER_PASSES
   138                              <2> .pass:
   139 00000925 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   140 00000928 01D3                <2> 	add bx, dx
   141                              <2>  %if _ELD_IDENTICALISE
   142                              <2> 	add bx, word [bp + ?lt]
   143                              <2> 	mov si, word [ltCodeToCode + bx]
   144                              <2>  %else
   145 0000092A 8BB7C80C            <2> 	mov si, word [linktable - code + ltCodeToCode + bx]
   146                              <2>  %endif
   147                              <2> %else
   148                              <2> 	mov si, internalcodetocoderelocations - code
   149                              <2> %endif
   150 0000092E 01D6                <2> 	add si, dx
   151                              <2> @@:
   152 00000930 AD                  <2> 	lodsw
   153 00000931 85C0                <2> 	test ax, ax		; was last ?
   154 00000933 740B                <2> 	jz @F			; yes -->
   155 00000935 93                  <2> 	xchg bx, ax		; bx = entry
   156 00000936 01D3                <2> 	add bx, dx		; relocate the entry itself
   157                              <2> %if _ELD_CODE_VSTART
   158 00000938 812F[0000]          <2> 	sub word [bx], code	; undo adjustment
   159                              <2> %endif
   160 0000093C 0117                <2> 	add word [bx], dx	; relocate word referenced by entry
   161 0000093E EBF0                <2> 	jmp @B
   162                              <2> 
   163                              <2> @@:
   164                              <2> 			; next, add heap data base (on stack) to code
   165                              <2> %if _ELD_LINKER_PASSES
   166 00000940 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   167 00000943 01D3                <2> 	add bx, dx
   168                              <2>  %if _ELD_IDENTICALISE
   169                              <2> 	add bx, word [bp + ?lt]
   170                              <2> 	mov si, word [ltCodeToData + bx]
   171                              <2>  %else
   172 00000945 8BB7CC0C            <2> 	mov si, word [linktable - code + ltCodeToData + bx]
   173                              <2>  %endif
   174                              <2> %else
   175                              <2> 	mov si, internalcodetodatarelocations - code
   176                              <2> %endif
   177 00000949 01D6                <2> 	add si, dx
   178                              <2> @@:
   179 0000094B AD                  <2> 	lodsw
   180 0000094C 85C0                <2> 	test ax, ax		; was last ?
   181 0000094E 740C                <2> 	jz @F			; yes -->
   182 00000950 93                  <2> 	xchg bx, ax		; bx = entry
   183 00000951 01D3                <2> 	add bx, dx		; relocate the entry itself
   184 00000953 58                  <2> 	pop ax			; ax -> heap data
   185 00000954 50                  <2> 	push ax
   186                              <2> %if _ELD_DATA_VSTART
   187 00000955 2D[0000]            <2> 	sub ax, datastart	; undo adjustment
   188                              <2> %endif
   189 00000958 0107                <2> 	add word [bx], ax	; relocate word referenced by entry
   190 0000095A EBEF                <2> 	jmp @B
   191                              <2> 
   192                              <2> @@:
   193                              <2> 
   194                              <2> 			; add instance base (dx) to data
   195                              <2> %if _ELD_LINKER_PASSES
   196 0000095C 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   197 0000095F 01D3                <2> 	add bx, dx
   198                              <2>  %if _ELD_IDENTICALISE
   199                              <2> 	add bx, word [bp + ?lt]
   200                              <2> 	mov si, word [ltDataToCode + bx]
   201                              <2>  %else
   202 00000961 8BB7D00C            <2> 	mov si, word [linktable - code + ltDataToCode + bx]
   203                              <2>  %endif
   204                              <2> %else
   205                              <2> 	mov si, internaldatatocoderelocations - code
   206                              <2> %endif
   207 00000965 01D6                <2> 	add si, dx
   208                              <2> @@:
   209 00000967 AD                  <2> 	lodsw
   210 00000968 83F8FF              <2> 	cmp ax, -1		; was last ?
   211 0000096B 740F                <2> 	je @F			; yes -->
   212 0000096D 93                  <2> 	xchg bx, ax		; bx = entry
   213 0000096E 58                  <2> 	pop ax
   214 0000096F 50                  <2> 	push ax
   215 00000970 01C3                <2> 	add bx, ax		; relocate the entry itself
   216                              <2> %if _ELD_CODE_VSTART
   217 00000972 36812F[0000]        <2> 	sub word [ss:bx], code	; undo adjustment
   218                              <2> %endif
   219 00000977 360117              <2> 	add word [ss:bx], dx	; relocate word referenced by entry
   220 0000097A EBEB                <2> 	jmp @B
   221                              <2> 
   222                              <2> @@:
   223                              <2> 			; next, add heap data base (on stack) to data
   224                              <2> %if _ELD_LINKER_PASSES
   225 0000097C 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   226 0000097F 01D3                <2> 	add bx, dx
   227                              <2>  %if _ELD_IDENTICALISE
   228                              <2> 	add bx, word [bp + ?lt]
   229                              <2> 	mov si, word [ltDataToData + bx]
   230                              <2>  %else
   231 00000981 8BB7D40C            <2> 	mov si, word [linktable - code + ltDataToData + bx]
   232                              <2>  %endif
   233                              <2> %else
   234                              <2> 	mov si, internaldatatodatarelocations - code
   235                              <2> %endif
   236 00000985 01D6                <2> 	add si, dx
   237                              <2> @@:
   238 00000987 AD                  <2> 	lodsw
   239 00000988 83F8FF              <2> 	cmp ax, -1		; was last ?
   240 0000098B 740D                <2> 	je @F			; yes -->
   241 0000098D 93                  <2> 	xchg bx, ax		; bx = entry
   242 0000098E 58                  <2> 	pop ax			; ax -> heap data
   243 0000098F 50                  <2> 	push ax
   244 00000990 01C3                <2> 	add bx, ax		; relocate the entry itself
   245                              <2> %if _ELD_DATA_VSTART
   246 00000992 2D[0000]            <2> 	sub ax, datastart	; undo adjustment
   247                              <2> %endif
   248 00000995 360107              <2> 	add word [ss:bx], ax	; relocate word referenced by entry
   249 00000998 EBED                <2> 	jmp @B
   250                              <2> 
   251                              <2> @@:
   252 0000099A 8B56FC              <2> 	mov dx, word [bp + ?instance]
   253                              <2> %if _ELD_LINKER_PASSES
   254 0000099D 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   255 000009A0 01D3                <2> 	add bx, dx
   256                              <2>  %if _ELD_IDENTICALISE
   257                              <2> 	add bx, word [bp + ?lt]
   258                              <2> 	add dx, word [ltLinkData + bx]
   259                              <2>  %else
   260 000009A2 0397D80C            <2> 	add dx, word [linktable - code + ltLinkData + bx]
   261                              <2>  %endif
   262                              <2> %else
   263                              <2> 	add dx, linkerdatarelocations - code
   264                              <2> %endif
   265                              <2> .otherloop:
   266 000009A6 8956F2              <2> 	mov word [bp + ?nextreloc], dx
   267                              <2> 
   268                              <2> .datarelocloop:		; must be done before further relocs
   269 000009A9 C576F2              <2> 	lds si, [bp + ?nextreloc]
   270 000009AC AD                  <2> 	lodsw			; ax = section indicator
   271 000009AD 85C0                <2> 	test ax, ax		; end of table ?
   272 000009AF 7503E92301          <2> 	jz .donedatareloc
   273 000009B4 48                  <2> 	dec ax			; al = 1 if data, 0 if code
   274 000009B5 5B                  <2> 	pop bx
   275 000009B6 53                  <2> 	push bx			; bx -> ELD data block
   276 000009B7 8946FA              <2> 	mov word [bp + ?targetsection_low_optional_high], ax
   277 000009BA 84C0                <2> 	test al, al		; data ?
   278 000009BC AD                  <2> 	lodsw
   279 000009BD 7504                <2> 	jnz @F			; yes -->
   280 000009BF 0346FC              <2> 	add ax, word [bp + ?instance]
   281                              <2> 				; relocate entry into code
   282 000009C2 A9                  <2> 	db __TEST_IMM16		; (skip add)
   283                              <2> @@:
   284 000009C3 01D8                <2> 	add ax, bx		; relocate entry into data
   285 000009C5 8946EE              <2> 	mov word [bp + ?entry], ax
   286 000009C8 AD                  <2> 	lodsw
   287 000009C9 8976F2              <2> 	mov word [bp + ?nextreloc], si
   288 000009CC E8DC00              <2> 	call .build_match
   289                              <2> %if _ELD_LINKER_PASSES
   290 000009CF 73D8                <2> 	jnc .datarelocloop
   291                              <2> %endif
   292 000009D1 C45EF6              <2> 	les bx, [bp + ?linkinfo]
   293                              <2> %if ELDOTHER
   294                              <2> 	rol byte [bp + ?other], 1
   295                              <2> 	jnc @F
   296                              <2> 	les bx, [bp + ?linkinfo_other]
   297                              <2> @@:
   298                              <2> %endif
   299 000009D4 268B4F08            <2> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   300 000009D8 268B7F0A            <2> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   301                              <2> .datarelocfind:
   302 000009DC F2AF                <2> 	repne scasw			; scan initial
   303 000009DE 7541                <2> 	jne .datarelocnotfound
   304 000009E0 57                  <2> 	push di
   305 000009E1 51                  <2> 	push cx
   306 000009E2 56                  <2> 	push si
   307 000009E3 262B7F0A            <2> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   308 000009E7 4F                  <2> 	dec di
   309 000009E8 4F                  <2> 	dec di				; 0-based
   310 000009E9 26037F0C            <2> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   311 000009ED 268B3D              <2> 	mov di, [es:di]			; -> counted suffix/string
   312 000009F0 B500                <2> 	mov ch, 0
   313 000009F2 8A0C                <2> 	mov cl, byte [si]		; cx = length
   314 000009F4 41                  <2> 	inc cx
   315                              <2> 	; cmp al, al			; ZR if length is zero
   316 000009F5 F3A6                <2> 	repe cmpsb			; match ?
   317 000009F7 5E                  <2> 	pop si
   318 000009F8 59                  <2> 	pop cx
   319 000009F9 5F                  <2> 	pop di
   320 000009FA 75E0                <2> 	jne .datarelocfind
   321 000009FC 8814                <2> 	mov byte [si], dl
   322 000009FE 262B7F0A            <2> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   323 00000A02 4F                  <2> 	dec di
   324 00000A03 4F                  <2> 	dec di				; 0-based
   325 00000A04 26037F0E            <2> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   326 00000A08 268B05              <2> 	mov ax, word [es:di]
   327 00000A0B E80700              <2> 	call .address_data_reloc
   328                              <2> %if _ELD_RELOC_VSTART
   329 00000A0E 2D[0000]            <2> 	sub ax, relocateddata		; *not* a relocation
   330                              <2> %endif
   331 00000A11 0104                <2> 	add word [si], ax		; relocate
   332 00000A13 EB94                <2> 	jmp .datarelocloop
   333                              <2> 
   334                              <2> .address_data_reloc:
   335 00000A15 C576EE              <2> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   336 00000A18 807EFA00            <2> 	cmp byte [bp + ?targetsection], 0
   337                              <2> 					; relocation in code ?
   338 00000A1C 7402                <2> 	je @F				; yes -->
   339 00000A1E 16                  <2> 	push ss
   340 00000A1F 1F                  <2> 	pop ds				; => our ELD data block
   341                              <2> @@:
   342 00000A20 C3                  <2> 	retn
   343                              <2> 
   344                              <2> .datarelocnotfound:
   345 00000A21 8814                <2> 	mov byte [si], dl
   346 00000A23 807EFB00            <2> 	cmp byte [bp + ?optional], 0
   347                              <2> %if _ELD_DEBUG
   348                              <2> 	jne @F
   349                              <2>  %ifn _ELD_LINKER_PASSES
   350                              <2> 	mov si, 0			; (invalid link)
   351                              <2> linkdatarelocation internalflags6
   352                              <2> 	test si, si
   353                              <2> 	jz .datanotfound
   354                              <2> 	mov si, 0			; (invalid link)
   355                              <2> linkdatarelocation options7
   356                              <2> 	test si, si
   357                              <2> 	jz .datanotfound
   358                              <2>  %else
   359                              <2> 	cmp byte [bp + ?pass], 0
   360                              <2> 	je .datanotfound
   361                              <2>  %endif
   362                              <2> 	houdini
   363                              <2> 	jmp .datanotfound
   364                              <2> @@:
   365                              <2> %else
   366 00000A27 7417                <2> 	je .datanotfound
   367                              <2> %endif
   368                              <2> 
   369                              <2> %if ELDDATA_PMREQUIRED_STATUS
   370                              <2> 	mov si, relocateddata
   371                              <2> linkdatarelocation build_option_PM
   372                              <2> 	test si, si
   373                              <2> 	jz @F
   374                              <2> 	test byte [bp + ?optional], 2
   375                              <2> 	jnz .datanotfound
   376                              <2> @@:
   377                              <2> %endif
   378                              <2> 
   379                              <2> %if _ELD_LINKER_PASSES
   380 00000A29 36F606[0000]02      <2> 	testopt [ss:relocateddata], 2
   381                              <2> linkdatarelocation options7, -3
   382 00000A2F 7406                <2> 	jz @F
   383 00000A31 BE[4513]            <2> 	mov si, lmsg.warning_data_optional
   384                              <2> internalcoderelocation
   385 00000A34 E82B00              <2> 	call .notfound
   386                              <2> @@:
   387                              <2> %endif
   388 00000A37 E8DBFF              <2> 	call .address_data_reloc
   389 00000A3A 832400              <2> 	and word [si], 0		; indicate optional data link failed
   390 00000A3D E969FF              <2> 	jmp .datarelocloop
   391                              <2> 
   392                              <2> 
   393                              <2> %if _ELDCALL_OPTIONAL
   394                              <2> .coderelocnotfound:
   395                              <2> 	mov byte [si], dl
   396                              <2> 	cmp byte [bp + ?optional], 0
   397                              <2> %if _ELD_DEBUG
   398                              <2> 	jne @F
   399                              <2>  %ifn _ELD_LINKER_PASSES
   400                              <2> 	mov si, 0			; (invalid link)
   401                              <2> linkdatarelocation internalflags6
   402                              <2> 	test si, si
   403                              <2> 	jz .codenotfound
   404                              <2> 	mov si, 0			; (invalid link)
   405                              <2> linkdatarelocation options7
   406                              <2> 	test si, si
   407                              <2> 	jz .codenotfound
   408                              <2>  %else
   409                              <2> 	cmp byte [bp + ?pass], 0
   410                              <2> 	je .codenotfound
   411                              <2>  %endif
   412                              <2> 	houdini
   413                              <2> 	jmp .codenotfound
   414                              <2> @@:
   415                              <2> %else
   416                              <2> 	je .codenotfound
   417                              <2> %endif
   418                              <2> 
   419                              <2> %if ELDCALL_PMREQUIRED_STATUS
   420                              <2>  %if _ELD_LINKER_PASSES
   421                              <2>   %assign ELDLINKER 0
   422                              <2>  %endif
   423                              <2> 	mov si, relocateddata
   424                              <2> linkdatarelocation build_option_PM
   425                              <2>  %if _ELD_LINKER_PASSES
   426                              <2>   %assign ELDLINKER 1
   427                              <2>  %endif
   428                              <2> 	test si, si
   429                              <2> 	jz @F
   430                              <2> 	test byte [bp + ?optional], 2
   431                              <2> 	jnz .codenotfound
   432                              <2> @@:
   433                              <2> %endif
   434                              <2> 
   435                              <2> %if _ELD_LINKER_PASSES
   436                              <2> 	testopt [ss:relocateddata], 2
   437                              <2> linkdatarelocation options7, -3
   438                              <2> 	jz @F
   439                              <2> 	mov si, lmsg.warning_code_optional
   440                              <2> internalcoderelocation
   441                              <2> 	call .notfound
   442                              <2> @@:
   443                              <2> %endif
   444                              <2> 	lds si, [bp + ?entry]
   445                              <2> 	mov word [si], 9090h
   446                              <2> 	mov byte [si + 2], 90h		; indicate optional code link failed
   447                              <2> 	jmp .coderelocloop
   448                              <2> %endif
   449                              <2> 
   450                              <2> 
   451                              <2> %if _ELD_LINKER_PASSES
   452                              <2> .datanotfound:
   453 00000A40 BE[6713]            <2> 	mov si, lmsg.error_data
   454                              <2> internalcoderelocation
   455 00000A43 E81C00              <2> 	call .notfound
   456 00000A46 7203E91C01          <2> 	jnc .error_j
   457 00000A4B FF46E8              <2> 	inc word [bp + ?amounterrors]
   458 00000A4E E958FF              <2> 	jmp .datarelocloop
   459                              <2> 
   460                              <2> .codenotfound:
   461 00000A51 BE[8013]            <2> 	mov si, lmsg.error_code
   462                              <2> internalcoderelocation
   463 00000A54 E80B00              <2> 	call .notfound
   464 00000A57 7203E90B01          <2> 	jnc .error_j
   465 00000A5C FF46E8              <2> 	inc word [bp + ?amounterrors]
   466 00000A5F E98400              <2> 	jmp .coderelocloop
   467                              <2> 
   468                              <2> .notfound:
   469 00000A62 807EEA00            <2> 	cmp byte [bp + ?pass], 0
   470 00000A66 743A                <2> 	je @F				; --> (NC)
   471 00000A68 16                  <2> 	 push ss
   472 00000A69 07                  <2> 	 pop es
   473 00000A6A BF[0000]            <2> 	mov di, relocateddata
   474                              <2> linkdatarelocation line_out
   475 00000A6D E83300              <2> 	call .copy
   476 00000A70 8B76E6              <2> 	mov si, word [bp + ?name]
   477 00000A73 AD                  <2> 	lodsw
   478 00000A74 E8[0000]EB020000    <2> 	extcall hexword
   479 00000A7B 56                  <2> 	push si
   480 00000A7C BE[9913]            <2> 	mov si, lmsg.error.2
   481                              <2> internalcoderelocation
   482 00000A7F E82100              <2> 	call .copy
   483 00000A82 5E                  <2> 	pop si
   484                              <2> %if _ELD_LINKER_PASSES
   485 00000A83 56                  <2> 	push si
   486 00000A84 E81C00              <2> 	call .copy
   487 00000A87 5E                  <2> 	pop si
   488 00000A88 C60400              <2> 	mov byte [si], 0		; mark as failed
   489                              <2> %else
   490                              <2> 	call .copy
   491                              <2> %endif
   492 00000A8B B022                <2> 	mov al, '"'
   493 00000A8D AA                  <2> 	stosb
   494 00000A8E 16                  <2> 	 push ss
   495 00000A8F 1F                  <2> 	 pop ds
   496 00000A90 E8[0000]EB020000    <2> 	extcall putsline_crlf
   497 00000A97 B8350E              <2> 	mov ax, 0E35h
   498 00000A9A E8[0000]EB020000    <2> 	extcall setrc
   499 00000AA1 F9                  <2> 	stc				; CY, diagnostic displayed
   500                              <2> @@:
   501 00000AA2 C3                  <2> 	retn
   502                              <2> 
   503                              <2> .copy:
   504 00000AA3 E8[0000]EB020000    <2> 	extcall copy_single_counted_string
   505 00000AAA C3                  <2> 	retn
   506                              <2> %else
   507                              <2> .datanotfound: equ .error_j
   508                              <2> .codenotfound: equ .error_j
   509                              <2> %endif
   510                              <2> 
   511                              <2> .build_match:
   512                              <2> %if _ELD_CODE_VSTART
   513 00000AAB 2D[0000]            <2> 	sub ax, code
   514                              <2> %endif
   515 00000AAE 0346FC              <2> 	add ax, word [bp + ?instance]
   516 00000AB1 96                  <2> 	xchg si, ax
   517                              <2> %if _ELD_LINKER_PASSES
   518 00000AB2 8976E6              <2> 	mov word [bp + ?name], si
   519                              <2> %endif
   520 00000AB5 AD                  <2> 	lodsw			; = hash, si -> counted string
   521 00000AB6 8A14                <2> 	mov dl, byte [si]
   522                              <2> %if _ELD_LINKER_PASSES
   523 00000AB8 84D2                <2> 	test dl, dl		; marked as already failed ?
   524 00000ABA 750A                <2> 	jnz @F
   525 00000ABC 837EE800            <2> 	cmp word [bp + ?amounterrors], 0
   526 00000AC0 7503E9A200          <2> 	je .error_j
   527 00000AC5 C3                  <2> 	retn			; (NC)
   528                              <2> 
   529                              <2> @@:
   530                              <2> %endif
   531                              <2> %if ELDOTHER
   532                              <2> 	rol byte [bp + ?other], 1
   533                              <2> 	jnc @F
   534                              <2> 	rol byte [bp + ?use_hash_other], 1
   535                              <2> 	jmp @FF
   536                              <2> 
   537                              <2> @@:
   538                              <2> %endif
   539 00000AC6 D046EC              <2> 	rol byte [bp + ?use_hash], 1
   540                              <2> @@:
   541 00000AC9 720A                <2> 	jc @F
   542 00000ACB AC                  <2> 	lodsb
   543 00000ACC 91                  <2> 	xchg cx, ax		; cl = length
   544 00000ACD AD                  <2> 	lodsw			; ax = prefix
   545 00000ACE 49                  <2> 	dec cx
   546 00000ACF 49                  <2> 	dec cx
   547 00000AD0 4E                  <2> 	dec si
   548 00000AD1 8A14                <2> 	mov dl, byte [si]
   549 00000AD3 880C                <2> 	mov byte [si], cl	; si -> counted string suffix
   550                              <2> @@:
   551                              <2> %if _ELD_LINKER_PASSES
   552 00000AD5 F9                  <2> 	stc			; CY
   553                              <2> %endif
   554 00000AD6 C3                  <2> 	retn
   555                              <2> 
   556                              <2> 
   557                              <2> .donedatareloc:
   558                              <2> %if ELDOTHER
   559                              <2> 	rol byte [bp + ?other], 1
   560                              <2> 	jc .otherdone
   561                              <2> %endif
   562                              <2> 
   563 00000AD7 8B56FC              <2> 	mov dx, word [bp + ?instance]
   564                              <2> %if _ELD_LINKER_PASSES
   565 00000ADA 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   566 00000ADD 01D3                <2> 	add bx, dx
   567                              <2>  %if _ELD_IDENTICALISE
   568                              <2> 	add bx, word [bp + ?lt]
   569                              <2> 	add dx, word [ltLinkCode + bx]
   570                              <2>  %else
   571 00000ADF 0397DC0C            <2> 	add dx, word [linktable - code + ltLinkCode + bx]
   572                              <2>  %endif
   573                              <2> %else
   574                              <2> 	add dx, linkercoderelocations - code
   575                              <2> %endif
   576 00000AE3 8956F2              <2> 	mov word [bp + ?nextreloc], dx
   577                              <2> 
   578                              <2> .coderelocloop:
   579 00000AE6 C576F2              <2> 	lds si, [bp + ?nextreloc]
   580 00000AE9 AD                  <2> 	lodsw
   581                              <2> %if _ELDCALL_OPTIONAL
   582                              <2> 	dec ax
   583                              <2> 	js .donecodereloc
   584                              <2> 	mov word [bp + ?targetsection_low_optional_high], ax
   585                              <2> 	lodsw
   586                              <2> %endif
   587 00000AEA 0346FC              <2> 	add ax, word [bp + ?instance]
   588 00000AED 8946EE              <2> 	mov word [bp + ?entry], ax
   589 00000AF0 AD                  <2> 	lodsw
   590 00000AF1 8976F2              <2> 	mov word [bp + ?nextreloc], si
   591                              <2> %ifn _ELDCALL_OPTIONAL
   592 00000AF4 85C0                <2> 	test ax, ax
   593 00000AF6 7503E97E00          <2> 	jz .donecodereloc
   594                              <2> %endif
   595 00000AFB E8ADFF              <2> 	call .build_match
   596                              <2> %if _ELD_LINKER_PASSES
   597 00000AFE 73E6                <2> 	jnc .coderelocloop
   598                              <2> %endif
   599 00000B00 C45EF6              <2> 	les bx, [bp + ?linkinfo]
   600 00000B03 268B4F10            <2> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   601 00000B07 268B7F12            <2> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   602                              <2> .coderelocfind:
   603 00000B0B F2AF                <2> 	repne scasw			; scan initial
   604                              <2> %if _ELDCALL_OPTIONAL
   605                              <2> 	jne .coderelocnotfound
   606                              <2> %else
   607                              <2>  %if _ELD_DEBUG
   608                              <2> 	je @F
   609                              <2> 	houdini
   610                              <2> 	jmp .codenotfound
   611                              <2> @@:
   612                              <2>  %else
   613 00000B0D 7403E93FFF          <2> 	jne .codenotfound
   614                              <2>  %endif
   615                              <2> %endif
   616 00000B12 57                  <2> 	push di
   617 00000B13 51                  <2> 	push cx
   618 00000B14 56                  <2> 	push si
   619 00000B15 262B7F12            <2> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   620 00000B19 4F                  <2> 	dec di
   621 00000B1A 4F                  <2> 	dec di				; 0-based
   622 00000B1B 26037F14            <2> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   623 00000B1F 268B3D              <2> 	mov di, [es:di]			; -> counted suffix/string
   624 00000B22 B500                <2> 	mov ch, 0
   625 00000B24 8A0C                <2> 	mov cl, byte [si]		; cx = length
   626 00000B26 41                  <2> 	inc cx
   627                              <2> 	; cmp al, al			; ZR if length is zero
   628 00000B27 F3A6                <2> 	repe cmpsb			; match ?
   629 00000B29 5E                  <2> 	pop si
   630 00000B2A 59                  <2> 	pop cx
   631 00000B2B 5F                  <2> 	pop di
   632 00000B2C 75DD                <2> 	jne .coderelocfind
   633 00000B2E 8814                <2> 	mov byte [si], dl
   634 00000B30 262B7F12            <2> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   635 00000B34 4F                  <2> 	dec di
   636 00000B35 4F                  <2> 	dec di				; 0-based
   637 00000B36 01FF                <2> 	add di, di			; quadruple index
   638 00000B38 26037F16            <2> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   639 00000B3C 26FF35              <2> 	push word [es:di]
   640 00000B3F C576EE              <2> 	lds si, [bp + ?entry]
   641 00000B42 8F4405              <2> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   642                              <2> 					;  patch the destination address
   643 00000B45 803CE8              <2> 	cmp byte [si], 0E8h		; is it as expected ?
   644 00000B48 751D                <2> 	jne .error_j
   645 00000B4A 268B7D02            <2> 	mov di, word [es:di + 2]
   646 00000B4E BB[0000]            <2> 	mov bx, relocateddata
   647                              <2> linkdatarelocation linkcall_table	; ss:bx -> link call table
   648 00000B51 36833F01            <2> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   649 00000B55 7510                <2> 	jne .error_j			; no -->
   650 00000B57 368B4F02            <2> 	mov cx, word [ss:bx + 2]	; get amount of segments
   651 00000B5B E30A                <2> 	jcxz .error_j			; none -->
   652                              <2> @@:
   653 00000B5D 83C304              <2> 	add bx, 4			; -> next segment
   654 00000B60 36393F              <2> 	cmp word [ss:bx], di		; value matches ?
   655 00000B63 7405                <2> 	je @F				; yes, found -->
   656 00000B65 E2F6                <2> 	loop @B				; try remaining segments
   657                              <2> .error_j:
   658 00000B67 E98A00              <2> 	jmp .error
   659                              <2> 
   660                              <2> @@:
   661 00000B6A 368B5F02            <2> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   662                              <2> 		; si + 3 + delta = bx
   663                              <2> 		; delta = bx - si - 3
   664 00000B6E 29F3                <2> 	sub bx, si
   665 00000B70 83EB03              <2> 	sub bx, 3
   666 00000B73 895C01              <2> 	mov word [si + 1], bx		; patch the call instruction
   667 00000B76 E96DFF              <2> 	jmp .coderelocloop
   668                              <2> 
   669                              <2> .donecodereloc:
   670                              <2> %if _ELD_LINKER_PASSES
   671 00000B79 8B46E8              <2> 	mov ax, word [bp + ?amounterrors]
   672 00000B7C 85C0                <2> 	test ax, ax
   673 00000B7E 75E7                <2> 	jnz .error_j
   674 00000B80 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   675 00000B83 85DB                <2> 	test bx, bx
   676 00000B85 750B                <2> 	jnz @F
   677 00000B87 43                  <2> 	inc bx
   678 00000B88 43                  <2> 	inc bx
   679 00000B89 895EEA              <2> 	mov word [bp + ?pass], bx
   680 00000B8C 8B56FC              <2> 	mov dx, word [bp + ?instance]
   681 00000B8F E993FD              <2> 	jmp .pass
   682                              <2> 
   683                              <2> @@:
   684                              <2> %endif
   685                              <2> 
   686                              <2> %ifnidni _LISTING, ""
   687                              <2> %assign ELDLINKER 0
   688                              <2> .hint:
   689 00000B92 16                  <2> 	push ss
   690 00000B93 1F                  <2> 	pop ds
   691 00000B94 B02D                <2> 	mov al, 2Dh
   692 00000B96 E8[0000]EB020000    <2> 	extcall intchk			; ZR if offset = -1 or segment = 0
   693                              <2> 					; CHG: ax, dx, bx
   694 00000B9D 7437                <2> 	jz .no_hint
   695                              <2> 
   696 00000B9F 8A26[0000]          <2> 	mov ah, byte [relocateddata]
   697                              <2> linkdatarelocation try_debugger_amis_multiplex_number
   698 00000BA3 E85500              <2> 	call plex_check
   699 00000BA6 7305                <2> 	jnc @F
   700                              <2> 
   701 00000BA8 B4FF                <2> 	mov ah, 0FFh		; start with multiplex number 0FFh
   702                              <2> .loop_hint:
   703 00000BAA E84E00              <2> 	call plex_check
   704                              <2> @@:
   705 00000BAD 7307                <2> 	jnc .end_hint		; if found --> (NC)
   706 00000BAF 80EC01              <2> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   707 00000BB2 73F6                <2> 	jnc .loop_hint		; try next if we didn't check all yet -->
   708 00000BB4 EB20                <2> 	jmp .no_hint
   709                              <2> 
   710                              <2> .end_hint:
   711 00000BB6 50                  <2> 	push ax
   712 00000BB7 C446FC              <2> 	les ax, [bp + ?instance]
   713 00000BBA BF[BD0F]            <2> 	mov di, listmsg.hint.offset
   714                              <2> internalcoderelocation
   715 00000BBD E8[0000]EB020000    <2> 	extcall hexword
   716 00000BC4 BB[9C0F]            <2> 	mov bx, listmsg.hint
   717                              <2> internalcoderelocation
   718 00000BC7 368B16[0000]        <2> 	mov dx, [ss:relocateddata]
   719                              <2> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   720 00000BCC 58                  <2> 	pop ax
   721 00000BCD B040                <2> 	mov al, 40h		; AMIS message display service
   722 00000BCF E8[0000]EB020000    <2> 	extcall call_int2D
   723                              <2> .no_hint:
   724                              <2> %endif
   725                              <2> 
   726                              <2> %if ELDOTHER
   727                              <2> %assign ELDLINKER 0
   728                              <2> 	not byte [bp + ?other]
   729                              <2> 
   730                              <2> 	push ss
   731                              <2> 	pop ds
   732                              <2> 	mov al, 2Dh
   733                              <2> 	extcall intchk			; ZR if offset = -1 or segment = 0
   734                              <2> 					; CHG: ax, dx, bx
   735                              <2> 	jz .no_other
   736                              <2> 
   737                              <2> 	mov ah, byte [relocateddata]
   738                              <2> linkdatarelocation try_debugger_amis_multiplex_number
   739                              <2> 	call plex_check
   740                              <2> 	jnc @F
   741                              <2> 
   742                              <2> 	mov ah, 0FFh		; start with multiplex number 0FFh
   743                              <2> .loop_other:
   744                              <2> 	call plex_check
   745                              <2> @@:
   746                              <2> 	jnc .end_other		; if found --> (NC)
   747                              <2> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   748                              <2> 	jnc .loop_other		; try next if we didn't check all yet -->
   749                              <2> 	jmp .no_other
   750                              <2> 
   751                              <2> .end_other:
   752                              <2> 	mov al, 42h		; AMIS get other link info service
   753                              <2> 	extcall call_int2D
   754                              <2> 	cmp al, 0FFh
   755                              <2> 	jne .no_other
   756                              <2> 
   757                              <2> 	mov ax, si		; selector => PSP
   758                              <2> 	extcall ispm
   759                              <2> 	jz @F
   760                              <2> 	mov ax, dx		; segment => PSP
   761                              <2> @@:
   762                              <2> 	 push ss
   763                              <2> 	 pop ds
   764                              <2> 	mov word [otherds], ax
   765                              <2> internaldatarelocation		; current mode sel/seg
   766                              <2> 	mov word [otherseg], dx
   767                              <2> internaldatarelocation		; remember segment
   768                              <2> 
   769                              <2> 	mov ax, cx		; selector => link info
   770                              <2> 	extcall ispm
   771                              <2> 	jz @F
   772                              <2> 	mov ax, bx		; segment => link info
   773                              <2> @@:
   774                              <2> 	mov word [bp + ?linkinfo_other], di
   775                              <2> 	mov word [bp + ?linkinfo_other + 2], ax
   776                              <2> 
   777                              <2> 	mov ds, ax		; => link info
   778                              <2> 	xor ax, ax
   779                              <2> 	cmp word [di + eldlSignature], 0E1D1h
   780                              <2> 	jne .error_other
   781                              <2> 	cmp word [di + eldlUseLinkHash], 1
   782                              <2> 	ja .error_other
   783                              <2> 	jb @F
   784                              <2> 	dec ax
   785                              <2> @@:
   786                              <2> 	mov word [bp + ?use_hash_other], ax
   787                              <2> 
   788                              <2> 	mov dx, word [bp + ?instance]
   789                              <2> 	add dx, linkerotherdatarelocations - code
   790                              <2> 	jmp .otherloop
   791                              <2> 
   792                              <2> .error_other:
   793                              <2> 	push cs
   794                              <2> 	pop ds
   795                              <2> 	mov ax, 0E33h
   796                              <2> 	extcall setrc
   797                              <2> 	mov dx, lmsg.error_other
   798                              <2> internalcoderelocation
   799                              <2> 	jmp @F
   800                              <2> 
   801                              <2> .no_other:
   802                              <2> 	push cs
   803                              <2> 	pop ds
   804                              <2> 	mov ax, 0E34h
   805                              <2> 	extcall setrc
   806                              <2> 	mov dx, lmsg.no_other
   807                              <2> internalcoderelocation
   808                              <2> @@:
   809                              <2> 	extcall putsz
   810                              <2> 	jmp .error
   811                              <2> 
   812                              <2> .otherdone:
   813                              <2> %endif
   814                              <2> 
   815 00000BD6 5B                  <2> 	pop bx				; -> our heap data
   816 00000BD7 5E                  <2> 	pop si				; -> our command line tail
   817 00000BD8 16                  <2> 	 push ss
   818 00000BD9 1F                  <2> 	 pop ds
   819 00000BDA C47EFC              <2> 	les di, [bp + ?instance]
   820 00000BDD 268B4502            <2> 	mov ax, word [es:di + eldiEndCode]
   821                              <2> houdini
   822 00000BE1 2D[0009]            <2> 	sub ax, strict word endresident + code
   823                              <2> internalcoderelocation
   824 00000BE4 26C74502[0009]      <2> 	mov word [es:di + eldiEndCode], endresident + code
   825                              <2> internalcoderelocation
   826 00000BEA 2906[0000]          <2> 	sub word [relocateddata], ax
   827                              <2> linkdatarelocation extseg_used
   828                              <2> %if _DATA_SIZE == 0
   829                              <2> 	xor ax, ax
   830                              <2> 	mov word [es:di + eldiStartData], ax
   831                              <2> 	mov word [es:di + eldiEndData], ax
   832                              <2> %endif
   833 00000BEE 89EC5D              <2> 	lleave code
   834                              <2> 		; INP:	es => ELD code segment
   835                              <2> 		;	ds:si -> command line tail
   836                              <2> 		;	ds:bx -> ELD data block
   837                              <2> 		;	ss:sp -> far return address for current mode
   838                              <2> 		; STT:	ds = ss, UP, EI
   839 00000BF1 E911FC              <2> 	jmp start
   840                              <2> 
   841                              <2> .error:
   842 00000BF4 89EC5D              <2> 	lleave
   843 00000BF7 B8FFFF              <2> 	mov ax, -1
   844 00000BFA CB                  <2> 	retf
   845                              <2> 
   846                              <2> 
   847                              <2> %ifnidni _LISTING, ""
   848                              <2>  %assign ELDHINT 1
   849                              <2> %else
   850                              <2>  %assign ELDHINT 0
   851                              <2> %endif
   852                              <2> 
   853                              <2> %if ELDOTHER || ELDHINT
   854                              <2> 		; INP:	ah = multiplex number to check
   855                              <2> 		; OUT:	CY if multiplex number unused or no signature match,
   856                              <2> 		;	 bp, ah, ds unmodified
   857                              <2> 		;	NC if match found,
   858                              <2> 		;	 ah = multiplex number (unmodified)
   859                              <2> 		; CHG:	si, di, es, cx, dx
   860                              <2> plex_check:
   861 00000BFB 16                  <2> 	push ss
   862 00000BFC 1F                  <2> 	pop ds
   863 00000BFD F606[0000]08        <2> 	testopt [relocateddata], 8
   864                              <2> linkdatarelocation internalflags4, -3
   865 00000C02 740B                <2> 	jz @F
   866 00000C04 BE[0000]            <2> 	mov si, relocateddata
   867                              <2> linkdatarelocation amis_multiplex_number, -2, optional
   868 00000C07 85F6                <2> 	test si, si
   869 00000C09 7404                <2> 	jz @F
   870 00000C0B 3A24                <2> 	cmp ah, byte [si]
   871 00000C0D 7420                <2> 	je .notfound		; do not use our own multiplexer -->
   872                              <2> @@:
   873 00000C0F B000                <2> 	mov al, 00h		; AMIS installation check
   874 00000C11 E8[0000]EB020000    <2> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
   875 00000C18 3CFF                <2> 	cmp al, 0FFh
   876 00000C1A 7513                <2> 	jne .notfound
   877 00000C1C 0E                  <2> 	push cs
   878 00000C1D 1F                  <2> 	pop ds
   879 00000C1E BE[8C0F]            <2> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   880                              <2> internalcoderelocation
   881 00000C21 E8[0000]EB020000    <2> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
   882 00000C28 B90800              <2> 	mov cx, 8		; Ignore description, only compare vendor and program name
   883 00000C2B F3A7                <2> 	repe cmpsw
   884 00000C2D 7401                <2> 	je .checkret		; ZR, NC = match -->
   885                              <2> .notfound:
   886 00000C2F F9                  <2> 	stc			; CY no match
   887                              <2> .checkret:
   888 00000C30 C3                  <2> 	retn
   889                              <2> %endif
   890                              <2> 
   891                              <2> 
   892 00000C31 00<rep 3h>          <2> 	align 4, db 0
   893                              <2> linkercoderelocations:
   894                              <2> %if _ELDCALL_OPTIONAL
   895                              <2> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   896                              <2> %else
   897 00000C34 BD00[C50F]F600-     <2> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
   897 00000C3A [DC0F]1C01[C50F]64- <2>
   897 00000C41 02[EB0F]4808[0610]- <2>
   897 00000C48 5008[1C10]5808-     <2>
   897 00000C4E [3010]6008[4010]68- <2>
   897 00000C55 08[4C10]7008[5710]- <2>
   897 00000C5C 7808[5E10]8008-     <2>
   897 00000C62 [6610]8808[6E10]90- <2>
   897 00000C69 08[8B10]9808[B410]- <2>
   897 00000C70 A008[C910]A808-     <2>
   897 00000C76 [D410]B008[E410]B8- <2>
   897 00000C7D 08[F010]C008[F910]- <2>
   897 00000C84 C808[0511]D008-     <2>
   897 00000C8A [0D11]D808[1611]E0- <2>
   897 00000C91 08[2011]E808[2A11]- <2>
   897 00000C98 F008[3111]960B-     <2>
   897 00000C9E [3D11]BD0B[1611]CF- <2>
   897 00000CA5 0B[4611]110C[4611]- <2>
   897 00000CAC 210C[5311]00000000  <2>
   898                              <2> %endif
   899                              <2> 
   900                              <2> %if _ELD_LINKER_PASSES
   901                              <2> linkerlinkercoderelocations:
   902                              <2> %if _ELDCALL_OPTIONAL
   903                              <2> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   904                              <2> %else
   905 00000CB4 740A[1611]900A-     <2> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   905 00000CBA [D410]9A0A[5E10]A3- <2>
   905 00000CC1 0A[6E10]00000000    <2>
   906                              <2> %endif
   907                              <2> 
   908                              <2> 	align 2, db 0
   909                              <2> linktable:
   910                              <2> 	istruc LINKTABLE
   911                              <2> at ltCodeToCode
   912 00000CC8 7C0F                <2> 	dw internallinkercodetocoderelocations - code
   913 00000CCA 200E                <2> 	dw internalcodetocoderelocations - code
   914                              <2> at ltCodeToData
   915 00000CCC 860F                <2> 	dw internallinkercodetodatarelocations - code
   916 00000CCE 400E                <2> 	dw internalcodetodatarelocations - code
   917                              <2> at ltDataToCode
   918 00000CD0 880F                <2> 	dw internallinkerdatatocoderelocations - code
   919 00000CD2 600F                <2> 	dw internaldatatocoderelocations - code
   920                              <2> at ltDataToData
   921 00000CD4 8A0F                <2> 	dw internallinkerdatatodatarelocations - code
   922 00000CD6 660F                <2> 	dw internaldatatodatarelocations - code
   923                              <2> at ltLinkData
   924 00000CD8 680F                <2> 	dw linkerlinkerdatarelocations - code
   925 00000CDA E00C                <2> 	dw linkerdatarelocations - code
   926                              <2> at ltLinkCode
   927 00000CDC B40C                <2> 	dw linkerlinkercoderelocations - code
   928 00000CDE 340C                <2> 	dw linkercoderelocations - code
   929                              <2> 	iend
   930                              <2> %endif
   931                              <2> 
   932                              <2> 	align 2, db 0
   933                              <2> linkerdatarelocations:
   934 00000CE0 01002400[5E11]0100- <2> 	dw LINK_DATA_RELOCATIONS, 0
   934 00000CE8 5E00[6E11]01006200- <2>
   934 00000CF0 [7D11]01006600-     <2>
   934 00000CF6 [8C11]01008200-     <2>
   934 00000CFC [7D11]01009400-     <2>
   934 00000D02 [A311]0100AB00-     <2>
   934 00000D08 [B611]0100B000-     <2>
   934 00000D0E [CC11]0100CF00-     <2>
   934 00000D14 [B611]0100D400-     <2>
   934 00000D1A [E011]0100EE00-     <2>
   934 00000D20 [F311]0100F200-     <2>
   934 00000D26 [0612]0100F400-     <2>
   934 00000D2C [2212]01000401-     <2>
   934 00000D32 [B611]01001001-     <2>
   934 00000D38 [B611]01001501-     <2>
   934 00000D3E [E011]01003001-     <2>
   934 00000D44 [B611]01003501-     <2>
   934 00000D4A [E011]01005601-     <2>
   934 00000D50 [2B12]01005801-     <2>
   934 00000D56 [4312]01006001-     <2>
   934 00000D5C [5412]01006601-     <2>
   934 00000D62 [2B12]01006801-     <2>
   934 00000D68 [7012]01006C01-     <2>
   934 00000D6E [8A12]0100A201-     <2>
   934 00000D74 [8A12]0100CA01-     <2>
   934 00000D7A [F311]01002102-     <2>
   934 00000D80 [F311]01002702-     <2>
   934 00000D86 [F311]01002D02-     <2>
   934 00000D8C [F311]01003302-     <2>
   934 00000D92 [F311]01003902-     <2>
   934 00000D98 [F311]01004702-     <2>
   934 00000D9E [F311]01002D04-     <2>
   934 00000DA4 [9D12]0100A304-     <2>
   934 00000DAA [A812]01004605-     <2>
   934 00000DB0 [9D12]01007405-     <2>
   934 00000DB6 [9D12]01006907-     <2>
   934 00000DBC [9D12]01008007-     <2>
   934 00000DC2 [6E11]01008407-     <2>
   934 00000DC8 [7D11]01008807-     <2>
   934 00000DCE [8C11]0100AA07-     <2>
   934 00000DD4 [A311]0100C507-     <2>
   934 00000DDA [A812]0100F907-     <2>
   934 00000DE0 [B912]01000208-     <2>
   934 00000DE6 [C412]01002508-     <2>
   934 00000DEC [CD12]01003508-     <2>
   934 00000DF2 [D812]01004208-     <2>
   934 00000DF8 [7D11]02000200-     <2>
   934 00000DFE [9D12]0100A10B-     <2>
   934 00000E04 [F712]0100CA0B-     <2>
   934 00000E0A [C412]0100EC0B-     <2>
   934 00000E10 [D812]0100FF0B-     <2>
   934 00000E16 [1C13]0101050C-     <2>
   934 00000E1C [2D13]0000          <2>
   935                              <2> 
   936                              <2> 	align 2, db 0
   937                              <2> internalcodetocoderelocations:
   938 00000E20 7E00860062016F02AD- <2> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
   938 00000E29 043D072C0831083908- <2>
   938 00000E32 3E08BB0BC50BE20BE8- <2>
   938 00000E3B 0B1F0C0000          <2>
   939                              <2> 
   940                              <2> 	align 2, db 0
   941                              <2> internalcodetodatarelocations:
   942 00000E40 3400410059008B0098- <2> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
   942 00000E49 009C00A000A400A700- <2>
   942 00000E52 4D01D20124022A0230- <2>
   942 00000E5B 0236023C0241024402- <2>
   942 00000E64 57025B026D0279029C- <2>
   942 00000E6D 02A902B202BB02BF02- <2>
   942 00000E76 C502D002D502E402E9- <2>
   942 00000E7F 02F202FB0200030903- <2>
   942 00000E88 12031D033A03470356- <2>
   942 00000E91 035E036F0373037703- <2>
   942 00000E9A 820387038C03910398- <2>
   942 00000EA3 039D03A103AB03B203- <2>
   942 00000EAC C003C603CC03D203DB- <2>
   942 00000EB5 03EA03F203FA030304- <2>
   942 00000EBE 2A0432043604410449- <2>
   942 00000EC7 044D04530459047704- <2>
   942 00000ED0 8D0499049C04AB04B8- <2>
   942 00000ED9 04BE04C804CC04D404- <2>
   942 00000EE2 D704DA04DD04E104E8- <2>
   942 00000EEB 04EF04F304F7040405- <2>
   942 00000EF4 0C0521052F05350539- <2>
   942 00000EFD 053D054A0554056E05- <2>
   942 00000F06 A705DB05E405EA05F0- <2>
   942 00000F0F 05F405F70507060B06- <2>
   942 00000F18 760683068906C106C7- <2>
   942 00000F21 06CC06D106D706DC06- <2>
   942 00000F2A E206E706F006F606FF- <2>
   942 00000F33 0605070E0714071D07- <2>
   942 00000F3C 23072C0732073B0743- <2>
   942 00000F45 076C077A078E079A07- <2>
   942 00000F4E A007A707B807C107CB- <2>
   942 00000F57 07DF07ED071B080000  <2>
   943                              <2> 
   944                              <2> 	align 2, db 0
   945                              <2> internaldatatocoderelocations:
   946 00000F60 00000600FFFF        <2> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
   947                              <2> 
   948                              <2> 	align 2, db 0
   949                              <2> internaldatatodatarelocations:
   950 00000F66 FFFF                <2> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
   951                              <2> 
   952                              <2> %if _ELD_LINKER_PASSES
   953                              <2> 	align 2, db 0
   954                              <2> linkerlinkerdatarelocations:
   955 00000F68 01002C0A[CD12]0100- <2> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
   955 00000F70 6B0A[9D12]01004F0B- <2>
   955 00000F78 [E612]0000          <2>
   956                              <2> 
   957                              <2> 	align 2, db 0
   958                              <2> internallinkercodetocoderelocations:
   959 00000F7C 320A410A520A7D0A00- <2> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
   959 00000F85 00                  <2>
   960                              <2> 
   961                              <2> 	align 2, db 0
   962                              <2> internallinkercodetodatarelocations:
   963 00000F86 0000                <2> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
   964                              <2> 
   965                              <2> 	align 2, db 0
   966                              <2> internallinkerdatatocoderelocations:
   967 00000F88 FFFF                <2> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
   968                              <2> 
   969                              <2> 	align 2, db 0
   970                              <2> internallinkerdatatodatarelocations:
   971 00000F8A FFFF                <2> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
   972                              <2> %endif
   973                              <2> 
   974                              <2> %if ELDOTHER
   975                              <2> 	align 2, db 0
   976                              <2> linkerotherdatarelocations:
   977                              <2> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
   978                              <2> 
   979                              <2>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
   980                              <2>   %error Other linker data links not supported
   981                              <2>  %endif
   982                              <2> %endif
   983                              <2> 
   984                              <2> %if ELDOTHER || ELDHINT
   985                              <2> 	align 2, db 0
   986                              <2> debuggeramissig:
   987 00000F8C 65636D20<rep 5h>    <2> 		fill 8, 32, db "ecm"
   988 00000F94 6C446562756720-     <2> 		fill 8, 32, db "lDebug"
   988 00000F94 <rep 2h>            <2>
   989                              <2> %endif
   990                              <2> 
   991                              <2> %ifnidni _LISTING, ""
   992                              <2> listmsg:
   993 00000F9C 547261634C6973742D- <2> .hint:		db "TracList-add-offset=",_LISTING,"::"
   993 00000FA5 6164642D6F66667365- <2>
   993 00000FAE 743D626F6F74646972- <2>
   993 00000FB7 2E6C73743A3A        <2>
   994 00000FBD 2D2D2D2D680D0A00    <2> .hint.offset:	asciz "----h",13,10
   995                              <2> %endif
   996                              <2> 
   997 00000FC5 1527142E2E4079795F- <2> 	eldcall_dump_names ELDCALL_CODE_NAMES
   997 00000FCE 66696C656E616D655F- <2>
   997 00000FD7 656D707479D1C60C73- <2>
   997 00000FE0 63616E5F6469725F61- <2>
   997 00000FE9 75784C04186E656172- <2>
   997 00000FF2 5F7472616E73666572- <2>
   997 00000FFB 5F6578745F72657475- <2>
   997 00001004 726E4C4E1379795F62- <2>
   997 0000100D 6F6F745F7061727365- <2>
   997 00001016 5F6E616D653225D711- <2>
   997 0000101F 79795F626F6F745F69- <2>
   997 00001028 6E69745F6469723220- <2>
   997 00001031 660D626F6F745F7061- <2>
   997 0000103A 7273655F666EF12309- <2>
   997 00001043 757070657263617365- <2>
   997 0000104C 67B1087472696D7075- <2>
   997 00001055 7473BABD04636D6433- <2>
   997 0000105E B21205736574726355- <2>
   997 00001067 1205707574737AD0BB- <2>
   997 00001070 1A636F70795F73696E- <2>
   997 00001079 676C655F636F756E74- <2>
   997 00001082 65645F737472696E67- <2>
   997 0000108B ABFF26646973705F64- <2>
   997 00001094 7861785F74696D6573- <2>
   997 0000109D 5F63785F7769647468- <2>
   997 000010A6 5F62785F73697A652E- <2>
   997 000010AF 73746F726503AA1264- <2>
   997 000010B8 65635F64776F72645F- <2>
   997 000010C1 6D696E776964746839- <2>
   997 000010CA 8C08707574736C696E- <2>
   997 000010D3 656FA20D707574736C- <2>
   997 000010DC 696E655F63726C66A4- <2>
   997 000010E5 5509736B6970636F6D- <2>
   997 000010EE 6D30E83A066973656F- <2>
   997 000010F7 6C3F03C30969737374- <2>
   997 00001100 72696E673FA7AA0565- <2>
   997 00001109 72726F72DDB9066368- <2>
   997 00001112 6B656F6C8481076865- <2>
   997 0000111B 78776F7264EBA60764- <2>
   997 00001124 6563776F7264289004- <2>
   997 0000112D 6973706DD55509736B- <2>
   997 00001136 6970636F6D6D619869- <2>
   997 0000113F 06696E7463686B2130- <2>
   997 00001148 0A63616C6C5F696E74- <2>
   997 00001151 3244B7740873657465- <2>
   997 0000115A 73326478            <2>
   998 0000115E 899F0D696E7465726E- <2> 	link_data_dump_names LINK_DATA_NAMES
   998 00001167 616C666C616773F634- <2>
   998 00001170 0C657874646174615F- <2>
   998 00001179 73697A65B2400C6578- <2>
   998 00001182 74646174615F757365- <2>
   998 0000118B 64B0B2146175786275- <2>
   998 00001194 66665F63757272656E- <2>
   998 0000119D 745F73697A658B0010- <2>
   998 000011A6 617578627566665F73- <2>
   998 000011AF 65676F7273656C92AA- <2>
   998 000011B8 136C6F61645F636865- <2>
   998 000011C1 636B5F6469725F6174- <2>
   998 000011CA 74720EB5116C6F6164- <2>
   998 000011D3 5F79796E616D655F69- <2>
   998 000011DC 6E7075742F75106C6F- <2>
   998 000011E5 61645F79796E616D65- <2>
   998 000011EE 5F6E6578746C52106C- <2>
   998 000011F7 6F61645F79795F6469- <2>
   998 00001200 72656E74727938D219- <2>
   998 00001209 68616E646C655F7363- <2>
   998 00001212 616E5F6469725F6E6F- <2>
   998 0000121B 745F666F756E646B5D- <2>
   998 00001224 06646D79636D6494C0- <2>
   998 0000122D 1568616E646C655F73- <2>
   998 00001236 63616E5F6469725F65- <2>
   998 0000123F 6E7472793F850E7363- <2>
   998 00001248 616E5F6469725F656E- <2>
   998 00001251 74727958B8196E6561- <2>
   998 0000125A 725F7472616E736665- <2>
   998 00001263 725F6578745F616464- <2>
   998 0000126C 72657373D6ED176E65- <2>
   998 00001275 61725F7472616E7366- <2>
   998 0000127E 65725F6578745F656E- <2>
   998 00001287 74727975DD106C6F61- <2>
   998 00001290 645F6B65726E656C5F- <2>
   998 00001299 6E616D6584E3086C69- <2>
   998 000012A2 6E655F6F7574CA510E- <2>
   998 000012AB 696E7465726E616C66- <2>
   998 000012B4 6C61677333EB420865- <2>
   998 000012BD 7874647373656CD52D- <2>
   998 000012C6 066578747365675ABC- <2>
   998 000012CF 086F7074696F6E7337- <2>
   998 000012D8 E7D30B657874736567- <2>
   998 000012E1 5F7573656468440E6C- <2>
   998 000012EA 696E6B63616C6C5F74- <2>
   998 000012F3 61626C65F09E227472- <2>
   998 000012FC 795F64656275676765- <2>
   998 00001305 725F616D69735F6D75- <2>
   998 0000130E 6C7469706C65785F6E- <2>
   998 00001317 756D626572CB510E69- <2>
   998 00001320 6E7465726E616C666C- <2>
   998 00001329 61677334688C15616D- <2>
   998 00001332 69735F6D756C746970- <2>
   998 0000133B 6C65785F6E756D6265- <2>
   998 00001344 72                  <2>
   999                              <2> %if ELDOTHER
  1000                              <2> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1001                              <2> %endif
  1002                              <2> 
  1003                              <2> lmsg:
  1004                              <2> %if _ELD_LINKER_PASSES
  1005                              <2> %if _ELDCALL_OPTIONAL
  1006                              <2> .warning_code_optional:		counted "Optional code link missing, hash="
  1007                              <2> %endif
  1008 00001345 214F7074696F6E616C- <2> .warning_data_optional:		counted "Optional data link missing, hash="
  1008 0000134E 2064617461206C696E- <2>
  1008 00001357 6B206D697373696E67- <2>
  1008 00001360 2C20686173683D      <2>
  1009 00001367 1844617461206C696E- <2> .error_data:			counted "Data link missing, hash="
  1009 00001370 6B206D697373696E67- <2>
  1009 00001379 2C20686173683D      <2>
  1010 00001380 18436F6465206C696E- <2> .error_code:			counted "Code link missing, hash="
  1010 00001389 6B206D697373696E67- <2>
  1010 00001392 2C20686173683D      <2>
  1011 00001399 0A682C206C6162656C- <2> .error.2:			counted "h, label ",'"'
  1011 000013A2 2022                <2>
  1012                              <2> %endif
  1013                              <2> %if ELDOTHER
  1014                              <2> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1015                              <2> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1016                              <2> %endif
  1017                              <2> 
  1018 000013A4 00<rep Ch>          <2> 	align 16, db 0
  1994                              <1> 
  1995                              <1> 	align 16
  1996                              <1> code_size equ $ - code
