     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> %assign ELDDATA_NEXT_STATUS 0			; not any seen yet
    36                              <3> %assign ELDDATA_NEXT_ENTRY -1
    37                              <3> %assign ELDDATA_NEXT_SECTION -1
    38                              <3> %assign ELDDATA_NEXT_OTHER -1
    39                              <3> 
    40                              <3> 	%imacro internalcoderelocation 0-1.nolist -2
    41                              <3> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    42                              <3> %if ELDLINKER
    43                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    44                              <3>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    45                              <3>  %else
    46                              <3>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    47                              <3>  %endif
    48                              <3> %else
    49                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    50                              <3>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    51                              <3>  %else
    52                              <3>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    53                              <3>  %endif
    54                              <3> %endif
    55                              <3> 	eldstrictcheck
    56                              <3> 	%endmacro
    57                              <3> 
    58                              <3> 	%imacro internaldatarelocation 0-1.nolist -2
    59                              <3> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    60                              <3> %if ELDLINKER
    61                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    62                              <3>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    63                              <3>  %else
    64                              <3>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    65                              <3>  %endif
    66                              <3> %else
    67                              <3>  %ifidni _CURRENT_SECTION_TYPE, DATA
    68                              <3>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    69                              <3>  %else
    70                              <3>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    71                              <3>  %endif
    72                              <3> %endif
    73                              <3> 	eldstrictcheck
    74                              <3> 	%endmacro
    75                              <3> 
    76                              <3> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    77                              <3> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    78                              <3> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    79                              <3> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    80                              <3> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    81                              <3> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    82                              <3> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    83                              <3> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    84                              <3> 
    85                              <3> 
    86                              <3> %define LINK_DATA_RELOCATIONS ""
    87                              <3> %define LINK_LINKER_DATA_RELOCATIONS ""
    88                              <3> %define LINK_DATA_NAMES db ""
    89                              <3> %define LINK_DATA_DETECTION none, none
    90                              <3> 
    91                              <3> %define LINK_OTHER_DATA_RELOCATIONS ""
    92                              <3> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    93                              <3> %define LINK_OTHER_DATA_NAMES db ""
    94                              <3> %define LINK_OTHER_DATA_DETECTION none, none
    95                              <3> 
    96                              <3> %ifndef ELDOTHER
    97                              <3>  %assign ELDOTHER 0
    98                              <3> %endif
    99                              <3> %assign ELDOTHERLINK 0
   100                              <3> 
   101                              <3> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
   102                              <3> %if ELDOTHER
   103                              <3>  %assign ELDOTHERLINK 1
   104                              <3> %endif
   105                              <3> 	linkdatarelocation %1, %2, %3
   106                              <3> %assign ELDOTHERLINK 0
   107                              <3> 	%endmacro
   108                              <3> 
   109                              <3> 	%imacro linkdatarelocation 1-4.nolist -2, required, single
   110                              <3> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   111                              <3> %ifidni %3, required
   112                              <3>  %assign %%optional 0
   113                              <3> %elifidni %3, optional
   114                              <3>  %assign %%optional 100h
   115                              <3>  %if ELDDATA_OPTIONAL_STATUS == 0
   116                              <3>   %assign ELDDATA_OPTIONAL_STATUS 1
   117                              <3>  %elif ELDDATA_OPTIONAL_STATUS == 1
   118                              <3>  %else
   119                              <3>   %error Optional data link not allowed here
   120                              <3>  %endif
   121                              <3> %elifidni %3, PM required
   122                              <3>  %assign %%optional 300h
   123                              <3>  %assign ELDDATA_PMREQUIRED_STATUS 1
   124                              <3>  %if ELDDATA_OPTIONAL_STATUS == 0
   125                              <3>   %assign ELDDATA_OPTIONAL_STATUS 1
   126                              <3>  %elif ELDDATA_OPTIONAL_STATUS == 1
   127                              <3>  %else
   128                              <3>   %error Optional data link not allowed here
   129                              <3>  %endif
   130                              <3> %else
   131                              <3>  %fatal Unknown optional keyword
   132                              <3> %endif
   133                              <3> %ifidni _CURRENT_SECTION_TYPE, DATA
   134                              <3>  %assign %%DATASECTION 1
   135                              <3> %else
   136                              <3>  %assign %%DATASECTION 0
   137                              <3> %endif
   138                              <3> %ifidni %4, single
   139                              <3>  %if ELDDATA_NEXT_STATUS == 1		; after next ?
   140                              <3>   %error Unexpected single data link after next data link
   141                              <3>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   142                              <3>   %assign ELDDATA_NEXT_STATUS 3		; note single with next/last present
   143                              <3>  %endif
   144                              <3>  %assign %%next 0
   145                              <3> %elifidni %4, next
   146                              <3>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   147                              <3>   %assign ELDDATA_NEXT_STATUS 1		; in next
   148                              <3>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   149                              <3>   %assign ELDDATA_NEXT_STATUS 1		; in next
   150                              <3>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   151                              <3>   %assign ELDDATA_NEXT_STATUS 1		; in next
   152                              <3>  %elif ELDDATA_NEXT_STATUS == 1		; repeated next ?
   153                              <3>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   156                              <3>    %error Unexpected next data link
   157                              <3>   %endif
   158                              <3>  %else
   159                              <3>   %error Next data link not allowed here
   160                              <3>  %endif
   161                              <3>  %ifn %%optional
   162                              <3>   %error Next data link only valid as optional or PM required
   163                              <3>  %endif
   164                              <3>  %assign %%next 400h
   165                              <3>  %assign ELDDATA_NEXT_ENTRY %%entry
   166                              <3>  %assign ELDDATA_NEXT_SECTION %%DATASECTION
   167                              <3>  %assign ELDDATA_NEXT_OTHER ELDOTHERLINK
   168                              <3> %elifidni %4, last
   169                              <3>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   170                              <3>   %error Next last data link not allowed here
   171                              <3>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   172                              <3>   %error Next last data link not allowed here
   173                              <3>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   174                              <3>   %error Next last data link not allowed here
   175                              <3>  %elif ELDDATA_NEXT_STATUS == 1		; after next ?
   176                              <3>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   179                              <3>    %error Unexpected next data link
   180                              <3>   %endif
   181                              <3>   %assign ELDDATA_NEXT_STATUS 2		; note now after last
   182                              <3>  %else
   183                              <3>   %error Next data link not allowed here
   184                              <3>  %endif
   185                              <3>  %assign %%next 800h
   186                              <3>  %assign ELDDATA_NEXT_ENTRY -1
   187                              <3>  %assign ELDDATA_NEXT_SECTION -1
   188                              <3> %else
   189                              <3>  %fatal Unknown next keyword
   190                              <3> %endif
   191                              <3> 	%if ELDOTHERLINK
   192                              <3> %if ELDLINKER
   193                              <3>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   194                              <3> %else
   195                              <3>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   196                              <3> %endif
   197                              <3> 	%else
   198                              <3> %if ELDLINKER
   199                              <3>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   200                              <3> %else
   201                              <3>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   202                              <3> %endif
   203                              <3> 	%endif
   204                              <3> %defstr %%string %1
   205                              <3> %strlen %%length %%string
   206                              <3> %if %%length > 64
   207                              <3> 	; Could be increased, but mustn't exceed 127 bytes
   208                              <3> 	;  because flag 80h is used to mark optional links
   209                              <3> 	;  that failed to be matched.
   210                              <3>  %error Too long link name: %1
   211                              <3> %endif
   212                              <3> %define LINK_DATA_CHECK %1
   213                              <3> 	%if ELDOTHERLINK
   214                              <3> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   215                              <3> %if LINK_DATA_NEW
   216                              <3>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   217                              <3> 	hashdef HASH, %%string
   218                              <3>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   220                              <3> %else
   221                              <3>  %%name equ LINK_DATA_DUPLICATE
   222                              <3> %endif
   223                              <3> 	%else
   224                              <3> 	linkdata_detect LINK_DATA_DETECTION
   225                              <3> %if LINK_DATA_NEW
   226                              <3>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   227                              <3> 	hashdef HASH, %%string
   228                              <3>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   230                              <3> %else
   231                              <3>  %%name equ LINK_DATA_DUPLICATE
   232                              <3> %endif
   233                              <3> 	%endif
   234                              <3> 	eldstrictcheck
   235                              <3> 	%endmacro
   236                              <3> 
   237                              <3> 	%imacro linkdata_detect 2-*.nolist
   238                              <3> %assign LINK_DATA_NEW 1
   239                              <3> %rep (%0 - 2) / 2
   240                              <3>  %rotate 2
   241                              <3>  %ifidni %1, LINK_DATA_CHECK
   242                              <3>   %assign LINK_DATA_NEW 0
   243                              <3>   %xdefine LINK_DATA_DUPLICATE %2
   244                              <3>   %exitrep
   245                              <3>  %endif
   246                              <3> %endrep
   247                              <3> 	%endmacro
   248                              <3> 
   249                              <3> 	%imacro link_data_dump_names 1-*.nolist
   250                              <3> %rep %0
   251                              <3> 	%1
   252                              <3>  %rotate 1
   253                              <3> %endrep
   254                              <3> 	%endmacro
   255                              <3> 
   256                              <3> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   257                              <3> ; dw LINK_DATA_RELOCATIONS, 0, 0
   258                              <3> ; link_data_dump_names ELDCALL_CODE_NAMES
   259                              <3> 
   260                              <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> %assign ELDCALL_NEXT_STATUS 0			; not any seen yet
    55                              <2> %assign ELDCALL_NEXT_ENTRY -1
    56                              <2> 
    57                              <2> 	%imacro extcall 1-3.nolist required, single
    58                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
    59                              <2>  %error "ELD call cannot be used in ELD data block"
    60                              <2> %endif
    61                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP
    62                              <2> %ifidni %2, required
    63                              <2>  %assign %%optional 0
    64                              <2> %elifidni %2, optional
    65                              <2>  %assign %%optional 100h
    66                              <2>  %if ELDCALL_OPTIONAL_STATUS == 0
    67                              <2>   %assign ELDCALL_OPTIONAL_STATUS 1
    68                              <2>  %elif ELDCALL_OPTIONAL_STATUS == 1
    69                              <2>  %else
    70                              <2>   %error Optional code link not allowed here
    71                              <2>  %endif
    72                              <2> %elifidni %2, PM required
    73                              <2>  %assign %%optional 300h
    74                              <2>  %assign ELDCALL_PMREQUIRED_STATUS 1
    75                              <2>  %if ELDCALL_OPTIONAL_STATUS == 0
    76                              <2>   %assign ELDCALL_OPTIONAL_STATUS 1
    77                              <2>  %elif ELDCALL_OPTIONAL_STATUS == 1
    78                              <2>  %else
    79                              <2>   %error Optional code link not allowed here
    80                              <2>  %endif
    81                              <2> %else
    82                              <2>  %fatal Unknown optional keyword
    83                              <2> %endif
    84                              <2> %ifidni %3, single
    85                              <2>  %if ELDCALL_NEXT_STATUS == 1		; after next ?
    86                              <2>   %error Unexpected single code link after next code link
    87                              <2>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
    88                              <2>   %assign ELDCALL_NEXT_STATUS 3		; note single with next/last present
    89                              <2>  %endif
    90                              <2>  %assign %%next 0
    91                              <2> %elifidni %3, next
    92                              <2>  %if ELDCALL_NEXT_STATUS == 0		; no next/last yet ?
    93                              <2>   %assign ELDCALL_NEXT_STATUS 1		; in next
    94                              <2>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
    95                              <2>   %assign ELDCALL_NEXT_STATUS 1		; in next
    96                              <2>  %elif ELDCALL_NEXT_STATUS == 3		; after single ?
    97                              <2>   %assign ELDCALL_NEXT_STATUS 1		; in next
    98                              <2>  %elif ELDCALL_NEXT_STATUS == 1		; repeated next ?
    99                              <2>   %if ELDCALL_NEXT_ENTRY != %%entry
   100                              <2>    %error Unexpected next code link
   101                              <2>   %endif
   102                              <2>  %else
   103                              <2>   %error Next code link not allowed here
   104                              <2>  %endif
   105                              <2>  %ifn %%optional
   106                              <2>   %error Next code link only valid as optional or PM required
   107                              <2>  %endif
   108                              <2>  %assign %%next 400h
   109                              <2>  %assign ELDCALL_NEXT_ENTRY %%entry
   110                              <2> %elifidni %3, last
   111                              <2>  %if ELDCALL_NEXT_STATUS == 0		; no next/last yet ?
   112                              <2>   %error Next last code link not allowed here
   113                              <2>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
   114                              <2>   %error Next last code link not allowed here
   115                              <2>  %elif ELDCALL_NEXT_STATUS == 3		; after single ?
   116                              <2>   %error Next last code link not allowed here
   117                              <2>  %elif ELDCALL_NEXT_STATUS == 1		; after next ?
   118                              <2>   %if ELDCALL_NEXT_ENTRY != %%entry
   119                              <2>    %error Unexpected next code link
   120                              <2>   %endif
   121                              <2>   %assign ELDCALL_NEXT_STATUS 2		; note now after last
   122                              <2>  %else
   123                              <2>   %error Next code link not allowed here
   124                              <2>  %endif
   125                              <2>  %assign %%next 800h
   126                              <2>  %assign ELDCALL_NEXT_ENTRY -1
   127                              <2>  %assign ELDCALL_NEXT_SECTION -1
   128                              <2> %else
   129                              <2>  %fatal Unknown next keyword
   130                              <2> %endif
   131                              <2> %if %%next != 400h
   132                              <2> %if 0
   133                              <2> [warning -reloc-rel-word]
   134                              <2> 	call near relocatedzero
   135                              <2> [warning +reloc-rel-word]
   136                              <2> %else
   137                              <2> 	db 0E8h
   138                              <2> reloc	dw relocatedzero
   139                              <2> 	eldstrictcheck
   140                              <2> %endif
   141                              <2> 	jmp strict short %%skipparameter
   142                              <2> 	dw 0
   143                              <2> %%skipparameter:
   144                              <2> %endif
   145                              <2> %if ELDLINKER
   146                              <2>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS ELDCALL_LINKER_CODE_RELOCATIONS, %%entry, %%name
   147                              <2>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional + %%next, %%entry, %%name
   148                              <2> %else
   149                              <2>  %xdefine ELDCALL_CODE_RELOCATIONS ELDCALL_CODE_RELOCATIONS, %%entry, %%name
   150                              <2>  %xdefine ELDCALL_CODE_RELOCATIONS_OPTIONAL ELDCALL_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional + %%next, %%entry, %%name
   151                              <2> %endif
   152                              <2> %defstr %%string %1
   153                              <2> %strlen %%length %%string
   154                              <2> %if %%length > 64
   155                              <2> 	; Could be increased, but mustn't exceed 127 bytes
   156                              <2> 	;  because flag 80h is used to mark optional links
   157                              <2> 	;  that failed to be matched.
   158                              <2>  %error Too long link name: %1
   159                              <2> %endif
   160                              <2> %define ELDCALL_CODE_CHECK %1
   161                              <2> 	linkcode_detect ELDCALL_CODE_DETECTION
   162                              <2> %if ELDCALL_CODE_NEW
   163                              <2>  %xdefine ELDCALL_CODE_DETECTION ELDCALL_CODE_DETECTION, %1, %%name
   164                              <2> 	hashdef HASH, %%string
   165                              <2> %xdefine ELDCALL_CODE_NAMES 	ELDCALL_CODE_NAMES, %%name:, dw _HASH, {counted %%string}
   167                              <2> %else
   168                              <2>  %%name equ ELDCALL_CODE_DUPLICATE
   169                              <2> %endif
   170                              <2> 	%endmacro
   171                              <2> 
   172                              <2> 	%imacro linkcode_detect 2-*.nolist
   173                              <2> %assign ELDCALL_CODE_NEW 1
   174                              <2> %rep (%0 - 2) / 2
   175                              <2>  %rotate 2
   176                              <2>  %ifidni %1, ELDCALL_CODE_CHECK
   177                              <2>   %assign ELDCALL_CODE_NEW 0
   178                              <2>   %xdefine ELDCALL_CODE_DUPLICATE %2
   179                              <2>   %exitrep
   180                              <2>  %endif
   181                              <2> %endrep
   182                              <2> 	%endmacro
   183                              <2> 
   184                              <2> 
   185                              <2> %define ELDCALL_CALLCALL_LIST none
   186                              <2> %define ELDCALL_CALLCALL_PROCESSED_PRIOR ""
   187                              <2> 
   188                              <2> 	%imacro extcallcall 1.nolist
   189                              <2> 	call %1
   190                              <2> %xdefine ELDCALL_CALLCALL_LIST ELDCALL_CALLCALL_LIST, %1
   191                              <2> 	%endmacro
   192                              <2> 
   193                              <2> %assign ELDCALLCALL_DUMPED 0
   194                              <2> 
   195                              <2> 	%imacro eldcall_dump_callcall 1-*.nolist
   196                              <2> %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED_PRIOR
   197                              <2>  %rep %0 - 1
   198                              <2>   %rotate 1
   199                              <2>   %define ELDCALL_CHECK %1
   200                              <2> 	eldcall_callcall_detect ELDCALL_CALLCALL_PROCESSED
   201                              <2>   %if ELDCALL_NEW
   202                              <2>    %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED, %1
   203                              <2> 	align 8, nop
   204                              <2> %1:
   205                              <2> 	extcall %1
   206                              <2> 	retn
   207                              <2>   %endif
   208                              <2>  %endrep
   209                              <2> %assign ELDCALLCALL_DUMPED 1
   210                              <2> %define ELDCALL_CALLCALL_LIST none
   211                              <2> 	%endmacro
   212                              <2> 
   213                              <2> 	%imacro eldcall_new_callcall 0.nolist
   214                              <2> %if ELDCALLCALL_DUMPED
   215                              <2>  %xdefine ELDCALL_CALLCALL_PROCESSED_PRIOR   ELDCALL_CALLCALL_PROCESSED_PRIOR, ELDCALL_CALLCALL_PROCESSED
   217                              <2>  %assign ELDCALLCALL_DUMPED 0
   218                              <2>  %define ELDCALL_CALLCALL_LIST none
   219                              <2> %endif
   220                              <2> 	%endmacro
   221                              <2> 
   222                              <2> 	%imacro eldcall_callcall_detect 1-*.nolist
   223                              <2> %assign ELDCALL_NEW 1
   224                              <2> %rep %0
   225                              <2>  %ifidni %1, ELDCALL_CHECK
   226                              <2>   %assign ELDCALL_NEW 0
   227                              <2>   %exitrep
   228                              <2>  %endif
   229                              <2>  %rotate 1
   230                              <2> %endrep
   231                              <2> 	%endmacro
   232                              <2> 
   233                              <2> 	%imacro eldcall_dump_names 1-*.nolist
   234                              <2> %rep %0
   235                              <2> 	%1
   236                              <2>  %rotate 1
   237                              <2> %endrep
   238                              <2> 	%endmacro
   239                              <2> 
   240                              <2> ; eldcall_dump_callcall ELDCALL_CALLCALL_LIST
   241                              <2> ; if using optional code links:
   242                              <2> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   243                              <2> ;  dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   244                              <2> ; if not using optional code links:
   245                              <2> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   246                              <2> ;  dw ELDCALL_CODE_RELOCATIONS, 0, 0
   247                              <2> ; eldcall_dump_names ELDCALL_CODE_NAMES
   248                              <2> 
   249                              <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> %assign ELDDATA_NEXT_STATUS 0			; not any seen yet
    36                              <2> %assign ELDDATA_NEXT_ENTRY -1
    37                              <2> %assign ELDDATA_NEXT_SECTION -1
    38                              <2> %assign ELDDATA_NEXT_OTHER -1
    39                              <2> 
    40                              <2> 	%imacro internalcoderelocation 0-1.nolist -2
    41                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    42                              <2> %if ELDLINKER
    43                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    44                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    45                              <2>  %else
    46                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    47                              <2>  %endif
    48                              <2> %else
    49                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    50                              <2>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    51                              <2>  %else
    52                              <2>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    53                              <2>  %endif
    54                              <2> %endif
    55                              <2> 	eldstrictcheck
    56                              <2> 	%endmacro
    57                              <2> 
    58                              <2> 	%imacro internaldatarelocation 0-1.nolist -2
    59                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    60                              <2> %if ELDLINKER
    61                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    62                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    63                              <2>  %else
    64                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    65                              <2>  %endif
    66                              <2> %else
    67                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    68                              <2>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    69                              <2>  %else
    70                              <2>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    71                              <2>  %endif
    72                              <2> %endif
    73                              <2> 	eldstrictcheck
    74                              <2> 	%endmacro
    75                              <2> 
    76                              <2> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    77                              <2> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    78                              <2> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    79                              <2> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    80                              <2> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    81                              <2> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    82                              <2> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    83                              <2> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    84                              <2> 
    85                              <2> 
    86                              <2> %define LINK_DATA_RELOCATIONS ""
    87                              <2> %define LINK_LINKER_DATA_RELOCATIONS ""
    88                              <2> %define LINK_DATA_NAMES db ""
    89                              <2> %define LINK_DATA_DETECTION none, none
    90                              <2> 
    91                              <2> %define LINK_OTHER_DATA_RELOCATIONS ""
    92                              <2> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    93                              <2> %define LINK_OTHER_DATA_NAMES db ""
    94                              <2> %define LINK_OTHER_DATA_DETECTION none, none
    95                              <2> 
    96                              <2> %ifndef ELDOTHER
    97                              <2>  %assign ELDOTHER 0
    98                              <2> %endif
    99                              <2> %assign ELDOTHERLINK 0
   100                              <2> 
   101                              <2> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
   102                              <2> %if ELDOTHER
   103                              <2>  %assign ELDOTHERLINK 1
   104                              <2> %endif
   105                              <2> 	linkdatarelocation %1, %2, %3
   106                              <2> %assign ELDOTHERLINK 0
   107                              <2> 	%endmacro
   108                              <2> 
   109                              <2> 	%imacro linkdatarelocation 1-4.nolist -2, required, single
   110                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   111                              <2> %ifidni %3, required
   112                              <2>  %assign %%optional 0
   113                              <2> %elifidni %3, optional
   114                              <2>  %assign %%optional 100h
   115                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   116                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   117                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   118                              <2>  %else
   119                              <2>   %error Optional data link not allowed here
   120                              <2>  %endif
   121                              <2> %elifidni %3, PM required
   122                              <2>  %assign %%optional 300h
   123                              <2>  %assign ELDDATA_PMREQUIRED_STATUS 1
   124                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   125                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   126                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   127                              <2>  %else
   128                              <2>   %error Optional data link not allowed here
   129                              <2>  %endif
   130                              <2> %else
   131                              <2>  %fatal Unknown optional keyword
   132                              <2> %endif
   133                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
   134                              <2>  %assign %%DATASECTION 1
   135                              <2> %else
   136                              <2>  %assign %%DATASECTION 0
   137                              <2> %endif
   138                              <2> %ifidni %4, single
   139                              <2>  %if ELDDATA_NEXT_STATUS == 1		; after next ?
   140                              <2>   %error Unexpected single data link after next data link
   141                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   142                              <2>   %assign ELDDATA_NEXT_STATUS 3		; note single with next/last present
   143                              <2>  %endif
   144                              <2>  %assign %%next 0
   145                              <2> %elifidni %4, next
   146                              <2>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   147                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   148                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   149                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   150                              <2>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   151                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   152                              <2>  %elif ELDDATA_NEXT_STATUS == 1		; repeated next ?
   153                              <2>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   156                              <2>    %error Unexpected next data link
   157                              <2>   %endif
   158                              <2>  %else
   159                              <2>   %error Next data link not allowed here
   160                              <2>  %endif
   161                              <2>  %ifn %%optional
   162                              <2>   %error Next data link only valid as optional or PM required
   163                              <2>  %endif
   164                              <2>  %assign %%next 400h
   165                              <2>  %assign ELDDATA_NEXT_ENTRY %%entry
   166                              <2>  %assign ELDDATA_NEXT_SECTION %%DATASECTION
   167                              <2>  %assign ELDDATA_NEXT_OTHER ELDOTHERLINK
   168                              <2> %elifidni %4, last
   169                              <2>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   170                              <2>   %error Next last data link not allowed here
   171                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   172                              <2>   %error Next last data link not allowed here
   173                              <2>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   174                              <2>   %error Next last data link not allowed here
   175                              <2>  %elif ELDDATA_NEXT_STATUS == 1		; after next ?
   176                              <2>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   179                              <2>    %error Unexpected next data link
   180                              <2>   %endif
   181                              <2>   %assign ELDDATA_NEXT_STATUS 2		; note now after last
   182                              <2>  %else
   183                              <2>   %error Next data link not allowed here
   184                              <2>  %endif
   185                              <2>  %assign %%next 800h
   186                              <2>  %assign ELDDATA_NEXT_ENTRY -1
   187                              <2>  %assign ELDDATA_NEXT_SECTION -1
   188                              <2> %else
   189                              <2>  %fatal Unknown next keyword
   190                              <2> %endif
   191                              <2> 	%if ELDOTHERLINK
   192                              <2> %if ELDLINKER
   193                              <2>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   194                              <2> %else
   195                              <2>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   196                              <2> %endif
   197                              <2> 	%else
   198                              <2> %if ELDLINKER
   199                              <2>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   200                              <2> %else
   201                              <2>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   202                              <2> %endif
   203                              <2> 	%endif
   204                              <2> %defstr %%string %1
   205                              <2> %strlen %%length %%string
   206                              <2> %if %%length > 64
   207                              <2> 	; Could be increased, but mustn't exceed 127 bytes
   208                              <2> 	;  because flag 80h is used to mark optional links
   209                              <2> 	;  that failed to be matched.
   210                              <2>  %error Too long link name: %1
   211                              <2> %endif
   212                              <2> %define LINK_DATA_CHECK %1
   213                              <2> 	%if ELDOTHERLINK
   214                              <2> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   215                              <2> %if LINK_DATA_NEW
   216                              <2>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   217                              <2> 	hashdef HASH, %%string
   218                              <2>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   220                              <2> %else
   221                              <2>  %%name equ LINK_DATA_DUPLICATE
   222                              <2> %endif
   223                              <2> 	%else
   224                              <2> 	linkdata_detect LINK_DATA_DETECTION
   225                              <2> %if LINK_DATA_NEW
   226                              <2>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   227                              <2> 	hashdef HASH, %%string
   228                              <2>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   230                              <2> %else
   231                              <2>  %%name equ LINK_DATA_DUPLICATE
   232                              <2> %endif
   233                              <2> 	%endif
   234                              <2> 	eldstrictcheck
   235                              <2> 	%endmacro
   236                              <2> 
   237                              <2> 	%imacro linkdata_detect 2-*.nolist
   238                              <2> %assign LINK_DATA_NEW 1
   239                              <2> %rep (%0 - 2) / 2
   240                              <2>  %rotate 2
   241                              <2>  %ifidni %1, LINK_DATA_CHECK
   242                              <2>   %assign LINK_DATA_NEW 0
   243                              <2>   %xdefine LINK_DATA_DUPLICATE %2
   244                              <2>   %exitrep
   245                              <2>  %endif
   246                              <2> %endrep
   247                              <2> 	%endmacro
   248                              <2> 
   249                              <2> 	%imacro link_data_dump_names 1-*.nolist
   250                              <2> %rep %0
   251                              <2> 	%1
   252                              <2>  %rotate 1
   253                              <2> %endrep
   254                              <2> 	%endmacro
   255                              <2> 
   256                              <2> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   257                              <2> ; dw LINK_DATA_RELOCATIONS, 0, 0
   258                              <2> ; link_data_dump_names ELDCALL_CODE_NAMES
   259                              <2> 
   260                              <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 _LOADER 0
    18                              <1> %assign _DEBUG_COND 1
    19                              <1> %assign _DELAY_BEFORE_BP 0
    20                              <1> %assign _DHIGHLIGHT 0
    21                              <1> %assign _GETLINEHIGHLIGHT 0
    22                              <1> %assign _IMMASM 0
    23                              <1> %assign _INPUT_FILE_BOOT 0
    24                              <1> %assign _INPUT_FILE_HANDLES 0
    25                              <1> %assign _MS_0RANGE_COMPAT 0
    26                              <1> %assign _PM 0
    27                              <1> %assign _RH 0
    28                              <1> %assign _SYMBOLIC 0
    29                              <1> %assign _VXCHG 0
    30                              <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-2025 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_debug_run:			equ 200h
   203                              <2> opt7_no_ensure:			equ 1000h
   204                              <2> opt7_no_tsr_ll:			equ 2000h
   205                              <2> 
   206                              <2> 
   207                              <2> oldpacket	equ	  1	; Int25/Int26 packet method available (L, W)
   208                              <2> newpacket	equ	  2	; Int21.7305 packet method available (L, W)
   209                              <2> ntpacket	equ	  4	; VDD registered and usable (L, W)
   210                              <2> pagedcommand	equ	  8	; allows paging in puts
   211                              <2> notstdinput	equ	 10h	; DEBUG's StdIn isn't a device with StdIn bit (is file or other device)
   212                              <2> inputfile	equ	 20h	; DEBUG's StdIn is a file, notstdinput also set
   213                              <2> notstdoutput	equ	 40h	; DEBUG's StdOut isn't a device with StdOut bit (is file or other device)
   214                              <2> outputfile	equ	  80h	; DEBUG's StdOut is a file, notstdoutput also set
   215                              <2> hooked2F	equ	 100h	; Int2F hooked
   216                              <2> nohook2F	equ	 200h	; don't hook Int2F.1687 (required for Win9x, DosEmu?)
   217                              <2> unused_dif1_dpminohlt equ 400h	; DPMI doesn't like hlt
   218                              <2> protectedmode	equ	 800h	; in (DPMI) protected mode
   219                              <2> debuggeeA20	equ	1000h	; state of debuggee's A20
   220                              <2> debuggerA20	equ	2000h	; state of debugger's A20 (will be on if possible)
   221                              <2> nodosloaded	equ	4000h	; No DOS loaded currently (Boot loader mode)
   222                              <2> has386		equ	8000h	; CPU is a 386
   223                              <2> usecharcounter	equ    1_0000h	; don't reset charcounter between calls to puts
   224                              <2> runningnt	equ    2_0000h	; running in NTVDM
   225                              <2> canswitchmode	equ    4_0000h	; can switch modes (auxbuff large enough, DPMI mode switch set up)
   226                              <2> modeswitched	equ    8_0000h	; switched mode (now in the mode that we weren't entered in)
   227                              <2> promptwaiting	equ   10_0000h	; puts: any more output needs to display a prompt first
   228                              <2> switchbuffer	equ   20_0000h	; mode switch needs a buffer (auxbuff)
   229                              <2> tsrmode		equ   40_0000h	; in TSR mode; DPI and DPP not valid
   230                              <2> attachedterm	equ   80_0000h	; the attached process terminated
   231                              <2> runningdosemu	equ  100_0000h	; running in dosemu
   232                              <2> ; load_is_ldp	equ  200_0000h	; boot load: partition specified as "ldp"
   233                              <2> tt_while:	equ  400_0000h	; tt: while condition specified
   234                              <2> tt_p:		equ  800_0000h	; tt: proceed past repeated string instructions
   235                              <2> tt_silent_mode:	equ 1000_0000h	; tt: run should be silent (dump at end)
   236                              <2> tt_silence:	equ 2000_0000h	; tt: silent writing (write to auxbuff instead)
   237                              <2> tt_no_bb:	equ 4000_0000h	; tt: do not use bb breakpoints
   238                              <2> tt_no_bb_first:	equ 8000_0000h	; tt: do not use bb breakpoints at first
   239                              <2> 
   240                              <2> 
   241                              <2> dif2_gg_is_first:	equ   1
   242                              <2> dif2_gg_skip_non_cseip:	equ   2
   243                              <2> dif2_gg_skip_cseip:	equ   4
   244                              <2> dif2_gg_is_gg:		equ   8
   245                              <2> dif2_gg_first_detected:	equ  10h
   246                              <2> dif2_gg_again:		equ  20h
   247                              <2> dif2_tpg_proceed_bp_set:equ  40h
   248                              <2> dif2_tpg_keep_proceed_bp: equ 80h
   249                              <2> dif2_tpg_have_bp:	equ 100h
   250                              <2> dif2_tpg_adjusted_cseip:equ 200h
   251                              <2> dif2_tpg_do_not_adjust:	equ 400h
   252                              <2> dif2_bp_failure:	equ 800h
   253                              <2> dif2_is_pp:		equ 1000h
   254                              <2> %if _SYMBOLIC
   255                              <2> dif2_createdprocess:	equ 800_0000h	; created empty debuggee process
   256                              <2> dif2_sym_req_xms:	equ 2000h
   257                              <2> dif2_sym_req_86mm:	equ 4000h
   258                              <2> dif2_sym_req_mask equ dif2_sym_req_86mm | dif2_sym_req_xms
   259                              <2> dif2_no_pm_xms:		equ 1_0000h
   260                              <2> dif2_xms_detection_done:equ 2_0000h
   261                              <2> %endif
   262                              <2> %if _INPUT_FILE_HANDLES
   263                              <2> dif2_input_file:	equ 10_0000h
   264                              <2> dif2_closed_input_file:	equ 20_0000h
   265                              <2> %endif
   266                              <2> dif2_did_getline_file:	equ 40_0000h
   267                              <2> %if _SYMBOLIC
   268                              <2> dif2_poison:		equ 80_0000h
   269                              <2> %endif
   270                              <2> dif2_boot_loaded_kernel:equ 100_0000h
   271                              <2> %if _INPUT_FILE_BOOT
   272                              <2> dif2_input_file_boot:	equ 200_0000h
   273                              <2> dif2_closed_input_file_boot:	equ 400_0000h
   274                              <2> %endif
   275                              <2> dif2_in_silence_dump:	equ 1000_0000h
   276                              <2> dif2_int31_segment:	equ 2000_0000h
   277                              <2> dif2_nn_compat:		equ 4000_0000h
   278                              <2> dif2_nn_capitalise:	equ 8000_0000h
   279                              <2> 
   280                              <2> 
   281                              <2> dif3_load_is_ldp:	equ 1	; boot load: partition specified as "ldp"
   282                              <2> dif3_load_is_sdp:	equ 2	; boot load: partition specified as "sdp"
   283                              <2> dif3_load_is_ydp:	equ 4	; boot load: partition specified as "ydp"
   284                              <2> dif3_load_is_dp:	equ dif3_load_is_ldp 				| dif3_load_is_sdp 				| dif3_load_is_ydp
   287                              <2> dif3_load_dir_dir:	equ 8
   288                              <2> dif3_input_terminal_override:	equ 10h
   289                              <2> dif3_input_serial_override:	equ 20h
   290                              <2> dif3_if_not:		equ 40h
   291                              <2> dif3_partition_changed:	equ 80h
   292                              <2> ;
   293                              <2> dif3_input_cmdline:	equ 100h; input reading from cmdline_buffer
   294                              <2> dif3_input_cmdline_closed: equ 200h
   295                              <2> dif3_at_line_end:	equ 400h
   296                              <2> dif3_quiet_input_single:equ 800h
   297                              <2> dif3_quiet_output:	equ 1000h
   298                              <2> dif3_unquiet_error:	equ 2000h
   299                              <2> dif3_unquiet_prompt:	equ 4000h
   300                              <2> dif3_unquiet:		equ dif3_unquiet_error | dif3_unquiet_prompt
   301                              <2> dif3_return_eof:	equ 8000h
   302                              <2> dif3_highlighting:	equ 1_0000h
   303                              <2> dif3_do_not_highlight:	equ 2_0000h
   304                              <2> dif3_int10_highlight:	equ 2_0000h
   305                              <2> dif3_nosymbols_1:	equ 4_0000h
   306                              <2> dif3_nosymbols_2:	equ 8_0000h
   307                              <2> %if _PM
   308                              <2> dif3_ss_b_bit_set:	equ  10_0000h
   309                              <2> %endif
   310                              <2> dif3_gotint19:		equ  20_0000h
   311                              <2> dif3_prior_pm:		equ  40_0000h
   312                              <2> %if _DELAY_BEFORE_BP
   313                              <2> dif3_delayed		equ  80_0000h
   314                              <2> %endif
   315                              <2> dif3_input_re:		equ 100_0000h	; input reading from re_buffer
   316                              <2> dif3_input_re_closed:	equ 200_0000h
   317                              <2> dif3_accept_getrange_0:	equ 400_0000h
   318                              <2> %if _INPUT_FILE_HANDLES || _INPUT_FILE_BOOT
   319                              <2> dif3_in_if:		equ 800_0000h
   320                              <2> %endif
   321                              <2> dif3_auxbuff_guarded_1:	equ 1000_0000h
   322                              <2> dif3_auxbuff_guarded_2:	equ 2000_0000h
   323                              <2> dif3_auxbuff_guarded_3:	equ 4000_0000h
   324                              <2> dif3_sss_is_reverse:	equ 8000_0000h
   325                              <2> 
   326                              <2> 
   327                              <2> dif4_int_serial_hooked:	equ 1
   328                              <2> dif4_int_2F_hooked:	equ 2
   329                              <2> dif4_int_08_hooked:	equ 4
   330                              <2> dif4_int_2D_hooked:	equ 8
   331                              <2> %if _CATCHINTFAULTCOND && _CATCHINT0D
   332                              <2> dif4_int_0D_hooked:	equ 10h
   333                              <2> %endif
   334                              <2> %if _CATCHINTFAULTCOND && _CATCHINT0C
   335                              <2> dif4_int_0C_hooked:	equ 20h
   336                              <2> %endif
   337                              <2> %if _LOADER
   338                              <2> dif4_int_18_hooked:	equ 1000h
   339                              <2> dif4_int_19_hooked:	equ 2000h
   340                              <2> %endif
   341                              <2> 
   342                              <2> 
   343                              <2> %if _VXCHG
   344                              <2> dif6_vv_mode:		equ 1
   345                              <2> %endif
   346                              <2> dif6_in_hook2F:		equ 2
   347                              <2> dif6_in_amis_hook2F:	equ 4
   348                              <2> dif6_debug_mode:	equ 100h
   349                              <2> dif6_locked:		equ 200h
   350                              <2> dif6_mcp:		equ 400h
   351                              <2> %if _RH
   352                              <2> dif6_rh_mode_was:	equ  8_0000h
   353                              <2> dif6_rh_mode:		equ 10_0000h
   354                              <2> dif6_rh_mode_2:		equ 20_0000h
   355                              <2> %endif
   356                              <2> dif6_device_mode:	equ 40_0000h
   357                              <2> dif6_cpdepchars:	equ 80_0000h
   358                              <2> %if _IMMASM
   359                              <2> dif6_immasm_no_output:	equ 100_0000h
   360                              <2> dif6_immasm:		equ 200_0000h
   361                              <2> dif6_immasm_rel8:	equ 400_0000h
   362                              <2> %endif
   363                              <2> 
   364                              <2> 
   365                              <2> disasm_lowercase	equ 1
   366                              <2> disasm_commablank	equ 2
   367                              <2> disasm_nasm		equ 4
   368                              <2> disasm_lowercase_refmem:equ 8
   369                              <2> disasm_show_short:	equ 10h
   370                              <2> disasm_show_near:	equ 20h
   371                              <2> disasm_show_far:	equ 40h
   372                              <2> disasm_nec:		equ 80h
   373                              <2> disasm_40_columns:	equ 100h
   374                              <2> disasm_no_indent:	equ 200h
   375                              <2> disasm_msdebug_mnemonofs: equ 400h
   376                              <2> disasm_a16_memref:	equ 1000h
   377                              <2> disasm_a32_memref:	equ 2000h
   378                              <2> disasm_a16_string:	equ 4000h
   379                              <2> disasm_a32_string:	equ 8000h
   380                              <2> disasm_hide_modrm:	equ 10000h
   381                              <2> disasm_asize_loop_nasm:	equ 20000h
   382                              <2> disasm_modrm_always:	equ 40000h
   383                              <2> DEFAULTASMOPTIONS equ disasm_lowercase|disasm_commablank|disasm_nasm 	| disasm_a16_memref | disasm_a32_memref 	| disasm_a16_string | disasm_a32_string
    31                              <1> 
    32                              <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-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> 
    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> ldhlfPreserveLoader	equ 4
   109                              <2> 
   110                              <2> lsvefNoDataStart	equ 1
   111                              <2> lsvefPartitionNumber	equ 2
   112                              <2> lsvefPreserveLoader	equ 4
   113                              <2> 
   114                              <2> %if lsvefPreserveLoader != ldhlfPreserveLoader
   115                              <2>  %error Unexpected flag values
   116                              <2> %endif
   117                              <2> 
   118                              <2> 	struc LOADCMDLINE, LOADDATA - lsvclBufferLength
   119                              <2> ldCommandLine:
   120 FFFFFEE0 <res 100h>          <2> .start:		resb lsvclBufferLength
   121                              <2> 	endstruc
   122                              <2> 
   123                              <2> ldfHasLBA:	equ 1
   124                              <2> ldfFATInvalid:	equ 2
   125                              <2> ldfFATBuffered:	equ 4
   126                              <2> ldfDataBuffered: equ 8
   127                              <2> 
   128                              <2> 	struc LOADDATA2, LOADDATA - 10h
   129 FFFFFFD0 ????????            <2> ldRootSector:		resd 1
   130 FFFFFFD4 ????                <2> ldEntriesPerSector:	resw 1
   131                              <2> ldDataSegment:		; word
   132 FFFFFFD6 ????                <2> ldLastAvailableSector:	resw 1
   133                              <2> ldDataSector:		; dword
   134 FFFFFFD8 ????                <2> ldParasLeft:		resw 1
   135 FFFFFFDA ????                <2> ldParasDone:		resw 1
   136                              <2> 	endstruc
   137                              <2> 
   138                              <2> 	struc LOADDATA3, LOADDATA2 - 10h
   139 FFFFFFC0 ????????            <2> ldMaxCluster:		resd 1
   140 FFFFFFC4 ????????            <2> ldFileSize:		resd 1
   141 FFFFFFC8 ????????            <2> ldCurrentCluster:	resd 1
   142 FFFFFFCC ????????            <2> ldCurrentSeek:		resd 1
   143                              <2> 	endstruc
   144                              <2> 
   145                              <2> 	struc LOADERIMAGEIDENT
   146 00000000 ????????            <2> liiSignature:		resb 4		; "NLDR"
   147 00000004 ????                <2> liiVersion:		resb 2		; "00"
   148 00000006 ????                <2> liiChecksum:		resw 1		; word sum of first 8 words = 0
   149 00000008 ????                <2> liiAmountParagraphs:	resw 1
   150 0000000A ????????????        <2> liiReserved:		resw 3
   151 00000010 ????                <2> liiEntryQuerySize:	resw 1		; 0 if not supported
   152                              <2> 		; INP:	cs => NLDR image ident
   153                              <2> 		;	ip = this word field content
   154                              <2> 		;	ax = 60h
   155                              <2> 		; OUT:	ax => behind memory requested (should be >= 60h)
   156                              <2> 		; CHG:	es, ds, di, si, bx, cx, dx
   157                              <2> 		; STT:	far called, UP, EI
   158 00000012 ????                <2> liiEntryRelocate:	resw 1		; 0 if not supported
   159                              <2> 		; INP:	cs => NLDR image ident
   160                              <2> 		;	ip = this word field content
   161                              <2> 		;	ax = 60h
   162                              <2> 		; OUT:	ax => relocated NLDR segment (usually 60h)
   163                              <2> 		; CHG:	es, ds, di, si, bx, cx, dx
   164                              <2> 		; STT:	far called, UP, EI
   165 00000014 ????                <2> liiEntryDebug:		resw 1		; 0 if not supported
   166                              <2> 		; INP:	es = ds = cs = ss => relocated NLDR
   167                              <2> 		;	ip = this word field content
   168                              <2> 		;	sp = next word field content
   169                              <2> 		; STT:	running as debuggee, UP, EI
   170 00000016 ????                <2> liiStackPointer:	resw 1
   171                              <2> 	endstruc
   172                              <2> 
   173                              <2> 	struc LBAPACKET
   174 00000000 ????                <2> lpSize:		resw 1
   175 00000002 ????                <2> lpCount:	resw 1
   176 00000004 ????????            <2> lpBuffer:	resd 1
   177 00000008 ????????????????    <2> lpSector:	resq 1
   178                              <2> 	endstruc
   179                              <2> 
   180                              <2> 	struc PARTINFO
   181 00000000 ??                  <2> piBoot:		resb 1
   182 00000001 ??????              <2> piStartCHS:	resb 3
   183 00000004 ??                  <2> piType:		resb 1
   184 00000005 ??????              <2> piEndCHS:	resb 3
   185 00000008 ????????            <2> piStart:	resd 1
   186 0000000C ????????            <2> piLength:	resd 1
   187                              <2> 	endstruc
   188                              <2> 
   189                              <2> ptEmpty:		equ 0
   190                              <2> ptFAT12:		equ 1
   191                              <2> ptFAT16_16BIT_CHS:	equ 4
   192                              <2> ptExtendedCHS:		equ 5
   193                              <2> ptFAT16_CHS:		equ 6
   194                              <2> ptFAT32_CHS:		equ 0Bh
   195                              <2> ptFAT32:		equ 0Ch
   196                              <2> ptFAT16:		equ 0Eh
   197                              <2> ptExtended:		equ 0Fh
   198                              <2> ptLinux:		equ 83h
   199                              <2> ptExtendedLinux:	equ 85h
   200                              <2> 
   201                              <2> 
   202                              <2> 		; Flags of load_unit_flags
   203                              <2> lufForceCHS:		equ 1
   204                              <2> lufForceLBA:		equ 2
   205                              <2> lufForceGeometry:	equ 4
   206                              <2> luf_mask_writable equ lufForceCHS | lufForceLBA | lufForceGeometry
    33                              <1> 
    34                              <1> 	cpu 8086
    35                              <1> 
    36                              <1> 	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
    37                              <1> relocateddata:
    38                              <1> 
    39                              <1> 	addsection HEADER, start=0
    40                              <1> 
    41                              <1> 	istruc ELD_HEADERX
    42                              <1> at eldhxHeader
    43                              <1> 		; ELD executable header
    44                              <1> 	istruc ELD_HEADER
    45 00000000 454C4431            <1> at eldhSignature,	db "ELD1"
    46 00000004 000000              <1> 			db 0,0,0
    47 00000007 1A                  <1> 			db 26
    48 00000008 60000000            <1> at eldhCodeOffset,	dd CODEOFFSET
    49 0000000C 6013                <1> at eldhCodeImageLength,	dw code_size
    50 0000000E 0000                <1> at eldhCodeAllocLength,	dw 0
    51 00000010 C0130000            <1> at eldhDataOffset,	dd DATAOFFSET
    52 00000014 6003                <1> at eldhDataImageLength,	dw data_size
    53 00000016 1002                <1> at eldhDataAllocLength,	dw total_data_size - data_size
    54 00000018 F808                <1> at eldhCodeEntrypoint,	dw linker - code
    55                              <1> at eldhReserved
    56 0000001A 00<rep 4h>2800      <1> at eldhExtensionSize,	dw header_extension_end - $$
    57                              <1> 	iend
    58 00000020 [30000000]          <1> at eldhxDescriptionOffset,	dd description
    59 00000024 91150000            <1> at eldhxHelpOffset,		dd DATAOFFSET + msg.help - datastart
    60                              <1> PUT_ELDHX_DATETIME_OFFSET
    61                              <1> header_extension_end:
    62 00000028 00<rep 8h>          <1> 	iend
    63                              <1> 
    64                              <1> %if _BOOT
    65 00000030 4C6973742066696C65- <1> description:		asciz "List files from directories, boot loaded."
    65 00000039 732066726F6D206469- <1>
    65 00000042 726563746F72696573- <1>
    65 0000004B 2C20626F6F74206C6F- <1>
    65 00000054 616465642E00        <1>
    66                              <1> %else
    67                              <1> description:		asciz "List DOS files from directories."
    68                              <1> %endif
    69                              <1> 
    70 0000005A 00<rep 6h>          <1> 	align 16, db 0
    71                              <1> 
    72                              <1> 	eldstrict on
    73                              <1> 
    74                              <1> CODEOFFSET equ $ - $$
    75                              <1> 	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
    76                              <1> %define CODEFIXUP - code + 0
    77                              <1> code:
    78                              <1> 		; ELD instance header
    79                              <1> 	istruc ELD_INSTANCE
    80                              <1> at eldiStartCode
    81 00000000 00<rep 2h>          <1> at eldiEndCode
    82 00000002 00<rep 2h>          <1> at eldiStartData
    83 00000004 00<rep 2h>          <1> at eldiEndData
    84                              <1> %if _BOOT
    85 00000006 00<rep 2h>424F4F54- <1> at eldiIdentifier,	fill 8, 32, db "BOOT DIR"
    85 0000000C 20444952            <1>
    86 00000010 00<rep 2h>626F6F74- <1> at eldiListing,		asciz _ELD_LISTING
    86 00000016 6469722E6C737400    <1>
    87                              <1> %else
    88                              <1> at eldiIdentifier,	fill 8, 32, db "DOS DIR"
    89                              <1> at eldiListing,		asciz _ELD_LISTING
    90                              <1> %endif
    91 0000001E 00<rep 2h>          <1> 	iend
    92                              <1> 
    93                              <1> 
    94                              <1> run:
    95 00000020 16                  <1> 	push ss
    96 00000021 07                  <1> 	pop es
    97                              <1> 
    98                              <1> %if _BOOT
    99                              <1> run_boot:
   100 00000022 F606[0100]40        <1> reloc	testopt [relocateddata], nodosloaded
   101                              <1> linkdatarelocation internalflags, -3
   102 00000027 7503E99C08          <1> 	jz error
   103 0000002C E81908              <1> 	extcallcall yy_boot_parse_name2
   104 0000002F E88506              <1> 	call parse_verbose
   105 00000032 891E[6C03]          <1> reloc	mov word [pathname_start], bx
   106                              <1> internaldatarelocation
   107                              <1> 
   108 00000036 53                  <1> 	push bx
   109 00000037 89DF                <1> 	mov di, bx
   110 00000039 E85A06              <1> 	call find_dir
   111 0000003C 5B                  <1> 	pop bx
   112 0000003D 89FA                <1> 	mov dx, di
   113                              <1>  %if 0
   114                              <1> 	db __TEST_IMM8			; (skip inc)
   115                              <1> @@:
   116                              <1> 	inc di
   117                              <1> 	cmp byte [di], 0
   118                              <1> 	je boot_no_wild
   119                              <1> 	cmp byte [di], '?'
   120                              <1> 	je boot_wild
   121                              <1> 	cmp byte [di], '*'
   122                              <1> 	jne @B
   123                              <1> 
   124                              <1> boot_no_wild:
   125                              <1> boot_wild:
   126                              <1>  %endif
   127 0000003F 8916[6003]          <1> reloc	mov word [wild_pattern], dx
   128                              <1> internaldatarelocation
   129                              <1> 
   130 00000043 E80A08              <1> 	extcallcall yy_boot_init_dir2
   131                              <1> 
   132 00000046 8B7E0B              <1> 	mov di, word [bp + bsBPB + bpbBytesPerSector]
   133                              <1> 					; di = sector size
   134                              <1> 					; = start of available auxbuff
   135 00000049 807EE60C            <1> 	cmp byte [bp + ldFATType], 12	; FAT12 ?
   136 0000004D 7508                <1> 	jne @F				; no -->
   137 0000004F 81FF0020            <1> 	cmp di, 8192			; already enough for a full FAT ?
   138 00000053 7302                <1> 	jae @F				; yes -->
   139 00000055 01FF                <1> 	add di, di			; reserve straddling sector
   140                              <1> @@:
   141                              <1> %else
   142                              <1> run_dos:
   143                              <1> 	extcallcall InDOS
   144                              <1> 	extcallcall yy_dos_parse_name
   145                              <1> 	call parse_verbose
   146                              <1> 
   147                              <1> 	houdini
   148                              <1> reloc	mov word [pathname_start], bx
   149                              <1> internaldatarelocation
   150                              <1> 	push bx
   151                              <1> 
   152                              <1> 	mov ah, 2Fh			; get DTA
   153                              <1> 	extcallcall ispm
   154                              <1> 	jnz .rm
   155                              <1> 
   156                              <1> subcpu 286
   157                              <1> 	push word 0
   158                              <1> 	push word 21h
   159                              <1> 	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
   160                              <1> 	pop dx				; discard interrupt number
   161                              <1> 	pop dx				; get es
   162                              <1> subcpureset
   163                              <1> 	jmp @F
   164                              <1> .rm:
   165                              <1> 	int 21h
   166                              <1> 	mov dx, es
   167                              <1> @@:
   168                              <1> 
   169                              <1> reloc	mov word [originaldta], bx
   170                              <1> internaldatarelocation
   171                              <1> reloc	mov word [originaldta + 2], dx
   172                              <1> internaldatarelocation
   173                              <1> 
   174                              <1> reloc	mov ax, word [relocateddata]
   175                              <1> linkdatarelocation ext_inject_handler
   176                              <1> reloc	mov word [originalinject], ax
   177                              <1> internaldatarelocation
   178                              <1> reloc2	mov word [relocateddata], inject
   179                              <1> linkdatarelocation ext_inject_handler, -4
   180                              <1> internalcoderelocation
   181                              <1> 	call get_es_ext
   182                              <1> reloc	setopt [es:code + eldiFlags], eldifResident
   183                              <1> internalcoderelocation -3	; mark block as resident
   184                              <1> 	 push ss
   185                              <1> 	 pop es
   186                              <1> 
   187                              <1> 	houdini
   188                              <1> reloc	mov dx, dta
   189                              <1> internaldatarelocation
   190                              <1> 	mov ah, 1Ah		; set DTA
   191                              <1> 	extcallcall _doscall
   192                              <1> 
   193                              <1> 	pop dx
   194                              <1> %endif
   195                              <1> 
   196 00000057 D006[0B00]          <1> reloc	rol byte [sort], 1
   197                              <1> internaldatarelocation
   198 0000005B 734C                <1> 	jnc .no_sort_buffer
   199                              <1> 
   200 0000005D A1[0000]            <1> reloc	mov ax, word [relocateddata]
   201                              <1> linkdatarelocation extdata_size
   202 00000060 2B06[0000]          <1> reloc	sub ax, word [relocateddata]
   203                              <1> linkdatarelocation extdata_used
   204 00000064 8B1E[0000]          <1> reloc	mov bx, word [relocateddata]
   205                              <1> linkdatarelocation auxbuff_current_size
   206 00000068 83C000              <1> 	add ax, (uinit_data_end_2 - buffer_end)
   207                              <1> %if _BOOT
   208 0000006B 29FB                <1> 	sub bx, di
   209 0000006D 7606                <1> 	jbe .use_sort_buffer_eld_data_block
   210                              <1> %endif
   211 0000006F 39D8                <1> 	cmp ax, bx
   212 00000071 7302                <1> 	jae .use_sort_buffer_eld_data_block
   213                              <1> 
   214                              <1> %ifn _BOOT
   215                              <1> reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
   218                              <1> linkdatarelocation internalflags3, -3
   219                              <1> 	jz .use_sort_buffer_auxbuff
   220                              <1> %else
   221 00000073 EB1C                <1> 	jmp .use_sort_buffer_auxbuff
   222                              <1> %endif
   223                              <1> 
   224                              <1> .use_sort_buffer_eld_data_block:
   225 00000075 83E800              <1> 	sub ax, (uinit_data_end_2 - buffer_end)
   226 00000078 E87C07              <1> 	call get_es_ext
   227 0000007B 260106[0600]        <1> reloc	add word [es:code + eldiEndData], ax
   228                              <1> internalcoderelocation		; adjust size
   229 00000080 0106[0000]          <1> reloc	add word [relocateddata], ax
   230                              <1> linkdatarelocation extdata_used	; adjust size
   231 00000084 26A1[0600]          <1> reloc	mov ax, word [es:code + eldiEndData]
   232                              <1> internalcoderelocation		; -> end of sort buffer
   233 00000088 16                  <1> 	push ss
   234 00000089 07                  <1> 	pop es
   235                              <1> 
   236 0000008A BF[7005]            <1> reloc	mov di, buffer_end	; -> start of sort buffer
   237                              <1> internaldatarelocation
   238 0000008D 8CD6                <1> 	mov si, ss		; => sort buffer
   239 0000008F EB05                <1> 	jmp .sort_buffer_common
   240                              <1> 
   241                              <1> .use_sort_buffer_auxbuff:
   242 00000091 93                  <1> 	xchg ax, bx		; ax -> end of sort buffer
   243                              <1> %ifn _BOOT
   244                              <1> 	xor di, di		; di -> start of sort buffer
   245                              <1> %endif
   246 00000092 8B36[0000]          <1> reloc	mov si, word [relocateddata]
   247                              <1> linkdatarelocation auxbuff_segorsel	; => sort buffer
   248                              <1> %ifn _BOOT
   249                              <1> 	extcallcall guard_auxbuff
   250                              <1> %endif
   251                              <1> 
   252                              <1> 		; INP:	si:di -> buffer
   253                              <1> 		;	si:ax -> behind buffer
   254                              <1> .sort_buffer_common:
   255 00000096 8936[6203]          <1> reloc	mov word [sortsegsel], si
   256                              <1> internaldatarelocation
   257 0000009A 893E[6403]          <1> reloc	mov word [sortstartoffset], di
   258                              <1> internaldatarelocation
   259 0000009E 893E[6803]          <1> reloc	mov word [sort_last], di
   260                              <1> internaldatarelocation
   261 000000A2 893E[6A03]          <1> reloc	mov word [sort_next], di
   262                              <1> internaldatarelocation
   263 000000A6 A3[6603]            <1> reloc	mov word [sortendoffset], ax
   264                              <1> internaldatarelocation
   265                              <1> 
   266                              <1> .no_sort_buffer:
   267                              <1> 
   268                              <1> %ifn _BOOT
   269                              <1> 	call findfirst
   270                              <1> 	jc .notfound
   271                              <1> reloc	mov di, relocateddata
   272                              <1> linkdatarelocation line_out
   273                              <1> 
   274                              <1> .loop:
   275                              <1> %else
   276                              <1> boot_scan:
   277 000000A9 C606[0000]00        <1> reloc	mov byte [relocateddata], 0
   278                              <1> linkdatarelocation load_check_dir_attr, -3
   279 000000AE 8B36[0000]          <1> reloc	mov si, word [relocateddata]
   280                              <1> linkdatarelocation load_yyname_input
   281 000000B2 803C2F              <1> 	cmp byte [si], '/'
   282 000000B5 7501                <1> 	jne @F
   283 000000B7 46                  <1> 	inc si
   284                              <1> @@:
   285 000000B8 803C00              <1> 	cmp byte [si], 0
   286 000000BB 7507                <1> 	jne @F
   287 000000BD E8[0000]EB020000    <1> 	extcall ..@yy_filename_empty
   288                              <1> @@:
   289 000000C4 16                  <1> 	 push ss
   290 000000C5 07                  <1> 	 pop es
   291 000000C6 E88200              <1> 	call boot_parse_name
   292 000000C9 3C2F                <1> 	cmp al, '/'
   293 000000CB 7509                <1> 	jne @F
   294 000000CD C606[0000]10        <1> reloc	mov byte [relocateddata], ATTR_DIRECTORY
   295                              <1> linkdatarelocation load_check_dir_attr, -3
   296 000000D2 8936[0000]          <1> reloc	mov word [relocateddata], si
   297                              <1> linkdatarelocation load_yyname_next
   298                              <1> @@:
   299                              <1> 
   300 000000D6 BFFFFF              <1> 	mov di, -1
   301 000000D9 89FE                <1> 	mov si, di
   302 000000DB 897EF4              <1> 	mov [bp + lsvFATSector], di
   303 000000DE 8976F6              <1> 	mov [bp + lsvFATSector + 2], si
   304                              <1> 
   305 000000E1 31C0                <1> 	xor ax, ax
   306 000000E3 31D2                <1> 	xor dx, dx
   307                              <1> 
   308                              <1> scan_dir_yyname_loop:
   309 000000E5 8946EC              <1> 	mov word [bp + ldDirCluster], ax
   310 000000E8 8956EE              <1> 	mov word [bp + ldDirCluster + 2], dx
   311                              <1> 
   312 000000EB 16                  <1> 	push ss
   313 000000EC 07                  <1> 	pop es
   314 000000ED BB[0000]            <1> reloc	mov bx, relocateddata
   315                              <1> linkdatarelocation load_yy_direntry
   316                              <1> 
   317 000000F0 C706[0000][0000]    <1> reloc2	mov word [relocateddata], relocateddata
   318                              <1> linkdatarelocation handle_scan_dir_not_found, -4
   319                              <1> ;linkdatarelocation near_transfer_ext_entry
   320                              <1> linkdatarelocation dmycmd
   321 000000F6 E8[0000]EB020000    <1> 	extcall scan_dir_aux
   322 000000FD 7303E96901          <1> 	jc end_of_directory
   323                              <1> 
   324 00000102 803E[0000]10        <1> reloc	cmp byte [relocateddata], ATTR_DIRECTORY
   325                              <1> linkdatarelocation load_check_dir_attr, -3
   326 00000107 7403E95F01          <1> 	jne got_single_yyentry
   327                              <1> 
   328 0000010C 56                  <1> 	push si
   329 0000010D 57                  <1> 	push di
   330 0000010E C606[0000]00        <1> reloc	mov byte [relocateddata], 0
   331                              <1> linkdatarelocation load_check_dir_attr, -3
   332 00000113 8B36[0000]          <1> reloc	mov si, word [relocateddata]
   333                              <1> linkdatarelocation load_yyname_next
   334 00000117 803C00              <1> 	cmp byte [si], 0
   335 0000011A 7507                <1> 	jne @F
   336 0000011C E8[0000]EB020000    <1> 	extcall ..@yy_filename_empty
   337                              <1> @@:
   338 00000123 06                  <1> 	push es
   339 00000124 16                  <1> 	 push ss
   340 00000125 07                  <1> 	 pop es
   341 00000126 E82200              <1> 	call boot_parse_name
   342 00000129 07                  <1> 	pop es
   343 0000012A 3C2F                <1> 	cmp al, '/'
   344 0000012C 7509                <1> 	jne @F
   345 0000012E C606[0000]10        <1> reloc	mov byte [relocateddata], ATTR_DIRECTORY
   346                              <1> linkdatarelocation load_check_dir_attr, -3
   347 00000133 8936[0000]          <1> reloc	mov word [relocateddata], si
   348                              <1> linkdatarelocation load_yyname_next
   349                              <1> @@:
   350 00000137 5F                  <1> 	pop di
   351 00000138 5E                  <1> 	pop si
   352                              <1> 
   353 00000139 31D2                <1> 	xor dx, dx
   354 0000013B 268B471A            <1> 	mov ax, [es:bx + deClusterLow]
   355                              <1> 				; = first cluster (not FAT32)
   356 0000013F 807EE620            <1> 	cmp byte [bp + ldFATType], 32
   357 00000143 7504                <1> 	jne @F
   358 00000145 268B5714            <1> 	mov dx, [es:bx + deClusterHigh]
   359                              <1> 				; dx:ax = first cluster (FAT32)
   360                              <1> @@:
   361                              <1> 
   362 00000149 EB9A                <1> 	jmp scan_dir_yyname_loop
   363                              <1> 
   364                              <1> boot_parse_name:
   365 0000014B 3936[6003]          <1> reloc	cmp word [wild_pattern], si
   366                              <1> internaldatarelocation
   367 0000014F 740A                <1> 	je @F
   368 00000151 E80407              <1> 	extcallcall boot_parse_fn	; get next pathname
   369                              <1> 
   370 00000154 C706[0000][0000]    <1> reloc2	mov word [relocateddata], relocateddata
   371                              <1> linkdatarelocation handle_scan_dir_entry, -4
   372                              <1> linkdatarelocation scan_dir_entry
   373                              <1> 
   374 0000015A C3                  <1> 	retn
   375                              <1> 
   376                              <1> @@:
   377 0000015B E8FA06              <1> 	extcallcall boot_parse_fn	; get next pathname
   378                              <1> 
   379 0000015E C706[0000][8801]    <1> reloc2	mov word [relocateddata], match_wildcard
   380                              <1> linkdatarelocation near_transfer_ext_address, -4
   381                              <1> internalcoderelocation
   382 00000164 C706[0000][0000]    <1> reloc2	mov word [relocateddata], relocateddata
   383                              <1> linkdatarelocation handle_scan_dir_entry, -4
   384                              <1> linkdatarelocation near_transfer_ext_entry
   385                              <1> 
   386 0000016A 50                  <1> 	push ax
   387 0000016B BF[0000]            <1> reloc	mov di, relocateddata
   388                              <1> linkdatarelocation load_kernel_name
   389 0000016E B90800              <1> 	mov cx, 8
   390 00000171 E80700              <1> 	call .handle_asterisk		; handle in basename
   391 00000174 B103                <1> 	mov cl, 3
   392 00000176 E80200              <1> 	call .handle_asterisk		; handle in extension
   393 00000179 58                  <1> 	pop ax
   394 0000017A C3                  <1> 	retn
   395                              <1> 
   396                              <1> .handle_asterisk:
   397 0000017B B02A                <1> 	mov al, '*'
   398 0000017D F2AE                <1> 	repne scasb			; scan for asterisk
   399 0000017F 7506                <1> 	jne @F				; not found -->
   400 00000181 B03F                <1> 	mov al, '?'			; fill with question marks
   401 00000183 4F                  <1> 	dec di				; -> at the asterisk
   402 00000184 41                  <1> 	inc cx				; = how many bytes remain
   403 00000185 F3AA                <1> 	rep stosb			; fill this field
   404                              <1> @@:
   405 00000187 C3                  <1> 	retn
   406                              <1> 
   407                              <1> 
   408                              <1> 		; INP:	es:di -> DIRENTRY
   409                              <1> 		;	dx:ax - 1 = sector
   410                              <1> 		;	cx, si in use
   411                              <1> 		; OUT:	CY if end of directory
   412                              <1> 		;	NC if to continue,
   413                              <1> 		;	 ZR if match
   414                              <1> 		;	 NZ if mismatch
   415                              <1> 		; CHG:	bx
   416                              <1> match_wildcard:
   417 00000188 26803D00            <1> 	cmp byte [es:di], 0
   418 0000018C F9                  <1> 	stc
   419 0000018D 7503E9D200          <1> 	je .ret
   420 00000192 268A5D0B            <1> 	mov bl, byte [es:di + deAttrib]
   421 00000196 F6C308              <1> 	test bl, ATTR_VOLLABEL
   422 00000199 7403E9C500          <1> 	jnz .ret_NC		; skip volume labels (and LFNs) --> (NZ)
   423 0000019E 56                  <1> 	push si
   424 0000019F 57                  <1> 	push di
   425 000001A0 51                  <1> 	push cx
   426 000001A1 BE[0000]            <1> reloc	mov si, relocateddata	; ds:si-> name to match
   427                              <1> linkdatarelocation load_kernel_name
   428 000001A4 B90B00              <1> 	mov cx, 11		; length of padded 8.3 FAT filename
   429                              <1> @@:
   430 000001A7 F3A6                <1> 	repe cmpsb		; check entry
   431 000001A9 7406                <1> 	je @F			; match -->
   432 000001AB 807CFF3F            <1> 	cmp byte [si - 1], '?'	; wildcard ?
   433 000001AF 74F6                <1> 	je @B			; yes --> (ZR)
   434                              <1> 				; no (NZ)
   435                              <1> @@:
   436 000001B1 59                  <1> 	pop cx
   437 000001B2 5F                  <1> 	pop di
   438 000001B3 5E                  <1> 	pop si
   439 000001B4 7403E9AA00          <1> 	jne .ret_NC
   440                              <1> 
   441 000001B9 56                  <1> 	push si
   442 000001BA 06                  <1> 	push es
   443 000001BB 57                  <1> 	push di
   444 000001BC 52                  <1> 	push dx
   445 000001BD 50                  <1> 	push ax
   446 000001BE 51                  <1> 	push cx
   447                              <1> 
   448 000001BF B92000              <1> 	mov cx, DIRENTRY_size
   449 000001C2 1E                  <1> 	push ds
   450 000001C3 06                  <1> 	 push es
   451 000001C4 1F                  <1> 	 pop ds
   452 000001C5 89FE                <1> 	mov si, di		; ds:si -> entry in directory buffer
   453 000001C7 16                  <1> 	push ss
   454 000001C8 07                  <1> 	pop es
   455 000001C9 BF[0000]            <1> reloc	mov di, relocateddata	; es:di -> destination for entry
   456                              <1> linkdatarelocation load_yy_direntry
   457 000001CC 57                  <1> 	push di
   458 000001CD F3A4                <1> 	rep movsb
   459 000001CF 5E                  <1> 	pop si
   460 000001D0 1F                  <1> 	pop ds
   461                              <1> 
   462 000001D1 BF[9B03]            <1> reloc	mov di, pathnamebuffer - 1
   463                              <1> internaldatarelocation		; di -> buffer
   464 000001D4 B000                <1> 	mov al, 0
   465 000001D6 AA                  <1> 	stosb
   466 000001D7 57                  <1> 	push di
   467 000001D8 B108                <1> 	mov cl, 8
   468 000001DA 803C05              <1> 	cmp byte [si], 05h
   469 000001DD 7505                <1> 	jne @F
   470 000001DF B0E5                <1> 	mov al, 0E5h
   471 000001E1 AA                  <1> 	stosb
   472 000001E2 49                  <1> 	dec cx
   473 000001E3 46                  <1> 	inc si
   474                              <1> @@:
   475 000001E4 F3A4                <1> 	rep movsb
   476 000001E6 B109                <1> 	mov cl, 9
   477 000001E8 A8                  <1> 	db __TEST_IMM8
   478                              <1> @@:
   479 000001E9 4F                  <1> 	dec di
   480 000001EA 807DFF20            <1> 	cmp byte [di - 1], 32
   481 000001EE E1F9                <1> 	loope @B
   482                              <1> 
   483 000001F0 807DFF2E            <1> 	cmp byte [di - 1], '.'
   484 000001F4 750C                <1> 	jne @F
   485 000001F6 813C2020            <1> 	cmp word [si], 2020h
   486 000001FA 7506                <1> 	jne @F
   487 000001FC 807C0220            <1> 	cmp byte [si + 2], 32
   488 00000200 7418                <1> 	je .dotname
   489                              <1> @@:
   490                              <1> 
   491 00000202 B02E                <1> 	mov al, '.'
   492 00000204 AA                  <1> 	stosb
   493 00000205 B103                <1> 	mov cl, 3
   494 00000207 F3A4                <1> 	rep movsb
   495 00000209 B104                <1> 	mov cl, 4
   496 0000020B A8                  <1> 	db __TEST_IMM8
   497                              <1> @@:
   498 0000020C 4F                  <1> 	dec di
   499 0000020D 807DFF20            <1> 	cmp byte [di - 1], 32
   500 00000211 E1F9                <1> 	loope @B
   501 00000213 807DFF2E            <1> 	cmp byte [di - 1], '.'
   502 00000217 7501                <1> 	jne @F
   503 00000219 4F                  <1> 	dec di
   504                              <1> @@:
   505                              <1> .dotname:
   506 0000021A B000                <1> 	mov al, 0
   507 0000021C AA                  <1> 	stosb
   508                              <1> 
   509 0000021D 16                  <1> 	 push ss
   510 0000021E 07                  <1> 	 pop es
   511 0000021F 5A                  <1> 	pop dx
   512                              <1> 
   513                              <1> 		; get attrib byte
   514 00000220 A0[0B00]            <1> reloc	mov al, byte [relocateddata + deAttrib]
   515                              <1> linkdatarelocation load_yy_direntry
   516 00000223 A2[7003]            <1> reloc	mov byte [finddata.attrib], al
   517                              <1> internaldatarelocation
   518                              <1> 
   519                              <1> 		; get time and date
   520 00000226 A1[1600]            <1> reloc	mov ax, word [relocateddata + deTime]
   521                              <1> linkdatarelocation load_yy_direntry
   522 00000229 A3[8403]            <1> reloc	mov word [finddata.time], ax
   523                              <1> internaldatarelocation
   524 0000022C A1[1800]            <1> reloc	mov ax, word [relocateddata + deDate]
   525                              <1> linkdatarelocation load_yy_direntry
   526 0000022F A3[8603]            <1> reloc	mov word [finddata.date], ax
   527                              <1> internaldatarelocation
   528                              <1> 
   529                              <1> 		; get size low
   530 00000232 A1[1C00]            <1> reloc	mov ax, word [relocateddata + deSize]
   531                              <1> linkdatarelocation load_yy_direntry
   532 00000235 A3[9003]            <1> reloc	mov word [finddata.sizelow], ax
   533                              <1> internaldatarelocation
   534 00000238 A1[1E00]            <1> reloc	mov ax, word [relocateddata + deSize + 2]
   535                              <1> linkdatarelocation load_yy_direntry
   536 0000023B A3[9203]            <1> reloc	mov word [finddata.sizelow + 2], ax
   537                              <1> internaldatarelocation
   538                              <1> 
   539                              <1> 		; zero unused fields
   540 0000023E 31C0                <1> 	xor ax, ax
   541 00000240 A3[8E03]            <1> reloc	mov word [finddata.sizehigh + 2], ax
   542                              <1> internaldatarelocation
   543 00000243 A2[A004]            <1> reloc	mov byte [finddata.shortname], al
   544                              <1> internaldatarelocation
   545                              <1> 
   546                              <1> 		; get FAT+ high 6 size bits
   547 00000246 A0[0C00]            <1> reloc	mov al, byte [relocateddata + dePlusSize]
   548                              <1> linkdatarelocation load_yy_direntry
   549 00000249 88C4                <1> 	mov ah, al
   550 0000024B 2507E0              <1> 	and ax, 0E007h
   551 0000024E D0EC                <1> 	shr ah, 1
   552 00000250 D0EC                <1> 	shr ah, 1
   553 00000252 08E0                <1> 	or al, ah
   554 00000254 B400                <1> 	mov ah, 0
   555 00000256 A3[8C03]            <1> reloc	mov word [finddata.sizehigh], ax
   556                              <1> internaldatarelocation
   557                              <1> 
   558 00000259 FF16[0000]          <1> reloc	call near [matchfunction]
   559                              <1> internaldatarelocation		; NZ to continue search, ZR to end
   560                              <1> 
   561 0000025D 59                  <1> 	pop cx
   562 0000025E 58                  <1> 	pop ax
   563 0000025F 5A                  <1> 	pop dx
   564 00000260 5F                  <1> 	pop di
   565 00000261 07                  <1> 	pop es
   566 00000262 5E                  <1> 	pop si			; restore registers
   567                              <1> 
   568                              <1> %if 0
   569                              <1> 	pushf
   570                              <1> 	sub ax, 1
   571                              <1> 	sbb dx, 0
   572                              <1> reloc	mov bx, [relocateddata]
   573                              <1> linkdatarelocation load_adr_dirbuf_segment
   574                              <1> 	extcall read_sector	; restore sector
   575                              <1> 	popf
   576                              <1> %endif
   577                              <1> 
   578                              <1> .ret_NC:
   579 00000263 F8                  <1> 	clc
   580                              <1> .ret:
   581 00000264 E8[0000]EB020000    <1> 	extcall near_transfer_ext_return, required ; must NOT be extcallcall
   582                              <1> 
   583                              <1> 
   584                              <1> got_single_yyentry:
   585                              <1> end_of_directory:
   586 0000026B 813E[0000][2505]    <1> reloc2	cmp word [matchfunction], display_ZR
   587                              <1> internaldatarelocation -4
   588                              <1> internalcoderelocation
   589 00000271 7403E94801          <1> 	jne ..@boot_scan_end
   590 00000276 C3                  <1> 	retn
   591                              <1> 
   592                              <1> sort_or_display:
   593                              <1> %endif
   594 00000277 D006[0B00]          <1> reloc	rol byte [sort], 1
   595                              <1> internaldatarelocation
   596 0000027B 7203E93801          <1> 	jnc .display
   597                              <1> 
   598 00000280 E84302              <1> 	call populate_finddata
   599 00000283 7503E93301          <1> 	je .next
   600                              <1> 
   601                              <1> %ifn _BOOT
   602                              <1> reloc	rol byte [sortlfn], 1
   603                              <1> internaldatarelocation
   604                              <1> 	jnc @F
   605                              <1> 
   606                              <1> reloc	mov si, finddata.fullname
   607                              <1> internaldatarelocation
   608                              <1> @@:
   609                              <1> %endif
   610                              <1> 
   611 00000288 89F7                <1> 	mov di, si
   612 0000028A B000                <1> 	mov al, 0
   613 0000028C B90002              <1> 	mov cx, 512
   614 0000028F F2AE                <1> 	repne scasb
   615 00000291 7403E95301          <1> 	jne .error
   616                              <1> 
   617 00000296 89F9                <1> 	mov cx, di
   618 00000298 29F1                <1> 	sub cx, si		; = length including NUL
   619                              <1> 
   620 0000029A 8B3E[6803]          <1> reloc	mov di, word [sort_last]
   621                              <1> internaldatarelocation
   622 0000029E 89F8                <1> 	mov ax, di
   623 000002A0 01C8                <1> 	add ax, cx
   624 000002A2 7303E95201          <1> 	jc .toofull
   625 000002A7 0306[0400]          <1> reloc	add ax, word [meta]
   626                              <1> internaldatarelocation
   627 000002AB 7303E94901          <1> 	jc .toofull
   628 000002B0 3B06[6603]          <1> reloc	cmp ax, word [sortendoffset]
   629                              <1> internaldatarelocation
   630 000002B4 7603E94001          <1> 	ja .toofull
   631                              <1> 
   632 000002B9 8E06[6203]          <1> reloc	mov es, word [sortsegsel]
   633                              <1> internaldatarelocation
   634 000002BD 8B3E[6403]          <1> reloc	mov di, word [sortstartoffset]
   635                              <1> internaldatarelocation
   636 000002C1 89F2                <1> 	mov dx, si
   637                              <1> 
   638                              <1> .sort:
   639 000002C3 3B3E[6803]          <1> reloc	cmp di, word [sort_last]
   640                              <1> internaldatarelocation
   641 000002C7 7203E9DD00          <1> 	jae .sort_insert_last
   642                              <1> 
   643 000002CC 89FB                <1> 	mov bx, di
   644                              <1> 
   645 000002CE D006[0C00]          <1> reloc	rol byte [dirfirst], 1
   646                              <1> internaldatarelocation
   647 000002D2 730E                <1> 	jnc .notdirfirst
   648 000002D4 A0[7003]            <1> reloc	mov al, byte [finddata.attrib]
   649                              <1> internaldatarelocation
   650 000002D7 268A25              <1> 	mov ah, byte [es:di]
   651 000002DA 251010              <1> 	and ax, (ATTR_DIRECTORY << 8) | ATTR_DIRECTORY
   652 000002DD 38E0                <1> 	cmp al, ah
   653 000002DF 755F                <1> 	jne ..@compare_normal
   654 000002E1 47                  <1> 	inc di
   655                              <1> .notdirfirst:
   656                              <1> 
   657 000002E2 D006[0D00]          <1> reloc	rol byte [date], 1
   658                              <1> internaldatarelocation
   659 000002E6 7311                <1> 	jnc .notdate
   660 000002E8 A1[8603]            <1> reloc	mov ax, word [finddata.date]
   661                              <1> internaldatarelocation
   662 000002EB 263B4502            <1> 	cmp ax, word [es:di + 2]
   663 000002EF 7547                <1> 	jne .sort_compare
   664 000002F1 A1[8403]            <1> reloc	mov ax, word [finddata.time]
   665                              <1> internaldatarelocation
   666 000002F4 263B05              <1> 	cmp ax, word [es:di]
   667 000002F7 753F                <1> 	jne .sort_compare
   668                              <1> 	; scasw
   669                              <1> 	; scasw
   670                              <1> .notdate:
   671                              <1> 
   672 000002F9 D006[0E00]          <1> reloc	rol byte [size], 1
   673                              <1> internaldatarelocation
   674 000002FD 731A                <1> 	jnc .notsize
   675 000002FF A0[B204]            <1> reloc	mov al, byte [size40bit + 4]
   676                              <1> internaldatarelocation
   677 00000302 263A4504            <1> 	cmp al, byte [es:di + 4]
   678 00000306 7530                <1> 	jne .sort_compare
   679 00000308 A1[B004]            <1> reloc	mov ax, word [size40bit + 2]
   680                              <1> internaldatarelocation
   681 0000030B 263B4502            <1> 	cmp ax, word [es:di + 2]
   682 0000030F 7527                <1> 	jne .sort_compare
   683 00000311 A1[AE04]            <1> reloc	mov ax, word [size40bit]
   684                              <1> internaldatarelocation
   685 00000314 263B05              <1> 	cmp ax, word [es:di]
   686 00000317 751F                <1> 	jne .sort_compare
   687                              <1> 	; add di, 5
   688                              <1> .notsize:
   689                              <1> 
   690 00000319 89DF                <1> 	mov di, bx
   691 0000031B 033E[0400]          <1> reloc	add di, word [meta]
   692                              <1> internaldatarelocation
   693 0000031F 89D6                <1> 	mov si, dx
   694 00000321 B001                <1> 	mov al, 1
   695                              <1> @@:
   696 00000323 3C00                <1> 	cmp al, 0
   697 00000325 741B                <1> 	je .sort_insert_skip_bx
   698 00000327 AC                  <1> 	lodsb
   699 00000328 268A25              <1> 	mov ah, byte [es:di]
   700 0000032B 47                  <1> 	inc di
   701 0000032C E83105              <1> 	extcallcall uppercase
   702 0000032F 86C4                <1> 	xchg al, ah
   703 00000331 E82C05              <1> 	extcallcall uppercase
   704 00000334 38E0                <1> 	cmp al, ah
   705 00000336 74EB                <1> 	je @B
   706                              <1> .sort_compare:
   707 00000338 FF26[0600]          <1> reloc	jmp near [compare]
   708                              <1> internaldatarelocation
   709                              <1> 
   710                              <1> ..@compare_reverse:
   711 0000033C 7216                <1> 	jb .sort_insert_before_bx
   712 0000033E EB02                <1> 	jmp .sort_insert_skip_bx
   713                              <1> 
   714                              <1> ..@compare_normal:
   715 00000340 7712                <1> 	ja .sort_insert_before_bx
   716                              <1> .sort_insert_skip_bx:
   717 00000342 51                  <1> 	push cx
   718 00000343 89DF                <1> 	mov di, bx
   719 00000345 033E[0400]          <1> reloc	add di, word [meta]
   720                              <1> internaldatarelocation
   721 00000349 B000                <1> 	mov al, 0
   722 0000034B B90002              <1> 	mov cx, 512
   723 0000034E F2AE                <1> 	repne scasb
   724 00000350 59                  <1> 	pop cx
   725 00000351 E96FFF              <1> 	jmp .sort
   726                              <1> 
   727                              <1> .sort_insert_before_bx:
   728                              <1> 	houdini
   729 00000354 8B3E[6803]          <1> reloc	mov di, word [sort_last]	; -> after last
   730                              <1> internaldatarelocation
   731 00000358 89FE                <1> 	mov si, di			; -> behind source
   732 0000035A 01CF                <1> 	add di, cx			; -> behind target
   733 0000035C 033E[0400]          <1> reloc	add di, word [meta]
   734                              <1> internaldatarelocation
   735 00000360 51                  <1> 	push cx
   736 00000361 89F1                <1> 	mov cx, si			; -> behind source
   737 00000363 29D9                <1> 	sub cx, bx			; behind source minus start source
   738                              <1> 					;  = length of source
   739 00000365 FD                  <1> 	std
   740 00000366 A6                  <1> 	cmpsb				; -> last bytes
   741                              <1> @@:
   742 00000367 26A4                <1> 	es movsb
   743 00000369 E2FC                <1> 	loop @B				; move up trailer
   744 0000036B FC                  <1> 	cld
   745 0000036C 59                  <1> 	pop cx
   746 0000036D 010E[6803]          <1> reloc	add word [sort_last], cx
   747                              <1> internaldatarelocation
   748 00000371 8B3E[0400]          <1> reloc	mov di, word [meta]
   749                              <1> internaldatarelocation
   750 00000375 013E[6803]          <1> reloc	add word [sort_last], di
   751                              <1> internaldatarelocation
   752 00000379 89DF                <1> 	mov di, bx
   753 0000037B E80200              <1> 	call .store_with_meta
   754 0000037E EB34                <1> 	jmp .sort_inserted
   755                              <1> 
   756                              <1> .store_with_meta:
   757 00000380 D006[0C00]          <1> reloc	rol byte [dirfirst], 1
   758                              <1> internaldatarelocation
   759 00000384 7304                <1> 	jnc @F
   760 00000386 A0[7003]            <1> reloc	mov al, byte [finddata.attrib]
   761                              <1> internaldatarelocation
   762 00000389 AA                  <1> 	stosb
   763                              <1> @@:
   764                              <1> 
   765 0000038A D006[0E00]          <1> reloc	rol byte [size], 1
   766                              <1> internaldatarelocation
   767 0000038E 7306                <1> 	jnc @F
   768 00000390 BE[AE04]            <1> reloc	mov si, size40bit
   769                              <1> internaldatarelocation
   770 00000393 A5                  <1> 	movsw
   771 00000394 A5                  <1> 	movsw
   772 00000395 A4                  <1> 	movsb
   773                              <1> @@:
   774                              <1> 
   775 00000396 D006[0D00]          <1> reloc	rol byte [date], 1
   776                              <1> internaldatarelocation
   777 0000039A 7308                <1> 	jnc @F
   778 0000039C A1[8403]            <1> reloc	mov ax, word [finddata.time]
   779                              <1> internaldatarelocation
   780 0000039F AB                  <1> 	stosw
   781 000003A0 A1[8603]            <1> reloc	mov ax, word [finddata.date]
   782                              <1> internaldatarelocation
   783 000003A3 AB                  <1> 	stosw
   784                              <1> @@:
   785                              <1> 
   786 000003A4 89D6                <1> 	mov si, dx			; -> to insert, cx = length
   787 000003A6 F3A4                <1> 	rep movsb			; store new entry
   788 000003A8 C3                  <1> 	retn
   789                              <1> 
   790                              <1> .sort_insert_last:
   791 000003A9 8B3E[6803]          <1> reloc	mov di, word [sort_last]	; -> after last
   792                              <1> internaldatarelocation
   793 000003AD E8D0FF              <1> 	call .store_with_meta
   794 000003B0 893E[6803]          <1> reloc	mov word [sort_last], di	; update -> after last
   795                              <1> internaldatarelocation
   796                              <1> 
   797                              <1> .sort_inserted:
   798 000003B4 16                  <1> 	push ss
   799 000003B5 07                  <1> 	pop es
   800                              <1> 
   801 000003B6 EB03                <1> 	jmp @F
   802                              <1> 
   803                              <1> .display:
   804 000003B8 E86A01              <1> 	call display_single
   805                              <1> @@:
   806                              <1> 
   807                              <1> .next:
   808                              <1> %if _BOOT
   809 000003BB 85E4                <1> 	test sp, sp		; NZ (continue search)
   810 000003BD C3                  <1> 	retn
   811                              <1> %else
   812                              <1> reloc	mov ax, word [findnext_function_number]
   813                              <1> internaldatarelocation
   814                              <1> reloc	mov bx, word [findhandle]
   815                              <1> internaldatarelocation
   816                              <1> 	push di
   817                              <1> 	mov si, 1
   818                              <1> reloc	mov di, finddata
   819                              <1> internaldatarelocation
   820                              <1> 	stc
   821                              <1> 	extcallcall _doscall
   822                              <1> 	pop di
   823                              <1> 	jnc .loop
   824                              <1> %endif
   825                              <1> 
   826                              <1> %if _BOOT
   827                              <1> ..@boot_scan_end:
   828                              <1> %endif
   829                              <1> 
   830 000003BE D006[0800]          <1> reloc	rol byte [found], 1
   831                              <1> internaldatarelocation
   832 000003C2 7316                <1> 	jnc .notfound
   833 000003C4 D006[0B00]          <1> reloc	rol byte [sort], 1
   834                              <1> internaldatarelocation
   835 000003C8 7237                <1> 	jc sorted
   836 000003CA D006[0900]          <1> reloc	rol byte [wide], 1
   837                              <1> internaldatarelocation
   838 000003CE 7307                <1> 	jnc @F
   839                              <1> 
   840                              <1> %if _BOOT
   841 000003D0 8B3E[0200]          <1> reloc	mov di, [widecurrent]
   842                              <1> internaldatarelocation
   843                              <1> %endif
   844                              <1> 
   845 000003D4 E89104              <1> 	extcallcall trimputs
   846                              <1> @@:
   847 000003D7 E89604              <1> 	extcallcall cmd3
   848                              <1> 
   849                              <1> 
   850                              <1> .notfound:
   851 000003DA BA[BF01]            <1> reloc	mov dx, msg.notfound
   852                              <1> internaldatarelocation
   853 000003DD B8220E              <1> 	mov ax, 0E22h
   854                              <1> @@:
   855 000003E0 E89504              <1> 	extcallcall setrc
   856 000003E3 E89A04              <1> 	extcallcall putsz
   857 000003E6 E88704              <1> 	extcallcall cmd3
   858                              <1> 
   859                              <1> .error:
   860 000003E9 BA[3B01]            <1> reloc	mov dx, msg.error
   861                              <1> internaldatarelocation
   862 000003EC B8230E              <1> 	mov ax, 0E23h
   863 000003EF EBEF                <1> 	jmp @B
   864                              <1> 
   865                              <1> .error2:
   866 000003F1 BA[6201]            <1> reloc	mov dx, msg.error2
   867                              <1> internaldatarelocation
   868 000003F4 B8240E              <1> 	mov ax, 0E24h
   869 000003F7 EBE7                <1> 	jmp @B
   870                              <1> 
   871                              <1> .toofull:
   872 000003F9 BA[8401]            <1> reloc	mov dx, msg.toofull
   873                              <1> internaldatarelocation
   874 000003FC B8250E              <1> 	mov ax, 0E25h
   875 000003FF EBDF                <1> 	jmp @B
   876                              <1> 
   877                              <1> 
   878                              <1> sorted:
   879                              <1> 	houdini
   880                              <1> %ifn _BOOT
   881                              <1> 	call findclose
   882                              <1> %endif
   883                              <1> 
   884 00000401 8B3E[6C03]          <1> reloc	mov di, word [pathname_start]
   885                              <1> internaldatarelocation
   886                              <1> 
   887                              <1> .find_dir:
   888 00000405 89FB                <1> 	mov bx, di		; bx -> start of path
   889 00000407 B9FFFF              <1> 	mov cx, -1
   890 0000040A B000                <1> 	mov al, 0
   891 0000040C F2AE                <1> 	repne scasb
   892 0000040E 4F                  <1> 	dec di
   893                              <1> @@:
   894 0000040F 39DF                <1> 	cmp di, bx
   895 00000411 7611                <1> 	jbe .di
   896 00000413 4F                  <1> 	dec di
   897 00000414 803D2F              <1> 	cmp byte [di], '/'
   898 00000417 740A                <1> 	je .di_plus_one
   899 00000419 803D5C              <1> 	cmp byte [di], '\'
   900 0000041C 7405                <1> 	je .di_plus_one
   901 0000041E 803D3A              <1> 	cmp byte [di], ':'
   902 00000421 75EC                <1> 	jne @B
   903                              <1> .di_plus_one:
   904 00000423 47                  <1> 	inc di
   905                              <1> .di:				; di -> end of path
   906 00000424 89F9                <1> 	mov cx, di
   907 00000426 29D9                <1> 	sub cx, bx		; = length of path
   908                              <1> 
   909 00000428 890E[6E03]          <1> reloc	mov word [pathname_length], cx
   910                              <1> internaldatarelocation
   911                              <1> 
   912 0000042C BF[0000]            <1> reloc	mov di, relocateddata
   913                              <1> linkdatarelocation line_out
   914                              <1> 
   915                              <1> .loop:
   916 0000042F 57                  <1> 	push di
   917 00000430 8B1E[6E03]          <1> reloc	mov bx, word [pathname_length]
   918                              <1> internaldatarelocation
   919 00000434 8B36[6C03]          <1> reloc	mov si, word [pathname_start]
   920                              <1> internaldatarelocation
   921 00000438 89D9                <1> 	mov cx, bx
   922 0000043A 81F90002            <1> 	cmp cx, buffer_end - buffer
   923 0000043E 73A9                <1> 	jae .error
   924                              <1> 
   925 00000440 BF[7003]            <1> reloc	mov di, buffer
   926                              <1> internaldatarelocation
   927 00000443 F3A4                <1> 	rep movsb
   928 00000445 89FA                <1> 	mov dx, di
   929                              <1> 
   930 00000447 8B3E[6A03]          <1> reloc	mov di, word [sort_next]
   931                              <1> internaldatarelocation
   932 0000044B 3B3E[6803]          <1> reloc	cmp di, word [sort_last]
   933                              <1> internaldatarelocation
   934 0000044F 7364                <1> 	jae .end
   935 00000451 033E[0400]          <1> reloc	add di, word [meta]
   936                              <1> internaldatarelocation
   937 00000455 89FE                <1> 	mov si, di
   938                              <1> 
   939 00000457 8E06[6203]          <1> reloc	mov es, word [sortsegsel]
   940                              <1> internaldatarelocation
   941 0000045B B000                <1> 	mov al, 0
   942 0000045D B90002              <1> 	mov cx, 512
   943 00000460 F2AE                <1> 	repne scasb
   944 00000462 7585                <1> 	jne .error
   945 00000464 89F9                <1> 	mov cx, di
   946 00000466 29F1                <1> 	sub cx, si
   947                              <1> 
   948 00000468 01CB                <1> 	add bx, cx
   949 0000046A 81FBFF01            <1> 	cmp bx, buffer_end - !!_BOOT - buffer
   950 0000046E 7603E976FF          <1> 	ja .error
   951                              <1> 
   952 00000473 89D7                <1> 	mov di, dx
   953                              <1> %if _BOOT
   954 00000475 81FF[7003]          <1> reloc	cmp di, strict word buffer
   955                              <1> internaldatarelocation
   956 00000479 740C                <1> 	je .slash
   957 0000047B 807DFF2F            <1> 	cmp byte [di - 1], '/'
   958 0000047F 740A                <1> 	je .notslash
   959 00000481 807DFF5C            <1> 	cmp byte [di - 1], '\'
   960 00000485 7404                <1> 	je .notslash
   961                              <1> .slash:
   962 00000487 C6052F              <1> 	mov byte [di], '/'
   963 0000048A 47                  <1> 	inc di
   964                              <1> .notslash:
   965 0000048B 893E[6003]          <1> reloc	mov word [wild_pattern], di
   966                              <1> internaldatarelocation
   967                              <1> %endif
   968 0000048F 06                  <1> 	 push es
   969 00000490 1E                  <1> 	 push ds
   970 00000491 07                  <1> 	 pop es
   971 00000492 1F                  <1> 	 pop ds				; swap
   972 00000493 F3A4                <1> 	rep movsb
   973 00000495 16                  <1> 	 push ss
   974 00000496 1F                  <1> 	 pop ds				; reset
   975 00000497 8936[6A03]          <1> reloc	mov word [sort_next], si
   976                              <1> internaldatarelocation
   977                              <1> 
   978 0000049B BA[7003]            <1> reloc	mov dx, buffer
   979                              <1> internaldatarelocation
   980                              <1> %if _BOOT
   981 0000049E 5F                  <1> 	pop di
   982                              <1> 
   983 0000049F 89D3                <1> 	mov bx, dx
   984 000004A1 8026[0300]EF        <1> reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   985                              <1> linkdatarelocation internalflags3, -3
   986 000004A6 E8A703              <1> 	extcallcall yy_boot_init_dir2
   987                              <1> 
   988 000004A9 C706[0000][2505]    <1> reloc2	mov word [matchfunction], display_ZR
   989                              <1> internaldatarelocation -4
   990                              <1> internalcoderelocation
   991                              <1> 
   992 000004AF E8F7FB              <1> 	call boot_scan
   993                              <1> 
   994 000004B2 E97AFF              <1> 	jmp .loop
   995                              <1> 
   996                              <1> .error equ sort_or_display.error
   997                              <1> .error2 equ sort_or_display.error2
   998                              <1> %else
   999                              <1> 	call findfirst
  1000                              <1> 	jc .error2
  1001                              <1> 
  1002                              <1> 	call findclose
  1003                              <1> 	pop di
  1004                              <1> 	call display_single
  1005                              <1> 	jmp .loop
  1006                              <1> 
  1007                              <1> .error equ run_dos.error
  1008                              <1> .error2 equ run_dos.error2
  1009                              <1> %endif
  1010                              <1> 
  1011                              <1> .end:
  1012 000004B5 5F                  <1> 	pop di
  1013 000004B6 D006[0900]          <1> reloc	rol byte [wide], 1
  1014                              <1> internaldatarelocation
  1015 000004BA 7307                <1> 	jnc @F
  1016                              <1> 
  1017                              <1> %if _BOOT
  1018 000004BC 8B3E[0200]          <1> reloc	mov di, [widecurrent]
  1019                              <1> internaldatarelocation
  1020                              <1> %endif
  1021                              <1> 
  1022 000004C0 E8A503              <1> 	extcallcall trimputs
  1023                              <1> @@:
  1024 000004C3 E8AA03              <1> 	extcallcall cmd3
  1025                              <1> 
  1026                              <1> 
  1027                              <1> populate_finddata:
  1028                              <1> %ifn _BOOT
  1029                              <1> reloc	cmp byte [findnext_function_number + 1], 71h
  1030                              <1> internaldatarelocation -3
  1031                              <1> 	je .have_lfn
  1032                              <1> 
  1033                              <1> reloc	mov al, byte [dta.attrib]
  1034                              <1> internaldatarelocation
  1035                              <1> reloc	mov byte [finddata.attrib], al
  1036                              <1> internaldatarelocation
  1037                              <1> 
  1038                              <1> reloc	mov ax, word [dta.time]
  1039                              <1> internaldatarelocation
  1040                              <1> reloc	mov word [finddata.time], ax
  1041                              <1> internaldatarelocation
  1042                              <1> 
  1043                              <1> reloc	mov ax, word [dta.date]
  1044                              <1> internaldatarelocation
  1045                              <1> reloc	mov word [finddata.date], ax
  1046                              <1> internaldatarelocation
  1047                              <1> 
  1048                              <1> reloc	mov ax, word [dta.size]
  1049                              <1> internaldatarelocation
  1050                              <1> reloc	mov word [finddata.sizelow], ax
  1051                              <1> internaldatarelocation
  1052                              <1> 
  1053                              <1> reloc	mov ax, word [dta.size + 2]
  1054                              <1> internaldatarelocation
  1055                              <1> reloc	mov word [finddata.sizelow + 2], ax
  1056                              <1> internaldatarelocation
  1057                              <1> 
  1058                              <1> 	xor ax, ax
  1059                              <1> reloc	mov word [finddata.sizehigh], ax
  1060                              <1> internaldatarelocation
  1061                              <1> reloc	mov word [finddata.sizehigh + 2], ax
  1062                              <1> internaldatarelocation
  1063                              <1> 
  1064                              <1> 	push di
  1065                              <1> reloc	mov si, dta.name
  1066                              <1> internaldatarelocation
  1067                              <1> reloc	mov di, finddata.fullname
  1068                              <1> internaldatarelocation
  1069                              <1> 	mov cx, words(14)
  1070                              <1> 	rep movsw
  1071                              <1> 	pop di
  1072                              <1> 
  1073                              <1> reloc	mov byte [finddata.shortname], al
  1074                              <1> internaldatarelocation
  1075                              <1> 
  1076                              <1> .have_lfn:
  1077                              <1> %endif
  1078                              <1> 
  1079 000004C6 57                  <1> 	push di
  1080 000004C7 BF[AE04]            <1> reloc	mov di, size40bit
  1081                              <1> internaldatarelocation
  1082 000004CA F606[7003]10        <1> reloc	test byte [finddata.attrib], ATTR_DIRECTORY
  1083                              <1> internaldatarelocation -3
  1084 000004CF 740E                <1> 	jz @F
  1085 000004D1 31C0                <1> 	xor ax, ax
  1086 000004D3 A3[9003]            <1> reloc	mov word [finddata.sizelow], ax
  1087                              <1> internaldatarelocation
  1088 000004D6 A3[9203]            <1> reloc	mov word [finddata.sizelow + 2], ax
  1089                              <1> internaldatarelocation
  1090 000004D9 A3[8C03]            <1> reloc	mov word [finddata.sizehigh], ax
  1091                              <1> internaldatarelocation
  1092 000004DC A3[8E03]            <1> reloc	mov word [finddata.sizehigh + 2], ax
  1093                              <1> internaldatarelocation
  1094                              <1> @@:
  1095 000004DF 833E[8E03]00        <1> reloc	cmp word [finddata.sizehigh + 2], strict byte 0
  1096                              <1> internaldatarelocation -3
  1097 000004E4 7516                <1> 	jne .sizelarge
  1098 000004E6 813E[8C03]0001      <1> reloc	cmp word [finddata.sizehigh], 256
  1099                              <1> internaldatarelocation -4
  1100 000004EC 730E                <1> 	jae .sizelarge
  1101 000004EE A1[9003]            <1> reloc	mov ax, word [finddata.sizelow]
  1102                              <1> internaldatarelocation
  1103 000004F1 AB                  <1> 	stosw
  1104 000004F2 A1[9203]            <1> reloc	mov ax, word [finddata.sizelow + 2]
  1105                              <1> internaldatarelocation
  1106 000004F5 AB                  <1> 	stosw
  1107 000004F6 A0[8C03]            <1> reloc	mov al, byte [finddata.sizehigh]
  1108                              <1> internaldatarelocation
  1109 000004F9 AA                  <1> 	stosb
  1110 000004FA EB06                <1> 	jmp @F
  1111                              <1> 
  1112                              <1> .sizelarge:
  1113 000004FC B8FFFF              <1> 	mov ax, 0FFFFh
  1114 000004FF AB                  <1> 	stosw
  1115 00000500 AB                  <1> 	stosw
  1116 00000501 AA                  <1> 	stosb
  1117                              <1> @@:
  1118 00000502 5F                  <1> 	pop di
  1119                              <1> 
  1120 00000503 BE[A004]            <1> reloc	mov si, finddata.shortname
  1121                              <1> internaldatarelocation
  1122 00000506 803C00              <1> 	cmp byte [si], 0
  1123 00000509 7503                <1> 	jne @F
  1124 0000050B BE[9C03]            <1> reloc	mov si, finddata.fullname
  1125                              <1> internaldatarelocation
  1126                              <1> @@:
  1127                              <1> 
  1128 0000050E 803C2E              <1> 	cmp byte [si], '.'	; dot ?
  1129 00000511 750A                <1> 	jne @F			; no --> NZ
  1130 00000513 837C012E            <1> 	cmp word [si + 1], "."	; dot and NUL ?
  1131 00000517 7404                <1> 	je .next		; dotdot, skip --> ZR
  1132 00000519 807C0100            <1> 	cmp byte [si + 1], 0	; NUL ?
  1133                              <1> 	; je .next		; dot, skip --> ZR
  1134                              <1> .next:
  1135                              <1> @@:
  1136 0000051D 7405                <1> 	je @F
  1137 0000051F 800E[0800]FF        <1> reloc	or byte [found], -1
  1138                              <1> internaldatarelocation -3	; NZ
  1139                              <1> @@:
  1140 00000524 C3                  <1> 	retn
  1141                              <1> 
  1142                              <1> 
  1143                              <1> %if _BOOT
  1144                              <1> display_ZR:
  1145                              <1> %endif
  1146                              <1> display_single:
  1147 00000525 E89EFF              <1> 	call populate_finddata
  1148 00000528 7503E96601          <1> 	je .next
  1149                              <1> 
  1150 0000052D D006[0900]          <1> reloc	rol byte [wide], 1
  1151                              <1> internaldatarelocation
  1152 00000531 7340                <1> 	jnc .notwide
  1153                              <1> 
  1154                              <1> .wide:
  1155                              <1> 	houdini
  1156                              <1> %if _BOOT
  1157 00000533 8B3E[0200]          <1> reloc	mov di, [widecurrent]
  1158                              <1> internaldatarelocation
  1159                              <1> %endif
  1160                              <1> 
  1161 00000537 FE06[0A00]          <1> reloc	inc byte [widecounter]
  1162                              <1> internaldatarelocation
  1163 0000053B 803E[0A00]06        <1> reloc	cmp byte [widecounter], 6
  1164                              <1> internaldatarelocation -3
  1165 00000540 720B                <1> 	jb @F
  1166 00000542 E82303              <1> 	extcallcall trimputs
  1167 00000545 BF[0000]            <1> reloc	mov di, relocateddata
  1168                              <1> linkdatarelocation line_out
  1169 00000548 C606[0A00]01        <1> reloc	mov byte [widecounter], 1
  1170                              <1> internaldatarelocation -3
  1171                              <1> @@:
  1172                              <1> 
  1173 0000054D B420                <1> 	mov ah, 32
  1174 0000054F B90F00              <1> 	mov cx, 15		; width of column: 8 + 1 + 3 + 2 + 1
  1175 00000552 F606[7003]10        <1> reloc	test byte [finddata.attrib], ATTR_DIRECTORY
  1176                              <1> internaldatarelocation -3
  1177 00000557 7405                <1> 	jz @FF			; skip brackets and first iter stosb -->
  1178 00000559 B85B5D              <1> 	mov ax, "[]"		; use brackets
  1179 0000055C 49                  <1> 	dec cx			; decrement remaining width
  1180                              <1> @@:
  1181 0000055D AA                  <1> 	stosb			; dir first iter: store opening square bracket
  1182                              <1> 				; file first iter: skipped
  1183                              <1> 				; subsequent iter: store text byte
  1184                              <1> @@:
  1185 0000055E AC                  <1> 	lodsb			; load from name
  1186 0000055F 84C0                <1> 	test al, al		; got a NUL ? do not loop if so
  1187 00000561 E0FA                <1> 	loopnz @BB		; decrements width once per text byte
  1188                              <1> 				;  and finally once more for the NUL
  1189 00000563 88E0                <1> 	mov al, ah		; get blank or closing square bracket
  1190 00000565 AA                  <1> 	stosb			; store blank or closing square bracket
  1191                              <1> 				; (this store does not decrement the width)
  1192 00000566 B020                <1> 	mov al, 32		; pad with blanks
  1193 00000568 E301                <1> 	jcxz @F			; (error?) only once -->
  1194 0000056A F3                  <1> 	rep
  1195                              <1> @@:
  1196 0000056B AA                  <1> 	stosb			; store separator blanks
  1197                              <1> 
  1198                              <1> %if _BOOT
  1199 0000056C 893E[0200]          <1> reloc	mov [widecurrent], di
  1200                              <1> internaldatarelocation
  1201                              <1> %endif
  1202 00000570 E92001              <1> 	jmp .next
  1203                              <1> 
  1204                              <1> 
  1205                              <1> .notwide:
  1206 00000573 BF[0000]            <1> reloc	mov di, relocateddata
  1207                              <1> linkdatarelocation line_out
  1208 00000576 B90800              <1> 	mov cx, 8
  1209                              <1> 
  1210                              <1> @@:
  1211 00000579 AC                  <1> 	lodsb
  1212 0000057A 3C2E                <1> 	cmp al, '.'
  1213 0000057C 740D                <1> 	je @F
  1214 0000057E 3C00                <1> 	cmp al, 0
  1215 00000580 741A                <1> 	je .no_ext
  1216 00000582 AA                  <1> 	stosb
  1217 00000583 E2F4                <1> 	loop @B
  1218 00000585 AC                  <1> 	lodsb
  1219 00000586 3C2E                <1> 	cmp al, '.'
  1220 00000588 7401                <1> 	je @F
  1221 0000058A 4E                  <1> 	dec si			; doesn't fit, nothing sensible here
  1222                              <1> 
  1223                              <1> @@:
  1224 0000058B 41                  <1> 	inc cx
  1225 0000058C B020                <1> 	mov al, 32
  1226 0000058E F3AA                <1> 	rep stosb
  1227                              <1> 
  1228 00000590 B103                <1> 	mov cl, 3
  1229                              <1> @@:
  1230 00000592 AC                  <1> 	lodsb
  1231 00000593 3C00                <1> 	cmp al, 0
  1232 00000595 7408                <1> 	je @F
  1233 00000597 AA                  <1> 	stosb
  1234 00000598 E2F8                <1> 	loop @B
  1235 0000059A EB03                <1> 	jmp @F
  1236                              <1> 
  1237                              <1> .no_ext:
  1238 0000059C 83C104              <1> 	add cx, 1 + 3
  1239                              <1> 
  1240                              <1> @@:
  1241 0000059F 41                  <1> 	inc cx
  1242 000005A0 41                  <1> 	inc cx
  1243 000005A1 B020                <1> 	mov al, 32
  1244 000005A3 F3AA                <1> 	rep stosb
  1245                              <1> 
  1246                              <1> 
  1247 000005A5 8A1E[7003]          <1> reloc	mov bl, byte [finddata.attrib]
  1248                              <1> internaldatarelocation
  1249                              <1> 
  1250 000005A9 B02D                <1> 	mov al, '-'
  1251 000005AB F6C320              <1> 	test bl, ATTR_ARCHIVE
  1252 000005AE 7402                <1> 	jz @F
  1253 000005B0 B041                <1> 	mov al, 'A'
  1254                              <1> @@:
  1255 000005B2 AA                  <1> 	stosb
  1256 000005B3 B02D                <1> 	mov al, '-'
  1257 000005B5 F6C302              <1> 	test bl, ATTR_HIDDEN
  1258 000005B8 7402                <1> 	jz @F
  1259 000005BA B048                <1> 	mov al, 'H'
  1260                              <1> @@:
  1261 000005BC AA                  <1> 	stosb
  1262 000005BD B02D                <1> 	mov al, '-'
  1263 000005BF F6C301              <1> 	test bl, ATTR_READONLY
  1264 000005C2 7402                <1> 	jz @F
  1265 000005C4 B052                <1> 	mov al, 'R'
  1266                              <1> @@:
  1267 000005C6 AA                  <1> 	stosb
  1268 000005C7 B02D                <1> 	mov al, '-'
  1269 000005C9 F6C304              <1> 	test bl, ATTR_SYSTEM
  1270 000005CC 7402                <1> 	jz @F
  1271 000005CE B053                <1> 	mov al, 'S'
  1272                              <1> @@:
  1273 000005D0 AA                  <1> 	stosb
  1274 000005D1 B82020              <1> 	mov ax, 2020h
  1275 000005D4 AB                  <1> 	stosw
  1276                              <1> 
  1277 000005D5 F6C310              <1> 	test bl, ATTR_DIRECTORY
  1278 000005D8 7408                <1> 	jz @F
  1279 000005DA BE[AD01]            <1> reloc	mov si, msg.dirinsteadsize
  1280                              <1> internaldatarelocation
  1281                              <1> .nosize:
  1282 000005DD E8A802              <1> 	extcallcall copy_single_counted_string
  1283 000005E0 EB1F                <1> 	jmp @FF
  1284                              <1> 
  1285                              <1> @@:
  1286 000005E2 833E[8E03]00        <1> reloc	cmp word [finddata.sizehigh + 2], strict byte 0
  1287                              <1> internaldatarelocation -3
  1288 000005E7 7405                <1> 	je .sizefits
  1289                              <1> 
  1290 000005E9 BE[B601]            <1> reloc	mov si, msg.sizetoolarge
  1291                              <1> internaldatarelocation
  1292 000005EC EBEF                <1> 	jmp .nosize
  1293                              <1> 
  1294                              <1> .sizefits:
  1295 000005EE 8B36[8C03]          <1> reloc	mov si, word [finddata.sizehigh] 	; from FAT+ upper size bits
  1296                              <1> internaldatarelocation
  1297 000005F2 8B16[9203]          <1> reloc	mov dx, word [finddata.sizelow + 2]
  1298                              <1> internaldatarelocation
  1299 000005F6 A1[9003]            <1> reloc	mov ax, word [finddata.sizelow]
  1300                              <1> internaldatarelocation
  1301 000005F9 31C9                <1> 	xor cx, cx
  1302 000005FB BB0800              <1> 	mov bx, 4+4
  1303 000005FE E88F02              <1> 	extcallcall disp_dxax_times_cx_width_bx_size.store
  1304                              <1> 
  1305                              <1> @@:
  1306 00000601 B82020              <1> 	mov ax, 2020h
  1307 00000604 AB                  <1> 	stosw
  1308 00000605 8B1E[8603]          <1> reloc	mov bx, word [finddata.date]
  1309                              <1> internaldatarelocation
  1310 00000609 8B36[8403]          <1> reloc	mov si, word [finddata.time]
  1311                              <1> internaldatarelocation
  1312                              <1> 
  1313 0000060D 31D2                <1> 	xor dx, dx
  1314 0000060F 85DB                <1> 	test bx, bx
  1315 00000611 750A                <1> 	jnz @F
  1316 00000613 B82020              <1> 	mov ax, 2020h
  1317 00000616 B90500              <1> 	mov cx, 5
  1318 00000619 F3AB                <1> 	rep stosw
  1319 0000061B EB2B                <1> 	jmp .nodate
  1320                              <1> 
  1321                              <1> @@:
  1322 0000061D 89D8                <1> 	mov ax, bx
  1323 0000061F B90900              <1> 	mov cx, 9
  1324 00000622 D3E8                <1> 	shr ax, cl
  1325 00000624 05BC07              <1> 	add ax, 1980
  1326 00000627 B104                <1> 	mov cl, 4
  1327 00000629 E86C02              <1> 	extcallcall dec_dword_minwidth
  1328 0000062C B02D                <1> 	mov al, '-'
  1329 0000062E AA                  <1> 	stosb
  1330 0000062F 89D8                <1> 	mov ax, bx
  1331 00000631 B105                <1> 	mov cl, 5
  1332 00000633 D3E8                <1> 	shr ax, cl
  1333 00000635 83E00F              <1> 	and ax, 15
  1334 00000638 B102                <1> 	mov cl, 2
  1335 0000063A E85B02              <1> 	extcallcall dec_dword_minwidth
  1336 0000063D B02D                <1> 	mov al, '-'
  1337 0000063F AA                  <1> 	stosb
  1338 00000640 89D8                <1> 	mov ax, bx
  1339 00000642 83E01F              <1> 	and ax, 31
  1340 00000645 E85002              <1> 	extcallcall dec_dword_minwidth
  1341                              <1> .nodate:
  1342 00000648 B020                <1> 	mov al, 32
  1343 0000064A AA                  <1> 	stosb
  1344 0000064B 89F0                <1> 	mov ax, si
  1345 0000064D B10B                <1> 	mov cl, 11
  1346 0000064F D3E8                <1> 	shr ax, cl
  1347 00000651 B102                <1> 	mov cl, 2
  1348 00000653 E84202              <1> 	extcallcall dec_dword_minwidth
  1349 00000656 B03A                <1> 	mov al, ':'
  1350 00000658 AA                  <1> 	stosb
  1351 00000659 89F0                <1> 	mov ax, si
  1352 0000065B B105                <1> 	mov cl, 5
  1353 0000065D D3E8                <1> 	shr ax, cl
  1354 0000065F 83E03F              <1> 	and ax, 63
  1355 00000662 B102                <1> 	mov cl, 2
  1356 00000664 E83102              <1> 	extcallcall dec_dword_minwidth
  1357 00000667 B03A                <1> 	mov al, ':'
  1358 00000669 AA                  <1> 	stosb
  1359 0000066A 89F0                <1> 	mov ax, si
  1360 0000066C 83E01F              <1> 	and ax, 31
  1361 0000066F D1E0                <1> 	shl ax, 1
  1362 00000671 E82402              <1> 	extcallcall dec_dword_minwidth
  1363                              <1> 
  1364 00000674 803E[A004]00        <1> reloc	cmp byte [finddata.shortname], 0
  1365                              <1> internaldatarelocation -3
  1366 00000679 7415                <1> 	je @F
  1367 0000067B B82020              <1> 	mov ax, 2020h
  1368 0000067E AB                  <1> 	stosw
  1369 0000067F E81E02              <1> 	extcallcall putsline
  1370 00000682 BA[9C03]            <1> reloc	mov dx, finddata.fullname
  1371                              <1> internaldatarelocation
  1372 00000685 E8F801              <1> 	extcallcall putsz
  1373 00000688 BA[CE01]            <1> reloc	mov dx, msg.linebreak
  1374                              <1> internaldatarelocation
  1375 0000068B E8F201              <1> 	extcallcall putsz
  1376 0000068E EB03                <1> 	jmp .next
  1377                              <1> 
  1378                              <1> @@:
  1379 00000690 E81502              <1> 	extcallcall putsline_crlf
  1380                              <1> 
  1381                              <1> .next:
  1382                              <1> %if _BOOT
  1383 00000693 38C0                <1> 	cmp al, al		; ZR
  1384                              <1> %endif
  1385 00000695 C3                  <1> 	retn
  1386                              <1> 
  1387                              <1> 
  1388                              <1> %ifn _BOOT
  1389                              <1> findfirst:
  1390                              <1> reloc	mov word [findnext_function_number], 714Fh
  1391                              <1> internaldatarelocation -4
  1392                              <1> 	mov ax, 714Eh
  1393                              <1> 	mov cx, 16h		; find all files and directories
  1394                              <1> 	mov si, 1
  1395                              <1> reloc	mov di, finddata
  1396                              <1> internaldatarelocation
  1397                              <1> reloc	rol byte [prefersfn], 1
  1398                              <1> internaldatarelocation
  1399                              <1> 	jc .sfn_try
  1400                              <1> 	stc
  1401                              <1> 	extcallcall _doscall
  1402                              <1> 	jnc .lfn_found
  1403                              <1> 	cmp ax, 1
  1404                              <1> 	je .sfn_try
  1405                              <1> 	cmp ax, 7100h
  1406                              <1> 	je .sfn_try
  1407                              <1> 	stc	; CY
  1408                              <1> 	retn
  1409                              <1> 
  1410                              <1> .lfn_found:
  1411                              <1> reloc	mov word [findhandle], ax
  1412                              <1> internaldatarelocation
  1413                              <1> reloc	mov byte [findhandle_set], 0FFh
  1414                              <1> internaldatarelocation -3
  1415                              <1> 		; NC
  1416                              <1> 	retn
  1417                              <1> 
  1418                              <1> .sfn_try:
  1419                              <1> reloc	mov word [findnext_function_number], 4F00h
  1420                              <1> internaldatarelocation -4
  1421                              <1> 	mov ax, 4E00h
  1422                              <1> 	mov cx, 16h		; find all files and directories
  1423                              <1> 	extcallcall _doscall
  1424                              <1> 		; CY if not found
  1425                              <1> 	retn
  1426                              <1> %endif
  1427                              <1> 
  1428                              <1> 
  1429                              <1> %if _BOOT
  1430                              <1> find_dir:
  1431 00000696 89FB                <1> 	mov bx, di		; bx -> start of path
  1432 00000698 B9FFFF              <1> 	mov cx, -1
  1433 0000069B B000                <1> 	mov al, 0
  1434 0000069D F2AE                <1> 	repne scasb
  1435 0000069F 4F                  <1> 	dec di
  1436                              <1> @@:
  1437 000006A0 39DF                <1> 	cmp di, bx
  1438 000006A2 7611                <1> 	jbe .di
  1439 000006A4 4F                  <1> 	dec di
  1440 000006A5 803D2F              <1> 	cmp byte [di], '/'
  1441 000006A8 740A                <1> 	je .di_plus_one
  1442 000006AA 803D5C              <1> 	cmp byte [di], '\'
  1443 000006AD 7405                <1> 	je .di_plus_one
  1444 000006AF 803D3A              <1> 	cmp byte [di], ':'
  1445 000006B2 75EC                <1> 	jne @B
  1446                              <1> .di_plus_one:
  1447 000006B4 47                  <1> 	inc di
  1448                              <1> .di:				; di -> end of path
  1449 000006B5 C3                  <1> 	retn
  1450                              <1> %endif
  1451                              <1> 
  1452                              <1> 
  1453                              <1> parse_verbose.loop:
  1454 000006B6 AC                  <1> 	lodsb
  1455                              <1> parse_verbose:
  1456 000006B7 E8F601              <1> 	extcallcall skipcomm0
  1457 000006BA E8FB01              <1> 	extcallcall iseol?
  1458 000006BD 7526                <1> 	jne .parse
  1459                              <1> 
  1460                              <1> .meta:
  1461 000006BF D006[0D00]          <1> reloc	rol byte [date], 1
  1462                              <1> internaldatarelocation
  1463 000006C3 730A                <1> 	jnc @F
  1464 000006C5 C606[0E00]00        <1> reloc	mov byte [size], 0
  1465                              <1> internaldatarelocation -3
  1466 000006CA 8006[0400]04        <1> reloc	add byte [meta], 4
  1467                              <1> internaldatarelocation -3
  1468                              <1> @@:
  1469                              <1> 
  1470 000006CF D006[0E00]          <1> reloc	rol byte [size], 1
  1471                              <1> internaldatarelocation
  1472 000006D3 7305                <1> 	jnc @F
  1473 000006D5 8006[0400]05        <1> reloc	add byte [meta], 5
  1474                              <1> internaldatarelocation -3
  1475                              <1> @@:
  1476                              <1> 
  1477 000006DA D006[0C00]          <1> reloc	rol byte [dirfirst], 1
  1478                              <1> internaldatarelocation
  1479 000006DE 7304                <1> 	jnc @F
  1480 000006E0 FE06[0400]          <1> reloc	inc byte [meta]
  1481                              <1> internaldatarelocation
  1482                              <1> @@:
  1483 000006E4 C3                  <1> 	retn
  1484                              <1> 
  1485                              <1> .parse:
  1486 000006E5 4E                  <1> 	dec si
  1487                              <1> %ifn _BOOT
  1488                              <1> reloc	mov dx, msg.string_sfn
  1489                              <1> internaldatarelocation
  1490                              <1> 	extcallcall isstring?
  1491                              <1> 	jne @F
  1492                              <1> reloc	mov byte [prefersfn], 0FFh
  1493                              <1> internaldatarelocation -3
  1494                              <1> 	jmp .loop
  1495                              <1> 
  1496                              <1> @@:
  1497                              <1> %endif
  1498 000006E6 BA[0F00]            <1> reloc	mov dx, msg.string_wide
  1499                              <1> internaldatarelocation
  1500 000006E9 E8D401              <1> 	extcallcall isstring?
  1501 000006EC 7507                <1> 	jne @F
  1502 000006EE C606[0900]FF        <1> reloc	mov byte [wide], 0FFh
  1503                              <1> internaldatarelocation -3
  1504 000006F3 EBC1                <1> 	jmp .loop
  1505                              <1> 
  1506                              <1> @@:
  1507 000006F5 BA[1400]            <1> reloc	mov dx, msg.string_sort
  1508                              <1> internaldatarelocation
  1509 000006F8 E8C501              <1> 	extcallcall isstring?
  1510 000006FB 7507                <1> 	jne @F
  1511                              <1> .loop_sort:
  1512 000006FD C606[0B00]FF        <1> reloc	mov byte [sort], 0FFh
  1513                              <1> internaldatarelocation -3
  1514 00000702 EBB2                <1> 	jmp .loop
  1515                              <1> @@:
  1516 00000704 BA[1900]            <1> reloc	mov dx, msg.string_dirfirst
  1517                              <1> internaldatarelocation
  1518 00000707 E8B601              <1> 	extcallcall isstring?
  1519 0000070A 7507                <1> 	jne @F
  1520 0000070C C606[0C00]FF        <1> reloc	mov byte [dirfirst], 0FFh
  1521                              <1> internaldatarelocation -3
  1522 00000711 EBA3                <1> 	jmp .loop
  1523                              <1> 
  1524                              <1> @@:
  1525 00000713 BA[2200]            <1> reloc	mov dx, msg.string_date
  1526                              <1> internaldatarelocation
  1527 00000716 E8A701              <1> 	extcallcall isstring?
  1528 00000719 7507                <1> 	jne @F
  1529 0000071B C606[0D00]FF        <1> reloc	mov byte [date], 0FFh
  1530                              <1> internaldatarelocation -3
  1531 00000720 EB94                <1> 	jmp .loop
  1532                              <1> @@:
  1533 00000722 BA[2700]            <1> reloc	mov dx, msg.string_size
  1534                              <1> internaldatarelocation
  1535 00000725 E89801              <1> 	extcallcall isstring?
  1536 00000728 7507                <1> 	jne @F
  1537 0000072A C606[0E00]FF        <1> reloc	mov byte [size], 0FFh
  1538                              <1> internaldatarelocation -3
  1539 0000072F EB85                <1> 	jmp .loop
  1540                              <1> 
  1541                              <1> @@:
  1542 00000731 BA[2C00]            <1> reloc	mov dx, msg.string_reverse
  1543                              <1> internaldatarelocation
  1544 00000734 E88901              <1> 	extcallcall isstring?
  1545 00000737 7509                <1> 	jne @F
  1546 00000739 C706[0600][3C03]    <1> reloc2	mov word [compare], ..@compare_reverse
  1547                              <1> internaldatarelocation -4
  1548                              <1> internalcoderelocation
  1549 0000073F E974FF              <1> 	jmp .loop
  1550                              <1> 
  1551                              <1> @@:
  1552                              <1> %ifn _BOOT
  1553                              <1> reloc	mov dx, msg.string_sortlfn
  1554                              <1> internaldatarelocation
  1555                              <1> 	extcallcall isstring?
  1556                              <1> 	jne @F
  1557                              <1> reloc	mov byte [sortlfn], 0FFh
  1558                              <1> internaldatarelocation -3
  1559                              <1> 	jmp .loop_sort
  1560                              <1> 
  1561                              <1> @@:
  1562                              <1> reloc	mov dx, msg.string_sortsfn
  1563                              <1> internaldatarelocation
  1564                              <1> 	extcallcall isstring?
  1565                              <1> 	jne @F
  1566                              <1> reloc	mov byte [sortlfn], 0
  1567                              <1> internaldatarelocation -3
  1568                              <1> 	jmp .loop_sort
  1569                              <1> 
  1570                              <1> @@:
  1571                              <1> %endif
  1572                              <1> %if _DEBUG
  1573 00000742 BA[3400]            <1> reloc	mov dx, msg.string_sortdebug
  1574                              <1> internaldatarelocation
  1575 00000745 E87801              <1> 	extcallcall isstring?
  1576 00000748 7403                <1> 	je @F
  1577                              <1> %endif
  1578 0000074A E87B01              <1> 	extcallcall error
  1579                              <1> 
  1580                              <1> %if _DEBUG
  1581                              <1> @@:
  1582 0000074D AC                  <1> 	lodsb
  1583 0000074E E87F01              <1> 	extcallcall chkeol
  1584                              <1> 
  1585 00000751 E86BFF              <1> 	call .meta
  1586                              <1> 
  1587                              <1> %if _BOOT
  1588 00000754 E8F900              <1> 	extcallcall yy_boot_init_dir2
  1589                              <1> 
  1590 00000757 8B560B              <1> 	mov dx, word [bp + bsBPB + bpbBytesPerSector]
  1591                              <1> 					; di = sector size
  1592                              <1> 					; = start of available auxbuff
  1593 0000075A 807EE60C            <1> 	cmp byte [bp + ldFATType], 12	; FAT12 ?
  1594 0000075E 7508                <1> 	jne @F				; no -->
  1595 00000760 81FA0020            <1> 	cmp dx, 8192			; already enough for a full FAT ?
  1596 00000764 7302                <1> 	jae @F				; yes -->
  1597 00000766 01D2                <1> 	add dx, dx			; reserve straddling sector
  1598                              <1> @@:
  1599                              <1> %endif
  1600                              <1> 
  1601 00000768 BF[0000]            <1> reloc	mov di, relocateddata
  1602                              <1> linkdatarelocation line_out
  1603                              <1> 
  1604 0000076B BE[3E00]            <1> reloc	mov si, msg.debug.1
  1605                              <1> internaldatarelocation
  1606 0000076E E81701              <1> 	extcallcall copy_single_counted_string
  1607                              <1> 
  1608 00000771 8CD0                <1> 	mov ax, ss
  1609 00000773 E86201              <1> 	extcallcall hexword
  1610 00000776 B03A                <1> 	mov al, ':'
  1611 00000778 AA                  <1> 	stosb
  1612 00000779 B8[7005]            <1> reloc	mov ax, buffer_end
  1613                              <1> internaldatarelocation
  1614 0000077C E85901              <1> 	extcallcall hexword
  1615                              <1> 
  1616 0000077F A1[0000]            <1> reloc	mov ax, word [relocateddata]
  1617                              <1> linkdatarelocation extdata_size
  1618 00000782 2B06[0000]          <1> reloc	sub ax, word [relocateddata]
  1619                              <1> linkdatarelocation extdata_used
  1620 00000786 8B1E[0000]          <1> reloc	mov bx, word [relocateddata]
  1621                              <1> linkdatarelocation auxbuff_current_size
  1622                              <1> %if _BOOT
  1623 0000078A 29D3                <1> 	sub bx, dx
  1624 0000078C 52                  <1> 	push dx
  1625                              <1> %endif
  1626                              <1> 
  1627 0000078D BE[5800]            <1> reloc	mov si, msg.debug.2
  1628                              <1> internaldatarelocation
  1629 00000790 E8F500              <1> 	extcallcall copy_single_counted_string
  1630                              <1> 
  1631 00000793 83C000              <1> 	add ax, (uinit_data_end_2 - buffer_end)
  1632 00000796 E84200              <1> 	call display_buffer_size
  1633                              <1> 
  1634 00000799 BE[6B00]            <1> reloc	mov si, msg.debug.3
  1635                              <1> internaldatarelocation
  1636 0000079C E8E900              <1> 	extcallcall copy_single_counted_string
  1637                              <1> 
  1638 0000079F BA[BD00]            <1> reloc	mov dx, msg.debug.larger_data_block
  1639                              <1> internaldatarelocation
  1640                              <1> 
  1641 000007A2 39D8                <1> 	cmp ax, bx
  1642 000007A4 7303                <1> 	jae .use_sort_buffer_eld_data_block
  1643                              <1> 
  1644 000007A6 BA[FD00]            <1> reloc	mov dx, msg.debug.smaller_data_block
  1645                              <1> internaldatarelocation
  1646                              <1> 
  1647                              <1> %ifn _BOOT
  1648                              <1> reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
  1651                              <1> linkdatarelocation internalflags3, -3
  1652                              <1> 	jz .use_sort_buffer_auxbuff
  1653                              <1> 
  1654                              <1> reloc	mov dx, msg.debug.smaller_data_block_forced
  1655                              <1> internaldatarelocation
  1656                              <1> %endif
  1657                              <1> 
  1658                              <1> .use_sort_buffer_eld_data_block:
  1659                              <1> .use_sort_buffer_auxbuff:
  1660                              <1> 
  1661 000007A9 A1[0000]            <1> reloc	mov ax, word [relocateddata]
  1662                              <1> linkdatarelocation auxbuff_segorsel	; => sort buffer
  1663 000007AC E82901              <1> 	extcallcall hexword
  1664                              <1> 
  1665                              <1> %if _BOOT
  1666 000007AF B03A                <1> 	mov al, ':'
  1667 000007B1 AA                  <1> 	stosb
  1668 000007B2 58                  <1> 	pop ax
  1669 000007B3 E82201              <1> 	extcallcall hexword
  1670                              <1> %endif
  1671                              <1> 
  1672 000007B6 93                  <1> 	xchg ax, bx
  1673 000007B7 BE[5800]            <1> reloc	mov si, msg.debug.5
  1674                              <1> internaldatarelocation
  1675 000007BA E8CB00              <1> 	extcallcall copy_single_counted_string
  1676 000007BD E81B00              <1> 	call display_buffer_size
  1677                              <1> 
  1678 000007C0 BE[8E00]            <1> reloc	mov si, msg.debug.6.available
  1679                              <1> internaldatarelocation
  1680                              <1> 
  1681 000007C3 F606[0300]70        <1> reloc	testopt [relocateddata], dif3_auxbuff_guarded_1 		| dif3_auxbuff_guarded_2 		| dif3_auxbuff_guarded_3
  1684                              <1> linkdatarelocation internalflags3, -3
  1685 000007C8 7403                <1> 	jz @F
  1686                              <1> 
  1687 000007CA BE[A700]            <1> reloc	mov si, msg.debug.6.inuse
  1688                              <1> internaldatarelocation
  1689                              <1> @@:
  1690                              <1> 
  1691 000007CD E8B800              <1> 	extcallcall copy_single_counted_string
  1692 000007D0 52                  <1> 	push dx
  1693 000007D1 E8D400              <1> 	extcallcall putsline_crlf
  1694 000007D4 5A                  <1> 	pop dx
  1695                              <1> 
  1696 000007D5 E8A800              <1> 	extcallcall putsz
  1697 000007D8 E89500              <1> 	extcallcall cmd3
  1698                              <1> 
  1699                              <1> 
  1700                              <1> display_buffer_size:
  1701 000007DB E80201              <1> 	extcallcall decword
  1702 000007DE BE[6000]            <1> reloc	mov si, msg.debug.bytes
  1703                              <1> internaldatarelocation
  1704 000007E1 E8A400              <1> 	extcallcall copy_single_counted_string
  1705 000007E4 50                  <1> 	push ax
  1706 000007E5 52                  <1> 	push dx
  1707 000007E6 31D2                <1> 	xor dx, dx
  1708 000007E8 BE0D00              <1> 	mov si, 8 + 1 + 3 + 1		; ASCIZ SFN maximum length
  1709 000007EB 0336[0400]          <1> reloc	add si, word [meta]
  1710                              <1> internaldatarelocation
  1711 000007EF F7F6                <1> 	div si
  1712 000007F1 E8EC00              <1> 	extcallcall decword
  1713 000007F4 5A                  <1> 	pop dx
  1714 000007F5 58                  <1> 	pop ax
  1715 000007F6 C3                  <1> 	retn
  1716                              <1> %endif
  1717                              <1> 
  1718                              <1> 
  1719                              <1> %ifn _BOOT
  1720                              <1> inject:
  1721                              <1> reloc	mov dx, word [originaldta]	; dx -> original DTA
  1722                              <1> internaldatarelocation
  1723                              <1> 	mov ah, 1Ah			; set DTA (restoring)
  1724                              <1> 	extcallcall ispm
  1725                              <1> 	jnz .rm
  1726                              <1> 
  1727                              <1> subcpu 286
  1728                              <1> reloc	push word [originaldta + 2]
  1729                              <1> internaldatarelocation			; ds => original DTA (86M segment)
  1730                              <1> 	push word 21h
  1731                              <1> 	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
  1732                              <1> 	pop dx				; discard interrupt number
  1733                              <1> 	pop dx				; discard es
  1734                              <1> subcpureset
  1735                              <1> 	jmp @F
  1736                              <1> .rm:
  1737                              <1> reloc	mov ds, word [originaldta + 2]	; ds => original DTA
  1738                              <1> internaldatarelocation
  1739                              <1> 	int 21h
  1740                              <1> 	 push ss
  1741                              <1> 	 pop ds
  1742                              <1> @@:
  1743                              <1> 
  1744                              <1> 	call findclose
  1745                              <1> 
  1746                              <1> reloc	mov cx, word [originalinject]
  1747                              <1> internaldatarelocation
  1748                              <1> 	call get_es_ext
  1749                              <1> reloc	clropt [es:code + eldiFlags], eldifResident
  1750                              <1> internalcoderelocation -3		; mark block as no longer resident
  1751                              <1> 	 push ss
  1752                              <1> 	 pop es
  1753                              <1> 	jcxz @F
  1754                              <1> 	jmp cx
  1755                              <1> 
  1756                              <1> @@:
  1757                              <1> 	extcall cmd3_not_inject
  1758                              <1> 
  1759                              <1> 
  1760                              <1> findclose:
  1761                              <1> reloc	mov bx, word [findhandle]	; bx = find handle, if any
  1762                              <1> internaldatarelocation
  1763                              <1> reloc	rol byte [findhandle_set], 1	; find handle set ?
  1764                              <1> internaldatarelocation
  1765                              <1> 	jnc @F				; no -->
  1766                              <1> reloc	not byte [findhandle_set]
  1767                              <1> internaldatarelocation
  1768                              <1> 	mov ax, 71A1h
  1769                              <1> 	extcallcall _doscall		; LFN find close
  1770                              <1> @@:
  1771                              <1> 	retn
  1772                              <1> %endif
  1773                              <1> 
  1774                              <1> 
  1775                              <1> get_es_ext:
  1776 000007F7 8E06[0000]          <1> reloc	mov es, word [relocateddata]
  1777                              <1> linkdatarelocation extdssel
  1778 000007FB E8EA00              <1> 	extcallcall ispm
  1779 000007FE 7404                <1> 	jz @F
  1780 00000800 8E06[0000]          <1> reloc	mov es, word [relocateddata]
  1781                              <1> linkdatarelocation extseg
  1782                              <1> @@:
  1783 00000804 C3                  <1> 	retn
  1784                              <1> 
  1785                              <1> 
  1786                              <1> start:
  1787 00000805 8CC3                <1> 	mov bx, es
  1788 00000807 16                  <1> 	 push ss
  1789 00000808 07                  <1> 	 pop es
  1790 00000809 E8E400              <1> 	extcallcall skipcomma
  1791 0000080C E8A900              <1> 	extcallcall iseol?
  1792 0000080F 7409                <1> 	je .help
  1793 00000811 E80CF8              <1> 	call run
  1794                              <1> @@:
  1795 00000814 E80B00              <1> 	call uninstall_oneshot
  1796 00000817 31C0                <1> 	xor ax, ax
  1797 00000819 CB                  <1> 	retf
  1798                              <1> 
  1799                              <1> .help:
  1800 0000081A BA[D101]            <1> reloc	mov dx, msg.help
  1801                              <1> internaldatarelocation
  1802 0000081D E86000              <1> 	extcallcall putsz
  1803 00000820 EBF2                <1> 	jmp @B
  1804                              <1> 
  1805                              <1> 
  1806                              <1> uninstall_oneshot:
  1807 00000822 36F606[0000]01      <1> reloc	testopt [ss:relocateddata], 1
  1808                              <1> linkdatarelocation options7, -3
  1809 00000828 751A                <1> 	jnz @F
  1810                              <1> 
  1811 0000082A 2EA1[0200]          <1> reloc	mov ax, word [cs:code + eldiEndCode]
  1812                              <1> internalcoderelocation
  1813 0000082E 2E2B06[0000]        <1> reloc	sub ax, word [cs:code + eldiStartCode]
  1814                              <1> internalcoderelocation
  1815 00000833 2906[0000]          <1> reloc	sub word [relocateddata], ax
  1816                              <1> linkdatarelocation extseg_used
  1817                              <1> 
  1818 00000837 2EA1[0600]          <1> reloc	mov ax, word [cs:code + eldiEndData]
  1819                              <1> internalcoderelocation
  1820 0000083B 2E2B06[0400]        <1> reloc	sub ax, word [cs:code + eldiStartData]
  1821                              <1> internalcoderelocation
  1822 00000840 2906[0000]          <1> reloc	sub word [relocateddata], ax
  1823                              <1> linkdatarelocation extdata_used
  1824                              <1> @@:
  1825 00000844 C3                  <1> 	retn
  1826                              <1> 
  1827                              <1> 
  1828                              <1> DATAOFFSET equ CODEOFFSET + code_size
  1829                              <1> 	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
  1830                              <1> %define DATAFIXUP - datastart + 0
  1831                              <1> datastart:
  1832                              <1> PUT_ELD_DATETIME
  1833                              <1> 
  1834                              <1> %if _BOOT
  1835 00000000 [7702]              <1> reloc matchfunction:	dw sort_or_display
  1836                              <1> internalcoderelocation
  1837 00000002 [0000]              <1> reloc widecurrent:	dw relocateddata
  1838                              <1> linkdatarelocation line_out
  1839                              <1> %endif
  1840 00000004 0000                <1> meta:			dw 0
  1841 00000006 [4003]              <1> reloc compare:		dw ..@compare_normal
  1842                              <1> internalcoderelocation
  1843 00000008 00                  <1> found:			db 0
  1844                              <1> %ifn _BOOT
  1845                              <1> findhandle_set:		db 0
  1846                              <1> prefersfn:		db 0
  1847                              <1> %endif
  1848 00000009 00                  <1> wide:			db 0
  1849 0000000A 00                  <1> widecounter:		db 0
  1850 0000000B 00                  <1> sort:			db 0
  1851                              <1> %ifn _BOOT
  1852                              <1> sortlfn:		db 0
  1853                              <1> %endif
  1854 0000000C 00                  <1> dirfirst:		db 0
  1855 0000000D 00                  <1> date:			db 0
  1856 0000000E 00                  <1> size:			db 0
  1857                              <1> 
  1858                              <1> msg:
  1859                              <1> %ifn _BOOT
  1860                              <1> .string_sfn:		asciz "SFN"
  1861                              <1> %endif
  1862 0000000F 5749444500          <1> .string_wide:		asciz "WIDE"
  1863 00000014 534F525400          <1> .string_sort:		asciz "SORT"
  1864 00000019 444952464952535400  <1> .string_dirfirst:	asciz "DIRFIRST"
  1865 00000022 4441544500          <1> .string_date:		asciz "DATE"
  1866 00000027 53495A4500          <1> .string_size:		asciz "SIZE"
  1867 0000002C 5245564552534500    <1> .string_reverse:	asciz "REVERSE"
  1868                              <1> %ifn _BOOT
  1869                              <1> .string_sortlfn:	asciz "SORTLFN"
  1870                              <1> .string_sortsfn:	asciz "SORTSFN"
  1871                              <1> %endif
  1872                              <1> %if _DEBUG
  1873 00000034 534F52544445425547- <1> .string_sortdebug:	asciz "SORTDEBUG"
  1873 0000003D 00                  <1>
  1874 0000003E 19454C442064617461- <1> .debug.1:			counted "ELD data block buffer at "
  1874 00000047 20626C6F636B206275- <1>
  1874 00000050 6666657220617420    <1>
  1875 00000058 072C2073697A6520    <1> .debug.2:			counted ", size "
  1876 00000060 0A2062797465732C20- <1> .debug.bytes:			counted " bytes, >="
  1876 00000069 3E3D                <1>
  1877 0000006B 222053464E20656E74- <1> .debug.3:			counted " SFN entries",13,10,"Auxiliary buffer at "
  1877 00000074 726965730D0A417578- <1>
  1877 0000007D 696C69617279206275- <1>
  1877 00000086 6666657220617420    <1>
  1878                              <1> %if _BOOT
  1879                              <1> .debug.5 equ .debug.2
  1880                              <1> %else
  1881                              <1> .debug.5:			counted ":0000, size "
  1882                              <1> %endif
  1883 0000008E 182053464E20656E74- <1> .debug.6.available:		counted " SFN entries (available)"
  1883 00000097 726965732028617661- <1>
  1883 000000A0 696C61626C6529      <1>
  1884 000000A7 152053464E20656E74- <1> .debug.6.inuse:			counted " SFN entries (in use)"
  1884 000000B0 726965732028696E20- <1>
  1884 000000B9 75736529            <1>
  1885 000000BD 4461746120626C6F63- <1> .debug.larger_data_block:	asciz "Data block chosen because it is larger (above-or-equal size).",13,10
  1885 000000C6 6B2063686F73656E20- <1>
  1885 000000CF 626563617573652069- <1>
  1885 000000D8 74206973206C617267- <1>
  1885 000000E1 6572202861626F7665- <1>
  1885 000000EA 2D6F722D657175616C- <1>
  1885 000000F3 2073697A65292E0D0A- <1>
  1885 000000FC 00                  <1>
  1886 000000FD 417578696C69617279- <1> .debug.smaller_data_block:	asciz "Auxiliary buffer chosen because it is larger and available.",13,10
  1886 00000106 206275666665722063- <1>
  1886 0000010F 686F73656E20626563- <1>
  1886 00000118 617573652069742069- <1>
  1886 00000121 73206C617267657220- <1>
  1886 0000012A 616E6420617661696C- <1>
  1886 00000133 61626C652E0D0A00    <1>
  1887                              <1>  %ifn _BOOT
  1888                              <1> .debug.smaller_data_block_forced:asciz "Smaller data block chosen because auxiliary buffer not available.",13,10
  1889                              <1>  %endif
  1890                              <1> %endif
  1891 0000013B 546F6F206C6F6E6720- <1> .error:			asciz "Too long short name, internal error!",13,10
  1891 00000144 73686F7274206E616D- <1>
  1891 0000014D 652C20696E7465726E- <1>
  1891 00000156 616C206572726F7221- <1>
  1891 0000015F 0D0A00              <1>
  1892 00000162 46696C65206E6F7420- <1> .error2:		asciz "File not found, internal error!",13,10
  1892 0000016B 666F756E642C20696E- <1>
  1892 00000174 7465726E616C206572- <1>
  1892 0000017D 726F72210D0A00      <1>
  1893 00000184 46696C656E616D6573- <1> .toofull:		asciz "Filenames list does not fit in buffer!",13,10
  1893 0000018D 206C69737420646F65- <1>
  1893 00000196 73206E6F7420666974- <1>
  1893 0000019F 20696E206275666665- <1>
  1893 000001A8 72210D0A00          <1>
  1894 000001AD 082020205B4449525D  <1> .dirinsteadsize:	countedb "   [DIR]"
  1895 000001B6 083E32353620546942  <1> .sizetoolarge:		countedb ">256 TiB"
  1896 000001BF 46696C65206E6F7420- <1> .notfound:		db "File not found."
  1896 000001C8 666F756E642E        <1>
  1897 000001CE 0D0A00              <1> .linebreak:		asciz 13,10
  1898 000001D1 52756E207769746820- <1> .help:		db "Run with a pathname as parameter.",13,10
  1898 000001DA 6120706174686E616D- <1>
  1898 000001E3 652061732070617261- <1>
  1898 000001EC 6D657465722E0D0A    <1>
  1899 000001F4 4C61737420636F6D70- <1> 		db "Last component may include wildcards.",13,10
  1899 000001FD 6F6E656E74206D6179- <1>
  1899 00000206 20696E636C75646520- <1>
  1899 0000020F 77696C646361726473- <1>
  1899 00000218 2E0D0A              <1>
  1900 0000021B 0D0A                <1> 		db 13,10
  1901 0000021D 416674657220746865- <1> 		db "After the pathname, keywords may follow:",13,10
  1901 00000226 20706174686E616D65- <1>
  1901 0000022F 2C206B6579776F7264- <1>
  1901 00000238 73206D617920666F6C- <1>
  1901 00000241 6C6F773A0D0A        <1>
  1902                              <1> %ifn _BOOT
  1903                              <1> 		db 9,"SFN",9,"Use DOS SFN search even if LFN available",13,10
  1904                              <1> 		db 9,"WIDE",9,"Display in wide mode, up to 5 SFNs per line",13,10
  1905                              <1> 		db 9,"SORT",9,"Sort filenames, default is SFNs. Must fit in buffer!",13,10
  1906                              <1> 		db 9,"SORTSFN",9,"Same as SORT, but explicitly sort SFNs",13,10
  1907                              <1> 		db 9,"SORTLFN",9,"Sort filenames using their LFNs",13,10
  1908                              <1> %else
  1909 00000247 095749444509446973- <1> 		db 9,"WIDE",9,"Display in wide mode, up to 5 SFNs per line",13,10
  1909 00000250 706C617920696E2077- <1>
  1909 00000259 696465206D6F64652C- <1>
  1909 00000262 20757020746F203520- <1>
  1909 0000026B 53464E732070657220- <1>
  1909 00000274 6C696E650D0A        <1>
  1910 0000027A 09534F525409536F72- <1> 		db 9,"SORT",9,"Sort filenames. Must fit in buffer!",13,10
  1910 00000283 742066696C656E616D- <1>
  1910 0000028C 65732E204D75737420- <1>
  1910 00000295 66697420696E206275- <1>
  1910 0000029E 66666572210D0A      <1>
  1911                              <1> %endif
  1912 000002A5 094441544509576865- <1> 		db 9,"DATE",9,"When sorting, sort by date first",13,10
  1912 000002AE 6E20736F7274696E67- <1>
  1912 000002B7 2C20736F7274206279- <1>
  1912 000002C0 206461746520666972- <1>
  1912 000002C9 73740D0A            <1>
  1913 000002CD 0953495A4509576865- <1> 		db 9,"SIZE",9,"When sorting, sort by size first",13,10
  1913 000002D6 6E20736F7274696E67- <1>
  1913 000002DF 2C20736F7274206279- <1>
  1913 000002E8 2073697A6520666972- <1>
  1913 000002F1 73740D0A            <1>
  1914 000002F5 095245564552534509- <1> 		db 9,"REVERSE",9,"When sorting, reverse name/DATE/SIZE sort order",13,10
  1914 000002FE 5768656E20736F7274- <1>
  1914 00000307 696E672C2072657665- <1>
  1914 00000310 727365206E616D652F- <1>
  1914 00000319 444154452F53495A45- <1>
  1914 00000322 20736F7274206F7264- <1>
  1914 0000032B 65720D0A            <1>
  1915 0000032F 094449524649525354- <1> 		db 9,"DIRFIRST",9,"When sorting, sort directories first",13,10
  1915 00000338 095768656E20736F72- <1>
  1915 00000341 74696E672C20736F72- <1>
  1915 0000034A 74206469726563746F- <1>
  1915 00000353 726965732066697273- <1>
  1915 0000035C 740D0A              <1>
  1916 0000035F 00                  <1> 		asciz
  1917                              <1> 
  1918                              <1> uinit_data: equ $
  1919                              <1> 
  1920                              <1> 	align 16, db 0
  1921                              <1> data_size equ $ - datastart
  1922                              <1> 
  1923                              <1> 	absolute uinit_data
  1924                              <1> 
  1925                              <1> 	alignb 2
  1926                              <1> %if _BOOT
  1927 00000360 ????                <1> wild_pattern:	resw 1
  1928                              <1> %else
  1929                              <1> originaldta:	resd 1
  1930                              <1> originalinject:	resw 1
  1931                              <1> %endif
  1932                              <1> 
  1933 00000362 ????                <1> sortsegsel:	resw 1
  1934 00000364 ????                <1> sortstartoffset:resw 1
  1935 00000366 ????                <1> sortendoffset:	resw 1
  1936 00000368 ????                <1> sort_last:	resw 1
  1937 0000036A ????                <1> sort_next:	resw 1
  1938                              <1> 
  1939 0000036C ????                <1> pathname_start:	resw 1
  1940 0000036E ????                <1> pathname_length:resw 1
  1941                              <1> %ifn _BOOT
  1942                              <1> findnext_function_number:
  1943                              <1> 		resw 1
  1944                              <1> findhandle:	resw 1
  1945                              <1> %endif
  1946                              <1> 
  1947                              <1> buffer:
  1948                              <1> %ifn _BOOT
  1949                              <1> dta:		resb 15h
  1950                              <1> .attrib:	resb 1
  1951                              <1> .time:		resw 1
  1952                              <1> .date:		resw 1
  1953                              <1> .size:		resd 1
  1954                              <1> .name:		resb 13
  1955                              <1> %endif
  1956                              <1> 
  1957                              <1> 	alignb 2
  1958                              <1> finddata:
  1959 00000370 ????????            <1> .attrib:	resd 1
  1960 00000374 <res 10h>           <1> 		resq 2
  1961 00000384 ????                <1> .time:		resw 1
  1962 00000386 ????                <1> .date:		resw 1
  1963 00000388 ????????            <1> 		resd 1
  1964 0000038C ????????            <1> .sizehigh:	resd 1
  1965 00000390 ????????            <1> .sizelow:	resd 1
  1966 00000394 ????????????????    <1> 		resb 8
  1967                              <1> pathnamebuffer equ $
  1968 0000039C <res 104h>          <1> .fullname:	resb 260
  1969 000004A0 <res Eh>            <1> .shortname:	resb 14
  1970 000004AE ??????????          <1> size40bit:	resb 5
  1971                              <1> 
  1972 000004B3 <res Dh>            <1> 	alignb 16
  1973                              <1> uinit_data_end_1:
  1974                              <1> 
  1975                              <1> 	absolute buffer
  1976 00000370 <res 200h>          <1> 		resb 512
  1977                              <1> buffer_end:
  1978                              <1> 
  1979                              <1> 	alignb 16
  1980                              <1> uinit_data_end_2:
  1981                              <1> 
  1982                              <1> %if uinit_data_end_2 > uinit_data_end_1
  1983                              <1>  uinit_data_end equ uinit_data_end_2
  1984                              <1> %else
  1985                              <1>  uinit_data_end equ uinit_data_end_1
  1986                              <1> %endif
  1987                              <1> 
  1988                              <1> 
  1989                              <1> total_data_size equ uinit_data_end - datastart
  1990                              <1> %assign _DATA_SIZE total_data_size
  1991                              <1> 
  1992                              <1> 	usesection CODE
  1993                              <1> 
  1994                              <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> 	numdef ELDDATA_NEXT, ELDDATA_NEXT_STATUS
    38                              <2> 	numdef ELDCALL_NEXT, ELDCALL_NEXT_STATUS
    39                              <2> %if _ELD_IDENTICALISE
    40                              <2>  ;%assign _ELDCALL_OPTIONAL 1
    41                              <2> %endif
    42                              <2> %ifn _ELDCALL_OPTIONAL
    43                              <2> %assign ELDCALL_OPTIONAL_STATUS 2		; not allowed
    44                              <2> %endif
    45                              <2> ;%ifn _ELDDATA_OPTIONAL
    46                              <2> ;%assign ELDDATA_OPTIONAL_STATUS 2		; not allowed
    47                              <2> ;%endif
    48                              <2> 	gendef MAP, ""
    49                              <2> 
    50                              <2> %ifnidni _MAP, ""
    51                              <2>  [map all _MAP]
    52                              <2> %endif
    53                              <2> 
    54                              <2> 
    55                              <2> endresident: equ ($ + _CURRENT_SECTION %+ FIXUP + 15) & ~15
    56                              <2> 
    57                              <2> %if _ELD_LINKER_PASSES
    58                              <2> %assign ELDLINKER 1
    59                              <2> 
    60                              <2> 	struc LINKTABLE
    61 00000000 ????????            <2> ltCodeToCode:	resw 2
    62 00000004 ????????            <2> ltCodeToData:	resw 2
    63 00000008 ????????            <2> ltDataToCode:	resw 2
    64 0000000C ????????            <2> ltDataToData:	resw 2
    65 00000010 ????????            <2> ltLinkData:	resw 2
    66 00000014 ????????            <2> ltLinkCode:	resw 2
    67                              <2> 	endstruc
    68                              <2> %endif
    69                              <2> 
    70                              <2> 
    71                              <2> 		; INP:	es:dx -> loaded initial ELD image
    72                              <2> 		;	 ELD instance structure filled
    73                              <2> 		;	es => ELD code area
    74                              <2> 		;	ds:di -> link info
    75                              <2> 		;	ss:bx -> loaded initial data
    76                              <2> 		;	ss:si -> command line tail
    77                              <2> 		;	cs:ip -> entrypoint
    78                              <2> 		;	ss:sp -> far return address for current mode
    79                              <2> 		; STT:	UP, EI
    80                              <2> linker:
    81                              <2> 		; The first 15 Bytes of the linker should be
    82                              <2> 		;  the same regardless of the linker options
    83                              <2> 		;  used (debug, passes, vstart). This allows
    84                              <2> 		;  the eldcomp ELD to match even if up to 15
    85                              <2> 		;  Bytes of the linker are trailing in the
    86                              <2> 		;  resident part of the ELD.
    87                              <2> 	lframe
    88                              <2>  %if ELDOTHER
    89                              <2> 	lvar dword, linkinfo_other
    90                              <2> 	lvar word, use_hash_other
    91                              <2>  %endif
    92 000008F8 5589E5              <2> 	lenter
    93                              <2> 	lvar dword, instance
    94 000008FB 06                  <2> 	 push es
    95 000008FC 52                  <2> 	 push dx		; -> start of where we're loaded in ELD cs
    96                              <2> 	lvar word, targetsection_low_optional_high
    97 000008FD 50                  <2> 	 push ax		; placeholder
    98                              <2> 	lequ ?targetsection_low_optional_high, targetsection
    99                              <2> 	lequ ?targetsection_low_optional_high + 1, optional
   100                              <2> 	lvar dword, linkinfo
   101 000008FE 1E                  <2> 	 push ds
   102 000008FF 57                  <2> 	 push di		; -> link info (in debugger ss or message seg)
   103                              <2> 	lvar dword, nextreloc
   104 00000900 06                  <2> 	 push es		; => ELD cs
   105 00000901 52                  <2> 	 push dx		; placeholder
   106                              <2> 	lvar dword, entry
   107 00000902 06                  <2> 	 push es		; => ELD cs
   108 00000903 50                  <2> 	 push ax		; placeholder
   109 00000904 31C0                <2> 	xor ax, ax
   110 00000906 813DD1E1            <2> 	cmp word [di + eldlSignature], 0E1D1h
   111                              <2> %if ($ - linker) < 16
   112                              <2>  %error Expected invariant first paragraph of linker
   113                              <2> %endif
   114 0000090A 7403                <2> 	je @F
   115                              <2> .error_j1:
   116 0000090C E9C602              <2> 	jmp .error		; signature mismatch -->
   117                              <2> @@:
   118 0000090F 837D0601            <2> 	cmp word [di + eldlUseLinkHash], 1
   119 00000913 77F7                <2> 	ja .error_j1		; unknown use link hash number -->
   120 00000915 7201                <2> 	jb @F
   121                              <2> %if _ELDDATA_NEXT || _ELDCALL_NEXT
   122                              <2> 	dec al			; = -1 if hash used
   123                              <2> %else
   124 00000917 48                  <2> 	dec ax
   125                              <2> %endif
   126                              <2> @@:
   127                              <2> 	lvar word, use_hash_low_skip_last_high
   128 00000918 50                  <2> 	 push ax		; = -1 if hash used, else 0
   129                              <2> 	lequ ?use_hash_low_skip_last_high, use_hash
   130                              <2> 	lequ ?use_hash_low_skip_last_high + 1, skip_last
   131                              <2> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   132                              <2> 	mov ax, linktable - code
   133                              <2> 	lvar word, lt
   134                              <2> 	 push ax		; -> link tables (a single reference)
   135                              <2> %endif
   136                              <2> %if _ELD_LINKER_PASSES || ELDOTHER || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   137 00000919 31C0                <2> 	xor ax, ax
   138                              <2>  %if _ELD_LINKER_PASSES
   139                              <2> 	lvar word, pass
   140 0000091B 50                  <2> 	 push ax		; = 0 for linker itself, = 2 for application
   141                              <2> 	lvar word, amounterrors
   142 0000091C 50                  <2> 	 push ax		; how many distinct errors encountered in pass 2
   143                              <2>  %endif
   144                              <2>  %if _ELD_LINKER_PASSES || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   145                              <2> 	lvar word, name
   146 0000091D 50                  <2> 	 push ax		; -> name currently being sought (in our table)
   147                              <2>  %endif
   148                              <2>  %if ELDOTHER
   149                              <2> 	lvar word, other
   150                              <2> 	 push ax		; byte: 0 = own data links, -1 = other data links
   151                              <2>  %endif
   152                              <2>  %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   153                              <2> 	lvar word, optionalmissing
   154                              <2> 	 push ax
   155                              <2>  %endif
   156                              <2> %endif
   157 0000091E 56                  <2> 	push si			; -> command line tail
   158 0000091F 53                  <2> 	push bx			; -> data block in ELD data area (segment ss)
   159                              <2> 
   160                              <2> 			; simple: add instance base (dx) to code
   161 00000920 06                  <2> 	push es
   162 00000921 1F                  <2> 	pop ds			; ds = es => ELD cs
   163                              <2> %if _ELD_LINKER_PASSES
   164                              <2> .pass:
   165 00000922 8B5EEA              <2> 	mov bx, word [bp + ?pass]	; 0 or 2
   166 00000925 01D3                <2> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   167                              <2>  %if _ELD_IDENTICALISE
   168                              <2> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   169                              <2> 	mov si, word [ltCodeToCode + bx]
   170                              <2>  %else
   171 00000927 8BB7A80C            <2> 	mov si, word [linktable - code + ltCodeToCode + bx]
   172                              <2>  %endif
   173                              <2> %else
   174                              <2> 	mov si, internalcodetocoderelocations - code
   175                              <2> %endif		 		; si -> table for code to code (linker or app)
   176 0000092B 01D6                <2> 	add si, dx		; relocate the table pointer itself
   177                              <2> @@:
   178 0000092D AD                  <2> 	lodsw
   179 0000092E 85C0                <2> 	test ax, ax		; was last ?
   180 00000930 740B                <2> 	jz @F			; yes -->
   181 00000932 93                  <2> 	xchg bx, ax		; bx = entry
   182 00000933 01D3                <2> 	add bx, dx		; relocate the entry itself
   183                              <2> %if _ELD_CODE_VSTART
   184 00000935 812F[0000]          <2> 	sub word [bx], code	; undo adjustment
   185                              <2> %endif
   186 00000939 0117                <2> 	add word [bx], dx	; relocate word referenced by entry
   187 0000093B EBF0                <2> 	jmp @B
   188                              <2> 
   189                              <2> @@:
   190                              <2> 			; next, add heap data base (on stack) to code
   191                              <2> %if _ELD_LINKER_PASSES
   192 0000093D 8B5EEA              <2> 	mov bx, word [bp + ?pass]	; 0 or 2
   193 00000940 01D3                <2> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   194                              <2>  %if _ELD_IDENTICALISE
   195                              <2> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   196                              <2> 	mov si, word [ltCodeToData + bx]
   197                              <2>  %else
   198 00000942 8BB7AC0C            <2> 	mov si, word [linktable - code + ltCodeToData + bx]
   199                              <2>  %endif
   200                              <2> %else
   201                              <2> 	mov si, internalcodetodatarelocations - code
   202                              <2> %endif				; si -> table for code to data (linker or app)
   203 00000946 01D6                <2> 	add si, dx		; relocate the table pointer itself
   204                              <2> @@:
   205 00000948 AD                  <2> 	lodsw
   206 00000949 85C0                <2> 	test ax, ax		; was last ?
   207 0000094B 740C                <2> 	jz @F			; yes -->
   208 0000094D 93                  <2> 	xchg bx, ax		; bx = entry
   209 0000094E 01D3                <2> 	add bx, dx		; relocate the entry itself
   210                              <2> 		; ! access the offset of the data area block, topmost on stack
   211 00000950 58                  <2> 	pop ax			; ax -> heap data
   212 00000951 50                  <2> 	push ax
   213                              <2> %if _ELD_DATA_VSTART
   214 00000952 2D[0000]            <2> 	sub ax, datastart	; undo adjustment
   215                              <2> %endif
   216 00000955 0107                <2> 	add word [bx], ax	; relocate word referenced by entry
   217 00000957 EBEF                <2> 	jmp @B
   218                              <2> 
   219                              <2> @@:
   220                              <2> 
   221                              <2> 			; add instance base (dx) to data
   222                              <2> %if _ELD_LINKER_PASSES
   223 00000959 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   224 0000095C 01D3                <2> 	add bx, dx
   225                              <2>  %if _ELD_IDENTICALISE
   226                              <2> 	add bx, word [bp + ?lt]
   227                              <2> 	mov si, word [ltDataToCode + bx]
   228                              <2>  %else
   229 0000095E 8BB7B00C            <2> 	mov si, word [linktable - code + ltDataToCode + bx]
   230                              <2>  %endif
   231                              <2> %else
   232                              <2> 	mov si, internaldatatocoderelocations - code
   233                              <2> %endif
   234 00000962 01D6                <2> 	add si, dx
   235                              <2> @@:
   236 00000964 AD                  <2> 	lodsw
   237 00000965 83F8FF              <2> 	cmp ax, -1		; was last ?
   238 00000968 740F                <2> 	je @F			; yes -->
   239 0000096A 93                  <2> 	xchg bx, ax		; bx = entry
   240                              <2> 		; ! access the offset of the data area block, topmost on stack
   241 0000096B 58                  <2> 	pop ax
   242 0000096C 50                  <2> 	push ax
   243 0000096D 01C3                <2> 	add bx, ax		; relocate the entry itself
   244                              <2> %if _ELD_CODE_VSTART
   245 0000096F 36812F[0000]        <2> 	sub word [ss:bx], code	; undo adjustment
   246                              <2> %endif
   247 00000974 360117              <2> 	add word [ss:bx], dx	; relocate word referenced by entry
   248 00000977 EBEB                <2> 	jmp @B
   249                              <2> 
   250                              <2> @@:
   251                              <2> 			; next, add heap data base (on stack) to data
   252                              <2> %if _ELD_LINKER_PASSES
   253 00000979 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   254 0000097C 01D3                <2> 	add bx, dx
   255                              <2>  %if _ELD_IDENTICALISE
   256                              <2> 	add bx, word [bp + ?lt]
   257                              <2> 	mov si, word [ltDataToData + bx]
   258                              <2>  %else
   259 0000097E 8BB7B40C            <2> 	mov si, word [linktable - code + ltDataToData + bx]
   260                              <2>  %endif
   261                              <2> %else
   262                              <2> 	mov si, internaldatatodatarelocations - code
   263                              <2> %endif
   264 00000982 01D6                <2> 	add si, dx
   265                              <2> @@:
   266 00000984 AD                  <2> 	lodsw
   267 00000985 83F8FF              <2> 	cmp ax, -1		; was last ?
   268 00000988 740D                <2> 	je @F			; yes -->
   269 0000098A 93                  <2> 	xchg bx, ax		; bx = entry
   270                              <2> 		; ! access the offset of the data area block, topmost on stack
   271 0000098B 58                  <2> 	pop ax			; ax -> heap data
   272 0000098C 50                  <2> 	push ax
   273 0000098D 01C3                <2> 	add bx, ax		; relocate the entry itself
   274                              <2> %if _ELD_DATA_VSTART
   275 0000098F 2D[0000]            <2> 	sub ax, datastart	; undo adjustment
   276                              <2> %endif
   277 00000992 360107              <2> 	add word [ss:bx], ax	; relocate word referenced by entry
   278 00000995 EBED                <2> 	jmp @B
   279                              <2> 
   280                              <2> @@:
   281 00000997 8B56FC              <2> 	mov dx, word [bp + ?instance]
   282                              <2> 				; reset (why??) -> ELD instance in ELD cs
   283                              <2> %if _ELD_LINKER_PASSES
   284 0000099A 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   285 0000099D 01D3                <2> 	add bx, dx
   286                              <2>  %if _ELD_IDENTICALISE
   287                              <2> 	add bx, word [bp + ?lt]
   288                              <2> 	add dx, word [ltLinkData + bx]
   289                              <2>  %else
   290 0000099F 0397B80C            <2> 	add dx, word [linktable - code + ltLinkData + bx]
   291                              <2>  %endif
   292                              <2> %else
   293                              <2> 	add dx, linkerdatarelocations - code
   294                              <2> %endif
   295                              <2> .otherloop:
   296 000009A3 8956F2              <2> 	mov word [bp + ?nextreloc], dx
   297                              <2> 				; -> data link relocation table
   298                              <2> 
   299                              <2> .datarelocloop:		; must be done before further relocs
   300 000009A6 C576F2              <2> 	lds si, [bp + ?nextreloc]
   301 000009A9 AD                  <2> 	lodsw			; ax = section indicator
   302 000009AA 85C0                <2> 	test ax, ax		; end of table ?
   303 000009AC 7503E90401          <2> 	jz .donedatareloc
   304 000009B1 48                  <2> 	dec ax			; al = 1 if data, 0 if code (NB ah may != 0)
   305                              <2> 		; ! access the offset of the data area block, topmost on stack
   306 000009B2 5B                  <2> 	pop bx
   307 000009B3 53                  <2> 	push bx			; bx -> ELD data block
   308 000009B4 8946FA              <2> 	mov word [bp + ?targetsection_low_optional_high], ax
   309 000009B7 84C0                <2> 	test al, al		; data ?
   310 000009B9 AD                  <2> 	lodsw
   311 000009BA 7504                <2> 	jnz @F			; yes -->
   312 000009BC 0346FC              <2> 	add ax, word [bp + ?instance]
   313                              <2> 				; relocate entry into code
   314 000009BF A9                  <2> 	db __TEST_IMM16		; (skip add)
   315                              <2> @@:
   316 000009C0 01D8                <2> 	add ax, bx		; relocate entry into data
   317 000009C2 8946EE              <2> 	mov word [bp + ?entry], ax
   318                              <2> 				; save away -> where to patch
   319 000009C5 AD                  <2> 	lodsw			; get unrelocated -> name
   320 000009C6 8976F2              <2> 	mov word [bp + ?nextreloc], si
   321                              <2> 				; update -> behind relocation table entry
   322                              <2> %if _ELDDATA_NEXT
   323                              <2> 	rol byte [bp + ?skip_last], 1	; skipping ?
   324                              <2> 	jnc @F				; no -->
   325                              <2> 	test byte [bp + ?optional], 8	; is it a last relocation ?
   326                              <2> 	jz .datarelocloop		; no, leave skip_last set -->
   327                              <2> 	not byte [bp + ?skip_last]	; disable skip_last
   328                              <2> 	jmp .datarelocloop
   329                              <2> @@:
   330                              <2> %endif
   331 000009C9 E8BD00              <2> 	call .build_match	; get ax = scan value, si -> counted string,
   332                              <2> 				;  dl = original value at byte [si]
   333                              <2> 				; NC if symbol already not found before
   334                              <2> 				; CY if to search for the symbol
   335                              <2> %if _ELD_LINKER_PASSES
   336 000009CC 73D8                <2> 	jnc .datarelocloop	; if duplicate of a not found symbol -->
   337                              <2> %endif
   338 000009CE C45EF6              <2> 	les bx, [bp + ?linkinfo]
   339                              <2> %if ELDOTHER
   340                              <2> 	rol byte [bp + ?other], 1
   341                              <2> 	jnc @F
   342                              <2> 	les bx, [bp + ?linkinfo_other]
   343                              <2> @@:
   344                              <2> %endif				; es:bx -> link info table of the ELD host
   345 000009D1 268B4F08            <2> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   346 000009D5 268B7F0A            <2> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   347                              <2> .datarelocfind:
   348 000009D9 83F901              <2> 	cmp cx, 1			; NZ if cx == 0
   349 000009DC F2AF                <2> 	repne scasw			; scan initial
   350                              <2> %if _ELDDATA_OPTIONAL
   351                              <2> 	jne .datanotfound_may_be_optional
   352                              <2> %else
   353 000009DE 7541                <2> 	jne .datanotfound
   354                              <2> %endif
   355 000009E0 57                  <2> 	push di
   356 000009E1 51                  <2> 	push cx
   357 000009E2 56                  <2> 	push si
   358 000009E3 262B7F0A            <2> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   359 000009E7 4F                  <2> 	dec di
   360 000009E8 4F                  <2> 	dec di				; 0-based
   361 000009E9 26037F0C            <2> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   362 000009ED 268B3D              <2> 	mov di, [es:di]			; -> counted suffix/string
   363 000009F0 B500                <2> 	mov ch, 0
   364 000009F2 8A0C                <2> 	mov cl, byte [si]		; cx = length
   365 000009F4 41                  <2> 	inc cx
   366                              <2> 	; cmp al, al			; ZR if length is zero
   367 000009F5 F3A6                <2> 	repe cmpsb			; match ?
   368 000009F7 5E                  <2> 	pop si
   369 000009F8 59                  <2> 	pop cx
   370 000009F9 5F                  <2> 	pop di
   371 000009FA 75DD                <2> 	jne .datarelocfind		; if not found this time,
   372                              <2> 					;  scan for next initial -->
   373 000009FC 8814                <2> 	mov byte [si], dl		; restore the original byte at counter
   374 000009FE 262B7F0A            <2> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   375 00000A02 4F                  <2> 	dec di
   376 00000A03 4F                  <2> 	dec di				; 0-based
   377 00000A04 26037F0E            <2> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   378 00000A08 268B05              <2> 	mov ax, word [es:di]		; get link data from the table
   379 00000A0B E80700              <2> 	call .address_data_reloc
   380                              <2> %if _ELD_RELOC_VSTART
   381 00000A0E 2D[0000]            <2> 	sub ax, relocateddata		; *not* a relocation
   382                              <2> %endif
   383 00000A11 0104                <2> 	add word [si], ax		; relocate
   384                              <2> %if _ELDDATA_NEXT
   385                              <2> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   386                              <2> 	jz .datarelocloop
   387                              <2> 	mov byte [bp + ?skip_last], -1	; skip subsequent next/last relocs
   388                              <2> %endif
   389 00000A13 EB91                <2> 	jmp .datarelocloop
   390                              <2> 
   391                              <2> .address_data_reloc:
   392 00000A15 C576EE              <2> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   393 00000A18 807EFA00            <2> 	cmp byte [bp + ?targetsection], 0
   394                              <2> 					; relocation in code ?
   395 00000A1C 7402                <2> 	je @F				; yes -->
   396 00000A1E 16                  <2> 	push ss
   397 00000A1F 1F                  <2> 	pop ds				; => our ELD data block
   398                              <2> @@:
   399 00000A20 C3                  <2> 	retn
   400                              <2> 
   401                              <2> %if _ELDDATA_OPTIONAL
   402                              <2> .datanotfound_may_be_optional:
   403                              <2> 	mov byte [si], dl		; restore the original byte at counter
   404                              <2> %if _ELDDATA_NEXT
   405                              <2> 	test byte [bp + ?optional], 3	; is it an optional relocation ?
   406                              <2> %else
   407                              <2> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   408                              <2> %endif
   409                              <2> %if _ELD_DEBUG
   410                              <2> 	jnz @F
   411                              <2>  %ifn _ELD_LINKER_PASSES
   412                              <2> 	mov si, 0			; (invalid link)
   413                              <2> linkdatarelocation internalflags6
   414                              <2> 	test si, si
   415                              <2> 	jz .datanotfound
   416                              <2> 	mov si, 0			; (invalid link)
   417                              <2> linkdatarelocation options7
   418                              <2> 	test si, si
   419                              <2> 	jz .datanotfound
   420                              <2>  %else
   421                              <2> 	cmp byte [bp + ?pass], 0
   422                              <2> 	je .datanotfound
   423                              <2>  %endif
   424                              <2> 	houdini				; (the above conditions are for this)
   425                              <2> 	jmp .datanotfound
   426                              <2> @@:
   427                              <2> %else
   428                              <2> 	jz .datanotfound		; no, handle as an error -->
   429                              <2> %endif
   430                              <2> 
   431                              <2> %if ELDDATA_PMREQUIRED_STATUS
   432                              <2> 	mov si, relocateddata
   433                              <2> linkdatarelocation build_option_PM
   434                              <2> 	test si, si			; is it a PM build ?
   435                              <2> 	jz @F				; no --> (treat PM required as optional)
   436                              <2> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   437                              <2> 	jnz .datanotfound		; yes, handle as an error -->
   438                              <2> @@:
   439                              <2> %endif
   440                              <2> 
   441                              <2> %if _ELD_LINKER_PASSES
   442                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   443                              <2> 	rol byte [bp + ?optionalmissing], 1
   444                              <2> 	jnc .optionaldatamissingmsg
   445                              <2> 	mov si, [bp + ?name]
   446                              <2> 	or byte [si], 80h
   447                              <2> 	not byte [bp + ?optionalmissing]
   448                              <2> 	jmp @F
   449                              <2> .optionaldatamissingmsg:
   450                              <2> %endif
   451                              <2> 	testopt [ss:relocateddata], 2	; debug optional link ?
   452                              <2> linkdatarelocation options7, -3
   453                              <2> 	jz @F				; no -->
   454                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   455                              <2> 	mov byte [bp + ?optionalmissing + 1], -1
   456                              <2> %endif
   457                              <2> 	mov si, lmsg.warning_data_optional
   458                              <2> internalcoderelocation
   459                              <2> 	call .notfound			; display a warning
   460                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   461                              <2> 	not byte [bp + ?optionalmissing + 1]
   462                              <2> %endif
   463                              <2> @@:
   464                              <2> %endif
   465                              <2> %if _ELDDATA_NEXT
   466                              <2> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   467                              <2> 	jnz .datarelocloop
   468                              <2> %endif
   469                              <2> 	call .address_data_reloc
   470                              <2> 	and word [si], 0		; indicate optional data link failed
   471                              <2> 	jmp .datarelocloop
   472                              <2> %endif
   473                              <2> 
   474                              <2> 
   475                              <2> %if _ELDCALL_OPTIONAL
   476                              <2> .codenotfound_may_be_optional:
   477                              <2> 	mov byte [si], dl		; restore the original byte at counter
   478                              <2> %if _ELDCALL_NEXT
   479                              <2> 	test byte [bp + ?optional], 3	; is it an optional relocation ?
   480                              <2> %else
   481                              <2> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   482                              <2> %endif
   483                              <2> %if _ELD_DEBUG
   484                              <2> 	jnz @F
   485                              <2>  %ifn _ELD_LINKER_PASSES
   486                              <2> 	mov si, 0			; (invalid link)
   487                              <2> linkdatarelocation internalflags6
   488                              <2> 	test si, si
   489                              <2> 	jz .codenotfound
   490                              <2> 	mov si, 0			; (invalid link)
   491                              <2> linkdatarelocation options7
   492                              <2> 	test si, si
   493                              <2> 	jz .codenotfound
   494                              <2>  %else
   495                              <2> 	cmp byte [bp + ?pass], 0
   496                              <2> 	je .codenotfound
   497                              <2>  %endif
   498                              <2> 	houdini				; (the above conditions are for this)
   499                              <2> 	jmp .codenotfound
   500                              <2> @@:
   501                              <2> %else
   502                              <2> 	jz .codenotfound		; no, handle as an error -->
   503                              <2> %endif
   504                              <2> 
   505                              <2> %if ELDCALL_PMREQUIRED_STATUS
   506                              <2>  %if _ELD_LINKER_PASSES
   507                              <2>   %assign ELDLINKER 0
   508                              <2>  %endif
   509                              <2> 	mov si, relocateddata
   510                              <2> linkdatarelocation build_option_PM
   511                              <2>  %if _ELD_LINKER_PASSES
   512                              <2>   %assign ELDLINKER 1
   513                              <2>  %endif
   514                              <2> 	test si, si			; is it a PM build ?
   515                              <2> 	jz @F				; no --> (treat PM required as optional)
   516                              <2> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   517                              <2> 	jnz .codenotfound		; yes, handle as an error -->
   518                              <2> @@:
   519                              <2> %endif
   520                              <2> 
   521                              <2> %if _ELD_LINKER_PASSES
   522                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   523                              <2> 	rol byte [bp + ?optionalmissing], 1
   524                              <2> 	jnc .optionalcodemissingmsg
   525                              <2> 	mov si, [bp + ?name]
   526                              <2> 	or byte [si], 80h
   527                              <2> 	not byte [bp + ?optionalmissing]
   528                              <2> 	jmp @F
   529                              <2> .optionalcodemissingmsg:
   530                              <2> %endif
   531                              <2> 	testopt [ss:relocateddata], 2	; debug optional link ?
   532                              <2> linkdatarelocation options7, -3
   533                              <2> 	jz @F				; no -->
   534                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   535                              <2> 	mov byte [bp + ?optionalmissing + 1], -1
   536                              <2> %endif
   537                              <2> 	mov si, lmsg.warning_code_optional
   538                              <2> internalcoderelocation
   539                              <2> 	call .notfound			; display a warning
   540                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   541                              <2> 	not byte [bp + ?optionalmissing + 1]
   542                              <2> %endif
   543                              <2> @@:
   544                              <2> %endif
   545                              <2> %if _ELDCALL_NEXT
   546                              <2> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   547                              <2> 	jnz .coderelocloop
   548                              <2> %endif
   549                              <2> 	lds si, [bp + ?entry]		; -> code site (must be in ELD cs)
   550                              <2> 	mov word [si], 9090h
   551                              <2> 	mov byte [si + 2], 90h		; indicate optional code link failed
   552                              <2> 					;  (NOP out the 3-byte call near imm)
   553                              <2> 	jmp .coderelocloop
   554                              <2> %endif
   555                              <2> 
   556                              <2> 
   557                              <2> %if _ELD_LINKER_PASSES
   558                              <2> .datanotfound:
   559 00000A21 BE[1D13]            <2> 	mov si, lmsg.error_data
   560                              <2> internalcoderelocation
   561 00000A24 E81900              <2> 	call .notfound			; display error
   562 00000A27 7306                <2> 	jnc .error_j3			; NC if in pass 0, error out now -->
   563 00000A29 FF46E8              <2> 	inc word [bp + ?amounterrors]	; count the amount of errors
   564 00000A2C E977FF              <2> 	jmp .datarelocloop		; go to next relocation entry -->
   565                              <2> 
   566                              <2> .error_j3:
   567 00000A2F E9A301              <2> 	jmp .error
   568                              <2> 
   569                              <2> .codenotfound:
   570 00000A32 BE[3613]            <2> 	mov si, lmsg.error_code
   571                              <2> internalcoderelocation
   572 00000A35 E80800              <2> 	call .notfound			; display error
   573 00000A38 73F5                <2> 	jnc .error_j3			; NC if in pass 0 -->
   574 00000A3A FF46E8              <2> 	inc word [bp + ?amounterrors]	; count the amount of errors
   575 00000A3D E98400              <2> 	jmp .coderelocloop		; go to next -->
   576                              <2> 
   577                              <2> .notfound:
   578 00000A40 807EEA00            <2> 	cmp byte [bp + ?pass], 0	; pass 0 ?
   579 00000A44 743A                <2> 	je .notfound.retn		; yes, do not try displaying --> (NC)
   580 00000A46 16                  <2> 	 push ss
   581 00000A47 07                  <2> 	 pop es
   582 00000A48 BF[0000]            <2> 	mov di, relocateddata
   583                              <2> linkdatarelocation line_out		; es:di -> line_out buffer
   584 00000A4B E83300              <2> 	call .copy			; copy prefix message
   585 00000A4E 8B76E6              <2> 	mov si, word [bp + ?name]
   586 00000A51 AD                  <2> 	lodsw				; = hash
   587 00000A52 E8[0000]EB020000    <2> 	extcall hexword			; display the hash in hex
   588 00000A59 56                  <2> 	push si
   589 00000A5A BE[4F13]            <2> 	mov si, lmsg.error.2
   590                              <2> internalcoderelocation
   591 00000A5D E82100              <2> 	call .copy			; display message fragment
   592 00000A60 5E                  <2> 	pop si
   593                              <2> %if _ELD_LINKER_PASSES
   594 00000A61 56                  <2> 	push si
   595 00000A62 E81C00              <2> 	call .copy			; copy over the full name
   596 00000A65 5E                  <2> 	pop si
   597                              <2>  %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   598                              <2> 	or byte [si], 80h		; mark as failed optional link
   599                              <2> 	rol byte [bp + ?optionalmissing + 1], 1
   600                              <2> 					; was it optional ?
   601                              <2> 	jc @F				; yes -->
   602                              <2>  %endif
   603 00000A66 C60400              <2> 	mov byte [si], 0		; mark as failed (counter byte = 0)
   604                              <2> @@:
   605                              <2> %else
   606                              <2> 	call .copy
   607                              <2> %endif
   608 00000A69 B022                <2> 	mov al, '"'
   609 00000A6B AA                  <2> 	stosb				; end message with a closing quote mark
   610 00000A6C 16                  <2> 	 push ss
   611 00000A6D 1F                  <2> 	 pop ds
   612 00000A6E E8[0000]EB020000    <2> 	extcall putsline_crlf		; display diagnostic line
   613 00000A75 B8350E              <2> 	mov ax, 0E35h
   614 00000A78 E8[0000]EB020000    <2> 	extcall setrc
   615 00000A7F F9                  <2> 	stc				; CY, diagnostic displayed
   616                              <2> .notfound.retn:
   617 00000A80 C3                  <2> 	retn
   618                              <2> 
   619                              <2> .copy:		; (cannot use extcallcall here)
   620 00000A81 E8[0000]EB020000    <2> 	extcall copy_single_counted_string
   621 00000A88 C3                  <2> 	retn
   622                              <2> %else
   623                              <2> .datanotfound: equ .error
   624                              <2> .codenotfound: equ .error
   625                              <2> %endif
   626                              <2> 
   627                              <2> .build_match:
   628                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   629                              <2> 	mov byte [bp + ?optionalmissing], 0
   630                              <2> 		; This is needed for eldtestj.asm with debugoptlink.
   631                              <2> 		;  The optional data link sets flag 80h, then the
   632                              <2> 		;  required data link to the same symbol sets this
   633                              <2> 		;  flag but doesn't reset it. So the first optional
   634                              <2> 		;  code link still had this set. Reset here to fix.
   635                              <2> %endif
   636                              <2> %if _ELD_CODE_VSTART
   637 00000A89 2D[0000]            <2> 	sub ax, code			; revert adjustment (= displacement)
   638                              <2> %endif
   639 00000A8C 0346FC              <2> 	add ax, word [bp + ?instance]	; make displacement into -> name string
   640 00000A8F 96                  <2> 	xchg si, ax			; si -> hash word, counted name string
   641                              <2> %if _ELD_LINKER_PASSES || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   642 00000A90 8976E6              <2> 	mov word [bp + ?name], si	; save away for diagnostics
   643                              <2> %endif
   644 00000A93 AD                  <2> 	lodsw			; = hash, si -> counted string
   645 00000A94 8A14                <2> 	mov dl, byte [si]	; dl = original start byte of match
   646                              <2> %if _ELD_LINKER_PASSES
   647 00000A96 84D2                <2> 	test dl, dl		; marked as already failed ?
   648                              <2> 				;  (80h = optional, 0 = required)
   649 00000A98 750A                <2> 	jnz @F			; no -->
   650 00000A9A 837EE800            <2> 	cmp word [bp + ?amounterrors], 0
   651                              <2> 				; validate error status
   652 00000A9E 7503E9A500          <2> 	je .error_j		; no error known ?! cancel quickly -->
   653 00000AA3 C3                  <2> 	retn			; (NC)
   654                              <2> 
   655                              <2> @@:
   656                              <2> %else
   657                              <2> 	test dl, dl
   658                              <2> %endif
   659                              <2> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   660                              <2> 	jns @F
   661                              <2> 	and dl, 7Fh
   662                              <2> 	mov byte [si], dl
   663                              <2> 	mov byte [bp + ?optionalmissing], -1
   664                              <2> @@:
   665                              <2> %endif
   666                              <2> %if ELDOTHER
   667                              <2> 	rol byte [bp + ?other], 1
   668                              <2> 	jnc @F
   669                              <2> 	rol byte [bp + ?use_hash_other], 1
   670                              <2> 	jmp @FF
   671                              <2> 
   672                              <2> @@:
   673                              <2> %endif
   674 00000AA4 D046EC              <2> 	rol byte [bp + ?use_hash], 1
   675                              <2> @@:
   676                              <2> 		; If to use the hash, then ax = hash and si ->
   677                              <2> 		;  the entire symbol name as a counted string.
   678 00000AA7 720A                <2> 	jc @F			; if to use hash, return now -->
   679 00000AA9 AC                  <2> 	lodsb			; al = length
   680 00000AAA 91                  <2> 	xchg cx, ax		; cl = length
   681 00000AAB AD                  <2> 	lodsw			; ax = prefix
   682 00000AAC 49                  <2> 	dec cx
   683 00000AAD 49                  <2> 	dec cx			; cl = adjusted length
   684 00000AAE 4E                  <2> 	dec si			; -> second byte of prefix
   685 00000AAF 8A14                <2> 	mov dl, byte [si]	; dl = original start byte of match
   686 00000AB1 880C                <2> 	mov byte [si], cl	; si -> counted string suffix
   687                              <2> 		; (this name entry has been edited to provide the
   688                              <2> 		;  name suffix as a counted string, as required by
   689                              <2> 		;  the old-style non-hash link info tables.
   690                              <2> 		; it will be reset later by writing dl to si -> the
   691                              <2> 		;  first byte of the match string.)
   692                              <2> @@:
   693                              <2> %if _ELD_LINKER_PASSES
   694 00000AB3 F9                  <2> 	stc			; CY
   695                              <2> %endif
   696 00000AB4 C3                  <2> 	retn
   697                              <2> 
   698                              <2> 
   699                              <2> .donedatareloc:
   700                              <2> %if ELDOTHER
   701                              <2> 	rol byte [bp + ?other], 1
   702                              <2> 	jc .otherdone		; other link only has data links,
   703                              <2> 				;  so at this point we're done -->
   704                              <2> %endif
   705                              <2> 
   706 00000AB5 8B56FC              <2> 	mov dx, word [bp + ?instance]
   707                              <2> %if _ELD_LINKER_PASSES
   708 00000AB8 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   709 00000ABB 01D3                <2> 	add bx, dx
   710                              <2>  %if _ELD_IDENTICALISE
   711                              <2> 	add bx, word [bp + ?lt]
   712                              <2> 	add dx, word [ltLinkCode + bx]
   713                              <2>  %else
   714 00000ABD 0397BC0C            <2> 	add dx, word [linktable - code + ltLinkCode + bx]
   715                              <2>  %endif
   716                              <2> %else
   717                              <2> 	add dx, linkercoderelocations - code
   718                              <2> %endif
   719 00000AC1 8956F2              <2> 	mov word [bp + ?nextreloc], dx
   720                              <2> 
   721                              <2> .coderelocloop:
   722 00000AC4 C576F2              <2> 	lds si, [bp + ?nextreloc]
   723 00000AC7 AD                  <2> 	lodsw
   724                              <2> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
   725                              <2> 	dec ax				; optional word is 1-based, get 0-based
   726                              <2> 	js .donecodereloc
   727                              <2> 	mov word [bp + ?targetsection_low_optional_high], ax
   728                              <2> 	lodsw
   729                              <2> %endif
   730 00000AC8 0346FC              <2> 	add ax, word [bp + ?instance]
   731 00000ACB 8946EE              <2> 	mov word [bp + ?entry], ax
   732 00000ACE AD                  <2> 	lodsw
   733 00000ACF 8976F2              <2> 	mov word [bp + ?nextreloc], si
   734                              <2> %ifn _ELDCALL_OPTIONAL || _ELDCALL_NEXT
   735 00000AD2 85C0                <2> 	test ax, ax			; if no optional word, check -> match
   736 00000AD4 7503E98100          <2> 	jz .donecodereloc
   737                              <2> %endif
   738                              <2> %if _ELDCALL_NEXT
   739                              <2> 	rol byte [bp + ?skip_last], 1	; skipping ?
   740                              <2> 	jnc @F				; no -->
   741                              <2> 	test byte [bp + ?optional], 8	; is it a last relocation ?
   742                              <2> 	jz .coderelocloop		; no, leave skip_last set -->
   743                              <2> 	not byte [bp + ?skip_last]	; disable skip_last
   744                              <2> 	jmp .coderelocloop
   745                              <2> @@:
   746                              <2> %endif
   747 00000AD9 E8ADFF              <2> 	call .build_match
   748                              <2> %if _ELD_LINKER_PASSES
   749 00000ADC 73E6                <2> 	jnc .coderelocloop
   750                              <2> %endif
   751 00000ADE C45EF6              <2> 	les bx, [bp + ?linkinfo]
   752 00000AE1 268B4F10            <2> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   753 00000AE5 268B7F12            <2> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   754                              <2> .coderelocfind:
   755 00000AE9 83F901              <2> 	cmp cx, 1			; NZ if cx == 0
   756 00000AEC F2AF                <2> 	repne scasw			; scan initial
   757                              <2> %if _ELDCALL_OPTIONAL
   758                              <2> 	jne .codenotfound_may_be_optional
   759                              <2> %else
   760                              <2>  %if _ELD_DEBUG
   761                              <2> 	je @F
   762                              <2> 	houdini
   763                              <2> 	jmp .codenotfound
   764                              <2> @@:
   765                              <2>  %else
   766 00000AEE 7403E93FFF          <2> 	jne .codenotfound
   767                              <2>  %endif
   768                              <2> %endif
   769 00000AF3 57                  <2> 	push di
   770 00000AF4 51                  <2> 	push cx
   771 00000AF5 56                  <2> 	push si
   772 00000AF6 262B7F12            <2> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   773 00000AFA 4F                  <2> 	dec di
   774 00000AFB 4F                  <2> 	dec di				; 0-based
   775 00000AFC 26037F14            <2> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   776 00000B00 268B3D              <2> 	mov di, [es:di]			; -> counted suffix/string
   777 00000B03 B500                <2> 	mov ch, 0
   778 00000B05 8A0C                <2> 	mov cl, byte [si]		; cx = length
   779 00000B07 41                  <2> 	inc cx
   780                              <2> 	; cmp al, al			; ZR if length is zero
   781 00000B08 F3A6                <2> 	repe cmpsb			; match ?
   782 00000B0A 5E                  <2> 	pop si
   783 00000B0B 59                  <2> 	pop cx
   784 00000B0C 5F                  <2> 	pop di
   785 00000B0D 75DA                <2> 	jne .coderelocfind
   786 00000B0F 8814                <2> 	mov byte [si], dl
   787 00000B11 262B7F12            <2> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   788 00000B15 4F                  <2> 	dec di
   789 00000B16 4F                  <2> 	dec di				; 0-based
   790 00000B17 01FF                <2> 	add di, di			; quadruple index
   791 00000B19 26037F16            <2> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   792 00000B1D 26FF35              <2> 	push word [es:di]
   793 00000B20 C576EE              <2> 	lds si, [bp + ?entry]
   794 00000B23 8F4405              <2> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   795                              <2> 					;  patch the destination address
   796 00000B26 803CE8              <2> 	cmp byte [si], 0E8h		; is it as expected ?
   797 00000B29 751D                <2> 	jne .error_j
   798 00000B2B 268B7D02            <2> 	mov di, word [es:di + 2]
   799 00000B2F BB[0000]            <2> 	mov bx, relocateddata
   800                              <2> linkdatarelocation linkcall_table	; ss:bx -> link call table
   801 00000B32 36833F01            <2> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   802 00000B36 7510                <2> 	jne .error_j			; no -->
   803 00000B38 368B4F02            <2> 	mov cx, word [ss:bx + 2]	; get amount of segments
   804 00000B3C E30A                <2> 	jcxz .error_j			; none -->
   805                              <2> @@:
   806 00000B3E 83C304              <2> 	add bx, 4			; -> next segment
   807 00000B41 36393F              <2> 	cmp word [ss:bx], di		; value matches ?
   808 00000B44 7405                <2> 	je @F				; yes, found -->
   809 00000B46 E2F6                <2> 	loop @B				; try remaining segments
   810                              <2> .error_j:
   811 00000B48 E98A00              <2> 	jmp .error
   812                              <2> 
   813                              <2> @@:
   814 00000B4B 368B5F02            <2> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   815                              <2> 		; si + 3 + delta = bx
   816                              <2> 		; delta = bx - si - 3
   817 00000B4F 29F3                <2> 	sub bx, si
   818 00000B51 83EB03              <2> 	sub bx, 3
   819 00000B54 895C01              <2> 	mov word [si + 1], bx		; patch the call instruction
   820                              <2> %if _ELDCALL_NEXT
   821                              <2> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   822                              <2> 	jz .coderelocloop
   823                              <2> 	mov byte [bp + ?skip_last], -1	; skip subsequent next/last relocs
   824                              <2> %endif
   825 00000B57 E96AFF              <2> 	jmp .coderelocloop
   826                              <2> 
   827                              <2> .donecodereloc:
   828                              <2> %if _ELD_LINKER_PASSES
   829 00000B5A 8B46E8              <2> 	mov ax, word [bp + ?amounterrors]
   830 00000B5D 85C0                <2> 	test ax, ax
   831 00000B5F 75E7                <2> 	jnz .error_j
   832 00000B61 8B5EEA              <2> 	mov bx, word [bp + ?pass]
   833 00000B64 85DB                <2> 	test bx, bx
   834 00000B66 750B                <2> 	jnz @F
   835 00000B68 43                  <2> 	inc bx
   836 00000B69 43                  <2> 	inc bx
   837 00000B6A 895EEA              <2> 	mov word [bp + ?pass], bx
   838 00000B6D 8B56FC              <2> 	mov dx, word [bp + ?instance]
   839 00000B70 E9AFFD              <2> 	jmp .pass
   840                              <2> 
   841                              <2> @@:
   842                              <2> %endif
   843                              <2> 
   844                              <2> %ifnidni _LISTING, ""
   845                              <2> %assign ELDLINKER 0
   846                              <2> .hint:
   847 00000B73 16                  <2> 	push ss
   848 00000B74 1F                  <2> 	pop ds
   849 00000B75 B02D                <2> 	mov al, 2Dh
   850 00000B77 E8[0000]EB020000    <2> 	extcall intchk			; ZR if offset = -1 or segment = 0
   851                              <2> 					; CHG: ax, dx, bx
   852 00000B7E 7437                <2> 	jz .no_hint
   853                              <2> 
   854                              <2> %if ELDOTHER
   855                              <2> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   856                              <2> internalcoderelocation
   857                              <2> %endif
   858                              <2> 
   859 00000B80 8A26[0000]          <2> 	mov ah, byte [relocateddata]
   860                              <2> linkdatarelocation try_debugger_amis_multiplex_number
   861 00000B84 E85500              <2> 	call plex_check
   862 00000B87 7305                <2> 	jnc @F
   863                              <2> 
   864 00000B89 B4FF                <2> 	mov ah, 0FFh		; start with multiplex number 0FFh
   865                              <2> .loop_hint:
   866 00000B8B E84E00              <2> 	call plex_check
   867                              <2> @@:
   868 00000B8E 7307                <2> 	jnc .end_hint		; if found --> (NC)
   869 00000B90 80EC01              <2> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   870 00000B93 73F6                <2> 	jnc .loop_hint		; try next if we didn't check all yet -->
   871 00000B95 EB20                <2> 	jmp .no_hint
   872                              <2> 
   873                              <2> .end_hint:
   874 00000B97 50                  <2> 	push ax
   875 00000B98 C446FC              <2> 	les ax, [bp + ?instance]
   876 00000B9B BF[950F]            <2> 	mov di, listmsg.hint.offset
   877                              <2> internalcoderelocation
   878 00000B9E E8[0000]EB020000    <2> 	extcall hexword
   879 00000BA5 BB[740F]            <2> 	mov bx, listmsg.hint
   880                              <2> internalcoderelocation
   881 00000BA8 368B16[0000]        <2> 	mov dx, [ss:relocateddata]
   882                              <2> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   883 00000BAD 58                  <2> 	pop ax
   884 00000BAE B040                <2> 	mov al, 40h		; AMIS message display service
   885 00000BB0 E8[0000]EB020000    <2> 	extcall call_int2D
   886                              <2> .no_hint:
   887                              <2> %endif
   888                              <2> 
   889                              <2> %if ELDOTHER
   890                              <2> %assign ELDLINKER 0
   891                              <2> 	not byte [bp + ?other]
   892                              <2> 
   893                              <2> 	push ss
   894                              <2> 	pop ds
   895                              <2> 	mov al, 2Dh
   896                              <2> 	extcall intchk			; ZR if offset = -1 or segment = 0
   897                              <2> 					; CHG: ax, dx, bx
   898                              <2> 	jz .no_other
   899                              <2> 
   900                              <2> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   901                              <2> internalcoderelocation
   902                              <2> 
   903                              <2> 	mov ah, byte [relocateddata]
   904                              <2> linkdatarelocation try_debugger_amis_multiplex_number
   905                              <2> 	call plex_check
   906                              <2> 	jnc @F
   907                              <2> 
   908                              <2> 	mov ah, 0FFh		; start with multiplex number 0FFh
   909                              <2> .loop_other_debug:
   910                              <2> 	call plex_check
   911                              <2> @@:
   912                              <2> 	jnc .end_other		; if found --> (NC)
   913                              <2> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   914                              <2> 	jnc .loop_other_debug	; try next if we didn't check all yet -->
   915                              <2> 
   916                              <2> 	mov si, loaderamissig	; ds:si -> our AMIS name strings
   917                              <2> internalcoderelocation
   918                              <2> 
   919                              <2> 	mov ah, byte [relocateddata]
   920                              <2> linkdatarelocation try_debugger_amis_multiplex_number
   921                              <2> 	call plex_check
   922                              <2> 	jnc @F
   923                              <2> 
   924                              <2> 	mov ah, 0FFh		; start with multiplex number 0FFh
   925                              <2> .loop_other_loader:
   926                              <2> 	call plex_check
   927                              <2> @@:
   928                              <2> 	jnc .end_other		; if found --> (NC)
   929                              <2> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   930                              <2> 	jnc .loop_other_loader	; try next if we didn't check all yet -->
   931                              <2> 
   932                              <2> 	jmp .no_other
   933                              <2> 
   934                              <2> .end_other:
   935                              <2> 	mov al, 42h		; AMIS get other link info service
   936                              <2> 	extcall call_int2D
   937                              <2> 	cmp al, 0FFh
   938                              <2> 	jne .no_other
   939                              <2> 
   940                              <2> 	mov ax, si		; selector => PSP
   941                              <2> 	extcall ispm
   942                              <2> 	jz @F
   943                              <2> 	mov ax, dx		; segment => PSP
   944                              <2> @@:
   945                              <2> 	 push ss
   946                              <2> 	 pop ds
   947                              <2> 	mov word [otherds], ax
   948                              <2> internaldatarelocation		; current mode sel/seg
   949                              <2> 	mov word [otherseg], dx
   950                              <2> internaldatarelocation		; remember segment
   951                              <2> 
   952                              <2> 	mov ax, cx		; selector => link info
   953                              <2> 	extcall ispm
   954                              <2> 	jz @F
   955                              <2> 	mov ax, bx		; segment => link info
   956                              <2> @@:
   957                              <2> 	mov word [bp + ?linkinfo_other], di
   958                              <2> 	mov word [bp + ?linkinfo_other + 2], ax
   959                              <2> 
   960                              <2> 	mov ds, ax		; => link info
   961                              <2> 	xor ax, ax
   962                              <2> 	cmp word [di + eldlSignature], 0E1D1h
   963                              <2> 	jne .error_other
   964                              <2> 	cmp word [di + eldlUseLinkHash], 1
   965                              <2> 	ja .error_other
   966                              <2> 	jb @F
   967                              <2> 	dec ax
   968                              <2> @@:
   969                              <2> 	mov word [bp + ?use_hash_other], ax
   970                              <2> 
   971                              <2> 	mov dx, word [bp + ?instance]
   972                              <2> 	add dx, linkerotherdatarelocations - code
   973                              <2> 	jmp .otherloop
   974                              <2> 
   975                              <2> .error_other:
   976                              <2> 	push cs
   977                              <2> 	pop ds
   978                              <2> 	mov ax, 0E33h
   979                              <2> 	extcall setrc
   980                              <2> 	mov dx, lmsg.error_other
   981                              <2> internalcoderelocation
   982                              <2> 	jmp @F
   983                              <2> 
   984                              <2> .no_other:
   985                              <2> 	push cs
   986                              <2> 	pop ds
   987                              <2> 	mov ax, 0E34h
   988                              <2> 	extcall setrc
   989                              <2> 	mov dx, lmsg.no_other
   990                              <2> internalcoderelocation
   991                              <2> @@:
   992                              <2> 	extcall putsz
   993                              <2> .error_j2:
   994                              <2> 	jmp .error
   995                              <2> 
   996                              <2> .otherdone:
   997                              <2>  %if _ELD_LINKER_PASSES
   998                              <2> 	mov ax, word [bp + ?amounterrors]
   999                              <2> 	test ax, ax
  1000                              <2> 	jnz .error_j2
  1001                              <2>  %endif
  1002                              <2> %endif
  1003                              <2> 
  1004 00000BB7 5B                  <2> 	pop bx				; -> our heap data
  1005 00000BB8 5E                  <2> 	pop si				; -> our command line tail
  1006 00000BB9 16                  <2> 	 push ss
  1007 00000BBA 1F                  <2> 	 pop ds
  1008 00000BBB C47EFC              <2> 	les di, [bp + ?instance]
  1009 00000BBE 268B4502            <2> 	mov ax, word [es:di + eldiEndCode]
  1010                              <2> houdini
  1011 00000BC2 2D[0009]            <2> 	sub ax, strict word endresident + code
  1012                              <2> internalcoderelocation
  1013 00000BC5 26C74502[0009]      <2> 	mov word [es:di + eldiEndCode], endresident + code
  1014                              <2> internalcoderelocation
  1015 00000BCB 2906[0000]          <2> 	sub word [relocateddata], ax
  1016                              <2> linkdatarelocation extseg_used
  1017                              <2> %if _DATA_SIZE == 0
  1018                              <2> 	xor ax, ax
  1019                              <2> 	mov word [es:di + eldiStartData], ax
  1020                              <2> 	mov word [es:di + eldiEndData], ax
  1021                              <2> %endif
  1022 00000BCF 89EC5D              <2> 	lleave code
  1023                              <2> 		; INP:	es => ELD code segment
  1024                              <2> 		;	ds:si -> command line tail
  1025                              <2> 		;	ds:bx -> ELD data block
  1026                              <2> 		;	ss:sp -> far return address for current mode
  1027                              <2> 		; STT:	ds = ss, UP, EI
  1028 00000BD2 E930FC              <2> 	jmp start
  1029                              <2> 
  1030                              <2> .error:
  1031 00000BD5 89EC5D              <2> 	lleave
  1032 00000BD8 B8FFFF              <2> 	mov ax, -1
  1033 00000BDB CB                  <2> 	retf
  1034                              <2> 
  1035                              <2> 
  1036                              <2> %ifnidni _LISTING, ""
  1037                              <2>  %assign ELDHINT 1
  1038                              <2> %else
  1039                              <2>  %assign ELDHINT 0
  1040                              <2> %endif
  1041                              <2> 
  1042                              <2> %if ELDOTHER || ELDHINT
  1043                              <2> 		; INP:	ah = multiplex number to check
  1044                              <2> 		;	(if ELDOTHER:)
  1045                              <2> 		;	 cs:si -> 16-byte AMIS signature to check
  1046                              <2> 		; OUT:	CY if multiplex number unused or no signature match,
  1047                              <2> 		;	 bp, ah, ds unmodified
  1048                              <2> 		;	NC if match found,
  1049                              <2> 		;	 ah = multiplex number (unmodified)
  1050                              <2> 		; CHG:	di, es, cx, dx
  1051                              <2> 		;	(if ELDOTHER:) bx
  1052                              <2> 		;	(if not ELDOTHER:) si
  1053                              <2> plex_check:
  1054 00000BDC 16                  <2> 	push ss
  1055 00000BDD 1F                  <2> 	pop ds
  1056 00000BDE F606[0000]08        <2> 	testopt [relocateddata], 8
  1057                              <2> linkdatarelocation internalflags4, -3
  1058 00000BE3 740B                <2> 	jz @F
  1059                              <2> %if ELDOTHER
  1060                              <2> 	mov bx, relocateddata
  1061                              <2> linkdatarelocation amis_multiplex_number, -2, optional
  1062                              <2> 	test bx, bx
  1063                              <2> 	jz @F
  1064                              <2> 	cmp ah, byte [bx]
  1065                              <2> 	je .notfound		; do not use our own multiplexer -->
  1066                              <2> %else
  1067 00000BE5 BE[0000]            <2> 	mov si, relocateddata
  1068                              <2> linkdatarelocation amis_multiplex_number, -2, optional
  1069 00000BE8 85F6                <2> 	test si, si
  1070 00000BEA 7404                <2> 	jz @F
  1071 00000BEC 3A24                <2> 	cmp ah, byte [si]
  1072 00000BEE 7420                <2> 	je .notfound		; do not use our own multiplexer -->
  1073                              <2> %endif
  1074                              <2> @@:
  1075 00000BF0 B000                <2> 	mov al, 00h		; AMIS installation check
  1076 00000BF2 E8[0000]EB020000    <2> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
  1077 00000BF9 3CFF                <2> 	cmp al, 0FFh
  1078 00000BFB 7513                <2> 	jne .notfound
  1079 00000BFD 0E                  <2> 	push cs
  1080 00000BFE 1F                  <2> 	pop ds
  1081                              <2> %if ELDOTHER
  1082                              <2> 	push si
  1083                              <2> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
  1084                              <2> 	mov cx, 8		; Ignore description, only compare vendor and program name
  1085                              <2> 	repe cmpsw
  1086                              <2> 	pop si
  1087                              <2> %else
  1088 00000BFF BE[640F]            <2> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
  1089                              <2> internalcoderelocation
  1090 00000C02 E8[0000]EB020000    <2> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
  1091 00000C09 B90800              <2> 	mov cx, 8		; Ignore description, only compare vendor and program name
  1092 00000C0C F3A7                <2> 	repe cmpsw
  1093                              <2> %endif
  1094 00000C0E 7401                <2> 	je .checkret		; ZR, NC = match -->
  1095                              <2> .notfound:
  1096 00000C10 F9                  <2> 	stc			; CY no match
  1097                              <2> .checkret:
  1098 00000C11 C3                  <2> 	retn
  1099                              <2> %endif
  1100                              <2> 
  1101                              <2> 
  1102 00000C12 00<rep 2h>          <2> 	align 4, db 0
  1103                              <2> linkercoderelocations:
  1104                              <2> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
  1105                              <2> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
  1106                              <2> %else
  1107 00000C14 BD00[9D0F]F600-     <2> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
  1107 00000C1A [B40F]1C01[9D0F]64- <2>
  1107 00000C21 02[C30F]4808[DE0F]- <2>
  1107 00000C28 5008[F40F]5808-     <2>
  1107 00000C2E [0810]6008[1810]68- <2>
  1107 00000C35 08[2410]7008[2F10]- <2>
  1107 00000C3C 7808[3610]8008-     <2>
  1107 00000C42 [3E10]8808[4610]90- <2>
  1107 00000C49 08[6310]9808[8C10]- <2>
  1107 00000C50 A008[A110]A808-     <2>
  1107 00000C56 [AC10]B008[BC10]B8- <2>
  1107 00000C5D 08[C810]C008[D110]- <2>
  1107 00000C64 C808[DD10]D008-     <2>
  1107 00000C6A [E510]D808[EE10]E0- <2>
  1107 00000C71 08[F810]E808[0211]- <2>
  1107 00000C78 F008[0911]770B-     <2>
  1107 00000C7E [1511]9E0B[EE10]B0- <2>
  1107 00000C85 0B[1E11]F20B[1E11]- <2>
  1107 00000C8C 020C[2B11]00000000  <2>
  1108                              <2> %endif
  1109                              <2> 
  1110                              <2> %if _ELD_LINKER_PASSES
  1111                              <2> linkerlinkercoderelocations:
  1112                              <2> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
  1113                              <2> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
  1114                              <2> %else
  1115 00000C94 520A[EE10]6E0A-     <2> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
  1115 00000C9A [AC10]780A[3610]81- <2>
  1115 00000CA1 0A[4610]00000000    <2>
  1116                              <2> %endif
  1117                              <2> 
  1118                              <2> 	align 2, db 0
  1119                              <2> linktable:
  1120                              <2> 	istruc LINKTABLE
  1121                              <2> at ltCodeToCode
  1122 00000CA8 560F                <2> 	dw internallinkercodetocoderelocations - code
  1123 00000CAA 000E                <2> 	dw internalcodetocoderelocations - code
  1124                              <2> at ltCodeToData
  1125 00000CAC 5E0F                <2> 	dw internallinkercodetodatarelocations - code
  1126 00000CAE 200E                <2> 	dw internalcodetodatarelocations - code
  1127                              <2> at ltDataToCode
  1128 00000CB0 600F                <2> 	dw internallinkerdatatocoderelocations - code
  1129 00000CB2 400F                <2> 	dw internaldatatocoderelocations - code
  1130                              <2> at ltDataToData
  1131 00000CB4 620F                <2> 	dw internallinkerdatatodatarelocations - code
  1132 00000CB6 460F                <2> 	dw internaldatatodatarelocations - code
  1133                              <2> at ltLinkData
  1134 00000CB8 480F                <2> 	dw linkerlinkerdatarelocations - code
  1135 00000CBA C00C                <2> 	dw linkerdatarelocations - code
  1136                              <2> at ltLinkCode
  1137 00000CBC 940C                <2> 	dw linkerlinkercoderelocations - code
  1138 00000CBE 140C                <2> 	dw linkercoderelocations - code
  1139                              <2> 	iend
  1140                              <2> %endif
  1141                              <2> 
  1142                              <2> 	align 2, db 0
  1143                              <2> linkerdatarelocations:
  1144 00000CC0 01002400[3611]0100- <2> 	dw LINK_DATA_RELOCATIONS, 0
  1144 00000CC8 5E00[4611]01006200- <2>
  1144 00000CD0 [5511]01006600-     <2>
  1144 00000CD6 [6411]01008200-     <2>
  1144 00000CDC [5511]01009400-     <2>
  1144 00000CE2 [7B11]0100AB00-     <2>
  1144 00000CE8 [8E11]0100B000-     <2>
  1144 00000CEE [A411]0100CF00-     <2>
  1144 00000CF4 [8E11]0100D400-     <2>
  1144 00000CFA [B811]0100EE00-     <2>
  1144 00000D00 [CB11]0100F200-     <2>
  1144 00000D06 [DE11]0100F400-     <2>
  1144 00000D0C [FA11]01000401-     <2>
  1144 00000D12 [8E11]01001001-     <2>
  1144 00000D18 [8E11]01001501-     <2>
  1144 00000D1E [B811]01003001-     <2>
  1144 00000D24 [8E11]01003501-     <2>
  1144 00000D2A [B811]01005601-     <2>
  1144 00000D30 [0312]01005801-     <2>
  1144 00000D36 [1B12]01006001-     <2>
  1144 00000D3C [2C12]01006601-     <2>
  1144 00000D42 [0312]01006801-     <2>
  1144 00000D48 [4812]01006C01-     <2>
  1144 00000D4E [6212]0100A201-     <2>
  1144 00000D54 [6212]0100CA01-     <2>
  1144 00000D5A [CB11]01002102-     <2>
  1144 00000D60 [CB11]01002702-     <2>
  1144 00000D66 [CB11]01002D02-     <2>
  1144 00000D6C [CB11]01003302-     <2>
  1144 00000D72 [CB11]01003902-     <2>
  1144 00000D78 [CB11]01004702-     <2>
  1144 00000D7E [CB11]01002D04-     <2>
  1144 00000D84 [7512]0100A304-     <2>
  1144 00000D8A [8012]01004605-     <2>
  1144 00000D90 [7512]01007405-     <2>
  1144 00000D96 [7512]01006907-     <2>
  1144 00000D9C [7512]01008007-     <2>
  1144 00000DA2 [4611]01008407-     <2>
  1144 00000DA8 [5511]01008807-     <2>
  1144 00000DAE [6411]0100AA07-     <2>
  1144 00000DB4 [7B11]0100C507-     <2>
  1144 00000DBA [8012]0100F907-     <2>
  1144 00000DC0 [9112]01000208-     <2>
  1144 00000DC6 [9C12]01002508-     <2>
  1144 00000DCC [A512]01003508-     <2>
  1144 00000DD2 [B012]01004208-     <2>
  1144 00000DD8 [5511]02000200-     <2>
  1144 00000DDE [7512]0100820B-     <2>
  1144 00000DE4 [CF12]0100AB0B-     <2>
  1144 00000DEA [9C12]0100CD0B-     <2>
  1144 00000DF0 [B012]0100E00B-     <2>
  1144 00000DF6 [F412]0101E60B-     <2>
  1144 00000DFC [0513]0000          <2>
  1145                              <2> 
  1146                              <2> 	align 2, db 0
  1147                              <2> internalcodetocoderelocations:
  1148 00000E00 7E00860062016F02AD- <2> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
  1148 00000E09 043D072C0831083908- <2>
  1148 00000E12 3E089C0BA60BC30BC9- <2>
  1148 00000E1B 0B000C0000          <2>
  1149                              <2> 
  1150                              <2> 	align 2, db 0
  1151                              <2> internalcodetodatarelocations:
  1152 00000E20 3400410059008B0098- <2> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
  1152 00000E29 009C00A000A400A700- <2>
  1152 00000E32 4D01D20124022A0230- <2>
  1152 00000E3B 0236023C0241024402- <2>
  1152 00000E44 57025B026D0279029C- <2>
  1152 00000E4D 02A902B202BB02BF02- <2>
  1152 00000E56 C502D002D502E402E9- <2>
  1152 00000E5F 02F202FB0200030903- <2>
  1152 00000E68 12031D033A03470356- <2>
  1152 00000E71 035E036F0373037703- <2>
  1152 00000E7A 820387038C03910398- <2>
  1152 00000E83 039D03A103AB03B203- <2>
  1152 00000E8C C003C603CC03D203DB- <2>
  1152 00000E95 03EA03F203FA030304- <2>
  1152 00000E9E 2A0432043604410449- <2>
  1152 00000EA7 044D04530459047704- <2>
  1152 00000EB0 8D0499049C04AB04B8- <2>
  1152 00000EB9 04BE04C804CC04D404- <2>
  1152 00000EC2 D704DA04DD04E104E8- <2>
  1152 00000ECB 04EF04F304F7040405- <2>
  1152 00000ED4 0C0521052F05350539- <2>
  1152 00000EDD 053D054A0554056E05- <2>
  1152 00000EE6 A705DB05E405EA05F0- <2>
  1152 00000EEF 05F405F70507060B06- <2>
  1152 00000EF8 760683068906C106C7- <2>
  1152 00000F01 06CC06D106D706DC06- <2>
  1152 00000F0A E206E706F006F606FF- <2>
  1152 00000F13 0605070E0714071D07- <2>
  1152 00000F1C 23072C0732073B0743- <2>
  1152 00000F25 076C077A078E079A07- <2>
  1152 00000F2E A007A707B807C107CB- <2>
  1152 00000F37 07DF07ED071B080000  <2>
  1153                              <2> 
  1154                              <2> 	align 2, db 0
  1155                              <2> internaldatatocoderelocations:
  1156 00000F40 00000600FFFF        <2> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
  1157                              <2> 
  1158                              <2> 	align 2, db 0
  1159                              <2> internaldatatodatarelocations:
  1160 00000F46 FFFF                <2> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
  1161                              <2> 
  1162                              <2> %if _ELD_LINKER_PASSES
  1163                              <2> 	align 2, db 0
  1164                              <2> linkerlinkerdatarelocations:
  1165 00000F48 0100490A[7512]0100- <2> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
  1165 00000F50 300B[BE12]0000      <2>
  1166                              <2> 
  1167                              <2> 	align 2, db 0
  1168                              <2> internallinkercodetocoderelocations:
  1169 00000F56 220A330A5B0A0000    <2> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
  1170                              <2> 
  1171                              <2> 	align 2, db 0
  1172                              <2> internallinkercodetodatarelocations:
  1173 00000F5E 0000                <2> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
  1174                              <2> 
  1175                              <2> 	align 2, db 0
  1176                              <2> internallinkerdatatocoderelocations:
  1177 00000F60 FFFF                <2> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
  1178                              <2> 
  1179                              <2> 	align 2, db 0
  1180                              <2> internallinkerdatatodatarelocations:
  1181 00000F62 FFFF                <2> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
  1182                              <2> %endif
  1183                              <2> 
  1184                              <2> %if ELDOTHER
  1185                              <2> 	align 2, db 0
  1186                              <2> linkerotherdatarelocations:
  1187                              <2> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
  1188                              <2> 
  1189                              <2>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
  1190                              <2>   %error Other linker data links not supported
  1191                              <2>  %endif
  1192                              <2> %endif
  1193                              <2> 
  1194                              <2> %if ELDOTHER || ELDHINT
  1195                              <2> 	align 2, db 0
  1196                              <2> debuggeramissig:
  1197 00000F64 65636D20<rep 5h>    <2> 		fill 8, 32, db "ecm"
  1198 00000F6C 6C446562756720-     <2> 		fill 8, 32, db "lDebug"
  1198 00000F6C <rep 2h>            <2>
  1199                              <2> %endif
  1200                              <2> 
  1201                              <2> %if ELDOTHER
  1202                              <2> 	align 2, db 0
  1203                              <2> loaderamissig:
  1204                              <2> 		fill 8, 32, db "ecm"
  1205                              <2> 		fill 8, 32, db "Loader"
  1206                              <2> %endif
  1207                              <2> 
  1208                              <2> %ifnidni _LISTING, ""
  1209                              <2> listmsg:
  1210 00000F74 547261634C6973742D- <2> .hint:		db "TracList-add-offset=",_LISTING,"::"
  1210 00000F7D 6164642D6F66667365- <2>
  1210 00000F86 743D626F6F74646972- <2>
  1210 00000F8F 2E6C73743A3A        <2>
  1211 00000F95 2D2D2D2D680D0A00    <2> .hint.offset:	asciz "----h",13,10
  1212                              <2> %endif
  1213                              <2> 
  1214 00000F9D 1527142E2E4079795F- <2> 	eldcall_dump_names ELDCALL_CODE_NAMES
  1214 00000FA6 66696C656E616D655F- <2>
  1214 00000FAF 656D707479D1C60C73- <2>
  1214 00000FB8 63616E5F6469725F61- <2>
  1214 00000FC1 75784C04186E656172- <2>
  1214 00000FCA 5F7472616E73666572- <2>
  1214 00000FD3 5F6578745F72657475- <2>
  1214 00000FDC 726E4C4E1379795F62- <2>
  1214 00000FE5 6F6F745F7061727365- <2>
  1214 00000FEE 5F6E616D653225D711- <2>
  1214 00000FF7 79795F626F6F745F69- <2>
  1214 00001000 6E69745F6469723220- <2>
  1214 00001009 660D626F6F745F7061- <2>
  1214 00001012 7273655F666EF12309- <2>
  1214 0000101B 757070657263617365- <2>
  1214 00001024 67B1087472696D7075- <2>
  1214 0000102D 7473BABD04636D6433- <2>
  1214 00001036 B21205736574726355- <2>
  1214 0000103F 1205707574737AD0BB- <2>
  1214 00001048 1A636F70795F73696E- <2>
  1214 00001051 676C655F636F756E74- <2>
  1214 0000105A 65645F737472696E67- <2>
  1214 00001063 ABFF26646973705F64- <2>
  1214 0000106C 7861785F74696D6573- <2>
  1214 00001075 5F63785F7769647468- <2>
  1214 0000107E 5F62785F73697A652E- <2>
  1214 00001087 73746F726503AA1264- <2>
  1214 00001090 65635F64776F72645F- <2>
  1214 00001099 6D696E776964746839- <2>
  1214 000010A2 8C08707574736C696E- <2>
  1214 000010AB 656FA20D707574736C- <2>
  1214 000010B4 696E655F63726C66A4- <2>
  1214 000010BD 5509736B6970636F6D- <2>
  1214 000010C6 6D30E83A066973656F- <2>
  1214 000010CF 6C3F03C30969737374- <2>
  1214 000010D8 72696E673FA7AA0565- <2>
  1214 000010E1 72726F72DDB9066368- <2>
  1214 000010EA 6B656F6C8481076865- <2>
  1214 000010F3 78776F7264EBA60764- <2>
  1214 000010FC 6563776F7264289004- <2>
  1214 00001105 6973706DD55509736B- <2>
  1214 0000110E 6970636F6D6D619869- <2>
  1214 00001117 06696E7463686B2130- <2>
  1214 00001120 0A63616C6C5F696E74- <2>
  1214 00001129 3244B7740873657465- <2>
  1214 00001132 73326478            <2>
  1215 00001136 899F0D696E7465726E- <2> 	link_data_dump_names LINK_DATA_NAMES
  1215 0000113F 616C666C616773F634- <2>
  1215 00001148 0C657874646174615F- <2>
  1215 00001151 73697A65B2400C6578- <2>
  1215 0000115A 74646174615F757365- <2>
  1215 00001163 64B0B2146175786275- <2>
  1215 0000116C 66665F63757272656E- <2>
  1215 00001175 745F73697A658B0010- <2>
  1215 0000117E 617578627566665F73- <2>
  1215 00001187 65676F7273656C92AA- <2>
  1215 00001190 136C6F61645F636865- <2>
  1215 00001199 636B5F6469725F6174- <2>
  1215 000011A2 74720EB5116C6F6164- <2>
  1215 000011AB 5F79796E616D655F69- <2>
  1215 000011B4 6E7075742F75106C6F- <2>
  1215 000011BD 61645F79796E616D65- <2>
  1215 000011C6 5F6E6578746C52106C- <2>
  1215 000011CF 6F61645F79795F6469- <2>
  1215 000011D8 72656E74727938D219- <2>
  1215 000011E1 68616E646C655F7363- <2>
  1215 000011EA 616E5F6469725F6E6F- <2>
  1215 000011F3 745F666F756E646B5D- <2>
  1215 000011FC 06646D79636D6494C0- <2>
  1215 00001205 1568616E646C655F73- <2>
  1215 0000120E 63616E5F6469725F65- <2>
  1215 00001217 6E7472793F850E7363- <2>
  1215 00001220 616E5F6469725F656E- <2>
  1215 00001229 74727958B8196E6561- <2>
  1215 00001232 725F7472616E736665- <2>
  1215 0000123B 725F6578745F616464- <2>
  1215 00001244 72657373D6ED176E65- <2>
  1215 0000124D 61725F7472616E7366- <2>
  1215 00001256 65725F6578745F656E- <2>
  1215 0000125F 74727975DD106C6F61- <2>
  1215 00001268 645F6B65726E656C5F- <2>
  1215 00001271 6E616D6584E3086C69- <2>
  1215 0000127A 6E655F6F7574CA510E- <2>
  1215 00001283 696E7465726E616C66- <2>
  1215 0000128C 6C61677333EB420865- <2>
  1215 00001295 7874647373656CD52D- <2>
  1215 0000129E 066578747365675ABC- <2>
  1215 000012A7 086F7074696F6E7337- <2>
  1215 000012B0 E7D30B657874736567- <2>
  1215 000012B9 5F7573656468440E6C- <2>
  1215 000012C2 696E6B63616C6C5F74- <2>
  1215 000012CB 61626C65F09E227472- <2>
  1215 000012D4 795F64656275676765- <2>
  1215 000012DD 725F616D69735F6D75- <2>
  1215 000012E6 6C7469706C65785F6E- <2>
  1215 000012EF 756D626572CB510E69- <2>
  1215 000012F8 6E7465726E616C666C- <2>
  1215 00001301 61677334688C15616D- <2>
  1215 0000130A 69735F6D756C746970- <2>
  1215 00001313 6C65785F6E756D6265- <2>
  1215 0000131C 72                  <2>
  1216                              <2> %if ELDOTHER
  1217                              <2> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1218                              <2> %endif
  1219                              <2> 
  1220                              <2> lmsg:
  1221                              <2> %if _ELD_LINKER_PASSES
  1222                              <2> %if _ELDCALL_OPTIONAL
  1223                              <2> .warning_code_optional:		counted "Optional code link missing, hash="
  1224                              <2> %endif
  1225                              <2> %if _ELDDATA_OPTIONAL
  1226                              <2> .warning_data_optional:		counted "Optional data link missing, hash="
  1227                              <2> %endif
  1228 0000131D 1844617461206C696E- <2> .error_data:			counted "Data link missing, hash="
  1228 00001326 6B206D697373696E67- <2>
  1228 0000132F 2C20686173683D      <2>
  1229 00001336 18436F6465206C696E- <2> .error_code:			counted "Code link missing, hash="
  1229 0000133F 6B206D697373696E67- <2>
  1229 00001348 2C20686173683D      <2>
  1230 0000134F 0A682C206C6162656C- <2> .error.2:			counted "h, label ",'"'
  1230 00001358 2022                <2>
  1231                              <2> %endif
  1232                              <2> %if ELDOTHER
  1233                              <2> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1234                              <2> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1235                              <2> %endif
  1236                              <2> 
  1237 0000135A 00<rep 6h>          <2> 	align 16, db 0
  1995                              <1> 
  1996                              <1> 	align 16
  1997                              <1> code_size equ $ - code
