     1                                  
     2                                  ; Public Domain
     3                                  
     4                                  ; test run command: list.eld; .; .
     5                                  
     6                                  %include "lmacros3.mac"
     1                              <1> [list -]
    14                              <2> [list -]
    14                              <1> [list -]
     7                                  %include "eld.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2025 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELD_MAC
    16                              <1> %define ELD_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    19                              <1> 
    20                              <1> 		; ELD executable header
    21                              <1> 	struc ELD_HEADER
    22 00000000 ????????            <1> eldhSignature:		resb 4	; "ELD1"
    23 00000004 ??????              <1> 			resb 3	; reserved
    24 00000007 ??                  <1> 			resb 1	; 26 (Ctrl-Z)
    25 00000008 ????????            <1> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26 0000000C ????                <1> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27 0000000E ????                <1> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28 00000010 ????????            <1> eldhDataOffset:		resd 1
    29 00000014 ????                <1> eldhDataImageLength:	resw 1	; (zero allowed)
    30 00000016 ????                <1> eldhDataAllocLength:	resw 1	; (zero allowed)
    31 00000018 ????                <1> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32 0000001A ????????            <1> eldhReserved:		resb 4	; reserved
    33 0000001E ????                <1> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <1> 	endstruc
    35                              <1> 	endarea ELD_HEADER, 1
    36                              <1> 
    37                              <1> 	struc ELD_HEADERX
    38 00000000 <res 20h>           <1> eldhxHeader:		resb ELD_HEADER_size
    39 00000020 ????????            <1> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40 00000024 ????????            <1> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41 00000028 ????????            <1> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42 0000002C ????????            <1> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <1> 	alignb 16
    44                              <1> 	endstruc
    45                              <1> 
    46                              <1> 	struc ELD_TRAILER_HEADER
    47 00000000 ????????????????    <1> eldthSignature:		resb 8	; "ELD1TAIL"
    48 00000008 ????????            <1> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <1> 				;  add this dword to the seek offset
    50 0000000C ????                <1> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51 0000000E ????                <1> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <1> 	endstruc
    53                              <1> 	endarea ELD_TRAILER_HEADER, 1
    54                              <1> 
    55                              <1> 	struc ELD_LIBTABLE
    56 00000000 ????                <1> eldltFormat:		resw 1
    57                              <1> 	; 0 = uncompressed
    58                              <1> 	; 2 = heatshrink compressed
    59                              <1> 	; 3 = lzexedat -4 compressed
    60                              <1> 	; 4 = lzexedat -4 -l compressed
    61 00000002 ????                <1> eldltAmount:		resw 1
    62 00000004 ????????            <1> eldltOffset:		resd 1	; from eldhxHeader
    63                              <1> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <1> 	endstruc
    65                              <1> 	endarea ELD_LIBTABLE, 1
    66                              <1> 
    67                              <1> 		; ELD instance header
    68                              <1> 	struc ELD_INSTANCE
    69 00000000 ????                <1> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70 00000002 ????                <1> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71 00000004 ????                <1> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72 00000006 ????                <1> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73 00000008 ????????????????    <1> eldiIdentifier:		resb 8	; blank-filled text
    74 00000010 ????                <1> eldiFlags:		resw 1	; flags
    75                              <1> eldiListing_size equ 14
    76 00000012 <res Eh>            <1> eldiListing:		resb eldiListing_size
    77                              <1> 				; ASCIZ listing file name
    78                              <1> 	endstruc
    79                              <1> 		; flags for eldiFlags:
    80                              <1> eldifResident:		equ 1
    81                              <1> 
    82                              <1> 		; ELD link info header
    83                              <1> 	struc ELD_LINKINFO
    84 00000000 ????                <1> eldlSignature:		resw 1	; 0E1D1h
    85 00000002 ????????            <1> eldlReserved:		resw 2
    86 00000006 ????                <1> eldlUseLinkHash:	resw 1
    87 00000008 ????                <1> eldlDataAmount:		resw 1
    88 0000000A ????                <1> eldlDataPrefixes:	resw 1
    89 0000000C ????                <1> eldlDataEntries:	resw 1
    90 0000000E ????                <1> eldlDataAddresses:	resw 1
    91 00000010 ????                <1> eldlCodeAmount:		resw 1
    92 00000012 ????                <1> eldlCodePrefixes:	resw 1
    93 00000014 ????                <1> eldlCodeEntries:	resw 1
    94 00000016 ????                <1> eldlCodeAddresses:	resw 1
    95                              <1> 	endstruc
    96                              <1> 
    97                              <1> 	numdef ELD_CODE_VSTART, 9001h
    98                              <1> 	numdef ELD_DATA_VSTART, 8000h
    99                              <1> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <1> 
   101                              <1> 	numdef ELD_RECLAIM_HINT, 0
   102                              <1> 	strdef ELD_LISTING, ""
   103                              <1> 	numdef ELD_DATETIME, 0
   104                              <1> 
   105                              <1> %if _ELD_DATETIME
   106                              <1>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <1>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <1> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <1> 		asciz		; for future extension
   110                              <1>  %endmacro
   111                              <1> %else
   112                              <1>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <1>  %define PUT_ELD_DATETIME
   114                              <1> %endif
   115                              <1> 
   116                              <1> %endif
     8                                  %include "eldcall.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug call macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2024 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELDCALL_MAC
    16                              <1> %define ELDCALL_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    19                              <1> %include "nasmhash.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> Hashing macros
     5                              <2>  by E. C. Masloch, 2019
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef __NASMHASH_MAC__
    16                              <2> %assign __NASMHASH_MAC__ 1
    17                              <2> 
    18                              <2> 
    19                              <2> 	%macro hashdef 2+.nolist
    20                              <2> %ifempty %2
    21                              <2>  %assign _%1 1
    22                              <2> %else
    23                              <2> %ifstr %2
    24                              <2>  %define %%string %2
    25                              <2> %elifid %2
    26                              <2>  %defstr %%string %2
    27                              <2> %elifnum %2
    28                              <2>  %defstr %%string %2
    29                              <2> %eliftok %2
    30                              <2>  %defstr %%string %2
    31                              <2> %else
    32                              <2>  %error Unknown input
    33                              <2> %endif
    34                              <2> %strlen %%length %%string
    35                              <2> %assign %%hash 1
    36                              <2> %assign %%index 1
    37                              <2> %rep %%length
    38                              <2>  %substr %%char %%string %%index
    39                              <2>  %assign %%hash (%%hash * 31 + %%char) & 0FFFFh
    40                              <2>  %assign %%index %%index + 1
    41                              <2> %endrep
    42                              <2> %assign _%1 %%hash
    43                              <2> %endif
    44                              <2> 	%endmacro
    45                              <2> 
    46                              <2> 
    47                              <2> %endif
    20                              <1> %include "elddata.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug data relocation macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2024 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef ELDDATA_MAC
    16                              <2> %define ELDDATA_MAC 1
    17                              <2> 
    18                              <2> %include "lmacros3.mac"
     1                              <3> [list -]
    19                              <2> %include "nasmhash.mac"
     1                              <3> 
     2                              <3> %if 0
     3                              <3> 
     4                              <3> Hashing macros
     5                              <3>  by E. C. Masloch, 2019
     6                              <3> 
     7                              <3> Usage of the works is permitted provided that this
     8                              <3> instrument is retained with the works, so that any entity
     9                              <3> that uses the works is notified of this instrument.
    10                              <3> 
    11                              <3> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <3> 
    13                              <3> %endif
    14                              <3> 
    15                              <3> %ifndef __NASMHASH_MAC__
    16                              <3> %assign __NASMHASH_MAC__ 1
    17                              <3> 
    18                              <3> 
    19                              <3> 	%macro hashdef 2+.nolist
    20                              <3> %ifempty %2
    21                              <3>  %assign _%1 1
    22                              <3> %else
    23                              <3> %ifstr %2
    24                              <3>  %define %%string %2
    25                              <3> %elifid %2
    26                              <3>  %defstr %%string %2
    27                              <3> %elifnum %2
    28                              <3>  %defstr %%string %2
    29                              <3> %eliftok %2
    30                              <3>  %defstr %%string %2
    31                              <3> %else
    32                              <3>  %error Unknown input
    33                              <3> %endif
    34                              <3> %strlen %%length %%string
    35                              <3> %assign %%hash 1
    36                              <3> %assign %%index 1
    37                              <3> %rep %%length
    38                              <3>  %substr %%char %%string %%index
    39                              <3>  %assign %%hash (%%hash * 31 + %%char) & 0FFFFh
    40                              <3>  %assign %%index %%index + 1
    41                              <3> %endrep
    42                              <3> %assign _%1 %%hash
    43                              <3> %endif
    44                              <3> 	%endmacro
    45                              <3> 
    46                              <3> 
    47                              <3> %endif
    20                              <2> %include "eldcheck.mac"
     1                              <3> %if 0
     2                              <3> 
     3                              <3> Extensions for lDebug relocation check macros
     4                              <3> 
     5                              <3> Copyright (C) 2008-2023 E. C. Masloch
     6                              <3> 
     7                              <3> Usage of the works is permitted provided that this
     8                              <3> instrument is retained with the works, so that any entity
     9                              <3> that uses the works is notified of this instrument.
    10                              <3> 
    11                              <3> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <3> 
    13                              <3> %endif
    14                              <3> 
    15                              <3> %ifndef ELDCHECK_MAC
    16                              <3> %define ELDCHECK_MAC 1
    17                              <3> 
    18                              <3> %assign ELDSTRICT 0
    19                              <3> %assign ELDSTRICTCOUNTER 0
    20                              <3> 
    21                              <3> 	%imacro eldstrict 1.nolist
    22                              <3> %ifidni %1, on
    23                              <3>  %assign ELDSTRICT 1
    24                              <3>  [warning +error=reloc-abs]
    25                              <3>  [warning +reloc-abs]
    26                              <3> %elifidni %1, off
    27                              <3>  %assign ELDSTRICT 0
    28                              <3>  [warning -reloc-abs]
    29                              <3> %else
    30                              <3>  %error Unknown keyword
    31                              <3> %endif
    32                              <3> 	%endmacro
    33                              <3> 
    34                              <3> 	%imacro reloc 1+.nolist
    35                              <3> %if ELDSTRICT
    36                              <3>  %if ELDSTRICTCOUNTER
    37                              <3>   %error Missing relocation
    38                              <3>  %endif
    39                              <3>  [warning -reloc-abs]
    40                              <3>  %assign ELDSTRICTCOUNTER 1
    41                              <3> %endif
    42                              <3> %1
    43                              <3> 	%endmacro
    44                              <3> 
    45                              <3> 	%imacro reloc2 1+.nolist
    46                              <3> %if ELDSTRICT
    47                              <3>  %if ELDSTRICTCOUNTER
    48                              <3>   %error Missing relocation
    49                              <3>  %endif
    50                              <3>  [warning -reloc-abs]
    51                              <3>  %assign ELDSTRICTCOUNTER 2
    52                              <3> %endif
    53                              <3> %1
    54                              <3> 	%endmacro
    55                              <3> 
    56                              <3> 	%imacro eldstrictcheck 0.nolist
    57                              <3> %if ELDSTRICT
    58                              <3>  %ifn ELDSTRICTCOUNTER
    59                              <3>   %error Unexpected relocation
    60                              <3>  %else
    61                              <3>   %assign ELDSTRICTCOUNTER ELDSTRICTCOUNTER - 1
    62                              <3>   %ifn ELDSTRICTCOUNTER
    63                              <3>    [warning +reloc-abs]
    64                              <3>   %endif
    65                              <3>  %endif
    66                              <3> %endif
    67                              <3> 	%endmacro
    68                              <3> 
    69                              <3> %endif
    70                              <3> 
    21                              <2> 
    22                              <2> 
    23                              <2> %assign ELDLINKER 0
    24                              <2> 
    25                              <2> %define INTERNAL_CODE_TO_CODE_RELOCATIONS ""
    26                              <2> %define INTERNAL_CODE_TO_DATA_RELOCATIONS ""
    27                              <2> %define INTERNAL_DATA_TO_CODE_RELOCATIONS ""
    28                              <2> %define INTERNAL_DATA_TO_DATA_RELOCATIONS ""
    29                              <2> %define INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS ""
    30                              <2> %define INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS ""
    31                              <2> %define INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS ""
    32                              <2> %define INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS ""
    33                              <2> %assign ELDDATA_OPTIONAL_STATUS 0		; not any seen yet
    34                              <2> %assign ELDDATA_PMREQUIRED_STATUS 0		; not any seen yet
    35                              <2> 
    36                              <2> 	%imacro internalcoderelocation 0-1.nolist -2
    37                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    38                              <2> %if ELDLINKER
    39                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    40                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    41                              <2>  %else
    42                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    43                              <2>  %endif
    44                              <2> %else
    45                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    46                              <2>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    47                              <2>  %else
    48                              <2>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    49                              <2>  %endif
    50                              <2> %endif
    51                              <2> 	eldstrictcheck
    52                              <2> 	%endmacro
    53                              <2> 
    54                              <2> 	%imacro internaldatarelocation 0-1.nolist -2
    55                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    56                              <2> %if ELDLINKER
    57                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    58                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    59                              <2>  %else
    60                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    61                              <2>  %endif
    62                              <2> %else
    63                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    64                              <2>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    65                              <2>  %else
    66                              <2>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    67                              <2>  %endif
    68                              <2> %endif
    69                              <2> 	eldstrictcheck
    70                              <2> 	%endmacro
    71                              <2> 
    72                              <2> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    73                              <2> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    74                              <2> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    75                              <2> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    76                              <2> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    77                              <2> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    78                              <2> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    79                              <2> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    80                              <2> 
    81                              <2> 
    82                              <2> %define LINK_DATA_RELOCATIONS ""
    83                              <2> %define LINK_LINKER_DATA_RELOCATIONS ""
    84                              <2> %define LINK_DATA_NAMES db ""
    85                              <2> %define LINK_DATA_DETECTION none, none
    86                              <2> 
    87                              <2> %define LINK_OTHER_DATA_RELOCATIONS ""
    88                              <2> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    89                              <2> %define LINK_OTHER_DATA_NAMES db ""
    90                              <2> %define LINK_OTHER_DATA_DETECTION none, none
    91                              <2> 
    92                              <2> %ifndef ELDOTHER
    93                              <2>  %assign ELDOTHER 0
    94                              <2> %endif
    95                              <2> %assign ELDOTHERLINK 0
    96                              <2> 
    97                              <2> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
    98                              <2> %if ELDOTHER
    99                              <2>  %assign ELDOTHERLINK 1
   100                              <2> %endif
   101                              <2> 	linkdatarelocation %1, %2, %3
   102                              <2> %assign ELDOTHERLINK 0
   103                              <2> 	%endmacro
   104                              <2> 
   105                              <2> 	%imacro linkdatarelocation 1-3.nolist -2, required
   106                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   107                              <2> %ifidni %3, required
   108                              <2>  %assign %%optional 0
   109                              <2> %elifidni %3, optional
   110                              <2>  %assign %%optional 100h
   111                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   112                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   113                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   114                              <2>  %else
   115                              <2>   %error Optional data link not allowed here
   116                              <2>  %endif
   117                              <2> %elifidni %3, PM required
   118                              <2>  %assign %%optional 300h
   119                              <2>  %assign ELDDATA_PMREQUIRED_STATUS 1
   120                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   121                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   122                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   123                              <2>  %else
   124                              <2>   %error Optional data link not allowed here
   125                              <2>  %endif
   126                              <2> %else
   127                              <2>  %fatal Unknown optional keyword
   128                              <2> %endif
   129                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
   130                              <2>  %assign %%DATASECTION 1
   131                              <2> %else
   132                              <2>  %assign %%DATASECTION 0
   133                              <2> %endif
   134                              <2> 	%if ELDOTHERLINK
   135                              <2> %if ELDLINKER
   136                              <2>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   137                              <2> %else
   138                              <2>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   139                              <2> %endif
   140                              <2> 	%else
   141                              <2> %if ELDLINKER
   142                              <2>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   143                              <2> %else
   144                              <2>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   145                              <2> %endif
   146                              <2> 	%endif
   147                              <2> %defstr %%string %1
   148                              <2> %strlen %%length %%string
   149                              <2> %if %%length > 64
   150                              <2>  %error Too long link name: %1
   151                              <2> %endif
   152                              <2> %define LINK_DATA_CHECK %1
   153                              <2> 	%if ELDOTHERLINK
   154                              <2> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   155                              <2> %if LINK_DATA_NEW
   156                              <2>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   157                              <2> 	hashdef HASH, %%string
   158                              <2>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   160                              <2> %else
   161                              <2>  %%name equ LINK_DATA_DUPLICATE
   162                              <2> %endif
   163                              <2> 	%else
   164                              <2> 	linkdata_detect LINK_DATA_DETECTION
   165                              <2> %if LINK_DATA_NEW
   166                              <2>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   167                              <2> 	hashdef HASH, %%string
   168                              <2>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   170                              <2> %else
   171                              <2>  %%name equ LINK_DATA_DUPLICATE
   172                              <2> %endif
   173                              <2> 	%endif
   174                              <2> 	eldstrictcheck
   175                              <2> 	%endmacro
   176                              <2> 
   177                              <2> 	%imacro linkdata_detect 2-*.nolist
   178                              <2> %assign LINK_DATA_NEW 1
   179                              <2> %rep (%0 - 2) / 2
   180                              <2>  %rotate 2
   181                              <2>  %ifidni %1, LINK_DATA_CHECK
   182                              <2>   %assign LINK_DATA_NEW 0
   183                              <2>   %xdefine LINK_DATA_DUPLICATE %2
   184                              <2>   %exitrep
   185                              <2>  %endif
   186                              <2> %endrep
   187                              <2> 	%endmacro
   188                              <2> 
   189                              <2> 	%imacro link_data_dump_names 1-*.nolist
   190                              <2> %rep %0
   191                              <2> 	%1
   192                              <2>  %rotate 1
   193                              <2> %endrep
   194                              <2> 	%endmacro
   195                              <2> 
   196                              <2> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   197                              <2> ; dw LINK_DATA_RELOCATIONS, 0, 0
   198                              <2> ; link_data_dump_names ELDCALL_CODE_NAMES
   199                              <2> 
   200                              <2> %endif
    21                              <1> 
    22                              <1> %assign ELDLINKER 0
    23                              <1> 
    24                              <1> [section relocatedzero nobits vstart=0]
    25                              <1> relocatedzero:
    26                              <1> __SECT__
    27                              <1> 
    28                              <1> 	numdef HOUDINI, 1
    29                              <1> 	numdef HOUDINI_CONDITIONAL, 1
    30                              <1> 
    31                              <1> %imacro houdini 0.nolist
    32                              <1> %if _HOUDINI
    33                              <1>  %if _HOUDINI_CONDITIONAL
    34                              <1> reloc	testopt [ss:relocateddata], 100h
    35                              <1> linkdatarelocation options7, -3
    36                              <1> 	jz %%skip
    37                              <1>  %endif
    38                              <1> reloc	testopt [ss:relocateddata], 100h
    39                              <1> linkdatarelocation internalflags6, -3
    40                              <1> 	jz %%skip
    41                              <1> 	int3
    42                              <1> %%skip:
    43                              <1> %endif
    44                              <1> %endmacro
    45                              <1> 
    46                              <1> %define ELDCALL_CODE_RELOCATIONS ""
    47                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS ""
    48                              <1> %define ELDCALL_CODE_RELOCATIONS_OPTIONAL ""
    49                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ""
    50                              <1> %define ELDCALL_CODE_NAMES db ""
    51                              <1> %define ELDCALL_CODE_DETECTION none, none
    52                              <1> %assign ELDCALL_OPTIONAL_STATUS 0		; not any seen yet
    53                              <1> %assign ELDCALL_PMREQUIRED_STATUS 0		; not any seen yet
    54                              <1> 
    55                              <1> 	%imacro extcall 1-2.nolist required
    56                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
    57                              <1>  %error "ELD call cannot be used in ELD data block"
    58                              <1> %endif
    59                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP
    60                              <1> %ifidni %2, required
    61                              <1>  %assign %%optional 0
    62                              <1> %elifidni %2, optional
    63                              <1>  %assign %%optional 100h
    64                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    65                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    66                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    67                              <1>  %else
    68                              <1>   %error Optional code link not allowed here
    69                              <1>  %endif
    70                              <1> %elifidni %2, PM required
    71                              <1>  %assign %%optional 300h
    72                              <1>  %assign ELDCALL_PMREQUIRED_STATUS 1
    73                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    74                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    75                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    76                              <1>  %else
    77                              <1>   %error Optional code link not allowed here
    78                              <1>  %endif
    79                              <1> %else
    80                              <1>  %fatal Unknown optional keyword
    81                              <1> %endif
    82                              <1> %if 0
    83                              <1> [warning -reloc-rel-word]
    84                              <1> 	call near relocatedzero
    85                              <1> [warning +reloc-rel-word]
    86                              <1> %else
    87                              <1> 	db 0E8h
    88                              <1> reloc	dw relocatedzero
    89                              <1> 	eldstrictcheck
    90                              <1> %endif
    91                              <1> 	jmp strict short %%skipparameter
    92                              <1> 	dw 0
    93                              <1> %%skipparameter:
    94                              <1> %if ELDLINKER
    95                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS ELDCALL_LINKER_CODE_RELOCATIONS, %%entry, %%name
    96                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
    97                              <1> %else
    98                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS ELDCALL_CODE_RELOCATIONS, %%entry, %%name
    99                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS_OPTIONAL ELDCALL_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
   100                              <1> %endif
   101                              <1> %defstr %%string %1
   102                              <1> %strlen %%length %%string
   103                              <1> %if %%length > 64
   104                              <1>  %error Too long link name: %1
   105                              <1> %endif
   106                              <1> %define ELDCALL_CODE_CHECK %1
   107                              <1> 	linkcode_detect ELDCALL_CODE_DETECTION
   108                              <1> %if ELDCALL_CODE_NEW
   109                              <1>  %xdefine ELDCALL_CODE_DETECTION ELDCALL_CODE_DETECTION, %1, %%name
   110                              <1> 	hashdef HASH, %%string
   111                              <1> %xdefine ELDCALL_CODE_NAMES 	ELDCALL_CODE_NAMES, %%name:, dw _HASH, {counted %%string}
   113                              <1> %else
   114                              <1>  %%name equ ELDCALL_CODE_DUPLICATE
   115                              <1> %endif
   116                              <1> 	%endmacro
   117                              <1> 
   118                              <1> 	%imacro linkcode_detect 2-*.nolist
   119                              <1> %assign ELDCALL_CODE_NEW 1
   120                              <1> %rep (%0 - 2) / 2
   121                              <1>  %rotate 2
   122                              <1>  %ifidni %1, ELDCALL_CODE_CHECK
   123                              <1>   %assign ELDCALL_CODE_NEW 0
   124                              <1>   %xdefine ELDCALL_CODE_DUPLICATE %2
   125                              <1>   %exitrep
   126                              <1>  %endif
   127                              <1> %endrep
   128                              <1> 	%endmacro
   129                              <1> 
   130                              <1> 
   131                              <1> %define ELDCALL_CALLCALL_LIST none
   132                              <1> 
   133                              <1> 	%imacro extcallcall 1.nolist
   134                              <1> 	call %1
   135                              <1> %xdefine ELDCALL_CALLCALL_LIST ELDCALL_CALLCALL_LIST, %1
   136                              <1> 	%endmacro
   137                              <1> 
   138                              <1> %assign ELDCALLCALL_DUMPED 0
   139                              <1> 
   140                              <1> 	%imacro eldcall_dump_callcall 1-*.nolist
   141                              <1> %define ELDCALL_CALLCALL_PROCESSED none
   142                              <1>  %rep %0 - 1
   143                              <1>   %rotate 1
   144                              <1>   %define ELDCALL_CHECK %1
   145                              <1> 	eldcall_callcall_detect ELDCALL_CALLCALL_PROCESSED
   146                              <1>   %if ELDCALL_NEW
   147                              <1>    %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED, %1
   148                              <1> 	align 8, nop
   149                              <1> %1:
   150                              <1> 	extcall %1
   151                              <1> 	retn
   152                              <1>   %endif
   153                              <1>  %endrep
   154                              <1> %unimacro extcallcall 1.nolist
   155                              <1> %assign ELDCALLCALL_DUMPED 1
   156                              <1> %define ELDCALL_CALLCALL_LIST none
   157                              <1> 	%endmacro
   158                              <1> 
   159                              <1> 	%imacro eldcall_callcall_detect 1-*.nolist
   160                              <1> %assign ELDCALL_NEW 1
   161                              <1> %rep %0 - 1
   162                              <1>  %rotate 1
   163                              <1>  %ifidni %1, ELDCALL_CHECK
   164                              <1>   %assign ELDCALL_NEW 0
   165                              <1>   %exitrep
   166                              <1>  %endif
   167                              <1> %endrep
   168                              <1> 	%endmacro
   169                              <1> 
   170                              <1> 	%imacro eldcall_dump_names 1-*.nolist
   171                              <1> %rep %0
   172                              <1> 	%1
   173                              <1>  %rotate 1
   174                              <1> %endrep
   175                              <1> 	%endmacro
   176                              <1> 
   177                              <1> ; eldcall_dump_callcall ELDCALL_CALLCALL_LIST
   178                              <1> ; if using optional code links:
   179                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   180                              <1> ;  dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   181                              <1> ; if not using optional code links:
   182                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   183                              <1> ;  dw ELDCALL_CODE_RELOCATIONS, 0, 0
   184                              <1> ; eldcall_dump_names ELDCALL_CODE_NAMES
   185                              <1> 
   186                              <1> %endif
     9                                  %include "elddata.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug data relocation macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2024 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELDDATA_MAC
    16                              <1> %define ELDDATA_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
    19                              <1> %include "nasmhash.mac"
    20                              <1> %include "eldcheck.mac"
    21                              <1> 
    22                              <1> 
    23                              <1> %assign ELDLINKER 0
    24                              <1> 
    25                              <1> %define INTERNAL_CODE_TO_CODE_RELOCATIONS ""
    26                              <1> %define INTERNAL_CODE_TO_DATA_RELOCATIONS ""
    27                              <1> %define INTERNAL_DATA_TO_CODE_RELOCATIONS ""
    28                              <1> %define INTERNAL_DATA_TO_DATA_RELOCATIONS ""
    29                              <1> %define INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS ""
    30                              <1> %define INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS ""
    31                              <1> %define INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS ""
    32                              <1> %define INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS ""
    33                              <1> %assign ELDDATA_OPTIONAL_STATUS 0		; not any seen yet
    34                              <1> %assign ELDDATA_PMREQUIRED_STATUS 0		; not any seen yet
    35                              <1> 
    36                              <1> 	%imacro internalcoderelocation 0-1.nolist -2
    37                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    38                              <1> %if ELDLINKER
    39                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    40                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    41                              <1>  %else
    42                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    43                              <1>  %endif
    44                              <1> %else
    45                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    46                              <1>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    47                              <1>  %else
    48                              <1>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    49                              <1>  %endif
    50                              <1> %endif
    51                              <1> 	eldstrictcheck
    52                              <1> 	%endmacro
    53                              <1> 
    54                              <1> 	%imacro internaldatarelocation 0-1.nolist -2
    55                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    56                              <1> %if ELDLINKER
    57                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    58                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    59                              <1>  %else
    60                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    61                              <1>  %endif
    62                              <1> %else
    63                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    64                              <1>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    65                              <1>  %else
    66                              <1>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    67                              <1>  %endif
    68                              <1> %endif
    69                              <1> 	eldstrictcheck
    70                              <1> 	%endmacro
    71                              <1> 
    72                              <1> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    73                              <1> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    74                              <1> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    75                              <1> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    76                              <1> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    77                              <1> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    78                              <1> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    79                              <1> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    80                              <1> 
    81                              <1> 
    82                              <1> %define LINK_DATA_RELOCATIONS ""
    83                              <1> %define LINK_LINKER_DATA_RELOCATIONS ""
    84                              <1> %define LINK_DATA_NAMES db ""
    85                              <1> %define LINK_DATA_DETECTION none, none
    86                              <1> 
    87                              <1> %define LINK_OTHER_DATA_RELOCATIONS ""
    88                              <1> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    89                              <1> %define LINK_OTHER_DATA_NAMES db ""
    90                              <1> %define LINK_OTHER_DATA_DETECTION none, none
    91                              <1> 
    92                              <1> %ifndef ELDOTHER
    93                              <1>  %assign ELDOTHER 0
    94                              <1> %endif
    95                              <1> %assign ELDOTHERLINK 0
    96                              <1> 
    97                              <1> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
    98                              <1> %if ELDOTHER
    99                              <1>  %assign ELDOTHERLINK 1
   100                              <1> %endif
   101                              <1> 	linkdatarelocation %1, %2, %3
   102                              <1> %assign ELDOTHERLINK 0
   103                              <1> 	%endmacro
   104                              <1> 
   105                              <1> 	%imacro linkdatarelocation 1-3.nolist -2, required
   106                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   107                              <1> %ifidni %3, required
   108                              <1>  %assign %%optional 0
   109                              <1> %elifidni %3, optional
   110                              <1>  %assign %%optional 100h
   111                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   112                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   113                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   114                              <1>  %else
   115                              <1>   %error Optional data link not allowed here
   116                              <1>  %endif
   117                              <1> %elifidni %3, PM required
   118                              <1>  %assign %%optional 300h
   119                              <1>  %assign ELDDATA_PMREQUIRED_STATUS 1
   120                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   121                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   122                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   123                              <1>  %else
   124                              <1>   %error Optional data link not allowed here
   125                              <1>  %endif
   126                              <1> %else
   127                              <1>  %fatal Unknown optional keyword
   128                              <1> %endif
   129                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
   130                              <1>  %assign %%DATASECTION 1
   131                              <1> %else
   132                              <1>  %assign %%DATASECTION 0
   133                              <1> %endif
   134                              <1> 	%if ELDOTHERLINK
   135                              <1> %if ELDLINKER
   136                              <1>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   137                              <1> %else
   138                              <1>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   139                              <1> %endif
   140                              <1> 	%else
   141                              <1> %if ELDLINKER
   142                              <1>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   143                              <1> %else
   144                              <1>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   145                              <1> %endif
   146                              <1> 	%endif
   147                              <1> %defstr %%string %1
   148                              <1> %strlen %%length %%string
   149                              <1> %if %%length > 64
   150                              <1>  %error Too long link name: %1
   151                              <1> %endif
   152                              <1> %define LINK_DATA_CHECK %1
   153                              <1> 	%if ELDOTHERLINK
   154                              <1> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   155                              <1> %if LINK_DATA_NEW
   156                              <1>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   157                              <1> 	hashdef HASH, %%string
   158                              <1>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   160                              <1> %else
   161                              <1>  %%name equ LINK_DATA_DUPLICATE
   162                              <1> %endif
   163                              <1> 	%else
   164                              <1> 	linkdata_detect LINK_DATA_DETECTION
   165                              <1> %if LINK_DATA_NEW
   166                              <1>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   167                              <1> 	hashdef HASH, %%string
   168                              <1>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   170                              <1> %else
   171                              <1>  %%name equ LINK_DATA_DUPLICATE
   172                              <1> %endif
   173                              <1> 	%endif
   174                              <1> 	eldstrictcheck
   175                              <1> 	%endmacro
   176                              <1> 
   177                              <1> 	%imacro linkdata_detect 2-*.nolist
   178                              <1> %assign LINK_DATA_NEW 1
   179                              <1> %rep (%0 - 2) / 2
   180                              <1>  %rotate 2
   181                              <1>  %ifidni %1, LINK_DATA_CHECK
   182                              <1>   %assign LINK_DATA_NEW 0
   183                              <1>   %xdefine LINK_DATA_DUPLICATE %2
   184                              <1>   %exitrep
   185                              <1>  %endif
   186                              <1> %endrep
   187                              <1> 	%endmacro
   188                              <1> 
   189                              <1> 	%imacro link_data_dump_names 1-*.nolist
   190                              <1> %rep %0
   191                              <1> 	%1
   192                              <1>  %rotate 1
   193                              <1> %endrep
   194                              <1> 	%endmacro
   195                              <1> 
   196                              <1> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   197                              <1> ; dw LINK_DATA_RELOCATIONS, 0, 0
   198                              <1> ; link_data_dump_names ELDCALL_CODE_NAMES
   199                              <1> 
   200                              <1> %endif
    10                                  
    11                                  %assign _CATCHINT0C 0
    12                                  %assign _CATCHINT0D 0
    13                                  %assign _CATCHINTFAULTCOND 0
    14                                  %assign _DEBUG 0
    15                                  %assign _DELAY_BEFORE_BP 0
    16                                  %assign _DHIGHLIGHT 0
    17                                  %assign _GETLINEHIGHLIGHT 0
    18                                  %assign _IMMASM 0
    19                                  %assign _INPUT_FILE_BOOT 0
    20                                  %assign _INPUT_FILE_HANDLES 0
    21                                  %assign _MS_0RANGE_COMPAT 0
    22                                  %assign _PM 0
    23                                  %assign _RH 0
    24                                  %assign _SYMBOLIC 0
    25                                  %assign _VXCHG 0
    26                                  %include "options.mac"
     1                              <1> 
     2                              <1> %if 0
     3                              <1> 
     4                              <1> lDebug options and internal flags
     5                              <1> 
     6                              <1> Copyright (C) 2008-2023 E. C. Masloch
     7                              <1> 
     8                              <1> Usage of the works is permitted provided that this
     9                              <1> instrument is retained with the works, so that any entity
    10                              <1> that uses the works is notified of this instrument.
    11                              <1> 
    12                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <1> 
    14                              <1> %endif
    15                              <1> 
    16                              <1> 
    17                              <1> dispregs32	equ	  1	; RX: 32-bit register display (R, T/P/G)
    18                              <1> traceints	equ	  2	; TM: trace into interrupts (T)
    19                              <1> cpdepchars	equ	  4	; allow dumping of CP-dependent characters (D, DX)
    20                              <1> fakeindos	equ	  8	; always assume InDOS flag non-zero (all)
    21                              <1> nonpagingdevice	equ	 10h	; disallow paged output with [more] prompt (all exc. P, T)
    22                              <1> 	; This option was never used anywhere:
    23                              <1> ; pagingdevice	equ	 20h	; allow paged output with [more] prompt (all exc. P, T)
    24                              <1> 				; paged output is by default on if the output device is StdOut, else off
    25                              <1> hexrn		equ	 40h	; display raw hexadecimal content of FPU registers (RN)
    26                              <1> ;novdd		equ	 80h	; don't use a registered NTVDM VDD (L, W)
    27                              <1> nondospaging	equ	100h	; paging: don't use DOS for input when waiting for a key
    28                              <1> opt1_86mnohlt	equ	200h	; (86 Mode:) HLT doesn't work, don't use it
    29                              <1> biosidles	equ	400h	; don't idle with HLT or Int2F.1680, only call BIOS Int16.00
    30                              <1> opt_usegetinput	equ	800h	; use getinput for int 21h interactive input
    31                              <1> use_si_units	equ    1000h	; in disp_*_size use SI units (kB = 1000, etc)
    32                              <1> use_jedec_units	equ    2000h	; in disp_*_size use JEDEC units (kB = 1024)
    33                              <1> enable_serial	equ    4000h	; enable serial I/O (preferred over DOS or BIOS terminal)
    34                              <1> int8_disable_serial equ	   8000h	; disable serial I/O when breaking due to intr8
    35                              <1> gg_do_not_skip_bp equ	 1_0000h	; gg: do not skip a breakpoint (bb or gg)
    36                              <1> gg_no_autorepeat equ	 2_0000h	; gg: do not auto-repeat
    37                              <1> tp_do_not_skip_bp equ	 4_0000h	; T/TP/P: do not skip a (bb) breakpoint
    38                              <1> gg_bb_hit_no_repeat equ	 8_0000h	; gg: do not auto-repeat after bb hit
    39                              <1> tp_bb_hit_no_repeat equ	10_0000h	; T/TP/P: do not auto-repeat after bb hit
    40                              <1> gg_unexpected_no_repeat equ 20_0000h	; gg: do not auto-repeat after unexpectedinterrupt
    41                              <1> tp_unexpected_no_repeat equ 40_0000h	; T/TP/P
    42                              <1> ss_no_dump:		equ 80_0000h
    43                              <1> %if _SYMBOLIC
    44                              <1> dd_no_blanks_sym:	equ 100_0000h
    45                              <1> zz_no_pm_xms:		equ 200_0000h
    46                              <1> %endif
    47                              <1> rr_disasm_no_rept:	equ 1000_0000h
    48                              <1> rr_disasm_no_show:	equ 2000_0000h
    49                              <1> opt_cmdline_quiet_input:equ 4000_0000h
    50                              <1> opt_cmdline_quiet_output:equ 8000_0000h
    51                              <1> %if _SYMBOLIC
    52                              <1> DEFAULTOPTIONS	equ zz_no_pm_xms
    53                              <1> %else
    54                              <1> DEFAULTOPTIONS	equ 0
    55                              <1> %endif
    56                              <1> 
    57                              <1> 
    58                              <1> opt2_db_header:		equ 1
    59                              <1> opt2_db_trailer:	equ 2
    60                              <1> opt2_dw_header:		equ 10h
    61                              <1> opt2_dw_trailer:	equ 20h
    62                              <1> opt2_dd_header:		equ 100h
    63                              <1> opt2_dd_trailer:	equ 200h
    64                              <1> opt2_getinput_dpmi:	equ 800h
    65                              <1> opt2_hh_compat:		equ 1000h
    66                              <1> opt2_getc_idle:		equ 2000h
    67                              <1> opt2_getc_idle_dpmi:	equ 4000h
    68                              <1> opt2_re_cancel_tpg:	equ 8000h
    69                              <1> opt2_nn_compat:		equ 1_0000h
    70                              <1> opt2_nn_capitalise:	equ 2_0000h
    71                              <1> %if _MS_0RANGE_COMPAT
    72                              <1> opt2_0range_compat:	equ 4_0000h
    73                              <1> %endif
    74                              <1> opt2_rr16_compat:	equ 8_0000h
    75                              <1> opt2_r_prompt_compat:	equ 10_0000h
    76                              <1> opt2_r_separate:	equ 20_0000h
    77                              <1> opt2_r_linebreak_always:equ 40_0000h
    78                              <1> opt2_dpminohlt:		equ 8000_0000h	; DPMI doesn't like hlt
    79                              <1> DEFAULTOPTIONS2	equ opt2_dw_header | opt2_dd_header | opt2_getc_idle_dpmi | opt2_dpminohlt
    80                              <1> 
    81                              <1> 
    82                              <1> opt3_tt_no_paging:	equ 1
    83                              <1> opt3_tp_no_paging:	equ 2
    84                              <1> opt3_pp_no_paging:	equ 4
    85                              <1> opt3_gg_no_paging:	equ 8
    86                              <1> opt3_silence_paging_set:equ 100h
    87                              <1> opt3_silence_paging_on:	equ 200h
    88                              <1> opt3_paging_rc:		equ 1000h
    89                              <1> opt3_paging_yy:		equ 2000h
    90                              <1> opt3_paging_re:		equ 4000h
    91                              <1> opt3_r_highlight_diff:	equ 10000h
    92                              <1> opt3_r_highlight_dumb:	equ 20000h
    93                              <1> opt3_r_highlight_full:	equ 40000h
    94                              <1> opt3_r_highlight_eip:	equ 80000h
    95                              <1> %if _PM
    96                              <1> opt3_ss_b_bit_set:	equ   10_0000h
    97                              <1>  %if _BREAK_INSTALLDPMI
    98                              <1> opt3_break_installdpmi:	equ   20_0000h
    99                              <1>  %endif
   100                              <1> %endif
   101                              <1> %if _DHIGHLIGHT
   102                              <1> opt3_d_highlight:	equ   80_0000h
   103                              <1> %endif
   104                              <1> %if _GETLINEHIGHLIGHT
   105                              <1> opt3_getline_highlight:	equ  100_0000h
   106                              <1> %endif
   107                              <1> opt3_no_idle_2F:	equ  200_0000h
   108                              <1> %if _DELAY_BEFORE_BP
   109                              <1> opt3_delay_before_bp:	equ  400_0000h
   110                              <1> %endif
   111                              <1> opt3_no_call_amis:	equ  800_0000h
   112                              <1> opt3_disable_autorepeat:equ 1000_0000h
   113                              <1> opt3_check_ctrlc_keyb:	equ 2000_0000h
   114                              <1> opt3_check_ctrlc_0bh:	equ 4000_0000h
   115                              <1> opt3_tsr_quit_leave_tf:	equ 8000_0000h
   116                              <1> DEFAULTOPTIONS3	equ opt3_tt_no_paging | opt3_tp_no_paging 		| opt3_pp_no_paging | opt3_gg_no_paging 		| opt3_check_ctrlc_keyb | opt3_check_ctrlc_0bh
   119                              <1> 
   120                              <1> 
   121                              <1> opt4_int_2F_hook:	equ 2
   122                              <1> opt4_int_08_hook:	equ 4
   123                              <1> opt4_int_2D_hook:	equ 8
   124                              <1> %if _CATCHINTFAULTCOND
   125                              <1> opt4_int_fault_hook:	equ 10h
   126                              <1> %endif
   127                              <1> opt4_int_serial_force:	equ 1_0000h
   128                              <1> opt4_int_2F_force:	equ 2_0000h
   129                              <1> opt4_int_08_force:	equ 4_0000h
   130                              <1> opt4_int_2D_force:	equ 8_0000h
   131                              <1> %if _CATCHINT0D
   132                              <1> opt4_int_0D_force:	equ   10_0000h
   133                              <1> %endif
   134                              <1> %if _CATCHINT0C
   135                              <1> opt4_int_0C_force:	equ   20_0000h
   136                              <1> %endif
   137                              <1> opt4_int_00_force:	equ  100_0000h
   138                              <1> opt4_int_01_force:	equ  200_0000h
   139                              <1> opt4_int_03_force:	equ  400_0000h
   140                              <1> opt4_int_06_force:	equ  800_0000h
   141                              <1> opt4_int_18_force:	equ 1000_0000h
   142                              <1> opt4_int_19_force:	equ 2000_0000h
   143                              <1> opt4_int_09_force:	equ 4000_0000h	; not used at the same time as 15h
   144                              <1> opt4_int_15_force:	equ 4000_0000h	; not used at the same time as 09h
   145                              <1> opt4_int_07_force:	equ 8000_0000h
   146                              <1> DEFAULTOPTIONS4 equ opt4_int_2F_hook
   147                              <1> 
   148                              <1> 
   149                              <1> %if _VXCHG
   150                              <1> opt6_vv_mode:		equ 1
   151                              <1> opt6_vv_keep:		equ 2
   152                              <1> opt6_vv_int16:		equ 10h
   153                              <1>  %if _VXCHG_DEFAULT_ON
   154                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq | opt6_vv_mode
   155                              <1>  %else
   156                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   157                              <1>  %endif
   158                              <1> %else
   159                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   160                              <1> %endif
   161                              <1> %if _DEBUG
   162                              <1> opt6_debug_exception_late:	equ  20h
   163                              <1> opt6_debug_exception_early:	equ  40h
   164                              <1>  %if _DEBUG_COND
   165                              <1> opt6_debug_exception:	equ  80h
   166                              <1> opt6_debug_mode:	equ 100h
   167                              <1>  %endif
   168                              <1> %endif
   169                              <1> opt6_bios_output:	equ 200h
   170                              <1> opt6_flat_binary:	equ 400h
   171                              <1> opt6_big_stack:		equ 800h
   172                              <1> opt6_40_columns:	equ 1000h
   173                              <1> opt6_40_indent_odd:	equ 2000h
   174                              <1> opt6_40_dash:		equ 4000h
   175                              <1> opt6_share_serial_irq:	equ 1_0000h
   176                              <1> opt6_serial_EOI_call:	equ 2_0000h
   177                              <1> %if _RH
   178                              <1> opt6_rh_mode:		equ 10_0000h
   179                              <1> %endif
   180                              <1> %if _DEBUG
   181                              <1> opt6_debug_putrunint_early:	equ  40_0000h
   182                              <1>  %if _DEBUG_COND
   183                              <1> opt6_debug_putrunint:		equ  80_0000h
   184                              <1>  %endif
   185                              <1> %endif
   186                              <1> opt6_bios_io:		equ 100_0000h
   187                              <1> opt6_immasm_display_uu:	equ 200_0000h
   188                              <1> opt6_immasm_debug:	equ 400_0000h
   189                              <1> opt6_immasm_flag:	equ 800_0000h
   190                              <1> opt6_immasm_nobranch:	equ 1000_0000h
   191                              <1> opt6_r_flags_style2:	equ 2000_0000h
   192                              <1> opt6_r_flags_style3:	equ 4000_0000h
   193                              <1> opt6_r_linebreak_conditional:	equ 8000_0000h
   194                              <1> 
   195                              <1> 
   196                              <1> DEFAULTOPTIONS7 equ opt7_no_tsr_ll
   197                              <1> opt7_no_free_oneshot_eld:	equ 1
   198                              <1> opt7_debug_optional_link:	equ 2
   199                              <1> opt7_quiet_install:		equ 4
   200                              <1> opt7_quick_run:			equ 8
   201                              <1> opt7_houdini:			equ 100h
   202                              <1> opt7_no_ensure:			equ 1000h
   203                              <1> opt7_no_tsr_ll:			equ 2000h
   204                              <1> 
   205                              <1> 
   206                              <1> oldpacket	equ	  1	; Int25/Int26 packet method available (L, W)
   207                              <1> newpacket	equ	  2	; Int21.7305 packet method available (L, W)
   208                              <1> ntpacket	equ	  4	; VDD registered and usable (L, W)
   209                              <1> pagedcommand	equ	  8	; allows paging in puts
   210                              <1> notstdinput	equ	 10h	; DEBUG's StdIn isn't a device with StdIn bit (is file or other device)
   211                              <1> inputfile	equ	 20h	; DEBUG's StdIn is a file, notstdinput also set
   212                              <1> notstdoutput	equ	 40h	; DEBUG's StdOut isn't a device with StdOut bit (is file or other device)
   213                              <1> outputfile	equ	  80h	; DEBUG's StdOut is a file, notstdoutput also set
   214                              <1> hooked2F	equ	 100h	; Int2F hooked
   215                              <1> nohook2F	equ	 200h	; don't hook Int2F.1687 (required for Win9x, DosEmu?)
   216                              <1> unused_dif1_dpminohlt equ 400h	; DPMI doesn't like hlt
   217                              <1> protectedmode	equ	 800h	; in (DPMI) protected mode
   218                              <1> debuggeeA20	equ	1000h	; state of debuggee's A20
   219                              <1> debuggerA20	equ	2000h	; state of debugger's A20 (will be on if possible)
   220                              <1> nodosloaded	equ	4000h	; No DOS loaded currently (Boot loader mode)
   221                              <1> has386		equ	8000h	; CPU is a 386
   222                              <1> usecharcounter	equ    1_0000h	; don't reset charcounter between calls to puts
   223                              <1> runningnt	equ    2_0000h	; running in NTVDM
   224                              <1> canswitchmode	equ    4_0000h	; can switch modes (auxbuff large enough, DPMI mode switch set up)
   225                              <1> modeswitched	equ    8_0000h	; switched mode (now in the mode that we weren't entered in)
   226                              <1> promptwaiting	equ   10_0000h	; puts: any more output needs to display a prompt first
   227                              <1> switchbuffer	equ   20_0000h	; mode switch needs a buffer (auxbuff)
   228                              <1> tsrmode		equ   40_0000h	; in TSR mode; DPI and DPP not valid
   229                              <1> attachedterm	equ   80_0000h	; the attached process terminated
   230                              <1> runningdosemu	equ  100_0000h	; running in dosemu
   231                              <1> ; load_is_ldp	equ  200_0000h	; boot load: partition specified as "ldp"
   232                              <1> tt_while:	equ  400_0000h	; tt: while condition specified
   233                              <1> tt_p:		equ  800_0000h	; tt: proceed past repeated string instructions
   234                              <1> tt_silent_mode:	equ 1000_0000h	; tt: run should be silent (dump at end)
   235                              <1> tt_silence:	equ 2000_0000h	; tt: silent writing (write to auxbuff instead)
   236                              <1> tt_no_bb:	equ 4000_0000h	; tt: do not use bb breakpoints
   237                              <1> tt_no_bb_first:	equ 8000_0000h	; tt: do not use bb breakpoints at first
   238                              <1> 
   239                              <1> 
   240                              <1> dif2_gg_is_first:	equ   1
   241                              <1> dif2_gg_skip_non_cseip:	equ   2
   242                              <1> dif2_gg_skip_cseip:	equ   4
   243                              <1> dif2_gg_is_gg:		equ   8
   244                              <1> dif2_gg_first_detected:	equ  10h
   245                              <1> dif2_gg_again:		equ  20h
   246                              <1> dif2_tpg_proceed_bp_set:equ  40h
   247                              <1> dif2_tpg_keep_proceed_bp: equ 80h
   248                              <1> dif2_tpg_have_bp:	equ 100h
   249                              <1> dif2_tpg_adjusted_cseip:equ 200h
   250                              <1> dif2_tpg_do_not_adjust:	equ 400h
   251                              <1> dif2_bp_failure:	equ 800h
   252                              <1> dif2_is_pp:		equ 1000h
   253                              <1> %if _SYMBOLIC
   254                              <1> dif2_createdprocess:	equ 800_0000h	; created empty debuggee process
   255                              <1> dif2_sym_req_xms:	equ 2000h
   256                              <1> dif2_sym_req_86mm:	equ 4000h
   257                              <1> dif2_sym_req_mask equ dif2_sym_req_86mm | dif2_sym_req_xms
   258                              <1> dif2_no_pm_xms:		equ 1_0000h
   259                              <1> dif2_xms_detection_done:equ 2_0000h
   260                              <1> %endif
   261                              <1> %if _INPUT_FILE_HANDLES
   262                              <1> dif2_input_file:	equ 10_0000h
   263                              <1> dif2_closed_input_file:	equ 20_0000h
   264                              <1> %endif
   265                              <1> dif2_did_getline_file:	equ 40_0000h
   266                              <1> %if _SYMBOLIC
   267                              <1> dif2_poison:		equ 80_0000h
   268                              <1> %endif
   269                              <1> dif2_boot_loaded_kernel:equ 100_0000h
   270                              <1> %if _INPUT_FILE_BOOT
   271                              <1> dif2_input_file_boot:	equ 200_0000h
   272                              <1> dif2_closed_input_file_boot:	equ 400_0000h
   273                              <1> %endif
   274                              <1> dif2_in_silence_dump:	equ 1000_0000h
   275                              <1> dif2_int31_segment:	equ 2000_0000h
   276                              <1> dif2_nn_compat:		equ 4000_0000h
   277                              <1> dif2_nn_capitalise:	equ 8000_0000h
   278                              <1> 
   279                              <1> 
   280                              <1> dif3_load_is_ldp:	equ 1	; boot load: partition specified as "ldp"
   281                              <1> dif3_load_is_sdp:	equ 2	; boot load: partition specified as "sdp"
   282                              <1> dif3_load_is_ydp:	equ 4	; boot load: partition specified as "ydp"
   283                              <1> dif3_load_is_dp:	equ dif3_load_is_ldp 				| dif3_load_is_sdp 				| dif3_load_is_ydp
   286                              <1> dif3_load_dir_dir:	equ 8
   287                              <1> dif3_input_terminal_override:	equ 10h
   288                              <1> dif3_input_serial_override:	equ 20h
   289                              <1> dif3_if_not:		equ 40h
   290                              <1> dif3_partition_changed:	equ 80h
   291                              <1> ;
   292                              <1> dif3_input_cmdline:	equ 100h; input reading from cmdline_buffer
   293                              <1> dif3_input_cmdline_closed: equ 200h
   294                              <1> dif3_at_line_end:	equ 400h
   295                              <1> dif3_quiet_input_single:equ 800h
   296                              <1> dif3_quiet_output:	equ 1000h
   297                              <1> dif3_unquiet_error:	equ 2000h
   298                              <1> dif3_unquiet_prompt:	equ 4000h
   299                              <1> dif3_unquiet:		equ dif3_unquiet_error | dif3_unquiet_prompt
   300                              <1> dif3_return_eof:	equ 8000h
   301                              <1> dif3_highlighting:	equ 1_0000h
   302                              <1> dif3_do_not_highlight:	equ 2_0000h
   303                              <1> dif3_int10_highlight:	equ 2_0000h
   304                              <1> dif3_nosymbols_1:	equ 4_0000h
   305                              <1> dif3_nosymbols_2:	equ 8_0000h
   306                              <1> %if _PM
   307                              <1> dif3_ss_b_bit_set:	equ  10_0000h
   308                              <1> %endif
   309                              <1> dif3_gotint19:		equ  20_0000h
   310                              <1> dif3_prior_pm:		equ  40_0000h
   311                              <1> %if _DELAY_BEFORE_BP
   312                              <1> dif3_delayed		equ  80_0000h
   313                              <1> %endif
   314                              <1> dif3_input_re:		equ 100_0000h	; input reading from re_buffer
   315                              <1> dif3_input_re_closed:	equ 200_0000h
   316                              <1> dif3_accept_getrange_0:	equ 400_0000h
   317                              <1> %if _INPUT_FILE_HANDLES || _INPUT_FILE_BOOT
   318                              <1> dif3_in_if:		equ 800_0000h
   319                              <1> %endif
   320                              <1> dif3_auxbuff_guarded_1:	equ 1000_0000h
   321                              <1> dif3_auxbuff_guarded_2:	equ 2000_0000h
   322                              <1> dif3_auxbuff_guarded_3:	equ 4000_0000h
   323                              <1> dif3_sss_is_reverse:	equ 8000_0000h
   324                              <1> 
   325                              <1> 
   326                              <1> dif4_int_serial_hooked:	equ 1
   327                              <1> dif4_int_2F_hooked:	equ 2
   328                              <1> dif4_int_08_hooked:	equ 4
   329                              <1> dif4_int_2D_hooked:	equ 8
   330                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0D
   331                              <1> dif4_int_0D_hooked:	equ 10h
   332                              <1> %endif
   333                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0C
   334                              <1> dif4_int_0C_hooked:	equ 20h
   335                              <1> %endif
   336                              <1> 
   337                              <1> 
   338                              <1> %if _VXCHG
   339                              <1> dif6_vv_mode:		equ 1
   340                              <1> %endif
   341                              <1> dif6_in_hook2F:		equ 2
   342                              <1> dif6_in_amis_hook2F:	equ 4
   343                              <1> dif6_debug_mode:	equ 100h
   344                              <1> dif6_locked:		equ 200h
   345                              <1> %if _RH
   346                              <1> dif6_rh_mode_was:	equ  8_0000h
   347                              <1> dif6_rh_mode:		equ 10_0000h
   348                              <1> dif6_rh_mode_2:		equ 20_0000h
   349                              <1> %endif
   350                              <1> dif6_device_mode:	equ 40_0000h
   351                              <1> dif6_cpdepchars:	equ 80_0000h
   352                              <1> %if _IMMASM
   353                              <1> dif6_immasm_no_output:	equ 100_0000h
   354                              <1> dif6_immasm:		equ 200_0000h
   355                              <1> dif6_immasm_rel8:	equ 400_0000h
   356                              <1> %endif
   357                              <1> 
   358                              <1> 
   359                              <1> disasm_lowercase	equ 1
   360                              <1> disasm_commablank	equ 2
   361                              <1> disasm_nasm		equ 4
   362                              <1> disasm_lowercase_refmem:equ 8
   363                              <1> disasm_show_short:	equ 10h
   364                              <1> disasm_show_near:	equ 20h
   365                              <1> disasm_show_far:	equ 40h
   366                              <1> disasm_nec:		equ 80h
   367                              <1> disasm_40_columns:	equ 100h
   368                              <1> disasm_no_indent:	equ 200h
   369                              <1> disasm_msdebug_mnemonofs: equ 400h
   370                              <1> disasm_a16_memref:	equ 1000h
   371                              <1> disasm_a32_memref:	equ 2000h
   372                              <1> disasm_a16_string:	equ 4000h
   373                              <1> disasm_a32_string:	equ 8000h
   374                              <1> disasm_hide_modrm:	equ 10000h
   375                              <1> disasm_asize_loop_nasm:	equ 20000h
   376                              <1> disasm_modrm_always:	equ 40000h
   377                              <1> DEFAULTASMOPTIONS equ disasm_lowercase|disasm_commablank|disasm_nasm 	| disasm_a16_memref | disasm_a32_memref 	| disasm_a16_string | disasm_a32_string
    27                                  
    28                                  %include "iniload.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> lDebug iniload/boot interfacing structs and macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2023 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> 
    16                              <1> 	struc BS
    17 00000000 ??????              <1> bsJump:	resb 3
    18 00000003 ????????????????    <1> bsOEM:	resb 8
    19                              <1> bsBPB:
    20                              <1> 	endstruc
    21                              <1> 
    22                              <1> 	struc EBPB		;        BPB sec
    23 00000000 ????                <1> bpbBytesPerSector:	resw 1	; offset 00h 0Bh
    24 00000002 ??                  <1> bpbSectorsPerCluster:	resb 1	; offset 02h 0Dh
    25 00000003 ????                <1> bpbReservedSectors:	resw 1	; offset 03h 0Eh
    26 00000005 ??                  <1> bpbNumFATs:		resb 1	; offset 05h 10h
    27 00000006 ????                <1> bpbNumRootDirEnts:	resw 1	; offset 06h 11h -- 0 for FAT32
    28 00000008 ????                <1> bpbTotalSectors:	resw 1	; offset 08h 13h
    29 0000000A ??                  <1> bpbMediaID:		resb 1	; offset 0Ah 15h
    30 0000000B ????                <1> bpbSectorsPerFAT:	resw 1	; offset 0Bh 16h -- 0 for FAT32
    31 0000000D ????                <1> bpbCHSSectors:		resw 1	; offset 0Dh 18h
    32 0000000F ????                <1> bpbCHSHeads:		resw 1	; offset 0Fh 1Ah
    33 00000011 ????????            <1> bpbHiddenSectors:	resd 1	; offset 11h 1Ch
    34 00000015 ????????            <1> bpbTotalSectorsLarge:	resd 1	; offset 15h 20h
    35                              <1> bpbNew:				; offset 19h 24h
    36                              <1> 
    37 00000019 ????????            <1> ebpbSectorsPerFATLarge:	resd 1	; offset 19h 24h
    38 0000001D ????                <1> ebpbFSFlags:		resw 1	; offset 1Dh 28h
    39 0000001F ????                <1> ebpbFSVersion:		resw 1	; offset 1Fh 2Ah
    40 00000021 ????????            <1> ebpbRootCluster:	resd 1	; offset 21h 2Ch
    41 00000025 ????                <1> ebpbFSINFOSector:	resw 1	; offset 25h 30h
    42 00000027 ????                <1> ebpbBackupSector:	resw 1	; offset 27h 32h
    43 00000029 <res Ch>            <1> ebpbReserved:		resb 12	; offset 29h 34h
    44                              <1> ebpbNew:			; offset 35h 40h
    45                              <1> 	endstruc
    46                              <1> 
    47                              <1> 	struc BPBN		; ofs B16 S16 B32 S32
    48 00000000 ??                  <1> bpbnBootUnit:		resb 1	; 00h 19h 24h 35h 40h
    49 00000001 ??                  <1> 			resb 1	; 01h 1Ah 25h 36h 41h
    50 00000002 ??                  <1> bpbnExtBPBSignature:	resb 1	; 02h 1Bh 26h 37h 42h -- 29h for valid BPBN
    51 00000003 ????????            <1> bpbnSerialNumber:	resd 1	; 03h 1Ch 27h 38h 43h
    52 00000007 <res Bh>            <1> bpbnVolumeLabel:	resb 11	; 07h 20h 2Bh 3Ch 47h
    53 00000012 ????????????????    <1> bpbnFilesystemID:	resb 8	; 12h 2Bh 36h 47h 52h
    54                              <1> 	endstruc		; 1Ah 33h 3Eh 4Fh 5Ah
    55                              <1> 
    56                              <1> 	struc DIRENTRY
    57 00000000 ????????????????    <1> deName:		resb 8
    58 00000008 ??????              <1> deExt:		resb 3
    59 0000000B ??                  <1> deAttrib:	resb 1
    60 0000000C ??                  <1> dePlusSize:	resb 1
    61 0000000D ??????????????      <1> 		resb 7
    62 00000014 ????                <1> deClusterHigh:	resw 1
    63 00000016 ????                <1> deTime:		resw 1
    64 00000018 ????                <1> deDate:		resw 1
    65 0000001A ????                <1> deClusterLow:	resw 1
    66 0000001C ????????            <1> deSize:		resd 1
    67                              <1> 	endstruc
    68                              <1> 
    69                              <1> ATTR_READONLY	equ 1
    70                              <1> ATTR_HIDDEN	equ 2
    71                              <1> ATTR_SYSTEM	equ 4
    72                              <1> ATTR_VOLLABEL	equ 8
    73                              <1> ATTR_DIRECTORY	equ 10h
    74                              <1> ATTR_ARCHIVE	equ 20h
    75                              <1> 
    76                              <1> lsvclSignature		equ "CL"
    77                              <1> lsvclBufferLength	equ 256
    78                              <1> 
    79                              <1> 	struc LOADSTACKVARS, -10h
    80 FFFFFFF0 ????????            <1> lsvFirstCluster:	resd 1
    81 FFFFFFF4 ????????            <1> lsvFATSector:		resd 1
    82 FFFFFFF8 ????                <1> lsvFATSeg:		resw 1
    83 FFFFFFFA ????                <1> lsvLoadSeg:		resw 1
    84 FFFFFFFC ????????            <1> lsvDataStart:		resd 1
    85                              <1> 	endstruc
    86                              <1> 
    87                              <1> 	struc LOADDATA, LOADSTACKVARS - 10h
    88 FFFFFFE0 ????                <1> ldMemoryTop:	resw 1
    89 FFFFFFE2 ????                <1> ldLoadTop:	resw 1
    90 FFFFFFE4 ????                <1> ldSectorSeg:	resw 1
    91 FFFFFFE6 ??                  <1> ldFATType:	resb 1
    92                              <1> ldFlags:
    93 FFFFFFE7 ??                  <1> ldHasLBA:	resb 1
    94 FFFFFFE8 ????                <1> ldClusterSize:	resw 1
    95 FFFFFFEA ????                <1> ldParaPerSector:resw 1
    96                              <1> ldDirCluster:			; dword
    97                              <1> ldLoadingSeg:		; word
    98                              <1> ldQueryPatchValue:	; word
    99                              <1> lsvCommandLine:		; word
   100                              <1> .start:		equ $ - lsvclBufferLength
   101 FFFFFFEC ????                <1> .signature:	resw 1
   102                              <1> ldLoadUntilSeg:		; word
   103                              <1> lsvExtra:		; word
   104 FFFFFFEE ??                  <1> .partition:	resb 1	; byte
   105 FFFFFFEF ??                  <1> .flags:		resb 1	; byte
   106                              <1> 	endstruc
   107                              <1> 
   108                              <1> lsvefNoDataStart	equ 1
   109                              <1> lsvefPartitionNumber	equ 2
   110                              <1> 
   111                              <1> 	struc LOADCMDLINE, LOADDATA - lsvclBufferLength
   112                              <1> ldCommandLine:
   113 FFFFFEE0 <res 100h>          <1> .start:		resb lsvclBufferLength
   114                              <1> 	endstruc
   115                              <1> 
   116                              <1> ldfHasLBA:	equ 1
   117                              <1> ldfFATInvalid:	equ 2
   118                              <1> ldfFATBuffered:	equ 4
   119                              <1> ldfDataBuffered: equ 8
   120                              <1> 
   121                              <1> 	struc LOADDATA2, LOADDATA - 10h
   122 FFFFFFD0 ????????            <1> ldRootSector:		resd 1
   123 FFFFFFD4 ????                <1> ldEntriesPerSector:	resw 1
   124                              <1> ldDataSegment:		; word
   125 FFFFFFD6 ????                <1> ldLastAvailableSector:	resw 1
   126                              <1> ldDataSector:		; dword
   127 FFFFFFD8 ????                <1> ldParasLeft:		resw 1
   128 FFFFFFDA ????                <1> ldParasDone:		resw 1
   129                              <1> 	endstruc
   130                              <1> 
   131                              <1> 	struc LOADDATA3, LOADDATA2 - 10h
   132 FFFFFFC0 ????????            <1> ldMaxCluster:		resd 1
   133 FFFFFFC4 ????????            <1> ldFileSize:		resd 1
   134 FFFFFFC8 ????????            <1> ldCurrentCluster:	resd 1
   135 FFFFFFCC ????????            <1> ldCurrentSeek:		resd 1
   136                              <1> 	endstruc
   137                              <1> 
   138                              <1> 	struc LBAPACKET
   139 00000000 ????                <1> lpSize:		resw 1
   140 00000002 ????                <1> lpCount:	resw 1
   141 00000004 ????????            <1> lpBuffer:	resd 1
   142 00000008 ????????????????    <1> lpSector:	resq 1
   143                              <1> 	endstruc
   144                              <1> 
   145                              <1> 	struc PARTINFO
   146 00000000 ??                  <1> piBoot:		resb 1
   147 00000001 ??????              <1> piStartCHS:	resb 3
   148 00000004 ??                  <1> piType:		resb 1
   149 00000005 ??????              <1> piEndCHS:	resb 3
   150 00000008 ????????            <1> piStart:	resd 1
   151 0000000C ????????            <1> piLength:	resd 1
   152                              <1> 	endstruc
   153                              <1> 
   154                              <1> ptEmpty:		equ 0
   155                              <1> ptFAT12:		equ 1
   156                              <1> ptFAT16_16BIT_CHS:	equ 4
   157                              <1> ptExtendedCHS:		equ 5
   158                              <1> ptFAT16_CHS:		equ 6
   159                              <1> ptFAT32_CHS:		equ 0Bh
   160                              <1> ptFAT32:		equ 0Ch
   161                              <1> ptFAT16:		equ 0Eh
   162                              <1> ptExtended:		equ 0Fh
   163                              <1> ptLinux:		equ 83h
   164                              <1> ptExtendedLinux:	equ 85h
   165                              <1> 
   166                              <1> 
   167                              <1> 		; Flags of load_unit_flags
   168                              <1> lufForceCHS:		equ 1
   169                              <1> lufForceLBA:		equ 2
   170                              <1> lufForceGeometry:	equ 4
   171                              <1> luf_mask_writable equ lufForceCHS | lufForceLBA | lufForceGeometry
    29                                  
    30                                  	numdef BOOTLDR, 1
    31                                  	numdef BOOTLDR_WILD, 1
    32                                  	numdef COMPRESSED, 1
    33                                  	numdef DATABUFFER, 1
    34                                  	numdef ELDTRAILER, 1
    35                                  
    36                                  	cpu 8086
    37                                  
    38                                  	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
    39                                  relocateddata:
    40                                  
    41                                  	addsection HEADER, start=0
    42                                  
    43                                  	istruc ELD_HEADERX
    44                                  at eldhxHeader
    45                                  		; ELD executable header
    46                                  	istruc ELD_HEADER
    47 00000000 454C4431                at eldhSignature,	db "ELD1"
    48 00000004 000000                  			db 0,0,0
    49 00000007 1A                      			db 26
    50 00000008 50000000                at eldhCodeOffset,	dd CODEOFFSET
    51 0000000C 3020                    at eldhCodeImageLength,	dw code_size
    52 0000000E 0000                    at eldhCodeAllocLength,	dw 0
    53 00000010 80200000                at eldhDataOffset,	dd DATAOFFSET
    54 00000014 4003                    at eldhDataImageLength,	dw data_size
    55 00000016 A017                    at eldhDataAllocLength,	dw total_data_size - data_size
    56 00000018 B812                    at eldhCodeEntrypoint,	dw linker - code
    57                                  at eldhReserved
    58 0000001A 00<rep 4h>2800          at eldhExtensionSize,	dw header_extension_end - $$
    59                                  	iend
    60 00000020 [30000000]              at eldhxDescriptionOffset,	dd description
    61 00000024 7B220000                at eldhxHelpOffset,		dd DATAOFFSET + msg.help - datastart
    62                                  PUT_ELDHX_DATETIME_OFFSET
    63                                  header_extension_end:
    64 00000028 00<rep 8h>              	iend
    65                                  
    66 00000030 446973706C61792045-     description:		asciz "Display ELD description lines."
    66 00000039 4C4420646573637269-
    66 00000042 7074696F6E206C696E-
    66 0000004B 65732E00           
    67                                  
    68 0000004F 00                      	align 16, db 0
    69                                  
    70                                  	eldstrict on
    71                                  
    72                                  CODEOFFSET equ $ - $$
    73                                  	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
    74                                  %define CODEFIXUP - code + 0
    75                                  code:
    76                                  		; ELD instance header
    77                                  	istruc ELD_INSTANCE
    78                                  at eldiStartCode
    79 00000000 00<rep 2h>              at eldiEndCode
    80 00000002 00<rep 2h>              at eldiStartData
    81 00000004 00<rep 2h>              at eldiEndData
    82 00000006 00<rep 2h>4C495354-     at eldiIdentifier,	fill 8, 32, db "LIST"
    82 0000000C 20<rep 4h>         
    83 00000010 00<rep 2h>6C697374-     at eldiListing,		asciz _ELD_LISTING
    83 00000016 2E6C737400         
    84 0000001B 00<rep 5h>              	iend
    85                                  
    86                                  
    87                                  run:
    88 00000020 16                      	push ss
    89 00000021 07                      	pop es
    90                                  %if _BOOTLDR
    91 00000022 F606[0100]40            reloc	testopt [relocateddata], nodosloaded
    92                                  linkdatarelocation internalflags, -3
    93 00000027 7503E94202              	jz run_dos
    94                                  .boot:
    95 0000002C E8B111                  	extcallcall yy_boot_parse_name2
    96 0000002F E84203                  	call parse_verbose
    97                                  
    98                                  boot_find:
    99 00000032 891E[4203]              reloc	mov word [boot_parsed], bx
   100                                  internaldatarelocation
   101                                   %if _BOOTLDR_WILD
   102 00000036 53                      	push bx
   103 00000037 89DF                    	mov di, bx
   104 00000039 E8DC03                  	call find_dir
   105 0000003C 5B                      	pop bx
   106 0000003D 89FA                    	mov dx, di
   107 0000003F A8                      	db __TEST_IMM8			; (skip inc)
   108                                  @@:
   109 00000040 47                      	inc di
   110 00000041 803D00                  	cmp byte [di], 0
   111 00000044 7503E9E401              	je boot_no_wild
   112 00000049 803D3F                  	cmp byte [di], '?'
   113 0000004C 7405                    	je boot_wild
   114 0000004E 803D2A                  	cmp byte [di], '*'
   115 00000051 75ED                    	jne @B
   116                                  
   117                                  boot_wild:
   118 00000053 8916[4003]              reloc	mov word [wild_pattern], dx
   119                                  internaldatarelocation
   120                                  
   121 00000057 E8[0000]EB020000        	extcall yy_boot_init_dir2	; calls initialise_fs
   122 0000005E C606[0000]00            reloc	mov byte [relocateddata], 0
   123                                  linkdatarelocation load_check_dir_attr, -3
   124 00000063 8B36[0000]              reloc	mov si, word [relocateddata]
   125                                  linkdatarelocation load_yyname_input
   126 00000067 803C2F                  	cmp byte [si], '/'
   127 0000006A 7501                    	jne @F
   128 0000006C 46                      	inc si
   129                                  @@:
   130 0000006D 803C00                  	cmp byte [si], 0
   131 00000070 7507                    	jne @F
   132 00000072 E8[0000]EB020000        	extcall ..@yy_filename_empty
   133                                  @@:
   134 00000079 16                      	 push ss
   135 0000007A 07                      	 pop es
   136 0000007B E88200                  	call boot_parse_name
   137 0000007E 3C2F                    	cmp al, '/'
   138 00000080 7509                    	jne @F
   139 00000082 C606[0000]10            reloc	mov byte [relocateddata], ATTR_DIRECTORY
   140                                  linkdatarelocation load_check_dir_attr, -3
   141 00000087 8936[0000]              reloc	mov word [relocateddata], si
   142                                  linkdatarelocation load_yyname_next
   143                                  @@:
   144                                  
   145 0000008B BFFFFF                  	mov di, -1
   146 0000008E 89FE                    	mov si, di
   147 00000090 897EF4                  	mov [bp + lsvFATSector], di
   148 00000093 8976F6                  	mov [bp + lsvFATSector + 2], si
   149                                  
   150 00000096 31C0                    	xor ax, ax
   151 00000098 31D2                    	xor dx, dx
   152                                  
   153                                  scan_dir_yyname_loop:
   154 0000009A 8946EC                  	mov word [bp + ldDirCluster], ax
   155 0000009D 8956EE                  	mov word [bp + ldDirCluster + 2], dx
   156                                  
   157 000000A0 16                      	push ss
   158 000000A1 07                      	pop es
   159 000000A2 BB[0000]                reloc	mov bx, relocateddata
   160                                  linkdatarelocation load_yy_direntry
   161                                  
   162 000000A5 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   163                                  linkdatarelocation handle_scan_dir_not_found, -4
   164                                  ;linkdatarelocation near_transfer_ext_entry
   165                                  linkdatarelocation dmycmd
   166 000000AB E8[0000]EB020000        	extcall scan_dir_aux
   167 000000B2 7303E94B01              	jc end_of_directory
   168                                  
   169 000000B7 803E[0000]10            reloc	cmp byte [relocateddata], ATTR_DIRECTORY
   170                                  linkdatarelocation load_check_dir_attr, -3
   171 000000BC 7403E96701              	jne got_single_yyentry
   172                                  
   173 000000C1 56                      	push si
   174 000000C2 57                      	push di
   175 000000C3 C606[0000]00            reloc	mov byte [relocateddata], 0
   176                                  linkdatarelocation load_check_dir_attr, -3
   177 000000C8 8B36[0000]              reloc	mov si, word [relocateddata]
   178                                  linkdatarelocation load_yyname_next
   179 000000CC 803C00                  	cmp byte [si], 0
   180 000000CF 7507                    	jne @F
   181 000000D1 E8[0000]EB020000        	extcall ..@yy_filename_empty
   182                                  @@:
   183 000000D8 06                      	push es
   184 000000D9 16                      	 push ss
   185 000000DA 07                      	 pop es
   186 000000DB E82200                  	call boot_parse_name
   187 000000DE 07                      	pop es
   188 000000DF 3C2F                    	cmp al, '/'
   189 000000E1 7509                    	jne @F
   190 000000E3 C606[0000]10            reloc	mov byte [relocateddata], ATTR_DIRECTORY
   191                                  linkdatarelocation load_check_dir_attr, -3
   192 000000E8 8936[0000]              reloc	mov word [relocateddata], si
   193                                  linkdatarelocation load_yyname_next
   194                                  @@:
   195 000000EC 5F                      	pop di
   196 000000ED 5E                      	pop si
   197                                  
   198 000000EE 31D2                    	xor dx, dx
   199 000000F0 268B471A                	mov ax, [es:bx + deClusterLow]
   200                                  				; = first cluster (not FAT32)
   201 000000F4 807EE620                	cmp byte [bp + ldFATType], 32
   202 000000F8 7504                    	jne @F
   203 000000FA 268B5714                	mov dx, [es:bx + deClusterHigh]
   204                                  				; dx:ax = first cluster (FAT32)
   205                                  @@:
   206                                  
   207 000000FE EB9A                    	jmp scan_dir_yyname_loop
   208                                  
   209                                  boot_parse_name:
   210 00000100 3936[4003]              reloc	cmp word [wild_pattern], si
   211                                  internaldatarelocation
   212 00000104 740A                    	je @F
   213 00000106 E8DF10                  	extcallcall boot_parse_fn	; get next pathname
   214                                  
   215 00000109 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   216                                  linkdatarelocation handle_scan_dir_entry, -4
   217                                  linkdatarelocation scan_dir_entry
   218                                  
   219 0000010F C3                      	retn
   220                                  
   221                                  @@:
   222 00000110 E8D510                  	extcallcall boot_parse_fn	; get next pathname
   223                                  
   224 00000113 C706[0000][3D01]        reloc2	mov word [relocateddata], match_wildcard
   225                                  linkdatarelocation near_transfer_ext_address, -4
   226                                  internalcoderelocation
   227 00000119 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   228                                  linkdatarelocation handle_scan_dir_entry, -4
   229                                  linkdatarelocation near_transfer_ext_entry
   230                                  
   231 0000011F 50                      	push ax
   232 00000120 BF[0000]                reloc	mov di, relocateddata
   233                                  linkdatarelocation load_kernel_name
   234 00000123 B90800                  	mov cx, 8
   235 00000126 E80700                  	call .handle_asterisk		; handle in basename
   236 00000129 B103                    	mov cl, 3
   237 0000012B E80200                  	call .handle_asterisk		; handle in extension
   238 0000012E 58                      	pop ax
   239 0000012F C3                      	retn
   240                                  
   241                                  .handle_asterisk:
   242 00000130 B02A                    	mov al, '*'
   243 00000132 F2AE                    	repne scasb			; scan for asterisk
   244 00000134 7506                    	jne @F				; not found -->
   245 00000136 B03F                    	mov al, '?'			; fill with question marks
   246 00000138 4F                      	dec di				; -> at the asterisk
   247 00000139 41                      	inc cx				; = how many bytes remain
   248 0000013A F3AA                    	rep stosb			; fill this field
   249                                  @@:
   250 0000013C C3                      	retn
   251                                  
   252                                  
   253                                  		; INP:	es:di -> DIRENTRY
   254                                  		;	dx:ax - 1 = sector
   255                                  		;	cx, si in use
   256                                  		; OUT:	CY if end of directory
   257                                  		;	NC if to continue,
   258                                  		;	 ZR if match
   259                                  		;	 NZ if mismatch
   260                                  		; CHG:	bx
   261                                  match_wildcard:
   262 0000013D 26803D00                	cmp byte [es:di], 0
   263 00000141 F9                      	stc
   264 00000142 7503E9B400              	je .ret
   265 00000147 268A5D0B                	mov bl, byte [es:di + deAttrib]
   266 0000014B F6C308                  	test bl, ATTR_VOLLABEL
   267 0000014E 7403E9A700              	jnz .ret_NC		; skip volume labels (and LFNs) --> (NZ)
   268 00000153 80E310                  	and bl, ATTR_DIRECTORY	; isolate directory bit
   269                                  	; cmp bl, byte [load_check_dir_attr]	; is it what we're searching?
   270                                  	; jne .ret_NC				; no -->
   271 00000156 7403E99F00              	jnz .ret_NC		; must not be directory -->
   272 0000015B 56                      	push si
   273 0000015C 57                      	push di
   274 0000015D 51                      	push cx
   275 0000015E BE[0000]                reloc	mov si, relocateddata	; ds:si-> name to match
   276                                  linkdatarelocation load_kernel_name
   277 00000161 B90B00                  	mov cx, 11		; length of padded 8.3 FAT filename
   278                                  @@:
   279 00000164 F3A6                    	repe cmpsb		; check entry
   280 00000166 7406                    	je @F			; match -->
   281 00000168 807CFF3F                	cmp byte [si - 1], '?'	; wildcard ?
   282 0000016C 74F6                    	je @B			; yes --> (ZR)
   283                                  				; no (NZ)
   284                                  @@:
   285 0000016E 59                      	pop cx
   286 0000016F 5F                      	pop di
   287 00000170 5E                      	pop si
   288 00000171 7403E98400              	jne .ret_NC
   289                                  
   290 00000176 56                      	push si
   291 00000177 06                      	push es
   292 00000178 57                      	push di
   293 00000179 52                      	push dx
   294 0000017A 50                      	push ax
   295 0000017B 51                      	push cx
   296                                  
   297 0000017C B92000                  	mov cx, DIRENTRY_size
   298 0000017F 1E                      	push ds
   299 00000180 06                      	 push es
   300 00000181 1F                      	 pop ds
   301 00000182 89FE                    	mov si, di		; ds:si -> entry in directory buffer
   302 00000184 16                      	push ss
   303 00000185 07                      	pop es
   304 00000186 BF[0000]                reloc	mov di, relocateddata	; es:di -> destination for entry
   305                                  linkdatarelocation load_yy_direntry
   306 00000189 57                      	push di
   307 0000018A F3A4                    	rep movsb
   308 0000018C 5E                      	pop si
   309 0000018D 1F                      	pop ds
   310                                  
   311 0000018E BF[7503]                reloc	mov di, pathnamebuffer - 1
   312                                  internaldatarelocation		; di -> buffer
   313 00000191 B000                    	mov al, 0
   314 00000193 AA                      	stosb
   315 00000194 57                      	push di
   316 00000195 B108                    	mov cl, 8
   317 00000197 803C05                  	cmp byte [si], 05h
   318 0000019A 7505                    	jne @F
   319 0000019C B0E5                    	mov al, 0E5h
   320 0000019E AA                      	stosb
   321 0000019F 49                      	dec cx
   322 000001A0 46                      	inc si
   323                                  @@:
   324 000001A1 F3A4                    	rep movsb
   325 000001A3 B109                    	mov cl, 9
   326 000001A5 A8                      	db __TEST_IMM8
   327                                  @@:
   328 000001A6 4F                      	dec di
   329 000001A7 807DFF20                	cmp byte [di - 1], 32
   330 000001AB E1F9                    	loope @B
   331 000001AD B02E                    	mov al, '.'
   332 000001AF AA                      	stosb
   333 000001B0 B103                    	mov cl, 3
   334 000001B2 F3A4                    	rep movsb
   335 000001B4 B104                    	mov cl, 4
   336 000001B6 A8                      	db __TEST_IMM8
   337                                  @@:
   338 000001B7 4F                      	dec di
   339 000001B8 807DFF20                	cmp byte [di - 1], 32
   340 000001BC E1F9                    	loope @B
   341 000001BE 807DFF2E                	cmp byte [di - 1], '.'
   342 000001C2 7501                    	jne @F
   343 000001C4 4F                      	dec di
   344                                  @@:
   345 000001C5 B000                    	mov al, 0
   346 000001C7 AA                      	stosb
   347                                  
   348 000001C8 E82510                  	extcallcall got_yyentry
   349 000001CB 8026[0300]EF            reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   350                                  linkdatarelocation internalflags3, -3
   351 000001D0 16                      	 push ss
   352 000001D1 07                      	 pop es
   353 000001D2 5A                      	pop dx
   354 000001D3 B8[0000]                reloc	mov ax, relocateddata
   355                                  linkdatarelocation load_data_lowest	; make yy_boot_get and yy_boot_update no-ops
   356 000001D6 E85F02                  	call commonhandle
   357 000001D9 800E[0300]10            reloc	setopt [relocateddata], dif3_auxbuff_guarded_1
   358                                  linkdatarelocation internalflags3, -3
   359 000001DE 59                      	pop cx
   360 000001DF 58                      	pop ax
   361 000001E0 5A                      	pop dx
   362 000001E1 5F                      	pop di
   363 000001E2 07                      	pop es
   364 000001E3 5E                      	pop si			; restore registers
   365                                  
   366 000001E4 83E801                  	sub ax, 1
   367 000001E7 83DA00                  	sbb dx, 0
   368 000001EA 8B1E[0000]              reloc	mov bx, [relocateddata]
   369                                  linkdatarelocation load_adr_dirbuf_segment
   370 000001EE E8[0000]EB020000        	extcall read_sector	; restore sector
   371                                  
   372 000001F5 800E[0500]FF            reloc	or byte [found], -1
   373                                  internaldatarelocation -3	; NZ
   374                                  .ret_NC:
   375 000001FA F8                      	clc
   376                                  .ret:
   377 000001FB E8[0000]EB020000        	extcall near_transfer_ext_return, required ; must NOT be extcallcall
   378                                  
   379                                  
   380                                  end_of_directory:
   381 00000202 D006[0500]              reloc	rol byte [found], 1
   382                                  internaldatarelocation
   383 00000206 721D                    	jc @F
   384                                  
   385                                  	; pushf
   386 00000208 8026[0300]EF            reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   387                                  linkdatarelocation internalflags3, -3
   388                                  	; popf
   389                                  
   390                                  	houdini
   391                                  ;reloc	mov di, word [relocateddata]
   392                                  ;linkdatarelocation load_yyname_input
   393 0000020D 8B3E[4203]              reloc	mov di, word [boot_parsed]
   394                                  internaldatarelocation
   395 00000211 E8E40F                  	extcallcall retry_open_scriptspath
   396 00000214 7503E919FE              	jz boot_find
   397                                  
   398 00000219 B8470E                  	mov ax, 0E47h
   399 0000021C E8E10F                  	extcallcall setrc
   400 0000021F BA[2300]                reloc	mov dx, msg.notfound
   401                                  internaldatarelocation
   402 00000222 E8E30F                  	extcallcall putsz
   403                                  @@:
   404 00000225 E8E80F                  	extcallcall cmd3
   405                                  
   406                                  got_single_yyentry:
   407 00000228 E8C50F                  	extcallcall got_yyentry
   408 0000022B EB03                    	jmp @F
   409                                  
   410                                  boot_no_wild:
   411                                   %endif
   412                                  
   413 0000022D E8E80F                  	extcallcall yy_boot_open_file2	; calls initialise_fs
   414                                  @@:
   415 00000230 8026[0300]EF            reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   416                                  linkdatarelocation internalflags3, -3
   417                                  
   418                                  %if _DATABUFFER
   419 00000235 F606[0100]40            reloc	testopt [relocateddata], nodosloaded
   420                                  linkdatarelocation internalflags, -3
   421 0000023A 7420                    	jz .skipdatabuffer
   422 0000023C B104                    	mov cl, 4
   423 0000023E 8CD0                    	mov ax, ss
   424 00000240 BB[E018]                reloc	mov bx, databuffer
   425                                  internaldatarelocation
   426 00000243 F6C30F                  	test bl, 15
   427 00000246 7514                    	jnz .skipdatabuffer
   428 00000248 D3EB                    	shr bx, cl
   429 0000024A 01D8                    	add ax, bx
   430 0000024C A3[0600]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSegment], ax
   431                                  linkdatarelocation load_data
   432 0000024F 31C0                    	xor ax, ax
   433 00000251 A3[0A00]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSector + 2], ax
   434                                  linkdatarelocation load_data
   435 00000254 A3[0800]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSector], ax
   436                                  linkdatarelocation load_data
   437 00000257 800E[1700]08            reloc	setopt [relocateddata - LOADDATA2 + ldFlags], ldfDataBuffered
   438                                  linkdatarelocation load_data, -3
   439                                  .skipdatabuffer:
   440                                  %endif
   441                                  
   442 0000025C 8B3E[0000]              reloc	mov di, word [relocateddata]
   443                                  linkdatarelocation load_yyname_input
   444 00000260 E8B501                  	call find_dir
   445 00000263 89FA                    	mov dx, di
   446 00000265 B8[0000]                reloc	mov ax, relocateddata
   447                                  linkdatarelocation load_data_lowest	; make yy_boot_get and yy_boot_update no-ops
   448 00000268 E8CD01                  	call commonhandle
   449 0000026B E8A20F                  	extcallcall cmd3
   450                                  %endif
   451                                  
   452                                  run_dos:
   453 0000026E E8AF0F                  	extcallcall InDOS
   454 00000271 E8B40F                  	extcallcall yy_dos_parse_name
   455 00000274 E8FD00                  	call parse_verbose
   456                                  
   457 00000277 53                      	push bx
   458                                  
   459 00000278 B42F                    	mov ah, 2Fh			; get DTA
   460 0000027A E8B30F                  	extcallcall ispm
   461 0000027D 750F                    	jnz .rm
   462                                  
   463                                  subcpu 286
   464 0000027F 6A00                    	push word 0
   465 00000281 6A21                    	push word 21h
   466 00000283 E8[0000]EB020000        	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
   467 0000028A 5A                      	pop dx				; discard interrupt number
   468 0000028B 5A                      	pop dx				; get es
   469                                  subcpureset
   470 0000028C EB04                    	jmp @F
   471                                  .rm:
   472 0000028E CD21                    	int 21h
   473 00000290 8CC2                    	mov dx, es
   474                                  @@:
   475                                  
   476 00000292 891E[4003]              reloc	mov word [originaldta], bx
   477                                  internaldatarelocation
   478 00000296 8916[4203]              reloc	mov word [originaldta + 2], dx
   479                                  internaldatarelocation
   480                                  
   481 0000029A A1[0000]                reloc	mov ax, word [relocateddata]
   482                                  linkdatarelocation ext_inject_handler
   483 0000029D A3[4403]                reloc	mov word [originalinject], ax
   484                                  internaldatarelocation
   485 000002A0 C706[0000][C20C]        reloc2	mov word [relocateddata], inject
   486                                  linkdatarelocation ext_inject_handler, -4
   487                                  internalcoderelocation
   488 000002A6 E8E80E                  	call get_es_ext
   489 000002A9 26800E[1000]01          reloc	setopt [es:code + eldiFlags], eldifResident
   490                                  internalcoderelocation -3	; mark block as resident
   491 000002AF 16                      	 push ss
   492 000002B0 07                      	 pop es
   493                                  
   494                                  	houdini
   495 000002B1 BA[4A03]                reloc	mov dx, dta
   496                                  internaldatarelocation
   497 000002B4 B41A                    	mov ah, 1Ah		; set DTA
   498 000002B6 E87F0F                  	extcallcall _doscall
   499                                  
   500 000002B9 5A                      	pop dx
   501                                  
   502                                  .find:
   503 000002BA C706[4603]4F71          reloc	mov word [findnext_function_number], 714Fh
   504                                  internaldatarelocation -4
   505 000002C0 B84E71                  	mov ax, 714Eh
   506 000002C3 B90600                  	mov cx, 6		; find all files, no directories
   507 000002C6 BE0100                  	mov si, 1
   508 000002C9 BF[7605]                reloc	mov di, finddata
   509                                  internaldatarelocation
   510 000002CC D006[0800]              reloc	rol byte [prefersfn], 1
   511                                  internaldatarelocation
   512 000002D0 721C                    	jc .sfn_try
   513 000002D2 F9                      	stc
   514 000002D3 E8620F                  	extcallcall _doscall
   515 000002D6 730C                    	jnc .lfn_found
   516 000002D8 83F801                  	cmp ax, 1
   517 000002DB 7411                    	je .sfn_try
   518 000002DD 3D0071                  	cmp ax, 7100h
   519 000002E0 740C                    	je .sfn_try
   520 000002E2 EB74                    	jmp .notfound
   521                                  
   522                                  .lfn_found:
   523 000002E4 A3[4803]                reloc	mov word [findhandle], ax
   524                                  internaldatarelocation
   525 000002E7 C606[0400]FF            reloc	mov byte [findhandle_set], 0FFh
   526                                  internaldatarelocation -3
   527 000002EC EB11                    	jmp .next
   528                                  
   529                                  .sfn_try:
   530 000002EE C706[4603]004F          reloc	mov word [findnext_function_number], 4F00h
   531                                  internaldatarelocation -4
   532 000002F4 B8004E                  	mov ax, 4E00h
   533 000002F7 B90600                  	mov cx, 6		; find all files, no directories
   534 000002FA E83B0F                  	extcallcall _doscall
   535 000002FD 7259                    	jc .notfound
   536                                  
   537                                  .next:
   538 000002FF 52                      	push dx
   539 00000300 89D7                    	mov di, dx
   540 00000302 E81301                  	call find_dir
   541 00000305 89DE                    	mov si, bx		; si -> path
   542 00000307 89F9                    	mov cx, di
   543 00000309 29F1                    	sub cx, si		; cx = length of path
   544 0000030B BF[7603]                reloc	mov di, pathnamebuffer
   545                                  internaldatarelocation		; di -> buffer
   546 0000030E 89FB                    	mov bx, di		; bx -> buffer
   547 00000310 F3A4                    	rep movsb
   548 00000312 89FA                    	mov dx, di		; dx -> where we store filename
   549 00000314 BE[6803]                reloc	mov si, dta.name
   550                                  internaldatarelocation
   551 00000317 B90D00                  	mov cx, 13
   552                                  
   553 0000031A 803E[4703]71            reloc	cmp byte [findnext_function_number + 1], 71h
   554                                  internaldatarelocation -3
   555 0000031F 7510                    	jne .sfn_copy
   556                                  
   557 00000321 BE[A205]                reloc	mov si, finddata.fullname
   558                                  internaldatarelocation
   559 00000324 57                      	push di
   560 00000325 B9FFFF                  	mov cx, -1
   561 00000328 B000                    	mov al, 0
   562 0000032A 89F7                    	mov di, si
   563 0000032C F2AE                    	repne scasb		; cx = -2, copy 1 byte
   564 0000032E F7D1                    	not cx
   565 00000330 5F                      	pop di
   566                                  
   567                                  .sfn_copy:
   568 00000331 F3A4                    	rep movsb
   569                                  
   570 00000333 52                      	push dx
   571 00000334 E8090F                  	extcallcall yy_open_file
   572 00000337 5A                      	pop dx
   573 00000338 A3[0000]                reloc	mov word [relocateddata], ax
   574                                  linkdatarelocation ext_handle
   575                                  @@:
   576 0000033B E8FA00                  	call commonhandle
   577 0000033E E8070F                  	extcallcall close_ext
   578 00000341 5A                      	pop dx
   579 00000342 A1[4603]                reloc	mov ax, word [findnext_function_number]
   580                                  internaldatarelocation
   581 00000345 8B1E[4803]              reloc	mov bx, word [findhandle]
   582                                  internaldatarelocation
   583 00000349 BE0100                  	mov si, 1
   584 0000034C BF[7605]                reloc	mov di, finddata
   585                                  internaldatarelocation
   586 0000034F F9                      	stc
   587 00000350 E8E50E                  	extcallcall _doscall
   588 00000353 73AA                    	jnc .next
   589                                  
   590 00000355 E8B80E                  	extcallcall cmd3
   591                                  
   592                                  
   593                                  .notfound:
   594 00000358 89D7                    	mov di, dx
   595 0000035A E89B0E                  	extcallcall retry_open_scriptspath
   596 0000035D 89DA                    	mov dx, bx
   597 0000035F 7503E956FF              	jz .find
   598                                  
   599 00000364 B8480E                  	mov ax, 0E48h
   600 00000367 E8960E                  	extcallcall setrc
   601 0000036A BA[2300]                reloc	mov dx, msg.notfound
   602                                  internaldatarelocation
   603 0000036D E8980E                  	extcallcall putsz
   604 00000370 E89D0E                  	extcallcall cmd3
   605                                  
   606                                  
   607                                  parse_verbose.loop:
   608 00000373 AC                      	lodsb
   609                                  parse_verbose:
   610 00000374 E8D90E                  	extcallcall skipcomm0
   611 00000377 E8DE0E                  	extcallcall iseol?
   612 0000037A 7501                    	jne @F
   613 0000037C C3                      	retn
   614                                  
   615                                  @@:
   616 0000037D 4E                      	dec si
   617 0000037E BA[0B00]                reloc	mov dx, msg.verbose
   618                                  internaldatarelocation
   619 00000381 E8DC0E                  	extcallcall isstring?
   620 00000384 7507                    	jne @F
   621 00000386 C606[0600]FF            reloc	mov byte [verbose], 0FFh
   622                                  internaldatarelocation -3
   623 0000038B EBE6                    	jmp .loop
   624                                  
   625                                  @@:
   626 0000038D BA[1300]                reloc	mov dx, msg.string_help
   627                                  internaldatarelocation
   628 00000390 E8CD0E                  	extcallcall isstring?
   629 00000393 7507                    	jne @F
   630 00000395 C606[0700]FF            reloc	mov byte [do_help], 0FFh
   631                                  internaldatarelocation -3
   632 0000039A EBD7                    	jmp .loop
   633                                  
   634                                  @@:
   635 0000039C BA[1800]                reloc	mov dx, msg.string_sfn
   636                                  internaldatarelocation
   637 0000039F E8BE0E                  	extcallcall isstring?
   638 000003A2 7507                    	jne @F
   639 000003A4 C606[0800]FF            reloc	mov byte [prefersfn], 0FFh
   640                                  internaldatarelocation -3
   641 000003A9 EBC8                    	jmp .loop
   642                                  
   643                                  @@:
   644 000003AB BA[1C00]                reloc	mov dx, msg.string_lib
   645                                  internaldatarelocation
   646 000003AE E8AF0E                  	extcallcall isstring?
   647 000003B1 750A                    	jne @F
   648 000003B3 C606[0900]FF            reloc	mov byte [lib], 0FFh
   649                                  internaldatarelocation -3
   650 000003B8 EBB9                    	jmp .loop
   651                                  
   652                                  .error:
   653 000003BA E9EB0E                  	jmp error
   654                                  
   655                                  @@:
   656 000003BD AC                      	lodsb
   657 000003BE 3C2F                    	cmp al, '/'
   658 000003C0 75F8                    	jne .error
   659 000003C2 BF[3803]                reloc	mov di, libnamebuffer
   660                                  internaldatarelocation
   661 000003C5 B82020                  	mov ax, 2020h
   662 000003C8 57                      	push di
   663 000003C9 AB<rep 4h>              	times 4 stosw
   664 000003CD 5F                      	pop di
   665 000003CE D006[0A00]              reloc	rol byte [libname], 1
   666                                  internaldatarelocation
   667 000003D2 72E6                    	jc .error
   668 000003D4 F616[0A00]              reloc	not byte [libname]
   669                                  internaldatarelocation
   670                                  @@:
   671 000003D8 AC                      	lodsb
   672 000003D9 E87C0E                  	extcallcall iseol?
   673 000003DC 7436                    	je .nameend
   674 000003DE 3C20                    	cmp al, 32
   675 000003E0 7432                    	je .nameend
   676 000003E2 3C09                    	cmp al, 9
   677 000003E4 742E                    	je .nameend
   678 000003E6 3C2C                    	cmp al, ','
   679 000003E8 742A                    	je .nameend
   680 000003EA 81FF[4003]              reloc	cmp di, strict word libnamebuffer + 8
   681                                  internaldatarelocation
   682 000003EE 73CA                    	jae .error
   683 000003F0 E8750E                  	extcallcall uppercase
   684 000003F3 AA                      	stosb
   685 000003F4 3C2A                    	cmp al, '*'
   686 000003F6 75E0                    	jne @B
   687 000003F8 4F                      	dec di
   688 000003F9 B03F                    	mov al, '?'
   689                                  @@:
   690 000003FB AA                      	stosb
   691 000003FC 81FF[4003]              reloc	cmp di, strict word libnamebuffer + 8
   692                                  internaldatarelocation
   693 00000400 72F9                    	jb @B
   694 00000402 AC                      	lodsb
   695 00000403 E8520E                  	extcallcall iseol?
   696 00000406 740C                    	je .nameend
   697 00000408 3C20                    	cmp al, 32
   698 0000040A 7408                    	je .nameend
   699 0000040C 3C09                    	cmp al, 9
   700 0000040E 7404                    	je .nameend
   701 00000410 3C2C                    	cmp al, ','
   702 00000412 75A6                    	jne .error
   703                                  .nameend:
   704 00000414 4E                      	dec si
   705 00000415 E95BFF                  	jmp .loop
   706                                  
   707                                  
   708                                  find_dir:
   709 00000418 89FB                    	mov bx, di		; bx -> start of path
   710 0000041A B9FFFF                  	mov cx, -1
   711 0000041D B000                    	mov al, 0
   712 0000041F F2AE                    	repne scasb
   713 00000421 4F                      	dec di
   714                                  @@:
   715 00000422 39DF                    	cmp di, bx
   716 00000424 7611                    	jbe .di
   717 00000426 4F                      	dec di
   718 00000427 803D2F                  	cmp byte [di], '/'
   719 0000042A 740A                    	je .di_plus_one
   720 0000042C 803D5C                  	cmp byte [di], '\'
   721 0000042F 7405                    	je .di_plus_one
   722 00000431 803D3A                  	cmp byte [di], ':'
   723 00000434 75EC                    	jne @B
   724                                  .di_plus_one:
   725 00000436 47                      	inc di
   726                                  .di:				; di -> end of path
   727 00000437 C3                      	retn
   728                                  
   729                                  
   730                                  		; INP:	file is opened
   731                                  		;	file seek is at ELD/SLD header
   732                                  		;	ax = file handle or bootloaded file structure offset
   733                                  		;	 (write to bx for file access functions)
   734                                  		;	dx -> ASCIZ name of matched file
   735                                  commonhandle:
   736                                  %if _COMPRESSED
   737 00000438 F9                      	stc
   738                                  %endif
   739 00000439 B300                    	mov bl, 0
   740                                  .lib:
   741                                  		; INP:	CY, bl = 0 if top level file (SLD or ELD),
   742                                  		;	 file seek is zero
   743                                  		;	CY, bl = 1 if uncompressed library's ELD,
   744                                  		;	 file seek is at ELD header
   745                                  		;	NC, bl = 1 if compressed library's ELD,
   746                                  		;	 cx:di = offset within compressed library
   747                                  	lframe
   748                                  	lvar word, more_help
   749                                  	lvar dword, liboffset
   750                                  	lvar dword, libnext
   751                                  	lvar word, libamount
   752                                  	lvar 12 + 2, libentry
   753                                  	lequ ?libentry, state
   754                                  	lequ ?libentry + 2, tail
   755                                  	lequ ?libentry + 4, next
   756                                  	lequ ?libentry + 6, helpstarted
   757 0000043B 5589E58D66E6            	lenter
   758                                  	lvar word, not_sld_bit_0
   759 00000441 53                      	 push bx
   760                                  %if _COMPRESSED
   761                                  	lvar word, uncompressed_bit_0
   762 00000442 9C                      	 pushf
   763 00000443 893E[C006]              reloc	mov word [depackskip], di
   764                                  internaldatarelocation
   765 00000447 890E[C206]              reloc	mov word [depackskip + 2], cx
   766                                  internaldatarelocation
   767                                  %endif
   768                                  	lvar word, handle
   769 0000044B 50                      	 push ax
   770 0000044C 93                      	xchg bx, ax		; bx = handle
   771 0000044D E8B80D                  	extcallcall putsz
   772 00000450 89D7                    	mov di, dx
   773                                  
   774 00000452 31C9                    	xor cx, cx
   775 00000454 31D2                    	xor dx, dx
   776 00000456 B80142                  	mov ax, 4201h
   777 00000459 E8B808                  	call seek_compressed_or_dos_or_boot_io
   778 0000045C 7303E9E204              	jc .io_error
   779                                  	lvar dword, eldheader
   780 00000461 52                      	 push dx
   781 00000462 50                      	 push ax
   782                                  
   783 00000463 BA[2000]                reloc	mov dx, msg.colon
   784                                  internaldatarelocation
   785 00000466 E89F0D                  	extcallcall putsz
   786                                  
   787 00000469 B000                    	mov al, 0
   788 0000046B B9FFFF                  	mov cx, -1
   789 0000046E F2AE                    	repne scasb		; cx = -2 means 0 bytes, -3 means 1 bytes
   790                                  %if 0
   791                                  	not cx			; cx = 1 means 0 bytes
   792                                  	cmp cx, 8 + 1 + 3 + 1
   793                                  	jae @FF
   794                                  	neg cx
   795                                  	add cx, 8 + 1 + 3 + 1
   796                                  %else
   797                                  		; I give up, it's magic
   798 00000470 83C10E                  	add cx, (8 + 1 + 3 + 1) + 1
   799 00000473 7309                    	jnc @FF
   800 00000475 7407                    	jz @FF
   801                                  %endif
   802                                  @@:
   803 00000477 B020                    	mov al, 32
   804 00000479 E8F40D                  	extcallcall putc
   805 0000047C E2F9                    	loop @B
   806                                  @@:
   807                                  
   808                                  %if _ELDTRAILER
   809 0000047E F646E401                	testopt [bp + ?not_sld_bit_0], 1
   810 00000482 7403E99000              	jnz .no_trailer_no_seek
   811 00000487 B80242                  	mov ax, 4202h
   812 0000048A 31C9                    	xor cx, cx
   813 0000048C 31D2                    	xor dx, dx
   814 0000048E E88308                  	call seek_compressed_or_dos_or_boot_io
   815 00000491 7303E9AD04              	jc .io_error
   816                                  
   817 00000496 85D2                    	test dx, dx
   818 00000498 7505                    	jnz @F
   819 0000049A 83F830                  	cmp ax, ELD_HEADER_size + ELD_TRAILER_HEADER_size
   820 0000049D 7267                    	jb .no_trailer
   821                                  @@:
   822                                  
   823 0000049F B80142                  	mov ax, 4201h
   824 000004A2 B9FFFF                  	mov cx, -1
   825 000004A5 BAF0FF                  	mov dx, - ELD_TRAILER_HEADER_size
   826 000004A8 E86908                  	call seek_compressed_or_dos_or_boot_io
   827 000004AB 7303E99304              	jc .io_error
   828                                  
   829 000004B0 52                      	push dx
   830 000004B1 50                      	push ax
   831                                  
   832 000004B2 B91000                  	mov cx, fromwords(ELD_TRAILER_HEADER_size_w)
   833 000004B5 29CC                    	sub sp, cx
   834 000004B7 89E2                    	mov dx, sp
   835                                  
   836 000004B9 B43F                    	mov ah, 3Fh
   837 000004BB E87C08                  	call read_compressed_or_dos_or_boot_io
   838 000004BE 7303E98004              	jc .io_error
   839 000004C3 89E7                    	mov di, sp
   840 000004C5 89E6                    	mov si, sp
   841                                  
   842 000004C7 39C8                    	cmp ax, cx
   843 000004C9 7538                    	jne .no_trailer_pop
   844                                  
   845 000004CB 31D2                    	xor dx, dx
   846 000004CD D1E9                    	shr cx, 1
   847                                  @@:
   848 000004CF AD                      	lodsw
   849 000004D0 01C2                    	add dx, ax
   850 000004D2 E2FB                    	loop @B
   851 000004D4 752D                    	jnz .no_trailer_pop
   852                                  
   853 000004D6 58                      	pop ax
   854 000004D7 3D454C                  	cmp ax, "EL"
   855 000004DA 7527                    	jne .no_trailer_pop
   856 000004DC 58                      	pop ax
   857 000004DD 3D4431                  	cmp ax, "D1"
   858 000004E0 7521                    	jne .no_trailer_pop
   859 000004E2 58                      	pop ax
   860 000004E3 3D5441                  	cmp ax, "TA"
   861 000004E6 751B                    	jne .no_trailer_pop
   862 000004E8 58                      	pop ax
   863 000004E9 3D494C                  	cmp ax, "IL"
   864 000004EC 7515                    	jne .no_trailer_pop
   865                                  
   866 000004EE 5E                      	pop si
   867 000004EF 59                      	pop cx			; cx:si = displacement to subtract
   868 000004F0 58                      	pop ax			; reserved
   869 000004F1 58                      	pop ax			; checksum
   870                                  
   871 000004F2 58                      	pop ax
   872 000004F3 5A                      	pop dx			; dx:ax = offset of trailer header
   873 000004F4 01F0                    	add ax, si
   874 000004F6 11CA                    	adc dx, cx		; dx:ax = offset of header
   875 000004F8 7203E94604              	jnc .io_error
   876                                  
   877 000004FD 8946DC                  	mov word [bp + ?eldheader], ax
   878 00000500 8956DE                  	mov word [bp + ?eldheader + 2], dx
   879                                  
   880                                  .no_trailer_pop:
   881 00000503 8D6514                  	lea sp, [di + fromwords(ELD_TRAILER_HEADER_size_w) + 4]
   882                                  
   883                                  .no_trailer:
   884 00000506 B80042                  	mov ax, 4200h
   885 00000509 8B56DC                  	mov dx, word [bp + ?eldheader]
   886 0000050C 8B4EDE                  	mov cx, word [bp + ?eldheader + 2]
   887 0000050F E80208                  	call seek_compressed_or_dos_or_boot_io
   888 00000512 7303E92C04              	jc .io_error
   889                                  
   890                                  .no_trailer_no_seek:
   891                                  %endif
   892                                  
   893 00000517 B43F                    	mov ah, 3Fh
   894 00000519 B92000                  	mov cx, fromwords(ELD_HEADER_size_w)
   895                                  	lvar fromwords(ELD_HEADER_size_w), header
   896 0000051C 29CC                    	sub sp, cx
   897 0000051E 89E2                    	mov dx, sp
   898 00000520 E81708                  	call read_compressed_or_dos_or_boot_io
   899 00000523 7303E91B04              	jc .io_error
   900 00000528 39C8                    	cmp ax, cx
   901 0000052A 750C                    	jne .invalid_check_sld_NZ
   902 0000052C 817EBC454C              	cmp word [bp + ?header + eldhSignature], "EL"
   903 00000531 7505                    	jne .invalid_check_sld_NZ
   904 00000533 817EBE4431              	cmp word [bp + ?header + eldhSignature + 2], "D1"
   905                                  .invalid_check_sld_NZ:
   906 00000538 7403E92804              	jne .invalid_check_sld
   907                                  	houdini
   908 0000053D 837EDA24                	cmp word [bp + ?header + eldhExtensionSize], eldhxDescriptionOffset + 4
   909 00000541 7303E9EE03              	jb .nodesc
   910 00000546 83EC04                  	sub sp, 4
   911                                  %if eldhxDescriptionOffset - ELD_HEADER_size
   912                                  	mov dx, eldhxDescriptionOffset - ELD_HEADER_size
   913                                  	xor cx, cx
   914                                  	mov ax, 4201h
   915                                  	call seek_compressed_or_dos_or_boot_io
   916                                  	jc .io_error
   917                                  %endif
   918 00000549 89E2                    	mov dx, sp
   919 0000054B B90400                  	mov cx, 4
   920 0000054E B43F                    	mov ah, 3Fh
   921 00000550 E8E707                  	call read_compressed_or_dos_or_boot_io
   922 00000553 7303E9EB03              	jc .io_error
   923 00000558 39C8                    	cmp ax, cx
   924 0000055A 7403E92D04              	jne .invalid
   925 0000055F 5A                      	pop dx
   926 00000560 59                      	pop cx
   927 00000561 89D0                    	mov ax, dx
   928 00000563 09C8                    	or ax, cx
   929 00000565 7503E9CA03              	jz .nodesc
   930 0000056A 0356DC                  	add dx, word [bp + ?eldheader]
   931 0000056D 134EDE                  	adc cx, word [bp + ?eldheader + 2]
   932 00000570 B80042                  	mov ax, 4200h
   933 00000573 E89E07                  	call seek_compressed_or_dos_or_boot_io
   934 00000576 7303E9C803              	jc .io_error
   935                                  
   936 0000057B BF[0000]                reloc	mov di, relocateddata
   937                                  linkdatarelocation line_out
   938 0000057E B94000                  	mov cx, words(128)
   939 00000581 31C0                    	xor ax, ax
   940 00000583 89FA                    	mov dx, di
   941 00000585 F3AB                    	rep stosw
   942 00000587 B43F                    	mov ah, 3Fh
   943 00000589 B97F00                  	mov cx, 127
   944 0000058C E8AB07                  	call read_compressed_or_dos_or_boot_io
   945 0000058F 7303E9AF03              	jc .io_error
   946 00000594 E8710C                  	extcallcall putsz
   947 00000597 BA[0301]                reloc	mov dx, msg.linebreak
   948                                  internaldatarelocation
   949                                  .putsz_desc_done:
   950 0000059A E86B0C                  	extcallcall putsz
   951                                  
   952 0000059D D006[0600]              reloc	rol byte [verbose], 1
   953                                  internaldatarelocation
   954 000005A1 7203E9AE00              	jnc .help
   955 000005A6 BF[0000]                reloc	mov di, relocateddata
   956                                  linkdatarelocation line_out
   957 000005A9 BE[3A01]                reloc	mov si, msg.verbose.1
   958                                  internaldatarelocation
   959 000005AC E8C90C                  	extcallcall copy_single_counted_string
   960                                  
   961 000005AF 8D76BC                  	lea si, [bp + ?header]
   962 000005B2 A5                      	movsw
   963 000005B3 A5                      	movsw
   964                                  
   965 000005B4 83EC08                  	sub sp, 8
   966 000005B7 B80042                  	mov ax, 4200h
   967 000005BA 8B4EC6                  	mov cx, word [bp + ?header + eldhCodeOffset + 2]
   968 000005BD 8B56C4                  	mov dx, word [bp + ?header + eldhCodeOffset]
   969 000005C0 0356DC                  	add dx, word [bp + ?eldheader]
   970 000005C3 134EDE                  	adc cx, word [bp + ?eldheader + 2]
   971                                  		; ELD header is at seek 0
   972 000005C6 83C208                  	add dx, eldiIdentifier
   973 000005C9 83D100                  	adc cx, 0
   974 000005CC 7303E98803              	jc .invalid_instance
   975 000005D1 E84007                  	call seek_compressed_or_dos_or_boot_io
   976 000005D4 7303E96A03              	jc .io_error
   977 000005D9 89E2                    	mov dx, sp
   978 000005DB B43F                    	mov ah, 3Fh
   979 000005DD B90800                  	mov cx, 8
   980 000005E0 E85707                  	call read_compressed_or_dos_or_boot_io
   981 000005E3 7303E95B03              	jc .io_error
   982 000005E8 39C8                    	cmp ax, cx
   983 000005EA 7403E96A03              	jne .invalid_instance
   984                                  
   985 000005EF BE[4601]                reloc	mov si, msg.verbose.2
   986                                  internaldatarelocation
   987 000005F2 51                      	push cx
   988 000005F3 E8820C                  	extcallcall copy_single_counted_string
   989 000005F6 59                      	pop cx
   990                                  
   991 000005F7 89E6                    	mov si, sp
   992 000005F9 F3A4                    	rep movsb
   993 000005FB A8                      	db __TEST_IMM8		; (skip dec)
   994                                  @@:
   995 000005FC 4F                      	dec di
   996 000005FD 807DFF20                	cmp byte [di - 1], 32
   997 00000601 74F9                    	je @B
   998                                  
   999 00000603 83C408                  	add sp, 8
  1000                                  
  1001 00000606 B022                    	mov al, '"'
  1002 00000608 AA                      	stosb
  1003                                  
  1004                                  .after_invalid_instance:
  1005 00000609 53                      	push bx
  1006 0000060A E8730C                  	extcallcall putsline_crlf
  1007 0000060D 5B                      	pop bx
  1008 0000060E BF[0000]                reloc	mov di, relocateddata
  1009                                  linkdatarelocation line_out
  1010                                  
  1011 00000611 B82020                  	mov ax, 2020h
  1012 00000614 AB                      	stosw
  1013                                  
  1014 00000615 8B46C8                  	mov ax, word [bp + ?header + eldhCodeImageLength]
  1015 00000618 E86D0C                  	extcallcall decword
  1016                                  
  1017 0000061B BE[5501]                reloc	mov si, msg.verbose.3
  1018                                  internaldatarelocation
  1019 0000061E E8570C                  	extcallcall copy_single_counted_string
  1020                                  
  1021 00000621 0346CA                  	add ax, word [bp + ?header + eldhCodeAllocLength]
  1022 00000624 83C00F                  	add ax, 15
  1023 00000627 24F0                    	and al, ~15
  1024 00000629 E85C0C                  	extcallcall decword
  1025                                  
  1026 0000062C BE[5D01]                reloc	mov si, msg.verbose.4
  1027                                  internaldatarelocation
  1028 0000062F E8460C                  	extcallcall copy_single_counted_string
  1029                                  
  1030 00000632 8B46D0                  	mov ax, word [bp + ?header + eldhDataImageLength]
  1031 00000635 E8500C                  	extcallcall decword
  1032                                  
  1033 00000638 BE[6601]                reloc	mov si, msg.verbose.5
  1034                                  internaldatarelocation
  1035 0000063B E83A0C                  	extcallcall copy_single_counted_string
  1036                                  
  1037 0000063E 0346D2                  	add ax, word [bp + ?header + eldhDataAllocLength]
  1038 00000641 83C00F                  	add ax, 15
  1039 00000644 24F0                    	and al, ~15
  1040 00000646 E83F0C                  	extcallcall decword
  1041                                  
  1042 00000649 BE[6E01]                reloc	mov si, msg.verbose.6
  1043                                  internaldatarelocation
  1044 0000064C E8290C                  	extcallcall copy_single_counted_string
  1045                                  
  1046 0000064F 53                      	push bx
  1047 00000650 E82D0C                  	extcallcall putsline_crlf
  1048 00000653 5B                      	pop bx
  1049                                  
  1050                                  .help:
  1051 00000654 D006[0700]              reloc	rol byte [do_help], 1
  1052                                  internaldatarelocation
  1053 00000658 7203E9B600              	jnc .help_done
  1054                                  
  1055 0000065D 837EDA28                	cmp word [bp + ?header + eldhExtensionSize], eldhxHelpOffset + 4
  1056 00000661 7303E9D402              	jb .nohelp
  1057 00000666 83EC04                  	sub sp, 4
  1058 00000669 BA2400                  	mov dx, eldhxHelpOffset
  1059 0000066C 31C9                    	xor cx, cx
  1060 0000066E 0356DC                  	add dx, word [bp + ?eldheader]
  1061 00000671 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1062 00000674 B80042                  	mov ax, 4200h
  1063 00000677 E89A06                  	call seek_compressed_or_dos_or_boot_io
  1064 0000067A 7303E9C402              	jc .io_error
  1065 0000067F 89E2                    	mov dx, sp
  1066 00000681 B90400                  	mov cx, 4
  1067 00000684 B43F                    	mov ah, 3Fh
  1068 00000686 E8B106                  	call read_compressed_or_dos_or_boot_io
  1069 00000689 7303E9B502              	jc .io_error
  1070 0000068E 39C8                    	cmp ax, cx
  1071 00000690 7403E9F702              	jne .invalid
  1072 00000695 5A                      	pop dx
  1073 00000696 59                      	pop cx
  1074 00000697 89D0                    	mov ax, dx
  1075 00000699 09C8                    	or ax, cx
  1076 0000069B 7503E99A02              	jz .nohelp
  1077 000006A0 0356DC                  	add dx, word [bp + ?eldheader]
  1078 000006A3 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1079 000006A6 B80042                  	mov ax, 4200h
  1080 000006A9 E86806                  	call seek_compressed_or_dos_or_boot_io
  1081 000006AC 7303E99202              	jc .io_error
  1082                                  
  1083 000006B1 BF[0000]                reloc	mov di, relocateddata
  1084                                  linkdatarelocation line_out
  1085 000006B4 C646FEFF                	mov byte [bp + ?more_help], 0FFh
  1086                                  
  1087                                  .loop:
  1088 000006B8 89F8                    	mov ax, di
  1089 000006BA 2D[0000]                reloc	sub ax, strict word relocateddata
  1090                                  linkdatarelocation line_out	; ax = how much already buffered
  1091                                  
  1092 000006BD 50                      	push ax
  1093 000006BE 89FA                    	mov dx, di		; dx -> buffer tail
  1094 000006C0 B43F                    	mov ah, 3Fh		; read
  1095 000006C2 B9[0001]                reloc	mov cx, 256 + relocateddata
  1096                                  linkdatarelocation line_out
  1097 000006C5 29D1                    	sub cx, dx		; cx = how much space in buffer
  1098 000006C7 E87006                  	call read_compressed_or_dos_or_boot_io
  1099 000006CA 7303E97402              	jc .io_error
  1100                                  %if 0
  1101                                  	mov si, dx
  1102                                  	add si, ax		; -> behind read data
  1103                                  	mov byte [si], 0	; may write byte [line_out + 256]
  1104                                  %endif
  1105 000006CF 59                      	pop cx
  1106 000006D0 01C1                    	add cx, ax		; = how much data we have now
  1107 000006D2 743F                    	jz .help_done		; if done -->
  1108                                  
  1109 000006D4 BF[0000]                reloc	mov di, relocateddata
  1110                                  linkdatarelocation line_out
  1111                                  
  1112 000006D7 57                      	push di
  1113 000006D8 51                      	push cx			; cx = 8 if 8 bytes
  1114 000006D9 B000                    	mov al, 0
  1115 000006DB F2AE                    	repne scasb		; if cx was = 8 and second byte is NUL, cx = 6
  1116 000006DD 91                      	xchg ax, cx		; ax = 6
  1117 000006DE 59                      	pop cx
  1118 000006DF 5F                      	pop di
  1119 000006E0 7506                    	jne @F
  1120 000006E2 F656FE                  	not byte [bp + ?more_help]
  1121 000006E5 29C1                    	sub cx, ax		; cx = 8 - 6 = 2
  1122 000006E7 49                      	dec cx			; cx = 1 (one data byte)
  1123                                  @@:
  1124                                  
  1125 000006E8 B00A                    	mov al, 10
  1126 000006EA 01CF                    	add di, cx		; di -> behind data
  1127 000006EC 51                      	push cx
  1128 000006ED 4F                      	dec di			; NZ, di -> last data byte
  1129 000006EE FD                      	std
  1130 000006EF F2AE                    	repne scasb		; scan for last LF
  1131 000006F1 FC                      	cld
  1132 000006F2 59                      	pop cx
  1133 000006F3 7405                    	je .partial		; found an LF -->
  1134                                  .full:
  1135 000006F5 BF[FEFF]                reloc	mov di, relocateddata - 2
  1136                                  linkdatarelocation line_out	; minus 2 to counteract inc inc
  1137 000006F8 01CF                    	add di, cx		; -> behind last data byte (minus 2)
  1138                                  .partial:
  1139 000006FA 47                      	inc di			; -> at LF
  1140 000006FB 47                      	inc di			; -> behind LF
  1141 000006FC 51                      	push cx
  1142 000006FD 53                      	push bx
  1143 000006FE E88F0B                  	extcallcall putsline	; display line_out .. di-1
  1144 00000701 5B                      	pop bx
  1145 00000702 59                      	pop cx
  1146 00000703 89FE                    	mov si, di		; -> behind data displayed
  1147 00000705 BF[0000]                reloc	mov di, relocateddata
  1148                                  linkdatarelocation line_out
  1149                                  		; cx = cx - (si - di)
  1150 00000708 01F9                    	add cx, di
  1151 0000070A 29F1                    	sub cx, si		; cx = how much data remains
  1152 0000070C F3A4                    	rep movsb		; move data to start of line_out
  1153                                  				; di -> where to write
  1154 0000070E D046FE                  	rol byte [bp + ?more_help], 1
  1155 00000711 72A5                    	jc .loop
  1156                                  
  1157                                  .help_done:
  1158 00000713 837EDA2C                	cmp word [bp + ?header + eldhExtensionSize], eldhxLibTable + 4
  1159 00000717 7303E97C02              	jb .nolib
  1160 0000071C 83EC04                  	sub sp, 4
  1161 0000071F BA2800                  	mov dx, eldhxLibTable
  1162 00000722 31C9                    	xor cx, cx
  1163 00000724 0356DC                  	add dx, word [bp + ?eldheader]
  1164 00000727 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1165 0000072A B80042                  	mov ax, 4200h
  1166 0000072D E8E405                  	call seek_compressed_or_dos_or_boot_io
  1167 00000730 7303E90E02              	jc .io_error
  1168 00000735 89E2                    	mov dx, sp
  1169 00000737 B90400                  	mov cx, 4
  1170 0000073A B43F                    	mov ah, 3Fh
  1171 0000073C E8FB05                  	call read_compressed_or_dos_or_boot_io
  1172 0000073F 7303E9FF01              	jc .io_error
  1173 00000744 39C8                    	cmp ax, cx
  1174 00000746 7403E94102              	jne .invalid
  1175 0000074B 5A                      	pop dx
  1176 0000074C 59                      	pop cx
  1177 0000074D 89D0                    	mov ax, dx
  1178 0000074F 09C8                    	or ax, cx
  1179 00000751 7503E94202              	jz .nolib
  1180 00000756 0356DC                  	add dx, word [bp + ?eldheader]
  1181 00000759 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1182 0000075C B80042                  	mov ax, 4200h
  1183 0000075F E8B205                  	call seek_compressed_or_dos_or_boot_io
  1184 00000762 7303E9DC01              	jc .io_error
  1185                                  
  1186 00000767 B90800                  	mov cx, fromwords(ELD_LIBTABLE_size_w)
  1187 0000076A 29CC                    	sub sp, cx
  1188 0000076C 89E2                    	mov dx, sp
  1189 0000076E B43F                    	mov ah, 3Fh
  1190 00000770 E8C705                  	call read_compressed_or_dos_or_boot_io
  1191 00000773 7303E9CB01              	jc .io_error
  1192 00000778 39C8                    	cmp ax, cx
  1193 0000077A 7403E90D02              	jne .invalid
  1194 0000077F 89E7                    	mov di, sp
  1195                                  %ifn _COMPRESSED
  1196                                  	cmp word [di + eldltFormat], 0
  1197                                  	jne .invalid
  1198                                  %else
  1199 00000781 31D2                    	xor dx, dx		; init to zero compression layers
  1200 00000783 8B05                    	mov ax, word [di + eldltFormat]
  1201                                  		; 0 = uncompressed
  1202                                  		; 2 = compressed heatshrink
  1203                                  		; 3 = compressed lzexedat -4
  1204                                  		; 4 = compressed lzexedat -4 -l
  1205 00000785 83F804                  	cmp ax, 4
  1206 00000788 7603E9FF01              	ja .invalid
  1207 0000078D 3C01                    	cmp al, 1
  1208 0000078F 7503E9F801              	je .invalid
  1209 00000794 721D                    	jb @F
  1210 00000796 A2[0300]                reloc	mov byte [depack_format], al
  1211                                  internaldatarelocation
  1212                                  
  1213 00000799 B90400                  	mov cx, 4
  1214 0000079C BA[B406]                reloc	mov dx, libtab_compressed_length
  1215                                  internaldatarelocation
  1216 0000079F B43F                    	mov ah, 3Fh
  1217 000007A1 E89605                  	call read_compressed_or_dos_or_boot_io
  1218 000007A4 7303E99A01              	jc .io_error
  1219 000007A9 39C8                    	cmp ax, cx
  1220 000007AB 7403E9DC01              	jne .invalid
  1221                                  
  1222 000007B0 BA0100                  	mov dx, 1
  1223                                  @@:
  1224 000007B3 F646E201                	testopt [bp + ?uncompressed_bit_0], 1
  1225                                   %if 0
  1226                                  	jnz @F
  1227                                  	inc dx			; count compression layers
  1228                                  	inc dh			; was already compressed
  1229                                  @@:
  1230                                  	cmp dl, 2		; compressed within compressed ?
  1231                                  	jae .doublepacked	; yes -->
  1232                                   %else
  1233 000007B7 7503E99201              	jz .doublepacked	; lib inside compressed is invalid -->
  1234                                   %endif
  1235                                  %endif
  1236 000007BC 8B4D02                  	mov cx, word [di + eldltAmount]
  1237 000007BF 85C9                    	test cx, cx
  1238 000007C1 7503E9D201              	jz .nolib
  1239 000007C6 894EF4                  	mov word [bp + ?libamount], cx
  1240 000007C9 8B4504                  	mov ax, word [di + eldltOffset]
  1241 000007CC 0346DC                  	add ax, word [bp + ?eldheader]
  1242 000007CF 8946FA                  	mov word [bp + ?liboffset], ax
  1243 000007D2 8B4506                  	mov ax, word [di + eldltOffset + 2]
  1244 000007D5 1346DE                  	adc ax, word [bp + ?eldheader + 2]
  1245 000007D8 8946FC                  	mov word [bp + ?liboffset + 2], ax
  1246                                  
  1247                                  %if _COMPRESSED
  1248 000007DB 52                      	push dx			; on stack: ah = was compressed,
  1249                                  				;  al = next is compressed
  1250                                  %endif
  1251 000007DC D006[0600]              reloc	rol byte [verbose], 1
  1252                                  internaldatarelocation
  1253 000007E0 7350                    	jnc .lib_verbose_done
  1254                                  
  1255 000007E2 53                      	push bx
  1256 000007E3 89FB                    	mov bx, di
  1257 000007E5 BF[0000]                reloc	mov di, relocateddata
  1258                                  linkdatarelocation line_out
  1259                                  
  1260                                  ;	mov ax, 2020h
  1261                                  ;	stosw
  1262                                  
  1263 000007E8 BE[8A01]                reloc	mov si, msg.verbose.lib.1
  1264                                  internaldatarelocation
  1265 000007EB E88A0A                  	extcallcall copy_single_counted_string
  1266                                  
  1267 000007EE 8B4702                  	mov ax, word [bx + eldltAmount]
  1268 000007F1 E8940A                  	extcallcall decword
  1269                                  
  1270 000007F4 BE[9E01]                reloc	mov si, msg.verbose.lib.2
  1271                                  internaldatarelocation
  1272 000007F7 E87E0A                  	extcallcall copy_single_counted_string
  1273                                  
  1274 000007FA 8B07                    	mov ax, word [bx + eldltFormat]
  1275 000007FC E8890A                  	extcallcall decword
  1276                                  
  1277 000007FF BE[AD01]                reloc	mov si, msg.verbose.lib.3.un
  1278                                  internaldatarelocation
  1279 00000802 3C00                    	cmp al, 0
  1280 00000804 7411                    	je @F
  1281 00000806 BE[BD01]                reloc	mov si, msg.verbose.lib.3.hs
  1282                                  internaldatarelocation
  1283 00000809 3C02                    	cmp al, 2
  1284 0000080B 740A                    	je @F
  1285 0000080D BE[CB01]                reloc	mov si, msg.verbose.lib.3.lze
  1286                                  internaldatarelocation
  1287 00000810 3C03                    	cmp al, 3
  1288 00000812 7403                    	je @F
  1289 00000814 BE[DA01]                reloc	mov si, msg.verbose.lib.3.lzel
  1290                                  internaldatarelocation
  1291                                  @@:
  1292 00000817 E85E0A                  	extcallcall copy_single_counted_string
  1293                                  
  1294 0000081A 3C00                    	cmp al, 0
  1295 0000081C 7410                    	je @F
  1296 0000081E BE[EC01]                reloc	mov si, msg.verbose.lib.4
  1297                                  internaldatarelocation
  1298 00000821 E8540A                  	extcallcall copy_single_counted_string
  1299                                  
  1300 00000824 8B16[B606]              reloc	mov dx, [libtab_compressed_length + 2]
  1301                                  internaldatarelocation
  1302 00000828 A1[B406]                reloc	mov ax, [libtab_compressed_length]
  1303                                  internaldatarelocation
  1304 0000082B E86A0A                  	extcallcall decdword
  1305                                  @@:
  1306                                  
  1307 0000082E E84F0A                  	extcallcall putsline_crlf
  1308 00000831 5B                      	pop bx
  1309                                  
  1310                                  .lib_verbose_done:
  1311                                  %if _COMPRESSED
  1312 00000832 5A                      	pop dx
  1313                                  %endif
  1314 00000833 83C408                  	add sp, fromwords(ELD_LIBTABLE_size_w)
  1315                                  %if _COMPRESSED
  1316 00000836 52                      	push dx			; on stack: ah = was compressed,
  1317                                  				;  al = next is compressed
  1318                                  %endif
  1319                                  
  1320 00000837 D006[0900]              reloc	rol byte [lib], 1
  1321                                  internaldatarelocation
  1322 0000083B 7203E95801              	jnc .lib_done
  1323                                  
  1324                                   %if _COMPRESSED
  1325 00000840 31D2                    	xor dx, dx
  1326 00000842 52                      	push dx
  1327 00000843 52                      	push dx
  1328                                   %endif
  1329                                  
  1330                                  .looplib:
  1331 00000844 8D56E6                  	lea dx, [bp + ?libentry]
  1332 00000847 B90C00                  	mov cx, 12
  1333 0000084A B43F                    	mov ah, 3Fh
  1334 0000084C E8EB04                  	call read_compressed_or_dos_or_boot_io
  1335 0000084F 7303E9EF00              	jc .io_error
  1336 00000854 39C8                    	cmp ax, cx
  1337 00000856 7403E93101              	jne .invalid
  1338                                  
  1339 0000085B 31C9                    	xor cx, cx
  1340 0000085D 31D2                    	xor dx, dx
  1341 0000085F B80142                  	mov ax, 4201h
  1342 00000862 E8AF04                  	call seek_compressed_or_dos_or_boot_io
  1343 00000865 7303E9D900              	jc .io_error
  1344 0000086A 8946F6                  	mov word [bp + ?libnext], ax
  1345 0000086D 8956F8                  	mov word [bp + ?libnext + 2], dx
  1346                                  
  1347                                  .libname:
  1348                                  %if _ELDTRAILER
  1349 00000870 F646E401                	testopt [bp + ?not_sld_bit_0], 1
  1350 00000874 7521                    	jnz .nolibname
  1351                                  %else
  1352                                  	cmp word [bp + ?eldheader], 0
  1353                                  	jne .nolibname
  1354                                  	cmp word [bp + ?eldheader + 2], 0
  1355                                  	jne .nolibname
  1356                                  %endif
  1357 00000876 D006[0A00]              reloc	rol byte [libname], 1
  1358                                  internaldatarelocation
  1359 0000087A 731B                    	jnc .nolibname
  1360 0000087C 8D76EA                  	lea si, [bp + ?libentry + 4]
  1361 0000087F BF[3803]                reloc	mov di, libnamebuffer
  1362                                  internaldatarelocation
  1363 00000882 B90800                  	mov cx, 8
  1364                                  @@:
  1365 00000885 AC                      	lodsb
  1366 00000886 E8DF09                  	extcallcall uppercase
  1367 00000889 AE                      	scasb
  1368 0000088A 7404                    	je @F
  1369 0000088C 807DFF3F                	cmp byte [di - 1], '?'
  1370                                  @@:
  1371 00000890 E1F3                    	loope @BB
  1372 00000892 7403E98500              	jne .libskip
  1373                                  .nolibname:
  1374                                  
  1375                                  %if _COMPRESSED
  1376 00000897 B80042                  	mov ax, 4200h
  1377 0000089A 5A                      	pop dx
  1378 0000089B 59                      	pop cx
  1379 0000089C E8AC04                  	call dos_or_boot_io
  1380                                  
  1381 0000089F 58                      	pop ax
  1382 000008A0 50                      	push ax
  1383 000008A1 3C01                    	cmp al, 1		; CY if uncompressed
  1384 000008A3 7208                    	jb .uncomp_seek
  1385                                  
  1386 000008A5 8B7EE6                  	mov di, word [bp + ?libentry]
  1387 000008A8 8B4EE8                  	mov cx, word [bp + ?libentry + 2]
  1388                                  
  1389                                   %if 0
  1390                                  	test ah, ah
  1391                                  	jz .comp_in_uncomp_seek
  1392                                  .uncomp_in_comp_seek:
  1393                                  	add di, word [bp + ?eldheader]
  1394                                  	adc cx, word [bp + ?eldheader]
  1395                                   %endif
  1396                                  
  1397                                  .comp_in_uncomp_seek:
  1398 000008AB EB1B                    	jmp .seek_done
  1399                                  %endif
  1400                                  .uncomp_seek:
  1401 000008AD 8B56FA                  	mov dx, word [bp + ?liboffset]
  1402 000008B0 8B4EFC                  	mov cx, word [bp + ?liboffset + 2]
  1403 000008B3 0356E6                  	add dx, word [bp + ?libentry]
  1404 000008B6 134EE8                  	adc cx, word [bp + ?libentry + 2]
  1405 000008B9 B80042                  	mov ax, 4200h
  1406 000008BC E85504                  	call seek_compressed_or_dos_or_boot_io
  1407 000008BF 7303E97F00              	jc .io_error
  1408                                  %if _COMPRESSED
  1409 000008C4 31C9                    	xor cx, cx
  1410 000008C6 31FF                    	xor di, di
  1411                                  
  1412                                  .seek_done:
  1413 000008C8 57                      	push di
  1414                                  %endif
  1415                                  
  1416 000008C9 8D7EF3                  	lea di, [bp + ?libentry + 12 + 1]
  1417 000008CC 8D56EA                  	lea dx, [bp + ?libentry + 4]
  1418                                  @@:
  1419 000008CF 4F                      	dec di
  1420 000008D0 39D7                    	cmp di, dx
  1421 000008D2 7606                    	jbe @F
  1422 000008D4 807DFF20                	cmp byte [di - 1], 32
  1423 000008D8 74F5                    	je @B
  1424                                  @@:
  1425 000008DA C60500                  	mov byte [di], 0
  1426                                  
  1427 000008DD B020                    	mov al, 32
  1428 000008DF E88E09                  	extcallcall putc
  1429                                  
  1430                                  %if _COMPRESSED
  1431 000008E2 5F                      	pop di
  1432                                  
  1433 000008E3 58                      	pop ax
  1434 000008E4 50                      	push ax
  1435                                  
  1436 000008E5 FF36[BA06]              reloc	push word [libseek + 2]
  1437                                  internaldatarelocation
  1438 000008E9 FF36[B806]              reloc	push word [libseek]
  1439                                  internaldatarelocation
  1440                                  
  1441                                  %if 0
  1442                                  	test ah, ah		; already was compressed ?
  1443                                  	jnz @F			; yes, leave libseek as is -->
  1444                                  %endif
  1445 000008ED FF76FC                  	push word [bp + ?liboffset + 2]
  1446 000008F0 8F06[BA06]              reloc	pop word [libseek + 2]
  1447                                  internaldatarelocation
  1448 000008F4 FF76FA                  	push word [bp + ?liboffset]
  1449 000008F7 8F06[B806]              reloc	pop word [libseek]
  1450                                  internaldatarelocation
  1451                                  @@:
  1452                                  
  1453 000008FB 3C01                    	cmp al, 1		; CY if uncompressed
  1454                                  %endif
  1455 000008FD 8B46E0                  	mov ax, word [bp + ?handle]
  1456 00000900 B301                    	mov bl, 1
  1457 00000902 E836FB                  	call commonhandle.lib
  1458 00000905 8B5EE0                  	mov bx, word [bp + ?handle]
  1459                                  
  1460                                  %if _COMPRESSED
  1461 00000908 B80142                  	mov ax, 4201h
  1462 0000090B 31C9                    	xor cx, cx
  1463 0000090D 31D2                    	xor dx, dx
  1464 0000090F E83904                  	call dos_or_boot_io
  1465                                  
  1466 00000912 8F06[B806]              reloc	pop word [libseek]
  1467                                  internaldatarelocation
  1468 00000916 8F06[BA06]              reloc	pop word [libseek + 2]
  1469                                  internaldatarelocation
  1470                                  
  1471 0000091A 52                      	push dx
  1472 0000091B 50                      	push ax
  1473                                  %endif
  1474                                  
  1475                                  .libskip:
  1476 0000091C 8B56F6                  	mov dx, word [bp + ?libnext]
  1477 0000091F 8B4EF8                  	mov cx, word [bp + ?libnext + 2]
  1478 00000922 B80042                  	mov ax, 4200h
  1479 00000925 E8EC03                  	call seek_compressed_or_dos_or_boot_io
  1480 00000928 7219                    	jc .io_error
  1481 0000092A FF4EF4                  	dec word [bp + ?libamount]
  1482 0000092D 7403E912FF              	jnz .looplib
  1483 00000932 EB64                    	jmp .lib_done
  1484                                  
  1485                                  .nodesc:
  1486 00000934 BA[3500]                reloc	mov dx, msg.nodesc
  1487                                  internaldatarelocation
  1488 00000937 E960FC                  	jmp .putsz_desc_done
  1489                                  
  1490                                  .nohelp:
  1491 0000093A BA[4700]                reloc	mov dx, msg.nohelp
  1492                                  internaldatarelocation
  1493 0000093D E8C808                  	extcallcall putsz
  1494 00000940 E9D0FD                  	jmp .help_done
  1495                                  
  1496                                  .io_error:
  1497 00000943 B8490E                  	mov ax, 0E49h
  1498 00000946 E8B708                  	extcallcall setrc
  1499 00000949 BA[6400]                reloc	mov dx, msg.io_error
  1500                                  internaldatarelocation
  1501 0000094C EB47                    	jmp .error
  1502                                  
  1503                                  %if _COMPRESSED
  1504                                  .doublepacked:
  1505 0000094E B84A0E                  	mov ax, 0E4Ah
  1506 00000951 E8AC08                  	extcallcall setrc
  1507 00000954 BA[7E00]                reloc	mov dx, msg.doublepacked_error
  1508                                  internaldatarelocation
  1509 00000957 EB3C                    	jmp .error
  1510                                  %endif
  1511                                  
  1512                                  .invalid_instance:
  1513 00000959 BE[BD00]                reloc	mov si, msg.invalid_instance
  1514                                  internaldatarelocation
  1515 0000095C E81909                  	extcallcall copy_single_counted_string
  1516                                  
  1517 0000095F 83C408                  	add sp, 8
  1518 00000962 E9A4FC                  	jmp .after_invalid_instance
  1519                                  
  1520                                  .invalid_check_sld:
  1521 00000965 F646E401                	test byte [bp + ?not_sld_bit_0], 1
  1522 00000969 7521                    	jnz .invalid			; in a lib -->
  1523 0000096B 83F806                  	cmp ax, 6			; "@;SLD0"
  1524 0000096E 7217                    	jb @F
  1525 00000970 817EBC403B              	cmp word [bp + ?header], "@;"
  1526 00000975 7510                    	jne @F
  1527 00000977 817EBE534C              	cmp word [bp + ?header + 2], "SL"
  1528 0000097C 7509                    	jne @F
  1529 0000097E 817EC04430              	cmp word [bp + ?header + 4], "D0"
  1530 00000983 7502                    	jne @F
  1531 00000985 EB15                    	jmp .sld
  1532                                  
  1533                                  @@:
  1534 00000987 BA[0601]                reloc	mov dx, msg.invalid_sld
  1535                                  internaldatarelocation
  1536 0000098A EB09                    	jmp .error
  1537                                  
  1538                                  .invalid:
  1539 0000098C B84B0E                  	mov ax, 0E4Bh
  1540 0000098F E86E08                  	extcallcall setrc
  1541 00000992 BA[D900]                reloc	mov dx, msg.invalid
  1542                                  internaldatarelocation
  1543                                  .error:
  1544                                  .putsz_ret:
  1545 00000995 E87008                  	extcallcall putsz
  1546                                  .ret:
  1547                                  .lib_done:
  1548                                  .nolib:
  1549 00000998 89EC5D                  	lleave code, forcerestoresp
  1550 0000099B C3                      	retn
  1551                                  
  1552                                  
  1553                                  .sld:
  1554                                  %if 0
  1555                                  	mov cx, word [bp + ?eldheader + 2]
  1556                                  	mov dx, word [bp + ?eldheader]
  1557                                  	add dx, 6
  1558                                  	adc cx, 0
  1559                                  %else
  1560 0000099C 31C9                    	xor cx, cx
  1561 0000099E BA0600                  	mov dx, 6
  1562                                  %endif
  1563 000009A1 B80042                  	mov ax, 4200h
  1564                                  	; call seek_compressed_or_dos_or_boot_io
  1565 000009A4 E8A403                  	call dos_or_boot_io
  1566 000009A7 729A                    	jc .io_error
  1567                                  
  1568 000009A9 B9[DE09]                reloc	mov cx, .check_d
  1569                                  internalcoderelocation
  1570                                  
  1571                                  .sldreload:
  1572 000009AC BA[0000]                reloc	mov dx, relocateddata
  1573                                  linkdatarelocation line_out
  1574 000009AF 8956EA                  	mov word [bp + ?next], dx	; reset ?next
  1575 000009B2 51                      	push cx				; ! preserve state
  1576 000009B3 B90001                  	mov cx, 256
  1577 000009B6 B43F                    	mov ah, 3Fh
  1578 000009B8 E89003                  	call dos_or_boot_io		; fill buffer
  1579 000009BB 59                      	pop cx				; ! preserve state
  1580 000009BC 7285                    	jc .io_error
  1581 000009BE 85C0                    	test ax, ax			; no more data ?
  1582 000009C0 7413                    	jz .sld_no_desc			; yes -->
  1583 000009C2 01D0                    	add ax, dx
  1584 000009C4 8946E8                  	mov word [bp + ?tail], ax	; set ?tail
  1585                                  
  1586                                  .sldloop:
  1587 000009C7 8B76EA                  	mov si, word [bp + ?next]	; -> next data
  1588 000009CA 3B76E8                  	cmp si, word [bp + ?tail]	; have one more byte ?
  1589 000009CD 74DD                    	je .sldreload			; no -->
  1590                                  
  1591 000009CF AC                      	lodsb				; get the byte
  1592 000009D0 8976EA                  	mov word [bp + ?next], si	; update ?next
  1593 000009D3 FFE1                    	jmp cx				; jump to state
  1594                                  
  1595                                  .sldnext: equ .sldloop			; get next byte -->
  1596                                  
  1597                                  .sld_no_desc:
  1598 000009D5 BA[3500]                reloc	mov dx, msg.nodesc
  1599                                  internaldatarelocation
  1600 000009D8 E82D08                  	extcallcall putsz
  1601 000009DB E9C800                  	jmp .sld_desc_done
  1602                                  
  1603                                  .check_d:				; D may be prepended by blanks,
  1604                                  					;  commas, or semicolons
  1605                                  				; state unchanged
  1606 000009DE 3C2C                    	cmp al, ','			; skip any commas
  1607 000009E0 74E5                    	je .sldnext
  1608 000009E2 3C3B                    	cmp al, ';'			; or semicolons
  1609 000009E4 74E1                    	je .sldnext
  1610 000009E6 3C20                    	cmp al, 32
  1611 000009E8 74DD                    	je .sldnext
  1612 000009EA 3C09                    	cmp al, 9			; or blanks
  1613 000009EC 74D9                    	je .sldnext
  1614 000009EE E87708                  	extcallcall uppercase
  1615 000009F1 B9[220A]                reloc	mov cx, .check_e 	; change state if D found
  1616                                  internalcoderelocation
  1617 000009F4 3C44                    	cmp al, 'D'			; is it a D ?
  1618                                  .sldnext_ZR_else_skip_to_eol:
  1619 000009F6 74CF                    	je .sldnext			; yes -->
  1620                                  				; skip to next line
  1621                                  .skip_to_eol:
  1622 000009F8 B9[0C0A]                reloc	mov cx, .check_at	; change state if EOL found
  1623                                  internalcoderelocation
  1624 000009FB 3C0D                    	cmp al, 13			; EOL ?
  1625 000009FD 74C8                    	je .sldnext
  1626 000009FF 3C0A                    	cmp al, 10
  1627 00000A01 74C4                    	je .sldnext
  1628 00000A03 3C00                    	cmp al, 0
  1629 00000A05 74C0                    	je .sldnext			; yes -->
  1630 00000A07 B9[F809]                reloc	mov cx, .skip_to_eol		; loop back to this state
  1631                                  internalcoderelocation
  1632 00000A0A EBBB                    	jmp .sldnext
  1633                                  
  1634                                  .check_at:				; @ must be in first column
  1635 00000A0C B9[130A]                reloc	mov cx, .check_semicolon
  1636                                  internalcoderelocation
  1637 00000A0F 3C40                    	cmp al, '@'
  1638 00000A11 EBE3                    	jmp .sldnext_ZR_else_skip_to_eol
  1639                                  
  1640                                  .check_semicolon:			; semicolon may be prepended by blanks
  1641 00000A13 3C20                    	cmp al, 32
  1642 00000A15 74B0                    	je .sldnext
  1643 00000A17 3C09                    	cmp al, 9
  1644                                  .sldnext_ZR_j1:
  1645 00000A19 74AC                    	je .sldnext
  1646 00000A1B B9[DE09]                reloc	mov cx, .check_d
  1647                                  internalcoderelocation
  1648 00000A1E 3C3B                    	cmp al, ';'
  1649 00000A20 EBD4                    	jmp .sldnext_ZR_else_skip_to_eol
  1650                                  
  1651                                  .check_e:				; E must be immediately after D
  1652 00000A22 E84308                  	extcallcall uppercase
  1653 00000A25 B9[2C0A]                reloc	mov cx, .check_s
  1654                                  internalcoderelocation
  1655 00000A28 3C45                    	cmp al, 'E'
  1656 00000A2A EBCA                    	jmp .sldnext_ZR_else_skip_to_eol
  1657                                  
  1658                                  .check_s:				; S must be immediately after E
  1659 00000A2C E83908                  	extcallcall uppercase
  1660 00000A2F B9[360A]                reloc	mov cx, .check_c
  1661                                  internalcoderelocation
  1662 00000A32 3C53                    	cmp al, 'S'
  1663 00000A34 EBC0                    	jmp .sldnext_ZR_else_skip_to_eol
  1664                                  
  1665                                  .check_c:				; C must be immediately after S
  1666 00000A36 E82F08                  	extcallcall uppercase
  1667 00000A39 B9[400A]                reloc	mov cx, .check_equals_sign
  1668                                  internalcoderelocation
  1669 00000A3C 3C43                    	cmp al, 'C'
  1670 00000A3E EBB6                    	jmp .sldnext_ZR_else_skip_to_eol
  1671                                  
  1672                                  .check_equals_sign:			; = or : may be prepended by blanks
  1673 00000A40 3C20                    	cmp al, 32
  1674 00000A42 74D5                    	je .sldnext_ZR_j1
  1675 00000A44 3C09                    	cmp al, 9
  1676 00000A46 74D1                    	je .sldnext_ZR_j1
  1677 00000A48 B9[530A]                reloc	mov cx, .skip_blanks
  1678                                  internalcoderelocation
  1679 00000A4B 3C3D                    	cmp al, '='
  1680 00000A4D 74CA                    	je .sldnext_ZR_j1
  1681 00000A4F 3C3A                    	cmp al, ':'
  1682 00000A51 EBA3                    	jmp .sldnext_ZR_else_skip_to_eol
  1683                                  
  1684                                  .skip_blanks:				; description may be prepended by blanks
  1685 00000A53 3C20                    	cmp al, 32
  1686 00000A55 74C2                    	je .sldnext_ZR_j1
  1687 00000A57 3C09                    	cmp al, 9
  1688 00000A59 74BE                    	je .sldnext_ZR_j1
  1689                                  
  1690 00000A5B BF[0000]                reloc	mov di, relocateddata
  1691                                  linkdatarelocation line_out		; -> start of buffer
  1692 00000A5E 8B76EA                  	mov si, word [bp + ?next]
  1693 00000A61 4E                      	dec si				; -> first nonblank (at least 1 byte)
  1694 00000A62 8B4EE8                  	mov cx, word [bp + ?tail]	; -> after last buffered byte
  1695 00000A65 29F1                    	sub cx, si			; = length of buffered data
  1696 00000A67 F3A4                    	rep movsb			; move down in buffer
  1697 00000A69 89FA                    	mov dx, di			; -> after buffered data
  1698 00000A6B B9[7F00]                reloc	mov cx, relocateddata + 127
  1699                                  linkdatarelocation line_out		; -> after last byte we want to read
  1700 00000A6E 89CF                    	mov di, cx			; -> where to place terminator
  1701 00000A70 29D1                    	sub cx, dx			; = length to read after buffered data
  1702 00000A72 760E                    	jbe @F				; if below-or-equal zero, none to read -->
  1703 00000A74 B43F                    	mov ah, 3Fh
  1704 00000A76 E8D202                  	call dos_or_boot_io		; read it
  1705 00000A79 7303E9C5FE              	jc .io_error			; on error -->
  1706                                  					; (valid to read 0 up to 126 Bytes)
  1707 00000A7E 89C7                    	mov di, ax
  1708 00000A80 01D7                    	add di, dx			; -> after last read byte
  1709                                  @@:
  1710 00000A82 C60500                  	mov byte [di], 0		; store a terminator
  1711                                  
  1712 00000A85 BA[0000]                reloc	mov dx, relocateddata
  1713                                  linkdatarelocation line_out		; -> message data
  1714 00000A88 89D6                    	mov si, dx			; -> text to scan
  1715                                  @@:
  1716 00000A8A AC                      	lodsb				; get a text byte
  1717 00000A8B 3C00                    	cmp al, 0			; EOL ?
  1718 00000A8D 7408                    	je @F
  1719 00000A8F 3C0D                    	cmp al, 13
  1720 00000A91 7404                    	je @F
  1721 00000A93 3C0A                    	cmp al, 10
  1722 00000A95 75F3                    	jne @B				; not yet -->
  1723                                  @@:
  1724 00000A97 46                      	inc si				; (si - 2) -> behind message data
  1725 00000A98 C744FE0D0A              	mov word [si - 2], 13 | (10 << 8)
  1726                                  					; append a linebreak
  1727 00000A9D 89F1                    	mov cx, si
  1728 00000A9F 29D1                    	sub cx, dx			; cx = message data length including CR LF
  1729 00000AA1 53                      	push bx
  1730 00000AA2 E8FB07                  	extcallcall puts		; display message
  1731 00000AA5 5B                      	pop bx
  1732                                  
  1733                                  .sld_desc_done:
  1734 00000AA6 D006[0600]              reloc	rol byte [verbose], 1
  1735                                  internaldatarelocation
  1736 00000AAA 7341                    	jnc .sld_verbose_done
  1737 00000AAC BF[0000]                reloc	mov di, relocateddata
  1738                                  linkdatarelocation line_out
  1739 00000AAF BE[3A01]                reloc	mov si, msg.verbose.1
  1740                                  internaldatarelocation
  1741 00000AB2 E8C307                  	extcallcall copy_single_counted_string
  1742                                  
  1743 00000AB5 8D76BE                  	lea si, [bp + ?header + 2]
  1744 00000AB8 A5                      	movsw
  1745 00000AB9 A5                      	movsw
  1746                                  
  1747 00000ABA BE[7501]                reloc	mov si, msg.verbose.2.sld
  1748                                  internaldatarelocation
  1749 00000ABD E8B807                  	extcallcall copy_single_counted_string
  1750                                  
  1751 00000AC0 31D2                    	xor dx, dx
  1752 00000AC2 31C9                    	xor cx, cx
  1753 00000AC4 B80242                  	mov ax, 4202h
  1754                                  %if 0
  1755                                  	call dos_or_boot_io
  1756                                  	jc .io_error
  1757                                  %else
  1758                                   %if _BOOTLDR
  1759 00000AC7 F606[0100]40            reloc	testopt [relocateddata], nodosloaded
  1760                                  linkdatarelocation internalflags, -3
  1761 00000ACC 7409                    	jz @F
  1762 00000ACE A1[F4FF]                reloc	mov ax, word [relocateddata - LOADDATA2 + ldFileSize]
  1763                                  linkdatarelocation load_data
  1764 00000AD1 8B16[F6FF]              reloc	mov dx, word [relocateddata - LOADDATA2 + ldFileSize + 2]
  1765                                  linkdatarelocation load_data
  1766 00000AD5 EB08                    	jmp @FF
  1767                                  @@:
  1768                                   %endif
  1769 00000AD7 E87802                  	call dos_or_boot_io.dos
  1770 00000ADA 7303E964FE              	jc .io_error
  1771                                  @@:
  1772                                  %endif
  1773 00000ADF E8B607                  	extcallcall decdword
  1774                                  
  1775 00000AE2 BE[8301]                reloc	mov si, msg.verbose.3.sld
  1776                                  internaldatarelocation
  1777 00000AE5 E89007                  	extcallcall copy_single_counted_string
  1778                                  
  1779 00000AE8 53                      	push bx
  1780 00000AE9 E89407                  	extcallcall putsline_crlf
  1781 00000AEC 5B                      	pop bx
  1782                                  
  1783                                  .sld_verbose_done:
  1784                                  sld_help:
  1785 00000AED D006[0700]              reloc	rol byte [do_help], 1
  1786                                  internaldatarelocation
  1787 00000AF1 734C                    	jnc .done
  1788                                  
  1789 00000AF3 31D2                    	xor dx, dx
  1790 00000AF5 31C9                    	xor cx, cx
  1791 00000AF7 894EEC                  	mov word [bp + ?helpstarted], cx
  1792 00000AFA B80042                  	mov ax, 4200h
  1793 00000AFD E84B02                  	call dos_or_boot_io
  1794 00000B00 7303E93EFE              	jc commonhandle.io_error
  1795                                  
  1796 00000B05 B9[420B]                reloc	mov cx, .check_at_or_semicolon
  1797                                  internalcoderelocation
  1798                                  
  1799                                  .reload:
  1800 00000B08 BA[0000]                reloc	mov dx, relocateddata
  1801                                  linkdatarelocation line_out
  1802 00000B0B 8956EA                  	mov word [bp + ?next], dx	; reset ?next
  1803 00000B0E 51                      	push cx				; ! preserve state
  1804 00000B0F B90001                  	mov cx, 256
  1805 00000B12 B43F                    	mov ah, 3Fh
  1806 00000B14 E83402                  	call dos_or_boot_io		; fill buffer
  1807 00000B17 59                      	pop cx				; ! preserve state
  1808 00000B18 7303E926FE              	jc commonhandle.io_error
  1809 00000B1D 85C0                    	test ax, ax			; no more data ?
  1810 00000B1F 7413                    	jz .eof				; yes -->
  1811 00000B21 01D0                    	add ax, dx
  1812 00000B23 8946E8                  	mov word [bp + ?tail], ax	; set ?tail
  1813                                  
  1814                                  .loop:
  1815 00000B26 8B76EA                  	mov si, word [bp + ?next]	; -> next data
  1816 00000B29 3B76E8                  	cmp si, word [bp + ?tail]	; have one more byte ?
  1817 00000B2C 74DA                    	je .reload			; no -->
  1818                                  
  1819 00000B2E AC                      	lodsb				; get the byte
  1820 00000B2F 8976EA                  	mov word [bp + ?next], si	; update ?next
  1821 00000B32 FFE1                    	jmp cx				; jump to state
  1822                                  
  1823                                  .next: equ .loop			; get next byte -->
  1824                                  
  1825                                  .eof:
  1826 00000B34 D046EC                  	rol byte [bp + ?helpstarted], 1
  1827 00000B37 7206                    	jc .done
  1828                                  
  1829                                  .no_help:
  1830 00000B39 BA[4700]                reloc	mov dx, msg.nohelp
  1831                                  internaldatarelocation
  1832 00000B3C E8C906                  	extcallcall putsz
  1833                                  .done:
  1834 00000B3F E956FE                  	jmp commonhandle.ret
  1835                                  
  1836                                  .check_at_or_semicolon:
  1837 00000B42 B9[490B]                reloc	mov cx, .check_semicolon
  1838                                  internalcoderelocation
  1839 00000B45 3C40                    	cmp al, '@'			; is it an @ ?
  1840 00000B47 74DD                    	je .next
  1841                                  .check_semicolon:
  1842 00000B49 3C20                    	cmp al, 32			; blanks
  1843 00000B4B 74D9                    	je .next
  1844 00000B4D 3C09                    	cmp al, 9			; or tabs
  1845 00000B4F 74D5                    	je .next
  1846 00000B51 B9[6C0B]                reloc	mov cx, .check_h
  1847                                  internalcoderelocation
  1848 00000B54 3C3B                    	cmp al, ';'			; semicolon ?
  1849                                  .next_ZR_else_skip_to_eol:
  1850 00000B56 74CE                    	je .next			; yes -->
  1851                                  				; skip to next line
  1852                                  .skip_to_eol:
  1853 00000B58 B9[420B]                reloc	mov cx, .check_at_or_semicolon	; change state if EOL found
  1854                                  internalcoderelocation
  1855 00000B5B 3C0D                    	cmp al, 13			; EOL ?
  1856 00000B5D 74C7                    	je .next
  1857 00000B5F 3C0A                    	cmp al, 10
  1858 00000B61 74C3                    	je .next
  1859 00000B63 3C00                    	cmp al, 0
  1860 00000B65 74BF                    	je .next			; yes -->
  1861                                  .next_skip_to_eol:
  1862 00000B67 B9[580B]                reloc	mov cx, .skip_to_eol		; loop back to this state
  1863                                  internalcoderelocation
  1864 00000B6A EBBA                    	jmp .next
  1865                                  
  1866                                  .check_h:
  1867 00000B6C 3C20                    	cmp al, 32			; blanks
  1868 00000B6E 74B6                    	je .next
  1869 00000B70 3C09                    	cmp al, 9			; or tabs
  1870 00000B72 74B2                    	je .next
  1871 00000B74 E8F106                  	extcallcall uppercase
  1872 00000B77 3C48                    	cmp al, 'H'
  1873 00000B79 75DD                    	jne .skip_to_eol
  1874 00000B7B E81701                  	call .fill
  1875 00000B7E 81FA[0A00]              reloc	cmp dx, relocateddata + msg.helpstart.length + 1
  1876                                  linkdatarelocation line_out
  1877 00000B82 72B5                    	jb .no_help
  1878 00000B84 A0[0900]                reloc	mov al, byte [relocateddata + msg.helpstart.length]
  1879                                  linkdatarelocation line_out
  1880 00000B87 3C20                    	cmp al, 32			; blank ?
  1881 00000B89 7415                    	je @F
  1882 00000B8B 3C09                    	cmp al, 9
  1883 00000B8D 7411                    	je @F
  1884 00000B8F 3C0D                    	cmp al, 13			; CR ?
  1885 00000B91 740D                    	je @F
  1886 00000B93 3C00                    	cmp al, 0			; NUL ?
  1887 00000B95 7409                    	je @F
  1888 00000B97 3C0A                    	cmp al, 10			; LF ?
  1889                                  .next_skip_to_eol_NZ:
  1890 00000B99 75CC                    	jne .next_skip_to_eol
  1891 00000B9B C606[0900]0D            reloc	mov byte [relocateddata + msg.helpstart.length], 13
  1892                                  linkdatarelocation line_out, -3		; insert CR for isstring?
  1893                                  		; Modifying the buffered data!
  1894                                  @@:
  1895 00000BA0 BE[0000]                reloc	mov si, relocateddata
  1896                                  linkdatarelocation line_out
  1897 00000BA3 BA[5200]                reloc	mov dx, msg.helpstart
  1898                                  internaldatarelocation
  1899 00000BA6 E8B706                  	extcallcall isstring?
  1900 00000BA9 75EE                    	jne .next_skip_to_eol_NZ
  1901                                  
  1902 00000BAB 8976EA                  	mov word [bp + ?next], si
  1903 00000BAE B9[B40B]                reloc	mov cx, .check_eol
  1904                                  internalcoderelocation
  1905                                  .next_j:
  1906 00000BB1 E972FF                  	jmp .next
  1907                                  
  1908                                  .check_eol:
  1909 00000BB4 3C20                    	cmp al, 32
  1910 00000BB6 74F9                    	je .next_j
  1911 00000BB8 3C09                    	cmp al, 9
  1912 00000BBA 74F5                    	je .next_j
  1913 00000BBC 3C0D                    	cmp al, 13
  1914 00000BBE 7408                    	je @F
  1915 00000BC0 3C0A                    	cmp al, 10
  1916 00000BC2 7404                    	je @F
  1917 00000BC4 3C00                    	cmp al, 0
  1918 00000BC6 75D1                    	jne .next_skip_to_eol_NZ
  1919                                  @@:
  1920 00000BC8 B9[D00B]                reloc	mov cx, .check_help_at_or_semicolon
  1921                                  internalcoderelocation
  1922 00000BCB F656EC                  	not byte [bp + ?helpstarted]
  1923                                  .next_j2:
  1924 00000BCE EBE1                    	jmp .next_j
  1925                                  
  1926                                  .check_help_at_or_semicolon:
  1927 00000BD0 B9[D70B]                reloc	mov cx, .check_help_semicolon
  1928                                  internalcoderelocation
  1929 00000BD3 3C40                    	cmp al, '@'			; is it an @ ?
  1930 00000BD5 74F7                    	je .next_j2
  1931                                  .check_help_semicolon:
  1932 00000BD7 3C20                    	cmp al, 32			; blanks
  1933 00000BD9 74F3                    	je .next_j2
  1934 00000BDB 3C09                    	cmp al, 9			; or tabs
  1935 00000BDD 74EF                    	je .next_j2
  1936 00000BDF B9[FA0B]                reloc	mov cx, .display_help
  1937                                  internalcoderelocation
  1938 00000BE2 3C3B                    	cmp al, ';'			; semicolon ?
  1939                                  ;.next_ZR_else_skip_to_eol:
  1940 00000BE4 74E8                    	je .next_j2			; yes -->
  1941                                  				; skip to next line
  1942                                  .help_skip_to_eol:
  1943 00000BE6 B9[D00B]                reloc	mov cx, .check_help_at_or_semicolon
  1944                                  internalcoderelocation			; change state if EOL found
  1945 00000BE9 3C0D                    	cmp al, 13			; EOL ?
  1946 00000BEB 74E1                    	je .next_j2
  1947 00000BED 3C0A                    	cmp al, 10
  1948 00000BEF 74DD                    	je .next_j2
  1949 00000BF1 3C00                    	cmp al, 0
  1950 00000BF3 74D9                    	je .next_j2			; yes -->
  1951                                  .next_help_skip_to_eol:
  1952 00000BF5 B9[E60B]                reloc	mov cx, .help_skip_to_eol	; loop back to this state
  1953                                  internalcoderelocation
  1954 00000BF8 EBD4                    	jmp .next_j2
  1955                                  
  1956                                  .display_help:
  1957 00000BFA E89800                  	call .fill
  1958 00000BFD FF4EEA                  	dec word [bp + ?next]
  1959 00000C00 BE[0000]                reloc	mov si, relocateddata
  1960                                  linkdatarelocation line_out		; -> buffer
  1961                                  @@:
  1962 00000C03 39D6                    	cmp si, dx
  1963 00000C05 7365                    	jae .do_display_help
  1964 00000C07 AC                      	lodsb
  1965 00000C08 3C20                    	cmp al, 32
  1966 00000C0A 74F7                    	je @B
  1967 00000C0C 3C09                    	cmp al, 9
  1968 00000C0E 74F3                    	je @B
  1969 00000C10 E85506                  	extcallcall uppercase
  1970 00000C13 3C48                    	cmp al, 'H'
  1971 00000C15 7555                    	jne .do_display_help
  1972                                  
  1973 00000C17 4E                      	dec si				; -> at the H
  1974 00000C18 8D7C07                  	lea di, [si + msg.helpend.length]
  1975                                  					; -> at candidate separator
  1976 00000C1B 39FA                    	cmp dx, di			; string is in buffer ?
  1977 00000C1D 724D                    	jb .do_display_help		; no -->
  1978 00000C1F 7703                    	ja .havesep			; yes, separator too -->
  1979 00000C21 C60500                  	mov byte [di], 0		; store a separator here
  1980                                  					;  (can overflow line_out+256)
  1981                                  .havesep:
  1982 00000C24 8A05                    	mov al, byte [di]		; get separator
  1983 00000C26 3C20                    	cmp al, 32			; one of the valid separators ?
  1984 00000C28 7413                    	je @F
  1985 00000C2A 3C09                    	cmp al, 9
  1986 00000C2C 740F                    	je @F
  1987 00000C2E 3C0D                    	cmp al, 13
  1988 00000C30 740B                    	je @F
  1989 00000C32 3C00                    	cmp al, 0
  1990 00000C34 7407                    	je @F
  1991 00000C36 3C0A                    	cmp al, 10			; LF ?
  1992 00000C38 7532                    	jne .do_display_help		; no -->
  1993 00000C3A C6050D                  	mov byte [di], 13		; insert CR for isstring?
  1994                                  		; Modifying the buffered data!
  1995                                  @@:
  1996 00000C3D 52                      	push dx
  1997 00000C3E BA[5C00]                reloc	mov dx, msg.helpend
  1998                                  internaldatarelocation
  1999 00000C41 E81C06                  	extcallcall isstring?		; is it "helpend" ?
  2000 00000C44 5A                      	pop dx
  2001 00000C45 7525                    	jne .do_display_help		; no -->
  2002                                  @@:
  2003 00000C47 39D6                    	cmp si, dx			; reached EOL ?
  2004 00000C49 7203E9F1FE              	jae .done			; then it was helpend
  2005 00000C4E AC                      	lodsb
  2006 00000C4F 3C20                    	cmp al, 32			; blank ?
  2007 00000C51 74F4                    	je @B
  2008 00000C53 3C09                    	cmp al, 9
  2009 00000C55 74F0                    	je @B				; yes, loop here -->
  2010 00000C57 3C0D                    	cmp al, 13			; linebreak ?
  2011 00000C59 7503E9E1FE              	je .done
  2012 00000C5E 3C0A                    	cmp al, 10
  2013 00000C60 7503E9DAFE              	je .done
  2014 00000C65 3C00                    	cmp al, 0
  2015 00000C67 7503E9D3FE              	je .done			; yes, it was helpend -->
  2016                                  
  2017                                  		; Not "helpend". Display this line.
  2018                                  .do_display_help:
  2019 00000C6C BE[0000]                reloc	mov si, relocateddata
  2020                                  linkdatarelocation line_out		; -> buffer
  2021 00000C6F 56                      	push si				; -> buffer
  2022                                  @@:
  2023 00000C70 39D6                    	cmp si, dx			; reached end ?
  2024 00000C72 730E                    	jae .si				; yes, si -> end
  2025 00000C74 AC                      	lodsb				; get next byte
  2026 00000C75 3C0D                    	cmp al, 13			; linebreak ?
  2027 00000C77 7408                    	je .si_minus_1
  2028 00000C79 3C0A                    	cmp al, 10
  2029 00000C7B 7404                    	je .si_minus_1
  2030 00000C7D 3C00                    	cmp al, 0
  2031 00000C7F 75EF                    	jne @B				; no, loop -->
  2032                                  .si_minus_1:
  2033 00000C81 4E                      	dec si				; -> end of text
  2034                                  .si:
  2035 00000C82 89F1                    	mov cx, si			; -> end of text
  2036 00000C84 5A                      	pop dx
  2037 00000C85 29D1                    	sub cx, dx			; = length
  2038 00000C87 53                      	push bx
  2039 00000C88 E81506                  	extcallcall puts
  2040 00000C8B 5B                      	pop bx
  2041 00000C8C BA[0301]                reloc	mov dx, msg.linebreak		; display a linebreak
  2042                                  internaldatarelocation
  2043 00000C8F E87605                  	extcallcall putsz
  2044 00000C92 E960FF                  	jmp .next_help_skip_to_eol	; skip to next line
  2045                                  
  2046                                  
  2047                                  		; INP:	?next, ?tail
  2048                                  		;	?next - 1 -> buffered data, at least 1 byte
  2049                                  		; OUT:	line_out -> buffered data, at least 1 byte
  2050                                  		;	?next = line_out + 1
  2051                                  		;	dx = ?tail -> behind buffered data
  2052                                  		;	 (up to EOF or == line_out + 256)
  2053                                  		;	branches to commonhandle.io_error on I/O error
  2054                                  		; CHG:	di, si, ax, cx
  2055                                  .fill:
  2056 00000C95 BF[0000]                reloc	mov di, relocateddata
  2057                                  linkdatarelocation line_out		; -> buffer
  2058 00000C98 8B76EA                  	mov si, word [bp + ?next]
  2059 00000C9B 4E                      	dec si				; -> H in buffer
  2060 00000C9C 8B4EE8                  	mov cx, word [bp + ?tail]	; -> behind last buffered text
  2061 00000C9F 29F1                    	sub cx, si			; length of buffered data
  2062 00000CA1 8D5501                  	lea dx, [di + 1]		; -> behind the H's destination
  2063 00000CA4 F3A4                    	rep movsb			; move down buffered data
  2064 00000CA6 8956EA                  	mov word [bp + ?next], dx	; -> behind the H
  2065                                  	; mov word [bp + ?tail], di
  2066 00000CA9 89FA                    	mov dx, di
  2067 00000CAB B9[0001]                reloc	mov cx, relocateddata + 256
  2068                                  linkdatarelocation line_out
  2069 00000CAE 29D1                    	sub cx, dx
  2070 00000CB0 7434                    	jz @F
  2071 00000CB2 B43F                    	mov ah, 3Fh
  2072 00000CB4 E89400                  	call dos_or_boot_io		; fill buffer
  2073 00000CB7 7303E987FC              	jc commonhandle.io_error
  2074 00000CBC 01C2                    	add dx, ax
  2075 00000CBE 8956E8                  	mov word [bp + ?tail], dx
  2076 00000CC1 C3                      	retn
  2077                                  
  2078                                  
  2079                                  inject:
  2080 00000CC2 8B16[4003]              reloc	mov dx, word [originaldta]	; dx -> original DTA
  2081                                  internaldatarelocation
  2082 00000CC6 B41A                    	mov ah, 1Ah			; set DTA (restoring)
  2083 00000CC8 E86505                  	extcallcall ispm
  2084 00000CCB 7511                    	jnz .rm
  2085                                  
  2086                                  subcpu 286
  2087 00000CCD FF36[4203]              reloc	push word [originaldta + 2]
  2088                                  internaldatarelocation			; ds => original DTA (86M segment)
  2089 00000CD1 6A21                    	push word 21h
  2090 00000CD3 E8[0000]EB020000        	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
  2091 00000CDA 5A                      	pop dx				; discard interrupt number
  2092 00000CDB 5A                      	pop dx				; discard es
  2093                                  subcpureset
  2094 00000CDC EB08                    	jmp @F
  2095                                  .rm:
  2096 00000CDE 8E1E[4203]              reloc	mov ds, word [originaldta + 2]	; ds => original DTA
  2097                                  internaldatarelocation
  2098 00000CE2 CD21                    	int 21h
  2099 00000CE4 16                      	 push ss
  2100 00000CE5 1F                      	 pop ds
  2101                                  @@:
  2102                                  
  2103 00000CE6 8B1E[4803]              reloc	mov bx, word [findhandle]	; bx = find handle, if any
  2104                                  internaldatarelocation
  2105 00000CEA D006[0400]              reloc	rol byte [findhandle_set], 1	; find handle set ?
  2106                                  internaldatarelocation
  2107 00000CEE 730A                    	jnc @F				; no -->
  2108 00000CF0 F616[0400]              reloc	not byte [findhandle_set]
  2109                                  internaldatarelocation
  2110 00000CF4 B8A171                  	mov ax, 71A1h
  2111 00000CF7 E83E05                  	extcallcall _doscall		; LFN find close
  2112                                  @@:
  2113                                  
  2114 00000CFA 8B0E[4403]              reloc	mov cx, word [originalinject]
  2115                                  internaldatarelocation
  2116 00000CFE E89004                  	call get_es_ext
  2117 00000D01 268026[1000]FE          reloc	clropt [es:code + eldiFlags], eldifResident
  2118                                  internalcoderelocation -3		; mark block as no longer resident
  2119 00000D07 16                      	 push ss
  2120 00000D08 07                      	 pop es
  2121 00000D09 E302                    	jcxz @F
  2122 00000D0B FFE1                    	jmp cx
  2123                                  
  2124                                  @@:
  2125 00000D0D E8[0000]EB020000        	extcall cmd3_not_inject
  2126                                  
  2127                                  
  2128                                  %if _COMPRESSED
  2129                                  seek_compressed_or_dos_or_boot_io:
  2130 00000D14 F646E201                	testopt [bp + ?uncompressed_bit_0], 1
  2131 00000D18 7531                    	jnz dos_or_boot_io
  2132 00000D1A 80FC42                  	cmp ah, 42h
  2133 00000D1D 7529                    	jne @F
  2134 00000D1F 3C01                    	cmp al, 1
  2135 00000D21 7725                    	ja @F
  2136 00000D23 7208                    	jb .abs
  2137 00000D25 0316[C006]              reloc	add dx, word [depackskip]
  2138                                  internaldatarelocation
  2139 00000D29 130E[C206]              reloc	adc cx, word [depackskip + 2]
  2140                                  internaldatarelocation
  2141                                  .abs:
  2142 00000D2D 8916[C006]              reloc	mov word [depackskip], dx
  2143                                  internaldatarelocation
  2144 00000D31 890E[C206]              reloc	mov word [depackskip + 2], cx
  2145                                  internaldatarelocation
  2146 00000D35 89C8                    	mov ax, cx
  2147 00000D37 92                      	xchg ax, dx
  2148 00000D38 F8                      	clc
  2149 00000D39 C3                      	retn
  2150                                  
  2151                                  
  2152                                  read_compressed_or_dos_or_boot_io:
  2153 00000D3A F646E201                	testopt [bp + ?uncompressed_bit_0], 1
  2154 00000D3E 750B                    	jnz dos_or_boot_io
  2155 00000D40 80FC3F                  	cmp ah, 3Fh
  2156 00000D43 7503                    	jne @F
  2157 00000D45 E9A402                  	jmp read_and_depack
  2158                                  
  2159                                  @@:
  2160 00000D48 E85D05                  	extcallcall error
  2161                                  %else
  2162                                   seek_compressed_or_dos_or_boot_io equ dos_or_boot_io
  2163                                   read_compressed_or_dos_or_boot_io equ dos_or_boot_io
  2164                                  %endif
  2165                                  
  2166                                  	lleave ctx
  2167                                  
  2168                                  
  2169                                  dos_or_boot_io:
  2170                                  %if _BOOTLDR
  2171 00000D4B F606[0100]40            reloc	testopt [relocateddata], nodosloaded
  2172                                  linkdatarelocation internalflags, -3
  2173 00000D50 7508                    	jnz .boot
  2174                                  %endif
  2175                                  .dos:
  2176 00000D52 E8[0000]EB020000        	extcall _doscall
  2177 00000D59 C3                      	retn
  2178                                  
  2179                                  %if _BOOTLDR
  2180                                  .boot:
  2181 00000D5A 80FC3F                  	cmp ah, 3Fh
  2182 00000D5D 7508                    	jne @F
  2183 00000D5F E8[0000]EB020000        	extcall yy_boot_read.bx
  2184 00000D66 C3                      	retn
  2185                                  
  2186                                  @@:
  2187 00000D67 3D0042                  	cmp ax, 4200h
  2188 00000D6A 7517                    	jne @F
  2189                                  .boot_seek_absolute:
  2190 00000D6C 2B16[FCFF]              reloc	sub dx, word [relocateddata - LOADDATA2 + ldCurrentSeek]
  2191                                  linkdatarelocation load_data
  2192 00000D70 1B0E[FEFF]              reloc	sbb cx, word [relocateddata - LOADDATA2 + ldCurrentSeek + 2]
  2193                                  linkdatarelocation load_data
  2194                                  
  2195                                  .boot_seek_current:
  2196 00000D74 E8[0000]EB020000        	extcall yy_boot_seek_current.bx
  2197 00000D7B A1[FCFF]                reloc	mov ax, word [relocateddata - LOADDATA2 + ldCurrentSeek]
  2198                                  linkdatarelocation load_data
  2199 00000D7E 8B16[FEFF]              reloc	mov dx, word [relocateddata - LOADDATA2 + ldCurrentSeek + 2]
  2200                                  linkdatarelocation load_data
  2201 00000D82 C3                      	retn
  2202                                  
  2203                                  @@:
  2204 00000D83 3D0142                  	cmp ax, 4201h
  2205 00000D86 74EC                    	je .boot_seek_current
  2206                                   %if _ELDTRAILER
  2207 00000D88 3D0242                  	cmp ax, 4202h
  2208 00000D8B 750A                    	jne @F
  2209                                  .boot_seek_eof:
  2210 00000D8D 0316[F4FF]              reloc	add dx, word [relocateddata - LOADDATA2 + ldFileSize]
  2211                                  linkdatarelocation load_data
  2212 00000D91 130E[F6FF]              reloc	adc cx, word [relocateddata - LOADDATA2 + ldFileSize + 2]
  2213                                  linkdatarelocation load_data
  2214 00000D95 EBD5                    	jmp .boot_seek_absolute
  2215                                   %endif
  2216                                  @@:
  2217 00000D97 E80E05                  	extcallcall error
  2218                                  %endif
  2219                                  
  2220                                  
  2221                                  %if _COMPRESSED
  2222                                   %assign _STANDALONE 0
  2223                                   %assign _MULTI 1
  2224                                   %include "depack.asm"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> lDebug heatshrink/lzexedat depacker
     4                              <1> 
     5                              <1> Copyright (C) 2008-2025 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    16                              <1> 
    17                              <1> 
    18                              <1> 	numdef LZEXEDAT,	0
    19                              <1> 	numdef DEPACKINLINELITERAL,	1
    20                              <1> 	numdef DXTAG,		1
    21                              <1> 	numdef LONGLITERAL,	0
    22                              <1> 	numdef MULTI,		0
    23                              <1> 	numdef STANDALONE,	1
    24                              <1> 	numdef DATEXE,		0
    25                              <1> 
    26                              <1> %ifn _STANDALONE
    27                              <1> 	overridedef DEBUG0,	0
    28                              <1> 	overridedef COUNTER,	0
    29                              <1> %else
    30                              <1>  %ifn _DATEXE
    31                              <1> 	overridedef MULTI,	0
    32                              <1>  %endif
    33                              <1> 	numdef DEBUG0,		0
    34                              <1> 	numdef COUNTER,		0, 32
    35                              <1> %if (_COUNTER - 1) & _COUNTER
    36                              <1>  %error COUNTER must be a power of two
    37                              <1> %endif
    38                              <1> 	numdef OUTBUFFER,	1
    39                              <1> 
    40                              <1> 
    41                              <1> %ifn _DATEXE
    42                              <1> 	cpu 8086
    43                              <1> 	org 256
    44                              <1> 	addsection CODE, start=256
    45                              <1> testprogram:
    46                              <1> 	mov si, 81h
    47                              <1> 
    48                              <1> 	cmp sp, stack.top
    49                              <1> 	jae @F
    50                              <1> error:
    51                              <1> 	mov dx, msg.error
    52                              <1> 	mov ah, 09h
    53                              <1> 	int 21h
    54                              <1> 	mov ax, 4CFFh
    55                              <1> 	int 21h
    56                              <1> 	int 20h
    57                              <1> 
    58                              <1> @@:
    59                              <1> 	lodsb
    60                              <1> 	cmp al, 9
    61                              <1> 	je @B
    62                              <1> 	cmp al, 32
    63                              <1> 	je @B
    64                              <1> 	cmp al, 13
    65                              <1> 	je error
    66                              <1> 	mov dx, si
    67                              <1> 	dec dx
    68                              <1> 
    69                              <1> @@:
    70                              <1> 	lodsb
    71                              <1> 	cmp al, 9
    72                              <1> 	je @F
    73                              <1> 	cmp al, 32
    74                              <1> 	je @F
    75                              <1> 	cmp al, 13
    76                              <1> 	jne @B
    77                              <1> @@:
    78                              <1> 	mov byte [si - 1], 0
    79                              <1> 
    80                              <1> 	mov ax, 3D00h | 1_010_0_000b	; RO, DENY WRITE, No inherit
    81                              <1> 	int 21h
    82                              <1> 	jc error
    83                              <1> 	mov word [handle], ax
    84                              <1> 
    85                              <1> 	xchg bx, ax
    86                              <1> 	mov ax, 4202h
    87                              <1> 	xor cx, cx
    88                              <1> 	xor dx, dx
    89                              <1> 	int 21h
    90                              <1> 	jc error
    91                              <1> 
    92                              <1> 	push dx
    93                              <1> 	push ax
    94                              <1> 	mov ax, 4200h
    95                              <1> 	xor cx, cx
    96                              <1> 	xor dx, dx
    97                              <1> 	int 21h
    98                              <1> 	jc error
    99                              <1> 
   100                              <1> 	mov ax, 3C00h
   101                              <1> 	xor cx, cx
   102                              <1> 	mov dx, msg.outname
   103                              <1> 	int 21h
   104                              <1> 	jc error
   105                              <1> 	mov word [handle2], ax
   106                              <1> 
   107                              <1> 	pop dx
   108                              <1> 	pop cx				; = file size
   109                              <1> %else	; _DATEXE
   110                              <1> 	usesection CODE
   111                              <1> datexe_depack:
   112                              <1> 	mov cx, word [insize + 2]
   113                              <1> 	mov dx, word [insize]
   114                              <1> %endif
   115                              <1> 	mov word [filebuffer.next], filebuffer
   116                              <1> 	mov word [filebuffer.tail], filebuffer
   117                              <1> %if _OUTBUFFER
   118                              <1> 	mov word [outbuffer.next], outbuffer
   119                              <1> %endif
   120                              <1> 
   121                              <1> %if _DATEXE
   122                              <1> 	mov ax, BUFFER
   123                              <1> 	mov es, ax
   124                              <1> %endif
   125                              <1> 	mov di, resultbuffer
   126                              <1> 	push di
   127                              <1> 	push cx
   128                              <1> 	mov ax, 0CCCCh
   129                              <1> 	mov cx, words(resultbuffer.end - resultbuffer)
   130                              <1> 	rep stosw
   131                              <1> 	pop cx
   132                              <1> 	pop di
   133                              <1> 	mov si, resultbuffer.end
   134                              <1> 
   135                              <1> %if _DATEXE
   136                              <1> 	mov ax, [format]
   137                              <1> ..@breakpoint_d:
   138                              <1> 	nop
   139                              <1> %endif
   140                              <1> 
   141                              <1> 	call depack
   142                              <1> %if _DATEXE
   143                              <1> 	mov dx, DATA
   144                              <1> 	mov ds, dx
   145                              <1> 
   146                              <1> 	sbb ax, ax
   147                              <1> 	jz @F
   148                              <1> 	mov dx, msg.decompresserror
   149                              <1> 	call disp_msg_counted
   150                              <1> 	mov ax, 4C0Bh
   151                              <1> 	int 21h
   152                              <1> @@:
   153                              <1> %if _OUTBUFFER
   154                              <1> 	mov di, [outbuffer.next]
   155                              <1> 	call dump_outbuffer
   156                              <1> %endif
   157                              <1> 
   158                              <1> 	mov bx, word [outhandle]
   159                              <1> 	mov ax, 4202h
   160                              <1> 	xor cx, cx
   161                              <1> 	xor dx, dx
   162                              <1> 	int 21h
   163                              <1> 	jc openoutfile.error
   164                              <1> 	mov word [outsize], ax
   165                              <1> 	mov word [outsize + 2], dx
   166                              <1> 
   167                              <1> 	rol byte [verbose], 1
   168                              <1> 	jc display_table_d
   169                              <1> display_short_d:
   170                              <1> 	mov dx, msg.short.1
   171                              <1> 	call disp_msg_counted
   172                              <1> 	mov ax, word [insize]
   173                              <1> 	mov dx, word [insize + 2]
   174                              <1> 	call disp_dxax_dec
   175                              <1> 	mov dx, msg.short.2
   176                              <1> 	call disp_msg_counted
   177                              <1> 	mov ax, word [outsize]
   178                              <1> 	mov dx, word [outsize + 2]
   179                              <1> 	call disp_dxax_dec
   180                              <1> 	mov dx, msg.short.3
   181                              <1> 	call disp_msg_counted
   182                              <1> 	call disp_percentage_swapped
   183                              <1> 	mov ax, 4C00h
   184                              <1> 	int 21h
   185                              <1> 
   186                              <1> 
   187                              <1> display_table_d:
   188                              <1> 	mov si, table_d
   189                              <1> .loop:
   190                              <1> 	lodsw
   191                              <1> 	test ax, ax
   192                              <1> 	jz .done
   193                              <1> 	xchg dx, ax
   194                              <1> 	call disp_msg_counted
   195                              <1> 	lodsw
   196                              <1> 	xchg bx, ax
   197                              <1> 	mov cx, [bx]
   198                              <1> 	mov dx, [bx + 2]
   199                              <1> 	lodsw
   200                              <1> 	xchg cx, ax
   201                              <1> 	call cx
   202                              <1> 	xchg cx, ax
   203                              <1> 	mov al, 32
   204                              <1> 	call disp_al
   205                              <1> 	lodsw
   206                              <1> 	xchg cx, ax
   207                              <1> 	call cx
   208                              <1> 	mov dx, msg.linebreak
   209                              <1> 	call disp_msg_counted
   210                              <1> 	jmp .loop
   211                              <1> 
   212                              <1> .done:
   213                              <1> 	mov dx, msg.done.6
   214                              <1> 	call disp_msg_counted
   215                              <1> 	call disp_percentage_swapped
   216                              <1> 	mov dx, msg.done
   217                              <1> 	call disp_msg_counted
   218                              <1> 	mov ax, 4C00h
   219                              <1> 	int 21h
   220                              <1> %else	; _DATEXE
   221                              <1> 	jc error
   222                              <1> 
   223                              <1> %if _OUTBUFFER
   224                              <1> 	mov di, [outbuffer.next]
   225                              <1> 	call dump_outbuffer
   226                              <1> %endif
   227                              <1> 
   228                              <1> 	push ss
   229                              <1> 	pop ds
   230                              <1> 	push ss
   231                              <1> 	pop es
   232                              <1> 
   233                              <1> 	mov ah, 3Eh
   234                              <1> 	mov bx, [handle]
   235                              <1> 	int 21h
   236                              <1> 
   237                              <1> 	mov ah, 3Eh
   238                              <1> 	mov bx, [handle2]
   239                              <1> 	int 21h
   240                              <1> 
   241                              <1> 	mov ax, 4C00h
   242                              <1> 	int 21h
   243                              <1> 	int 20h
   244                              <1> 
   245                              <1> 
   246                              <1> %if _COUNTER
   247                              <1> disp_al:
   248                              <1> 	push dx
   249                              <1> 	push ax
   250                              <1> 	xchg ax, dx
   251                              <1> 	mov ah, 02h
   252                              <1> 	int 21h
   253                              <1> 	pop ax
   254                              <1> 	pop dx
   255                              <1> 	retn
   256                              <1> %endif
   257                              <1> %endif	; _DATEXE
   258                              <1> 
   259                              <1> 
   260                              <1> 		; INP:	-
   261                              <1> 		; OUT:	Does not return if error (in this example)
   262                              <1> 		;	CY if error
   263                              <1> 		;	NC if success,
   264                              <1> 		;	 al = byte read from file
   265                              <1> 		; CHG:	si
   266                              <1> 		; REM:	In this example program we assume ds = es = ss.
   267                              <1> get_file_byte:
   268                              <1> %if _DATEXE
   269                              <1> 	push ds
   270                              <1> 	mov si, DATA
   271                              <1> 	mov ds, si
   272                              <1> %endif
   273                              <1> 	mov si, [filebuffer.next]
   274                              <1> 	cmp si, [filebuffer.tail]
   275                              <1> 	jb .buffered
   276                              <1> 
   277                              <1> 	push ax
   278                              <1> 	push bx
   279                              <1> 	push cx
   280                              <1> 	push dx
   281                              <1> 	mov dx, filebuffer
   282                              <1> 	mov [filebuffer.next], dx
   283                              <1> 	mov [filebuffer.tail], dx
   284                              <1> 	mov ah, 3Fh
   285                              <1> 	mov bx, [handle]
   286                              <1>         mov cx, filebuffer.end - filebuffer
   287                              <1> 
   288                              <1> 	int 21h
   289                              <1> %if _DATEXE
   290                              <1> 	jc getbuf.errorread
   291                              <1> 	test ax, ax
   292                              <1> 	jz getbuf.shortread
   293                              <1> %else
   294                              <1> 	jc error
   295                              <1> 	test ax, ax
   296                              <1> 	jz error
   297                              <1> %endif
   298                              <1> 	add ax, dx
   299                              <1> 	mov word [filebuffer.tail], ax
   300                              <1>         mov si, dx
   301                              <1> 	pop dx
   302                              <1> 	pop cx
   303                              <1> 	pop bx
   304                              <1> 	pop ax
   305                              <1> 
   306                              <1> .buffered:
   307                              <1> 	lodsb
   308                              <1> 	mov [filebuffer.next], si
   309                              <1> 	clc
   310                              <1> %if _DATEXE
   311                              <1> 	pop ds
   312                              <1> %endif
   313                              <1> 	retn
   314                              <1> 
   315                              <1> 
   316                              <1> %if _OUTBUFFER
   317                              <1> 		; INP:	ds:si -> data to write
   318                              <1> 		;	cx = length of data (may be zero)
   319                              <1> 		; OUT:	Does not return if error
   320                              <1> 		; CHG:	-
   321                              <1> 		; REM:	In this example program we assume ds = es = ss.
   322                              <1> put_file_data:
   323                              <1> 	push ax
   324                              <1> 	push bx
   325                              <1> 	push dx
   326                              <1> 	push di
   327                              <1> 	push si
   328                              <1> 	push cx
   329                              <1> %if _DATEXE
   330                              <1> 	push es
   331                              <1> 	mov di, DATA
   332                              <1> 	mov es, di
   333                              <1> 	es
   334                              <1> %endif
   335                              <1> 	mov di, [outbuffer.next]
   336                              <1> 	jcxz .end
   337                              <1> @@:
   338                              <1> 	cmp di, outbuffer.end
   339                              <1> 	jne @F
   340                              <1> 
   341                              <1> 	call dump_outbuffer
   342                              <1> 
   343                              <1> @@:
   344                              <1> 	movsb
   345                              <1> 	loop @BB
   346                              <1> %if _DATEXE
   347                              <1> 	es
   348                              <1> %endif
   349                              <1> 	mov [outbuffer.next], di
   350                              <1> .end:
   351                              <1> %if _DATEXE
   352                              <1> 	pop es
   353                              <1> %endif
   354                              <1> 	pop cx
   355                              <1> 	pop si
   356                              <1> 	pop di
   357                              <1> 	pop dx
   358                              <1> 	pop bx
   359                              <1> 	pop ax
   360                              <1> 	retn
   361                              <1> 
   362                              <1> dump_outbuffer:
   363                              <1> 	push cx
   364                              <1> %if _DATEXE
   365                              <1> 	push ds
   366                              <1> 	mov cx, DATA
   367                              <1> 	mov ds, cx
   368                              <1> %endif
   369                              <1> 	mov cx, di
   370                              <1> 	mov dx, outbuffer
   371                              <1> 	sub cx, dx
   372                              <1> 	jz @F
   373                              <1> 	mov bx, word [handle2]
   374                              <1> 	mov ah, 40h
   375                              <1> 	int 21h
   376                              <1> %if _DATEXE
   377                              <1> 	jc putbuf.errorwrite
   378                              <1> 	cmp ax, cx
   379                              <1> 	jne putbuf.shortwrite
   380                              <1> %else
   381                              <1> 	jc error
   382                              <1> 	cmp ax, cx
   383                              <1> 	jne error
   384                              <1> %endif
   385                              <1> @@:
   386                              <1> 	mov di, dx
   387                              <1> %if _DATEXE
   388                              <1> 	pop ds
   389                              <1> %endif
   390                              <1> 	pop cx
   391                              <1> 	retn
   392                              <1> %else
   393                              <1> 		; INP:	ds:si -> data to write
   394                              <1> 		;	cx = length of data (may be zero)
   395                              <1> 		; OUT:	Does not return if error
   396                              <1> 		; CHG:	-
   397                              <1> 		; REM:	In this example program we assume ds = es = ss.
   398                              <1> put_file_data:
   399                              <1> 	push ax
   400                              <1> 	push bx
   401                              <1> 	push dx
   402                              <1> 	mov dx, si
   403                              <1> 	mov ah, 40h
   404                              <1> %if _DATEXE
   405                              <1> 	push ds
   406                              <1> 	mov di, DATA
   407                              <1> 	mov ds, di
   408                              <1> %endif
   409                              <1> 	mov bx, [handle2]
   410                              <1> %if _DATEXE
   411                              <1> 	pop ds
   412                              <1> %endif
   413                              <1> 	jcxz @F
   414                              <1> 	int 21h
   415                              <1> %if _DATEXE
   416                              <1> 	jc putbuf.errorwrite
   417                              <1> 	cmp ax, cx
   418                              <1> 	jne putbuf.shortwrite
   419                              <1> %else
   420                              <1> 	jc error
   421                              <1> 	cmp ax, cx
   422                              <1> 	jne error
   423                              <1> %endif
   424                              <1> @@:
   425                              <1> 	pop dx
   426                              <1> 	pop bx
   427                              <1> 	pop ax
   428                              <1> 	retn
   429                              <1> %endif
   430                              <1> 
   431                              <1> 
   432                              <1> %ifn _DATEXE
   433                              <1> 	addsection DATA, align=1 follows=CODE
   434                              <1> msg:
   435                              <1> .error:		ascic "Error!",13,10
   436                              <1> .outname:	asciz "output.bin"
   437                              <1> 
   438                              <1> 
   439                              <1> 	addsection BSSDATA, align=16 nobits follows=DATA
   440                              <1> 	alignb 16
   441                              <1> resultbuffer:
   442                              <1> .size equ 4096
   443                              <1> 		resb .size
   444                              <1> .end:
   445                              <1> 
   446                              <1> %else
   447                              <1> 	usesection DATA
   448                              <1> %endif
   449                              <1> 	alignb 2
   450                              <1> filebuffer:	resb 256
   451                              <1> .end:
   452                              <1> 	alignb 2
   453                              <1> .next:		resw 1
   454                              <1> .tail:		resw 1
   455                              <1> %if _DATEXE
   456                              <1> handle equ inhandle
   457                              <1> handle2 equ outhandle
   458                              <1> %else
   459                              <1> handle:		resw 1
   460                              <1> handle2:	resw 1
   461                              <1> %endif
   462                              <1> 
   463                              <1> %if _OUTBUFFER
   464                              <1> outbuffer:	resb 256
   465                              <1> .end:
   466                              <1> .next:		resw 1
   467                              <1> %endif
   468                              <1> 
   469                              <1> %ifn _DATEXE
   470                              <1> stack:		resb 512
   471                              <1> .top:
   472                              <1> %endif
   473                              <1> 
   474                              <1> 
   475                              <1> 	usesection CODE
   476                              <1> %endif	; _STANDALONE
   477                              <1> 
   478                              <1> %if _MULTI
   479                              <1> 	overridedef LZEXEDAT, 1
   480                              <1> 	overridedef LONGLITERAL, 1
   481                              <1> %endif
   482                              <1> 
   483                              <1> 		; INP:	cx:dx = length of source
   484                              <1> 		;	es:di -> destination
   485                              <1> 		;	si -> behind end of destination (si > di)
   486                              <1> 		;	(al = format, 2 = heatshrink, 3 = lzexedat -4)
   487                              <1> 		;	(ah = 0FFh for switch4k on, 00h for off)
   488                              <1> 		; OUT:	NC if success
   489                              <1> 		;	CY if error,
   490                              <1> 		;	 bx = ?errordata (if _DEBUG0)
   491                              <1> 		; CHG:	ax, (bx), cx, dx, es, ds, si, di
   492                              <1> 		; STT:	UP
   493                              <1> depack:
   494                              <1> 	lframe near
   495 00000D9A 5589E5              <1> 	lenter
   496                              <1>  %if _DEBUG0 || _COUNTER
   497                              <1> 	xor bx, bx
   498                              <1>  %endif
   499                              <1>  %if _DEBUG0
   500                              <1> 	lvar word,	errordata
   501                              <1> 	 push bx
   502                              <1>  %endif
   503                              <1> %if _MULTI
   504 00000D9D 88C3                <1> 	mov bl, al
   505                              <1> %endif
   506                              <1> %if _COUNTER || _MULTI
   507                              <1> 	lvar word,	format_and_counter
   508                              <1> 	lequ ?format_and_counter + 1, counter
   509                              <1> 	lequ ?format_and_counter, format
   510 00000D9F 53                  <1> 	 push bx		; initialise counter (high byte) to zero
   511                              <1> 				; and format (low byte)
   512                              <1> %endif
   513                              <1> %if _DATEXE
   514                              <1> 	lvar word,	empty_and_switch4k
   515                              <1> 	lequ ?empty_and_switch4k + 1, switch4k
   516                              <1> 	 push ax
   517                              <1> %endif
   518                              <1> 
   519                              <1> 	lvar dword,	original_dst
   520 00000DA0 06                  <1> 	 push es
   521 00000DA1 57                  <1> 	 push di
   522                              <1> 	lvar dword,	dst
   523 00000DA2 06                  <1> 	 push es
   524 00000DA3 57                  <1> 	 push di
   525                              <1> 	lvar dword,	src_remaining
   526 00000DA4 51                  <1> 	 push cx
   527 00000DA5 52                  <1> 	 push dx
   528                              <1> 
   529 00000DA6 89F1                <1> 	mov cx, si
   530 00000DA8 29F9                <1> 	sub cx, di		; same flags as cmp si, di
   531 00000DAA 7703E9E900          <1> 	jbe .error
   532                              <1> 
   533                              <1> %if _DXTAG
   534                              <1> 	lvar word,	dst_end
   535 00000DAF 56                  <1> 	 push si		; push into [bp + ?dst_end]
   536                              <1> %else
   537                              <1> 	mov dx, si
   538                              <1> %endif
   539                              <1> 
   540 00000DB0 31C0                <1> 	xor ax, ax
   541 00000DB2 F3AA                <1> 	rep stosb		; prepare for matches before first data byte
   542                              <1> %if _LZEXEDAT || _MULTI
   543 00000DB4 40                  <1> 	inc ax			; = 1
   544                              <1> %endif
   545                              <1> %if _MULTI
   546                              <1> 	lvar word,	word1
   547                              <1> 	lvar word,	word2
   548                              <1> 	lvar word,	word3
   549                              <1> 
   550 00000DB5 807EFE02            <1> 	cmp byte [bp + ?format], 2
   551 00000DB9 7303E9DA00          <1> 	jb .error
   552 00000DBE 806EFE03            <1> 	sub byte [bp + ?format], 3
   553                              <1> 		; -1 = heatshrink, 0 = lzexedat -4, 1 = lzexedat -4 -l
   554 00000DC2 7303E98E00          <1> 	jb .hs_init
   555 00000DC7 3846FE              <1> 	cmp byte [bp + ?format], al
   556 00000DCA 7603E9C900          <1> 	ja .error
   557                              <1> %endif
   558                              <1> %if _LZEXEDAT
   559                              <1> .lze_init:
   560                              <1> %if _MULTI
   561                              <1> 	lequ ?word1,	tagbitscycle
   562                              <1> %else
   563                              <1> 	lvar word,	tagbitscycle
   564                              <1> %endif
   565 00000DCF 50                  <1> 	 push ax		; = 1
   566                              <1> 
   567                              <1> %ifn _DXTAG
   568                              <1>  %if _MULTI
   569                              <1> 	lequ ?word2,	tagword
   570                              <1>  %else
   571                              <1> 	lvar word,	tagword
   572                              <1>  %endif
   573                              <1> 	 push ax
   574                              <1> %endif
   575 00000DD0 E8B601              <1> 	call get_bit			; ?tagbitscycle init to 1, ror sets CY
   576                              <1> 					;  (bogus result in CF is ignored)
   577                              <1> 
   578 00000DD3 EB26                <1> 	jmp .lze_loop
   579                              <1> 
   580                              <1> .lze_literal:
   581                              <1> %if _LONGLITERAL
   582 00000DD5 41                  <1> 	inc cx
   583                              <1> .loop_literal:
   584                              <1> %endif
   585                              <1> 
   586 00000DD6 E8CA01              <1> 	call load_byte
   587                              <1> %if _LONGLITERAL
   588 00000DD9 51                  <1> 	push cx
   589                              <1> %endif
   590                              <1> %if _DEPACKINLINELITERAL
   591                              <1> %if _LONGLITERAL
   592 00000DDA B90100              <1> 	mov cx, 1
   593                              <1> %else
   594                              <1> 	inc cx				; cx = 1
   595                              <1> %endif
   596 00000DDD C47EF6              <1> 	les di, [bp + ?dst]		; -> destination
   597                              <1> %if _DXTAG
   598 00000DE0 3B7EF0              <1> 	cmp di, [bp + ?dst_end]		; at end of circular buffer ?
   599                              <1> %else
   600                              <1> 	cmp di, dx
   601                              <1> %endif
   602 00000DE3 7603E9B000          <1> 	ja .error			; invalid -->
   603 00000DE8 7203                <1> 	jb @F				; no -->
   604 00000DEA 8B7EFA              <1> 	mov di, word [bp + ?original_dst]	; yes, reset
   605                              <1> @@:
   606 00000DED 06                  <1> 	push es
   607 00000DEE 1F                  <1> 	pop ds
   608 00000DEF 89FE                <1> 	mov si, di			; ds:si -> where to store
   609 00000DF1 AA                  <1> 	stosb				; store it
   610 00000DF2 897EF6              <1> 	mov word [bp + ?dst], di	; update ?dst
   611 00000DF5 E80E03              <1> 	call put_file_data		; ds:si ->, length cx
   612                              <1> %else
   613                              <1> 	push ax				; on stack: the literal
   614                              <1> 	 push ss
   615                              <1> 	 pop ds
   616                              <1> 	mov si, sp			; ds:si -> data on stack
   617                              <1> %if _LONGLITERAL
   618                              <1> 	xor ax, ax
   619                              <1> %else
   620                              <1> 	xchg ax, cx			; ax = 0
   621                              <1> %endif
   622                              <1> 	inc ax				; length = 1
   623                              <1> 	mov bx, ax			; bx NZ
   624                              <1> 	call copy_data.bx
   625                              <1> 	pop ax				; (discard)
   626                              <1> d0	mov byte [bp + ?errordata], 75h
   627                              <1> 	jc .error
   628                              <1> %endif
   629                              <1> 
   630                              <1> %if _LONGLITERAL
   631 00000DF8 59                  <1> 	pop cx
   632 00000DF9 E2DB                <1> 	loop .loop_literal
   633                              <1> %endif
   634                              <1> 
   635                              <1> %assign LENGTHOFLITERAL $ - .lze_literal
   636                              <1> %warning length of lze literal = LENGTHOFLITERAL
   636          ******************  <1>  warning: length of lze literal = 38 [-w+user]
   637                              <1> 
   638                              <1> .lze_loop:
   639 00000DFB 31C9                <1> 	xor cx, cx			; ! ch = 0, cx = 0
   640 00000DFD E88901              <1> 	call get_bit
   641 00000E00 72D3                <1> 	jc .lze_literal
   642                              <1> 
   643                              <1> .lze_notliteral:
   644                              <1> %if _COUNTER
   645                              <1> 	inc byte [bp + ?counter]
   646                              <1> 	test byte [bp + ?counter], _COUNTER - 1
   647                              <1> 	jnz @F
   648                              <1> 	mov al, '.'
   649                              <1> 	call disp_al_counter
   650                              <1> @@:
   651                              <1> %endif
   652                              <1> 
   653 00000E02 E88401              <1> 	call get_bit
   654 00000E05 7219                <1> 	jc .lze_combined
   655                              <1> 
   656                              <1> .lze_shortmatch:
   657                              <1> 		; cx = 0
   658 00000E07 E87F01              <1> 	call get_bit
   659 00000E0A D1D1                <1> 	rcl cx, 1
   660 00000E0C E87A01              <1> 	call get_bit
   661 00000E0F D1D1                <1> 	rcl cx, 1			; cx = 0..3
   662                              <1> 
   663 00000E11 E88F01              <1> 	call load_byte			; load displacement
   664                              <1> 
   665 00000E14 B4FF                <1> 	mov ah, -1			; sign extend for negative number
   666 00000E16 93                  <1> 	xchg bx, ax			; bx = displacement (-1 to -256)
   667                              <1> 
   668                              <1> .lze_match_cx_plus_2:
   669 00000E17 41                  <1> 	inc cx
   670                              <1> .lze_match_cx_plus_1:
   671 00000E18 41                  <1> 	inc cx
   672                              <1> 
   673                              <1> 		; INP:	bx = match displacement (-1 to -4096)
   674                              <1> 		;	cx = match count (2 to 256)
   675 00000E19 93                  <1> 	xchg ax, bx			; ax = displacement, cx = count
   676 00000E1A 91                  <1> 	xchg ax, cx			; cx = displacement, ax = length of match
   677 00000E1B F7D9                <1> 	neg cx				; cx = index
   678 00000E1D E9BC00              <1> 	jmp .lze_match
   679                              <1> .lze_loop_j1: equ .lze_loop
   680                              <1> 
   681                              <1> .lze_combined:
   682 00000E20 E87501              <1> 	call load_word			; load combined word
   683                              <1> 
   684 00000E23 89C3                <1> 	mov bx, ax
   685 00000E25 F9                  <1> 	stc				; CY
   686 00000E26 D0DF                <1> 	rcr bh, 1			; rotate in a 1
   687 00000E28 D0FF                <1> 	sar bh, 1
   688 00000E2A D0FF                <1> 	sar bh, 1			; fill top three bits with 1s
   689                              <1> %if _DATEXE
   690                              <1> 	rol byte [bp + ?switch4k], 1
   691                              <1> 	jnc .8k
   692                              <1> .4k:
   693                              <1> 	sar bh, 1			; fill top *four* bits with 1s
   694                              <1> 	and ah, 15
   695                              <1> 	jmp @F
   696                              <1> .8k:
   697                              <1> 	and ah, 7
   698                              <1> @@:
   699                              <1> %else
   700                              <1>  %if 1	; _4
   701 00000E2C D0FF                <1> 	sar bh, 1			; fill top *four* bits with 1s
   702 00000E2E 80E40F              <1> 	and ah, 15
   703                              <1>  %else
   704                              <1> 	and ah, 7
   705                              <1>  %endif
   706                              <1> %endif
   707 00000E31 88E1                <1> 	mov cl, ah			; ch already = 0
   708 00000E33 75E2                <1> 	jnz .lze_match_cx_plus_2	; length = cx + 2, bx = displacement
   709                              <1> 
   710                              <1> .lze_escape:
   711 00000E35 E86B01              <1> 	call load_byte			; ah = 0
   712 00000E38 3C01                <1> 	cmp al, 1
   713 00000E3A 724F                <1> 	jb .end_check
   714 00000E3C 91                  <1> 	xchg cx, ax			; cx = length
   715 00000E3D 77D9                <1> 	ja .lze_match_cx_plus_1		; length = cx + 1, bx = displacement
   716                              <1> 
   717                              <1> %if _LONGLITERAL
   718                              <1>  %if _MULTI
   719 00000E3F 807EFE01            <1> 	cmp byte [bp + ?format], 1
   720 00000E43 750E                <1> 	jne .lze_normalise		; not lzexedat -4 -l -->
   721                              <1>  %endif
   722 00000E45 87CB                <1> 	xchg cx, bx			; cx = displacement, top 4 or 3 bits sets
   723                              <1>  %if _DATEXE
   724                              <1> 	and ch, ~ 1110_0000b		; isolate 13-bit displacement
   725                              <1> 	rol byte [bp + ?switch4k], 1
   726                              <1> 	jnc @F
   727                              <1> 	and ch, ~ 1111_0000b		; isolate 12-bit displacement
   728                              <1> @@:
   729                              <1>  %else
   730                              <1>   %if 1 ; _4
   731 00000E47 80E50F              <1> 	and ch, ~ 1111_0000b		; isolate 12-bit displacement
   732                              <1>   %else
   733                              <1> 	and ch, ~ 1110_0000b		; isolate 13-bit displacement
   734                              <1>   %endif
   735                              <1>  %endif
   736 00000E4A E307                <1>  	jcxz .lze_normalise		; displacement 0 means segment change -->
   737 00000E4C 83F91A              <1>  	cmp cx, 26			; long literals command needs >= 26 bytes
   738 00000E4F 7247                <1>  	jb .error			; (reserved for future expansion)
   739 00000E51 EB83                <1>  	jmp .loop_literal		; process the literals -->
   740                              <1> %endif
   741                              <1> .lze_normalise:
   742 00000E53 EBA6                <1> 	jmp .lze_loop_j1
   743                              <1> 
   744                              <1> %if !_MULTI
   745                              <1> .end_check:
   746                              <1> d0	mov byte [bp + ?errordata], 7Dh
   747                              <1> 	xor cx, cx
   748                              <1> 	cmp word [bp + ?src_remaining + 2], cx
   749                              <1> 	jne .error
   750                              <1> 	cmp word [bp + ?src_remaining], cx
   751                              <1> 	jne .error
   752                              <1> 
   753                              <1> .end:
   754                              <1> 	db __TEST_IMM8			; (NC)
   755                              <1> .error:
   756                              <1> 	stc
   757                              <1> 
   758                              <1> %if _COUNTER
   759                              <1> 	lahf
   760                              <1> 	mov al, 13
   761                              <1> 	call disp_al_for_progress
   762                              <1> 	mov al, 10
   763                              <1> 	call disp_al_for_progress
   764                              <1> 	sahf
   765                              <1> %endif
   766                              <1> d0	mov bx, word [bp + ?errordata]
   767                              <1> 	lleave code
   768                              <1> 	lret
   769                              <1> %endif
   770                              <1> %endif
   771                              <1> 
   772                              <1> %if _MULTI || !_LZEXEDAT
   773                              <1> .hs_init:
   774                              <1> @@:
   775 00000E55 E87C01              <1> 	call read_byte
   776                              <1> d0	mov byte [bp + ?errordata], 70h
   777 00000E58 723E                <1> 	jc .error
   778                              <1> 
   779 00000E5A B400                <1> 	mov ah, 0
   780 00000E5C 85C0                <1> 	test ax, ax
   781                              <1> d0	mov byte [bp + ?errordata], 71h
   782 00000E5E 7438                <1> 	jz .error
   783 00000E60 3C0F                <1> 	cmp al, 15
   784 00000E62 7734                <1> 	ja .error
   785                              <1> 
   786                              <1> %if _MULTI
   787                              <1> 	lequ ?word1,	window_size_bits
   788                              <1> %else
   789                              <1> 	lvar word,	window_size_bits
   790                              <1> %endif
   791 00000E64 50                  <1> 	 push ax
   792                              <1> 
   793 00000E65 91                  <1> 	xchg cx, ax
   794 00000E66 B80100              <1> 	mov ax, 1
   795 00000E69 D3E0                <1> 	shl ax, cl
   796 00000E6B 3D0010              <1> 	cmp ax, resultbuffer.size
   797 00000E6E 7728                <1> 	ja .error
   798                              <1> 
   799 00000E70 E86101              <1> 	call read_byte
   800                              <1> d0	mov byte [bp + ?errordata], 72h
   801 00000E73 7223                <1> 	jc .error
   802                              <1> 
   803 00000E75 B400                <1> 	mov ah, 0
   804 00000E77 85C0                <1> 	test ax, ax
   805                              <1> d0	mov byte [bp + ?errordata], 73h
   806 00000E79 741D                <1> 	jz .error
   807 00000E7B 3B46EE              <1> 	cmp ax, word [bp + ?window_size_bits]
   808 00000E7E 7318                <1> 	jae .error
   809                              <1> 
   810                              <1> %if _MULTI
   811                              <1> 	lequ ?word2,	lookahead_size_bits
   812                              <1> %else
   813                              <1> 	lvar word,	lookahead_size_bits
   814                              <1> %endif
   815 00000E80 50                  <1> 	 push ax
   816                              <1> 
   817                              <1> %if _DXTAG
   818 00000E81 31D2                <1> 	xor dx, dx			; dl = bit index, dh = current byte
   819                              <1> %else
   820                              <1> 	xor cx, cx
   821                              <1>  %if _MULTI
   822                              <1> 	lequ ?word3,	low_bit_index_and_high_current_byte
   823                              <1>  %else
   824                              <1> 	lvar word,	low_bit_index_and_high_current_byte
   825                              <1>  %endif
   826                              <1> 	 push cx
   827                              <1> %endif
   828                              <1> 
   829                              <1> .loop:
   830                              <1> %if _COUNTER
   831                              <1> 	inc byte [bp + ?counter]
   832                              <1> 	test byte [bp + ?counter], _COUNTER - 1
   833                              <1> 	jnz @F
   834                              <1> 	mov al, '.'
   835                              <1> 	call disp_al
   836                              <1> @@:
   837                              <1> %endif
   838                              <1> 
   839 00000E83 B90100              <1> 	mov cx, 1
   840 00000E86 E82301              <1> 	call get_bits
   841 00000E89 7312                <1> 	jnc .notend			; (cx = 0 if jumping)
   842                              <1> 
   843                              <1> d0	mov byte [bp + ?errordata], 7Dh
   844                              <1> .end_check:
   845 00000E8B 31C0                <1> 	xor ax, ax
   846 00000E8D 3946F2              <1> 	cmp word [bp + ?src_remaining], ax
   847 00000E90 7506                <1> 	jne .error
   848 00000E92 3946F4              <1> 	cmp word [bp + ?src_remaining + 2], ax
   849 00000E95 7501                <1> 	jne .error
   850                              <1> 
   851 00000E97 A8                  <1> 	db __TEST_IMM8			; (NC)
   852                              <1> .error:
   853 00000E98 F9                  <1> 	stc
   854                              <1> 
   855                              <1> %if _COUNTER
   856                              <1> 	lahf
   857                              <1> 	mov al, 13
   858                              <1> 	call disp_al
   859                              <1> 	mov al, 10
   860                              <1> 	call disp_al
   861                              <1> 	sahf
   862                              <1> %endif
   863                              <1> d0	mov bx, word [bp + ?errordata]
   864 00000E99 89EC5D              <1> 	lleave code
   865 00000E9C C3                  <1> 	lret
   866                              <1> 
   867                              <1> .notend:				; (cx = 0)
   868 00000E9D 84C0                <1> 	test al, al
   869 00000E9F 7422                <1> 	jz .notliteral
   870                              <1> 
   871                              <1> .hs_literal:
   872 00000EA1 B108                <1> 	mov cl, 8
   873 00000EA3 E80601              <1> 	call get_bits			; cx = 0
   874                              <1> d0	mov byte [bp + ?errordata], 74h
   875 00000EA6 72E3                <1> 	jc .end_check
   876                              <1> %if _DEPACKINLINELITERAL
   877 00000EA8 41                  <1> 	inc cx				; cx = 1
   878 00000EA9 C47EF6              <1> 	les di, [bp + ?dst]		; -> destination
   879                              <1> %if _DXTAG
   880 00000EAC 3B7EF0              <1> 	cmp di, [bp + ?dst_end]		; at end of circular buffer ?
   881                              <1> %else
   882                              <1> 	cmp di, dx
   883                              <1> %endif
   884 00000EAF 77E7                <1> 	ja .error			; invalid -->
   885 00000EB1 7203                <1> 	jb @F				; no -->
   886 00000EB3 8B7EFA              <1> 	mov di, word [bp + ?original_dst]	; yes, reset
   887                              <1> @@:
   888 00000EB6 06                  <1> 	push es
   889 00000EB7 1F                  <1> 	pop ds
   890 00000EB8 89FE                <1> 	mov si, di			; ds:si -> where to store
   891 00000EBA AA                  <1> 	stosb				; store it
   892 00000EBB 897EF6              <1> 	mov word [bp + ?dst], di	; update ?dst
   893 00000EBE E84502              <1> 	call put_file_data		; ds:si ->, length cx
   894                              <1> %else
   895                              <1> 	push ax				; on stack: the literal
   896                              <1> 	 push ss
   897                              <1> 	 pop ds
   898                              <1> 	mov si, sp			; ds:si -> data on stack
   899                              <1> 	xchg ax, cx			; ax = 0
   900                              <1> 	inc ax				; length = 1
   901                              <1> 	mov bx, ax			; bx NZ
   902                              <1> 	call copy_data.bx
   903                              <1> 	pop ax				; (discard)
   904                              <1> d0	mov byte [bp + ?errordata], 75h
   905                              <1> 	jc .error
   906                              <1> %endif
   907                              <1> %assign LENGTHOFLITERAL $ - .hs_literal
   908                              <1> %warning length of hs literal = LENGTHOFLITERAL
   908          ******************  <1>  warning: length of hs literal = 32 [-w+user]
   909 00000EC1 EBC0                <1> 	jmp .loop
   910                              <1> 
   911                              <1> .notliteral:				; (cx = 0)
   912                              <1> 
   913 00000EC3 8A4EEE              <1> 	mov cl, byte [bp + ?window_size_bits]
   914                              <1> 					; cx = -w parameter
   915 00000EC6 E8E300              <1> 	call get_bits
   916                              <1> d0	mov byte [bp + ?errordata], 76h
   917 00000EC9 72C0                <1> 	jc .end_check
   918                              <1> 		; ax = output index
   919                              <1> 		; cx = 0
   920 00000ECB 93                  <1> 	xchg bx, ax
   921 00000ECC 8A4EEC              <1> 	mov cl, byte [bp + ?lookahead_size_bits]
   922                              <1> 					; cx = -l parameter
   923 00000ECF E8DA00              <1> 	call get_bits
   924                              <1> d0	mov byte [bp + ?errordata], 77h
   925 00000ED2 72B7                <1> 	jc .end_check
   926                              <1> 		; bx = output index less 1
   927                              <1> 		; ax = output count less 1
   928 00000ED4 43                  <1> 	inc bx				; = output index
   929                              <1> d0	mov byte [bp + ?errordata], 78h
   930 00000ED5 74C1                <1> 	jz .error
   931                              <1> 
   932                              <1> 					; ax = length of match less one
   933 00000ED7 40                  <1> 	inc ax				; = length of match
   934 00000ED8 74BE                <1> 	jz .error
   935                              <1> 
   936 00000EDA 89D9                <1> 	mov cx, bx			; 1 .. 65535
   937                              <1> %endif
   938                              <1> 
   939                              <1> %if _LZEXEDAT
   940                              <1> .lze_match:
   941                              <1> %endif
   942                              <1> 
   943                              <1> 		; cx = index, ax = length
   944 00000EDC C576F6              <1> 	lds si, [bp + ?dst]
   945 00000EDF 8B5EFA              <1> 	mov bx, word [bp + ?original_dst]
   946 00000EE2 F7DB                <1> 	neg bx
   947 00000EE4 01F3                <1> 	add bx, si			; dst - original = length at start
   948 00000EE6 29CB                <1> 	sub bx, cx			; length start - match distance
   949 00000EE8 7324                <1> 	jae @F				; length start >= match distance -->
   950                              <1> 		; bx = negative length of matchable at end of buffer
   951                              <1> 
   952                              <1> %if _DXTAG
   953 00000EEA 8B76F0              <1> 	mov si, [bp + ?dst_end]
   954                              <1> %else
   955                              <1> 	mov si, dx
   956                              <1> %endif
   957 00000EED 01DE                <1> 	add si, bx			; si -> match data
   958 00000EEF 89F3                <1> 	mov bx, si
   959 00000EF1 01C3                <1> 	add bx, ax			; -> behind match data (if fits)
   960 00000EF3 7205                <1> 	jc .full			; if doesn't fit, copy full -->
   961                              <1> %if _DXTAG
   962 00000EF5 3B5EF0              <1> 	cmp bx, [bp + ?dst_end]		; -> behind is above-or-equal end ?
   963                              <1> %else
   964                              <1> 	cmp bx, dx
   965                              <1> %endif
   966                              <1> 	; jae .full			; yes -->
   967 00000EF8 7216                <1> 	jb .copy_data			; ax has full length from tail of buffer -->
   968                              <1> 
   969                              <1> 		; if we branch to here,
   970                              <1> 		;  si + ax >= (word [bp + ?dst_end] or dx)
   971                              <1> 		;  therefore  ax >= (word [bp + ?dst_end] or dx) - si
   972                              <1> .full:
   973 00000EFA 50                  <1> 	push ax				; save original length
   974                              <1> 		; calculate word [bp + ?dst_end] - si
   975                              <1> %if _DXTAG
   976 00000EFB 8B46F0              <1> 	mov ax, [bp + ?dst_end]
   977                              <1> %else
   978                              <1> 	mov ax, dx
   979                              <1> %endif
   980 00000EFE 29F0                <1> 	sub ax, si			; -> end minus -> match data
   981 00000F00 50                  <1> 	push ax				; save length
   982 00000F01 E82200              <1> 	call copy_data
   983                              <1> d0	mov byte [bp + ?errordata], 1
   984 00000F04 7292                <1> 	jc .error
   985 00000F06 5B                  <1> 	pop bx				; = done length
   986 00000F07 58                  <1> 	pop ax				; = entire length
   987 00000F08 29D8                <1> 	sub ax, bx			; entire length minus done length
   988 00000F0A 8B76FA              <1> 	mov si, word [bp + ?original_dst]	; -> start of buffer
   989 00000F0D A9                  <1> 	db __TEST_IMM16			; skip sub
   990                              <1> @@:
   991 00000F0E 29CE                <1> 	sub si, cx			; -> into buffer
   992                              <1> 
   993                              <1> .copy_data:
   994 00000F10 E81300              <1> 	call copy_data			; give ?dst -> dest, ds:si -> source
   995                              <1> 		; returns: ?dst incremented, ds:si -> after match source
   996                              <1> d0	mov byte [bp + ?errordata], 7Bh
   997 00000F13 7283                <1> 	jc .error
   998                              <1> 
   999                              <1> %if _MULTI
  1000                              <1> 		; end of common code, dispatch back to main loop
  1001 00000F15 807EFE01            <1> 	cmp byte [bp + ?format], 1
  1002 00000F19 7408                <1> 	je @F				; lzexedat -4 -l -->
  1003 00000F1B D046FE              <1> 	rol byte [bp + ?format], 1
  1004 00000F1E 7303E960FF          <1> 	jc .loop
  1005                              <1> @@:
  1006 00000F23 E9D5FE              <1> 	jmp .lze_loop
  1007                              <1> %elif _LZEXEDAT
  1008                              <1> 	jmp .lze_loop
  1009                              <1> %else
  1010                              <1> 	jmp .loop
  1011                              <1> %endif
  1012                              <1> 
  1013                              <1> 
  1014                              <1> 		; INP:	?dst -> destination,
  1015                              <1> 		;	 destination may overlap the circular buffer boundary.
  1016                              <1> 		;	ds:si -> source
  1017                              <1> 		;	ax = how long the data is (0 is valid),
  1018                              <1> 		;	 always 1 for literals.
  1019                              <1> 		;	 source must fit in circular buffer, except if
  1020                              <1> 		;	 source and destination overlap. in this case the
  1021                              <1> 		;	 source starts in the buffer but may extend past
  1022                              <1> 		;	 the circular buffer boundary.
  1023                              <1> 		;	word [?dst_end] or dx -> end of circular buffer
  1024                              <1> 		;	word [?original_dst] -> start of circular buffer
  1025                              <1> 		; OUT:	?dst incremented
  1026                              <1> 		;	CY if error (buffer too small)
  1027                              <1> 		;	NC if success
  1028                              <1> 		; CHG:	cx, bx, ax, es, di, ds, si
  1029                              <1> copy_data:
  1030                              <1> %ifn _DEPACKINLINELITERAL
  1031                              <1> 	xor bx, bx
  1032                              <1> .bx:
  1033                              <1> 		; bx = nonzero if literal
  1034                              <1> %endif
  1035                              <1> 
  1036                              <1> %if 0
  1037                              <1> 	push ax
  1038                              <1> 	push bx
  1039                              <1> 	push cx
  1040                              <1> 	push dx
  1041                              <1> 	mov ax, 4201h
  1042                              <1> 	mov cx, 0
  1043                              <1> 	mov dx, 0
  1044                              <1> 	mov bx, word [handle2]
  1045                              <1> 	int 21h
  1046                              <1> 	nop
  1047                              <1> 	pop dx
  1048                              <1> 	pop cx
  1049                              <1> 	pop bx
  1050                              <1> 	pop ax
  1051                              <1> %endif
  1052                              <1> 
  1053                              <1> d0	inc byte [bp + ?errordata + 1]
  1054                              <1> 
  1055 00000F26 C47EF6              <1> 	les di, [bp + ?dst]
  1056                              <1> 
  1057 00000F29 91                  <1> 	xchg cx, ax			; cx = remaining length
  1058 00000F2A E344                <1> 	jcxz .end
  1059                              <1> 
  1060                              <1> %if _DXTAG
  1061 00000F2C 3B7EF0              <1> 	cmp di, [bp + ?dst_end]
  1062                              <1> %else
  1063                              <1> 	cmp di, dx
  1064                              <1> %endif
  1065 00000F2F 7744                <1> 	ja .ret_CY			; error
  1066                              <1> 		; literals may branch to .start_maybe_part
  1067 00000F31 741D                <1> 	je .start_maybe_part		; ?dst -> at end (put whole data at start)
  1068 00000F33 01CF                <1> 	add di, cx			; -> behind data chunk (if fits)
  1069 00000F35 720A                <1> 	jc .fill			; doesn't fit -->
  1070                              <1> %if _DXTAG
  1071 00000F37 3B7EF0              <1> 	cmp di, [bp + ?dst_end]		; fits ?
  1072                              <1> %else
  1073                              <1> 	cmp di, dx
  1074                              <1> %endif
  1075                              <1> 		; literals never branch to .fill
  1076 00000F3A 7705                <1> 	ja .fill			; doesn't fit -->
  1077 00000F3C 8B7EF6              <1> 	mov di, word [bp + ?dst]	; restore -> destination
  1078                              <1> 		; ds:si l cx fits in circular buffer
  1079 00000F3F EB2C                <1> 	jmp .mov			; store full up to below-or-equal -> end
  1080                              <1> 
  1081                              <1> .fill:
  1082 00000F41 8B7EF6              <1> 	mov di, word [bp + ?dst]	; restore -> destination
  1083                              <1> %if _DXTAG
  1084 00000F44 8B46F0              <1> 	mov ax, [bp + ?dst_end]		; -> behind buffer
  1085                              <1> %else
  1086                              <1> 	mov ax, dx
  1087                              <1> %endif
  1088 00000F47 29F8                <1> 	sub ax, di			; -> behind buffer minus -> destination
  1089                              <1> 					; = length fitting at end
  1090 00000F49 29C1                <1> 	sub cx, ax			; cx -= length fitting at end
  1091                              <1> 					; = remaining length to store at start
  1092 00000F4B 91                  <1> 	xchg cx, ax			; cx = length fitting at end
  1093 00000F4C E82800              <1> 	call .mov_and_put		; store at end
  1094 00000F4F 91                  <1> 	xchg cx, ax			; cx = remaining length to store at start
  1095                              <1> 
  1096                              <1> .start_maybe_part:
  1097 00000F50 8B7EFA              <1> 	mov di, word [bp + ?original_dst]
  1098                              <1> %ifn _DEPACKINLINELITERAL
  1099                              <1> 	test bx, bx			; literal ?
  1100                              <1> 	jnz .mov			; yes -->
  1101                              <1> %endif
  1102                              <1> 		; literals never go here
  1103                              <1> 		; the following handles source overlapping destination
  1104                              <1> 		;  s.t. source crosses the circular buffer boundary.
  1105 00000F53 89F0                <1> 	mov ax, si
  1106 00000F55 01C8                <1> 	add ax, cx			; -> behind source
  1107 00000F57 7205                <1> 	jc .part			; CY, must copy part -->
  1108                              <1> %if _DXTAG
  1109 00000F59 3B46F0              <1> 	cmp ax, [bp + ?dst_end]		; below-or-equal end of buffer ?
  1110                              <1> %else
  1111                              <1> 	cmp ax, dx
  1112                              <1> %endif
  1113 00000F5C 760F                <1> 	jbe .mov			; yes -->
  1114                              <1> .part:
  1115                              <1> %if _DXTAG
  1116 00000F5E 8B46F0              <1> 	mov ax, [bp + ?dst_end]
  1117                              <1> %else
  1118                              <1> 	mov ax, dx
  1119                              <1> %endif
  1120 00000F61 29F0                <1> 	sub ax, si			; ax = how much source data remains
  1121 00000F63 29C1                <1> 	sub cx, ax			; cx = how much to copy after
  1122 00000F65 91                  <1> 	xchg cx, ax			; cx = part length (source data remains)
  1123 00000F66 E80E00              <1> 	call .mov_and_put		; put from end
  1124 00000F69 91                  <1> 	xchg cx, ax			; cx = how much to copy from buffer start
  1125 00000F6A 8B76FA              <1> 	mov si, word [bp + ?original_dst]	; -> start of buffer
  1126                              <1> 					; continue with di -> near start of buffer
  1127                              <1> .mov:
  1128 00000F6D E80700              <1> 	call .mov_and_put
  1129                              <1> 
  1130                              <1> .end:
  1131 00000F70 897EF6              <1> 	mov word [bp + ?dst], di
  1132 00000F73 F8                  <1> 	clc
  1133                              <1> .ret:
  1134 00000F74 C3                  <1> 	retn
  1135                              <1> 
  1136                              <1> .ret_CY:
  1137 00000F75 F9                  <1> 	stc
  1138 00000F76 C3                  <1> 	retn
  1139                              <1> 
  1140                              <1> .mov_and_put:
  1141 00000F77 1E                  <1> 	 push ds
  1142 00000F78 56                  <1> 	 push si
  1143 00000F79 06                  <1> 	push es
  1144 00000F7A 57                  <1> 	push di
  1145 00000F7B 51                  <1> 	push cx
  1146 00000F7C F3A4                <1> 	rep movsb
  1147 00000F7E 59                  <1> 	pop cx
  1148 00000F7F 5E                  <1> 	pop si
  1149 00000F80 1F                  <1> 	pop ds
  1150 00000F81 E88201              <1> 	call put_file_data
  1151 00000F84 5E                  <1> 	 pop si
  1152 00000F85 1F                  <1> 	 pop ds
  1153 00000F86 01CE                <1> 	add si, cx
  1154 00000F88 C3                  <1> 	retn
  1155                              <1> 
  1156                              <1> 
  1157                              <1> %if _LZEXEDAT
  1158                              <1> 		; INP:	?src_remaining
  1159                              <1> 		;	dx / word [?tagword] = tag word
  1160                              <1> 		;	word [?tagbitscycle] = circular tag bits indicator
  1161                              <1> 		;	 (there's always a single bit set in this word.
  1162                              <1> 		;	 if this word is equal to 1 on INP then the tag
  1163                              <1> 		;	 word must be reloaded, and the last bit shifted
  1164                              <1> 		;	 out of the INP prior tag word.)
  1165                              <1> 		; OUT:	NC if read a zero,
  1166                              <1> 		;	CY if read a one,
  1167                              <1> 		;	 ?src_remaining decremented
  1168                              <1> 		;	 dx / word [?tagword] updated
  1169                              <1> 		;	 word [?tagbitscycle] updated
  1170                              <1> 		;	branches to depack.error on error
  1171                              <1> 		; CHG:	ds, si, ax
  1172                              <1> get_bit:
  1173 00000F89 D14EEE              <1> 	ror word [bp + ?tagbitscycle], 1
  1174 00000F8C 7307                <1> 	jnc .left
  1175                              <1> 		; after this branch not taken, the cycle word
  1176                              <1> 		;  wraps around to be equal to 8000h. this
  1177                              <1> 		;  will wrap around again after 15 more ror.
  1178 00000F8E E80700              <1> 	call load_word
  1179                              <1> %if _DXTAG
  1180 00000F91 D1EA                <1> 	shr dx, 1
  1181 00000F93 92                  <1> 	xchg dx, ax
  1182 00000F94 C3                  <1> 	retn
  1183                              <1> 
  1184                              <1> .left:
  1185 00000F95 D1EA                <1> 	shr dx, 1
  1186 00000F97 C3                  <1> 	retn
  1187                              <1> %else
  1188                              <1> 	shr word [bp + ?tagword], 1
  1189                              <1> 	mov word [bp + ?tagword], ax
  1190                              <1> 	retn
  1191                              <1> 
  1192                              <1> .left:
  1193                              <1> 	shr word [bp + ?tagword], 1
  1194                              <1> 	retn
  1195                              <1> %endif
  1196                              <1> 
  1197                              <1> 		; lodsw with ?src_remaining check
  1198                              <1> load_word:
  1199 00000F98 E80800              <1> 	call load_byte
  1200 00000F9B 86C4                <1> 	xchg al, ah
  1201 00000F9D E80300              <1> 	call load_byte
  1202 00000FA0 86C4                <1> 	xchg al, ah
  1203 00000FA2 C3                  <1> 	retn
  1204                              <1> 
  1205                              <1> 		; lodsb with ?src_remaining check
  1206                              <1> load_byte:
  1207 00000FA3 E82E00              <1> 	call read_byte
  1208                              <1> d0	mov byte [bp + ?errordata], 84h
  1209 00000FA6 7303E9EDFE          <1> 	jc depack.error
  1210 00000FAB C3                  <1> 	retn
  1211                              <1> %endif
  1212                              <1> 
  1213                              <1> %if _MULTI || !_LZEXEDAT
  1214                              <1> 		; INP:	cx = 0..15
  1215                              <1> 		;	dl = bit index, dh = current byte
  1216                              <1> 		; OUT:	NC if successful,
  1217                              <1> 		;	 ax = value read
  1218                              <1> 		;	 cx = 0
  1219                              <1> 		;	 dx updated
  1220                              <1> 		;	CY if error
  1221                              <1> 		; CHG:	ds, si
  1222                              <1> get_bits:
  1223                              <1> %ifn _DXTAG
  1224                              <1> 	push dx
  1225                              <1> 	mov dx, word [bp + ?low_bit_index_and_high_current_byte]
  1226                              <1> %endif
  1227 00000FAC 83F90F              <1> 	cmp cx, 15
  1228 00000FAF 7721                <1> 	ja .error
  1229 00000FB1 85C9                <1> 	test cx, cx
  1230 00000FB3 741D                <1> 	jz .error
  1231 00000FB5 31C0                <1> 	xor ax, ax
  1232                              <1> .loop:
  1233 00000FB7 84D2                <1> 	test dl, dl
  1234 00000FB9 750B                <1> 	jnz .havebit
  1235 00000FBB 50                  <1> 	push ax
  1236 00000FBC E81500              <1> 	call read_byte
  1237 00000FBF 88C6                <1> 	mov dh, al
  1238 00000FC1 B280                <1> 	mov dl, 80h
  1239 00000FC3 58                  <1> 	pop ax
  1240 00000FC4 720C                <1> 	jc .error
  1241                              <1> .havebit:
  1242 00000FC6 D1E0                <1> 	shl ax, 1
  1243 00000FC8 84D6                <1> 	test dh, dl
  1244 00000FCA 7401                <1> 	jz @F
  1245 00000FCC 40                  <1> 	inc ax
  1246                              <1> @@:
  1247 00000FCD D0EA                <1> 	shr dl, 1
  1248 00000FCF E2E6                <1> 	loop .loop
  1249                              <1> .end:
  1250 00000FD1 A8                  <1> 	db __TEST_IMM8		; skip stc, NC
  1251                              <1> .error:
  1252 00000FD2 F9                  <1> 	stc
  1253                              <1> %ifn _DXTAG
  1254                              <1> 	mov word [bp + ?low_bit_index_and_high_current_byte], dx
  1255                              <1> 	pop dx
  1256                              <1> %endif
  1257 00000FD3 C3                  <1> 	retn
  1258                              <1> %endif
  1259                              <1> 
  1260                              <1> 
  1261                              <1> 		; INP:	?src_remaining
  1262                              <1> 		; OUT:	NC if success,
  1263                              <1> 		;	 al = value read
  1264                              <1> 		;	 ?src_remaining decremented
  1265                              <1> 		;	CY if error (source buffer too small),
  1266                              <1> 		;	 ?src_remaining = 0
  1267                              <1> 		; CHG:	ds, si
  1268                              <1> read_byte:
  1269 00000FD4 836EF201            <1> 	sub word [bp + ?src_remaining], 1
  1270 00000FD8 835EF400            <1> 	sbb word [bp + ?src_remaining + 2], 0
  1271 00000FDC 7204                <1> 	jb .empty
  1272                              <1> 
  1273 00000FDE E8D800              <1> 	call get_file_byte
  1274 00000FE1 C3                  <1> 	retn
  1275                              <1> 
  1276                              <1> .empty:
  1277 00000FE2 8366F200            <1> 	and word [bp + ?src_remaining], 0
  1278 00000FE6 8366F400            <1> 	and word [bp + ?src_remaining + 2], 0
  1279 00000FEA F9                  <1> 	stc
  1280 00000FEB C3                  <1> 	retn
  1281                              <1> 
  1282                              <1> 	lleave ctx
  1283                              <1> 
  1284                              <1> %if _MULTI
  1285                              <1> 	resetdef LONGLITERAL
  1286                              <1> 	resetdef LZEXEDAT
  1287                              <1> %endif
  1288                              <1> 
  1289                              <1> %ifn _STANDALONE
  1290                              <1> 	resetdef COUNTER
  1291                              <1> 	resetdef DEBUG0
  1292                              <1> 
  1293                              <1> 
  1294                              <1> read_and_depack:
  1295                              <1> 	houdini
  1296                              <1> 
  1297                              <1> 		; common setup for depacking
  1298 00000FEC 891E[D808]          <1> reloc	mov word [handle], bx
  1299                              <1> internaldatarelocation
  1300                              <1> 
  1301 00000FF0 8916[C806]          <1> reloc	mov word [depacked_buffer], dx
  1302                              <1> internaldatarelocation
  1303 00000FF4 8C06[CA06]          <1> reloc	mov word [depacked_buffer + 2], es
  1304                              <1> internaldatarelocation
  1305 00000FF8 890E[D006]          <1> reloc	mov word [depacked_length], cx
  1306                              <1> internaldatarelocation
  1307                              <1> 
  1308 00000FFC D006[0200]          <1> reloc	rol byte [partialdepack], 1
  1309                              <1> internaldatarelocation
  1310 00001000 7335                <1> 	jnc .new
  1311                              <1> 		; did we save a prior partial depack ?
  1312 00001002 833E[0000]FF        <1> reloc	cmp word [depack_saved_sp], strict byte 0FFFFh
  1313                              <1> internaldatarelocation -3
  1314 00001007 742E                <1> 	je .new				; no -->
  1315 00001009 A1[C606]            <1> reloc	mov ax, word [depackseek + 2]
  1316                              <1> internaldatarelocation
  1317 0000100C 3B06[C206]          <1> reloc	cmp ax, word [depackskip + 2]
  1318                              <1> internaldatarelocation
  1319 00001010 7507                <1> 	jne @F
  1320 00001012 A1[C406]            <1> reloc	mov ax, word [depackseek]
  1321                              <1> internaldatarelocation
  1322 00001015 3B06[C006]          <1> reloc	cmp ax, word [depackskip]
  1323                              <1> internaldatarelocation
  1324                              <1> @@:
  1325 00001019 771C                <1> 	ja .new				; seek is > skip, must rewind -->
  1326                              <1> 
  1327 0000101B A1[C406]            <1> reloc	mov ax, word [depackseek]
  1328                              <1> internaldatarelocation
  1329 0000101E 2906[C006]          <1> reloc	sub word [depackskip], ax
  1330                              <1> internaldatarelocation
  1331 00001022 A1[C606]            <1> reloc	mov ax, word [depackseek + 2]
  1332                              <1> internaldatarelocation
  1333 00001025 1906[C206]          <1> reloc	sbb word [depackskip + 2], ax	; skip -= seek
  1334                              <1> internaldatarelocation
  1335                              <1> 
  1336 00001029 52                  <1> 	push dx
  1337 0000102A 53                  <1> 	push bx
  1338 0000102B 57                  <1> 	push di
  1339 0000102C 56                  <1> 	push si
  1340 0000102D 06                  <1> 	push es
  1341 0000102E 55                  <1> 	push bp
  1342 0000102F 51                  <1> 	push cx				; stack frame must match what .read expects
  1343                              <1> 
  1344 00001030 8926[D206]          <1> reloc	mov word [depack_prior_sp], sp
  1345                              <1> internaldatarelocation			; store our sp
  1346 00001034 E92F01              <1> 	jmp put_file_data.entry		; continue depacking
  1347                              <1> 
  1348                              <1> 
  1349                              <1> .new:
  1350 00001037 52                  <1> 	push dx
  1351 00001038 51                  <1> 	push cx
  1352 00001039 06                  <1> 	push es
  1353 0000103A 8B16[B806]          <1> reloc	mov dx, word [libseek]
  1354                              <1> internaldatarelocation
  1355 0000103E 8B0E[BA06]          <1> reloc	mov cx, word [libseek + 2]
  1356                              <1> internaldatarelocation
  1357 00001042 B80042              <1> 	mov ax, 4200h
  1358 00001045 E803FD              <1> 	call dos_or_boot_io
  1359 00001048 07                  <1> 	pop es
  1360 00001049 7269                <1> 	jc .io_error
  1361                              <1> 
  1362 0000104B C706[D408][D406]    <1> reloc2	mov word [filebuffer.next], filebuffer
  1363                              <1> internaldatarelocation -4
  1364                              <1> internaldatarelocation
  1365 00001051 C706[D608][D406]    <1> reloc2	mov word [filebuffer.tail], filebuffer
  1366                              <1> internaldatarelocation -4
  1367                              <1> internaldatarelocation
  1368                              <1> 
  1369 00001057 59                  <1> 	pop cx
  1370 00001058 5A                  <1> 	pop dx
  1371                              <1> 
  1372 00001059 31C0                <1> 	xor ax, ax
  1373 0000105B A3[C406]            <1> reloc	mov word [depackseek], ax
  1374                              <1> internaldatarelocation
  1375 0000105E A3[C606]            <1> reloc	mov word [depackseek + 2], ax
  1376                              <1> internaldatarelocation
  1377                              <1> 
  1378 00001061 52                  <1> 	push dx
  1379 00001062 53                  <1> 	push bx
  1380 00001063 57                  <1> 	push di
  1381 00001064 56                  <1> 	push si
  1382 00001065 06                  <1> 	push es
  1383 00001066 55                  <1> 	push bp
  1384 00001067 51                  <1> 	push cx
  1385 00001068 16                  <1> 	 push ss
  1386 00001069 07                  <1> 	 pop es
  1387 0000106A BF[E008]            <1> reloc	mov di, resultbuffer
  1388                              <1> internaldatarelocation
  1389 0000106D BE[E018]            <1> reloc	mov si, resultbuffer.end
  1390                              <1> internaldatarelocation
  1391                              <1> 
  1392 00001070 8B0E[B606]          <1> reloc	mov cx, word [libtab_compressed_length + 2]
  1393                              <1> internaldatarelocation
  1394 00001074 8B16[B406]          <1> reloc	mov dx, word [libtab_compressed_length]
  1395                              <1> internaldatarelocation
  1396                              <1> 
  1397 00001078 8926[D206]          <1> reloc	mov word [depack_prior_sp], sp
  1398                              <1> internaldatarelocation
  1399 0000107C BC[FC02]            <1> reloc	mov sp, depack_stack.top
  1400                              <1> internaldatarelocation
  1401                              <1> %if _MULTI
  1402 0000107F A0[0300]            <1> reloc	mov al, byte [depack_format]
  1403                              <1> internaldatarelocation
  1404                              <1> %endif
  1405 00001082 E815FD              <1> 	call depack
  1406 00001085 C706[0000]FFFF      <1> reloc	mov word [depack_saved_sp], 0FFFFh
  1407                              <1> internaldatarelocation -4
  1408                              <1> .read:
  1409 0000108B 16                  <1> 	 push ss
  1410 0000108C 1F                  <1> 	 pop ds
  1411                              <1> 
  1412 0000108D FF36[C406]          <1> reloc	push word [depackseek]
  1413                              <1> internaldatarelocation
  1414 00001091 FF36[C606]          <1> reloc	push word [depackseek + 2]
  1415                              <1> internaldatarelocation
  1416 00001095 8F06[C206]          <1> reloc	pop word [depackskip + 2]
  1417                              <1> internaldatarelocation
  1418 00001099 8F06[C006]          <1> reloc	pop word [depackskip]
  1419                              <1> internaldatarelocation
  1420                              <1> 
  1421 0000109D 8B26[D206]          <1> reloc	mov sp, word [depack_prior_sp]
  1422                              <1> internaldatarelocation
  1423 000010A1 7209                <1> 	jc @F
  1424 000010A3 A1[D006]            <1> reloc	mov ax, word [depacked_length]
  1425                              <1> internaldatarelocation
  1426 000010A6 F7D8                <1> 	neg ax			; - remain
  1427 000010A8 59                  <1> 	pop cx
  1428 000010A9 01C8                <1> 	add ax, cx		; requested - remain = how much read
  1429 000010AB A8                  <1> 	db __TEST_IMM8		; skip pop, NC
  1430                              <1> @@:
  1431 000010AC 59                  <1> 	pop cx
  1432 000010AD 5D                  <1> 	pop bp
  1433 000010AE 07                  <1> 	pop es
  1434 000010AF 5E                  <1> 	pop si
  1435 000010B0 5F                  <1> 	pop di
  1436 000010B1 5B                  <1> 	pop bx
  1437 000010B2 5A                  <1> 	pop dx
  1438 000010B3 C3                  <1> 	retn
  1439                              <1> 
  1440                              <1> .io_error:
  1441 000010B4 83C404              <1> 	add sp, 4
  1442 000010B7 F9                  <1> 	stc
  1443 000010B8 C3                  <1> 	retn
  1444                              <1> 
  1445                              <1> 
  1446                              <1> get_file_byte:
  1447 000010B9 368B36[D408]        <1> reloc	mov si, [ss:filebuffer.next]
  1448                              <1> internaldatarelocation
  1449 000010BE 363B36[D608]        <1> reloc	cmp si, [ss:filebuffer.tail]
  1450                              <1> internaldatarelocation
  1451 000010C3 7238                <1> 	jb .buffered
  1452                              <1> 
  1453 000010C5 50                  <1> 	push ax
  1454 000010C6 53                  <1> 	push bx
  1455 000010C7 51                  <1> 	push cx
  1456 000010C8 52                  <1> 	push dx
  1457 000010C9 06                  <1> 	push es
  1458 000010CA 1E                  <1> 	push ds
  1459                              <1> 
  1460 000010CB 16                  <1> 	 push ss
  1461 000010CC 1F                  <1> 	 pop ds
  1462 000010CD 16                  <1> 	 push ss
  1463 000010CE 07                  <1> 	 pop es
  1464 000010CF BA[D406]            <1> reloc	mov dx, filebuffer
  1465                              <1> internaldatarelocation
  1466 000010D2 8916[D408]          <1> reloc	mov [filebuffer.next], dx
  1467                              <1> internaldatarelocation
  1468 000010D6 8916[D608]          <1> reloc	mov [filebuffer.tail], dx
  1469                              <1> internaldatarelocation
  1470 000010DA B8003F              <1> 	mov ax, 3F00h
  1471 000010DD 8B1E[D808]          <1> reloc	mov bx, [handle]
  1472                              <1> internaldatarelocation
  1473 000010E1 B90002              <1> 	mov cx, filebuffer.end - filebuffer
  1474 000010E4 E864FC              <1> 	call dos_or_boot_io
  1475 000010E7 720C                <1> 	jc @F			; CY -->
  1476 000010E9 85C0                <1> 	test ax, ax
  1477 000010EB F9                  <1> 	stc			; CY
  1478 000010EC 7407                <1> 	jz @F
  1479 000010EE 01D0                <1> 	add ax, dx		; NC
  1480 000010F0 A3[D608]            <1> reloc	mov word [filebuffer.tail], ax
  1481                              <1> internaldatarelocation
  1482 000010F3 89D6                <1> 	mov si, dx
  1483                              <1> @@:
  1484 000010F5 1F                  <1> 	pop ds
  1485 000010F6 07                  <1> 	pop es
  1486 000010F7 5A                  <1> 	pop dx
  1487 000010F8 59                  <1> 	pop cx
  1488 000010F9 5B                  <1> 	pop bx
  1489 000010FA 58                  <1> 	pop ax
  1490 000010FB 7208                <1> 	jc .ret
  1491                              <1> .buffered:
  1492 000010FD 36AC                <1> 	ss lodsb
  1493 000010FF 368936[D408]        <1> reloc	mov [ss:filebuffer.next], si
  1494                              <1> internaldatarelocation
  1495 00001104 F8                  <1> 	clc
  1496                              <1> .ret:
  1497 00001105 C3                  <1> 	retn
  1498                              <1> 
  1499                              <1> 
  1500                              <1> 		; INP:	ds:si -> data to write
  1501                              <1> 		;	cx = length of data (may be zero)
  1502                              <1> 		; OUT:	Does not return if error
  1503                              <1> 		; CHG:	-
  1504                              <1> put_file_data:
  1505 00001106 50                  <1> 	push ax
  1506 00001107 53                  <1> 	push bx
  1507 00001108 51                  <1> 	push cx
  1508 00001109 52                  <1> 	push dx
  1509 0000110A 1E                  <1> 	push ds
  1510 0000110B 56                  <1> 	push si
  1511 0000110C 06                  <1> 	push es
  1512 0000110D 57                  <1> 	push di
  1513 0000110E 16                  <1> 	 push ss
  1514 0000110F 1F                  <1> 	 pop ds
  1515                              <1> .entry2:
  1516                              <1> %if 0
  1517                              <1> reloc	cmp word [depackseek], strict word 0AFh
  1518                              <1> internaldatarelocation -4
  1519                              <1> 	jne @F
  1520                              <1> reloc	cmp word [depackseek + 2], strict byte 0
  1521                              <1> internaldatarelocation -3
  1522                              <1> 	jne @F
  1523                              <1> 	houdini
  1524                              <1> @@:
  1525                              <1> %endif
  1526 00001110 51                  <1> 	push cx			; put data length, add to depackseek maybe
  1527 00001111 833E[C206]00        <1> reloc	cmp word [depackskip + 2], strict byte 0
  1528                              <1> internaldatarelocation -3
  1529 00001116 755D                <1> 	jne .skip
  1530 00001118 390E[C006]          <1> reloc	cmp word [depackskip], cx
  1531                              <1> internaldatarelocation
  1532 0000111C 7357                <1> 	jae .skip		; still have to skip -->
  1533 0000111E 31D2                <1> 	xor dx, dx
  1534 00001120 8716[C006]          <1> reloc	xchg dx, word [depackskip]
  1535                              <1> internaldatarelocation		; how much to skip in this step
  1536                              <1> 				; dx = how many bytes skipped
  1537 00001124 01D6                <1> 	add si, dx		; -> data to copy (part of put data)
  1538 00001126 29D1                <1> 	sub cx, dx		; data - skip = length of data to copy, at least 1
  1539 00001128 7454                <1> 	jz .ret_cx		; (not needed ?)
  1540 0000112A 51                  <1> 	push cx			; = how many bytes left at si
  1541 0000112B C43E[C806]          <1> reloc	les di, [depacked_buffer]
  1542                              <1> internaldatarelocation
  1543 0000112F A1[D006]            <1> reloc	mov ax, word [depacked_length]
  1544                              <1> internaldatarelocation		; how much we want to read
  1545 00001132 39C8                <1> 	cmp ax, cx
  1546 00001134 7302                <1> 	jae @F
  1547 00001136 89C1                <1> 	mov cx, ax		; cx = min(ax, cx) lesser of requested, available
  1548                              <1> @@:
  1549 00001138 89C8                <1> 	mov ax, cx		; how much we want to copy
  1550 0000113A F3A4                <1> 	rep movsb		; copy to user buffer, si -> data left if any
  1551                              <1> 
  1552 0000113C 893E[C806]          <1> reloc	mov word [depacked_buffer], di
  1553                              <1> internaldatarelocation		; -> past copied data
  1554 00001140 2906[D006]          <1> reloc	sub word [depacked_length], ax
  1555                              <1> internaldatarelocation		; decrement count of how much still wanted
  1556                              <1> 		; this is NZ only if available < requested
  1557 00001144 59                  <1> 	pop cx			; = how many bytes left at prior si -> data just copied
  1558 00001145 7537                <1> 	jnz .ret_cx		; go add full length of put data to depackseek
  1559 00001147 01C2                <1> 	add dx, ax		; how many bytes processed (skipped + copied)
  1560 00001149 0116[C406]          <1> reloc	add word [depackseek], dx
  1561                              <1> internaldatarelocation
  1562 0000114D 8316[C606]00        <1> reloc	adc word [depackseek + 2], strict byte 0
  1563                              <1> internaldatarelocation -3	; add to seek the last bit processed
  1564 00001152 5A                  <1> 	pop dx			; discard cx on stack
  1565 00001153 29C1                <1> 	sub cx, ax		; = how many bytes left after new si ->
  1566 00001155 890E[CC06]          <1> reloc	mov word [depack_left_length], cx
  1567                              <1> internaldatarelocation		; = amount data left after new si ->
  1568 00001159 8936[CE06]          <1> reloc	mov word [depack_left_address], si
  1569                              <1> internaldatarelocation		; at current depackseek -> data left if any
  1570 0000115D 55                  <1> 	push bp
  1571 0000115E 8926[0000]          <1> reloc	mov word [depack_saved_sp], sp
  1572                              <1> internaldatarelocation
  1573 00001162 F8                  <1> 	clc
  1574 00001163 E925FF              <1> 	jmp read_and_depack.read
  1575                              <1> 
  1576                              <1> .entry:
  1577 00001166 8B26[0000]          <1> reloc	mov sp, word [depack_saved_sp]
  1578                              <1> internaldatarelocation
  1579 0000116A 5D                  <1> 	pop bp
  1580 0000116B 8B0E[CC06]          <1> reloc	mov cx, word [depack_left_length]
  1581                              <1> internaldatarelocation
  1582 0000116F 8B36[CE06]          <1> reloc	mov si, word [depack_left_address]
  1583                              <1> internaldatarelocation
  1584 00001173 EB9B                <1> 	jmp .entry2
  1585                              <1> 
  1586                              <1> .skip:
  1587 00001175 290E[C006]          <1> reloc	sub word [depackskip], cx
  1588                              <1> internaldatarelocation
  1589 00001179 831E[C206]00        <1> reloc	sbb word [depackskip + 2], strict byte 0
  1590                              <1> internaldatarelocation -3
  1591                              <1> 
  1592                              <1> .ret_cx:
  1593 0000117E 59                  <1> 	pop cx
  1594 0000117F 010E[C406]          <1> reloc	add word [depackseek], cx
  1595                              <1> internaldatarelocation
  1596 00001183 8316[C606]00        <1> reloc	adc word [depackseek + 2], strict byte 0
  1597                              <1> internaldatarelocation -3
  1598                              <1> 
  1599                              <1> .ret:
  1600 00001188 5F                  <1> 	pop di
  1601 00001189 07                  <1> 	pop es
  1602 0000118A 5E                  <1> 	pop si
  1603 0000118B 1F                  <1> 	pop ds
  1604 0000118C 5A                  <1> 	pop dx
  1605 0000118D 59                  <1> 	pop cx
  1606 0000118E 5B                  <1> 	pop bx
  1607 0000118F 58                  <1> 	pop ax
  1608 00001190 C3                  <1> 	retn
  1609                              <1> %endif
  2225                                  %endif
  2226                                  
  2227                                  
  2228                                  get_es_ext:
  2229 00001191 8E06[0000]              reloc	mov es, word [relocateddata]
  2230                                  linkdatarelocation extdssel
  2231 00001195 E89800                  	extcallcall ispm
  2232 00001198 7404                    	jz @F
  2233 0000119A 8E06[0000]              reloc	mov es, word [relocateddata]
  2234                                  linkdatarelocation extseg
  2235                                  @@:
  2236 0000119E C3                      	retn
  2237                                  
  2238                                  
  2239                                  start:
  2240 0000119F 8CC3                    	mov bx, es
  2241 000011A1 16                      	 push ss
  2242 000011A2 07                      	 pop es
  2243 000011A3 E80A01                  	extcallcall skipcomma
  2244 000011A6 E8AF00                  	extcallcall iseol?
  2245 000011A9 7409                    	je .help
  2246 000011AB E872EE                  	call run
  2247                                  @@:
  2248 000011AE E80B00                  	call uninstall_oneshot
  2249 000011B1 31C0                    	xor ax, ax
  2250 000011B3 CB                      	retf
  2251                                  
  2252                                  .help:
  2253 000011B4 BA[FB01]                reloc	mov dx, msg.help
  2254                                  internaldatarelocation
  2255 000011B7 E84E00                  	extcallcall putsz
  2256 000011BA EBF2                    	jmp @B
  2257                                  
  2258                                  
  2259                                  uninstall_oneshot:
  2260 000011BC 36F606[0000]01          reloc	testopt [ss:relocateddata], 1
  2261                                  linkdatarelocation options7, -3
  2262 000011C2 751A                    	jnz @F
  2263                                  
  2264 000011C4 2EA1[0200]              reloc	mov ax, word [cs:code + eldiEndCode]
  2265                                  internalcoderelocation
  2266 000011C8 2E2B06[0000]            reloc	sub ax, word [cs:code + eldiStartCode]
  2267                                  internalcoderelocation
  2268 000011CD 2906[0000]              reloc	sub word [relocateddata], ax
  2269                                  linkdatarelocation extseg_used
  2270                                  
  2271 000011D1 2EA1[0600]              reloc	mov ax, word [cs:code + eldiEndData]
  2272                                  internalcoderelocation
  2273 000011D5 2E2B06[0400]            reloc	sub ax, word [cs:code + eldiStartData]
  2274                                  internalcoderelocation
  2275 000011DA 2906[0000]              reloc	sub word [relocateddata], ax
  2276                                  linkdatarelocation extdata_used
  2277                                  @@:
  2278 000011DE C3                      	retn
  2279                                  
  2280                                  
  2281                                  DATAOFFSET equ CODEOFFSET + code_size
  2282                                  	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
  2283                                  %define DATAFIXUP - datastart + 0
  2284                                  datastart:
  2285                                  PUT_ELD_DATETIME
  2286                                  
  2287                                  %if _COMPRESSED
  2288                                  	align 2, db 0
  2289 00000000 FFFF                    depack_saved_sp:	dw 0FFFFh
  2290 00000002 FF                      partialdepack:		db 0FFh
  2291 00000003 00                      depack_format:		db 0
  2292                                  %endif
  2293                                  
  2294 00000004 00                      findhandle_set:		db 0
  2295 00000005 00                      found:			db 0
  2296 00000006 00                      verbose:		db 0
  2297 00000007 00                      do_help:		db 0
  2298 00000008 00                      prefersfn:		db 0
  2299 00000009 00                      lib:			db 0
  2300 0000000A 00                      libname:		db 0
  2301                                  
  2302                                  msg:
  2303 0000000B 564552424F534500        .verbose:		asciz "VERBOSE"
  2304 00000013 48454C5000              .string_help:		asciz "HELP"
  2305 00000018 53464E00                .string_sfn:		asciz "SFN"
  2306 0000001C 4C494200                .string_lib:		asciz "LIB"
  2307 00000020 3A2000                  .colon:			asciz ": "
  2308 00000023 46696C65206E6F7420-     .notfound:		asciz "File not found.",13,10
  2308 0000002C 666F756E642E0D0A00 
  2309 00000035 4E6F20646573637269-     .nodesc:		asciz "No description.",13,10
  2309 0000003E 7074696F6E2E0D0A00 
  2310 00000047 4E6F2068656C702E0D-     .nohelp:		asciz "No help.",13,10
  2310 00000050 0A00               
  2311 00000052 48454C505354415254-     .helpstart:		asciz "HELPSTART"
  2311 0000005B 00                 
  2312                                  .helpstart.length equ $ - 1 - .helpstart
  2313 0000005C 48454C50454E4400        .helpend:		asciz "HELPEND"
  2314                                  .helpend.length equ $ - 1 - .helpend
  2315 00000064 4C49535420454C4420-     .io_error:		asciz "LIST ELD got I/O error.",13,10
  2315 0000006D 676F7420492F4F2065-
  2315 00000076 72726F722E0D0A00   
  2316                                  %if _COMPRESSED
  2317 0000007E 4C49535420454C4420-     .doublepacked_error:	asciz "LIST ELD cannot recurse into nested compressed library ELDs.",13,10
  2317 00000087 63616E6E6F74207265-
  2317 00000090 637572736520696E74-
  2317 00000099 6F206E657374656420-
  2317 000000A2 636F6D707265737365-
  2317 000000AB 64206C696272617279-
  2317 000000B4 20454C44732E0D0A00 
  2318                                  %endif
  2319 000000BD 1B222E20496E76616C-     .invalid_instance:	counted '". Invalid instance header.'
  2319 000000C6 696420696E7374616E-
  2319 000000CF 636520686561646572-
  2319 000000D8 2E                 
  2320 000000D9 4E6F206F7220696E76-     .invalid:		db "No or invalid Extension for lDebug header."
  2320 000000E2 616C69642045787465-
  2320 000000EB 6E73696F6E20666F72-
  2320 000000F4 206C44656275672068-
  2320 000000FD 65616465722E       
  2321 00000103 0D0A00                  .linebreak:		asciz 13,10
  2322 00000106 4E6F206F7220696E76-     .invalid_sld:		asciz "No or invalid Script/Extension for lDebug header.",13,10
  2322 0000010F 616C69642053637269-
  2322 00000118 70742F457874656E73-
  2322 00000121 696F6E20666F72206C-
  2322 0000012A 446562756720686561-
  2322 00000133 6465722E0D0A00     
  2323 0000013A 0B2020466F726D6174-     .verbose.1:	counted "  Format: ",'"'
  2323 00000143 3A2022             
  2324 00000146 0E222C20454C44206E-     .verbose.2:	counted '", ELD name: "'
  2324 0000014F 616D653A2022       
  2325 00000155 0720636F64652C20        .verbose.3:	counted " code, "
  2326 0000015D 0820616C6C6F632C20      .verbose.4:	counted " alloc, "
  2327 00000166 0720646174612C20        .verbose.5:	counted " data, "
  2328 0000016E 0620616C6C6F63          .verbose.6:	counted " alloc"
  2329 00000175 0D222C2066696C6520-     .verbose.2.sld:	counted '", file size '
  2329 0000017E 73697A6520         
  2330 00000183 06206279746573          .verbose.3.sld:	counted " bytes"
  2331 0000018A 1320204C6962726172-     .verbose.lib.1:	counted "  Library contains "
  2331 00000193 7920636F6E7461696E-
  2331 0000019C 7320               
  2332 0000019E 0E20454C44732C2066-     .verbose.lib.2:	counted " ELDs, format "
  2332 000001A7 6F726D617420       
  2333 000001AD 0F2028756E636F6D70-     .verbose.lib.3.un:	counted " (uncompressed)"
  2333 000001B6 72657373656429     
  2334 000001BD 0D2028686561747368-     .verbose.lib.3.hs:	counted " (heatshrink)"
  2334 000001C6 72696E6B29         
  2335 000001CB 0E20286C7A65786564-     .verbose.lib.3.lze:	counted " (lzexedat -4)"
  2335 000001D4 6174202D3429       
  2336 000001DA 1120286C7A65786564-     .verbose.lib.3.lzel:	counted " (lzexedat -4 -l)"
  2336 000001E3 6174202D34202D6C29 
  2337 000001EC 0E2C207061636B6564-     .verbose.lib.4:	counted ", packed size "
  2337 000001F5 2073697A6520       
  2338                                  
  2339                                  depack_stack: equ $
  2340                                  
  2341 000001FB 52756E207769746820-     .help:		db "Run with a pathname as parameter.",13,10
  2341 00000204 6120706174686E616D-
  2341 0000020D 652061732070617261-
  2341 00000216 6D657465722E0D0A   
  2342 0000021E 4C61737420636F6D70-     		db "Last component may include wildcards.",13,10
  2342 00000227 6F6E656E74206D6179-
  2342 00000230 20696E636C75646520-
  2342 00000239 77696C646361726473-
  2342 00000242 2E0D0A             
  2343 00000245 0D0A                    		db 13,10
  2344 00000247 416674657220746865-     		db "After the pathname, keywords may follow:",13,10
  2344 00000250 20706174686E616D65-
  2344 00000259 2C206B6579776F7264-
  2344 00000262 73206D617920666F6C-
  2344 0000026B 6C6F773A0D0A       
  2345 00000271 09564552424F534509-     		db 9,"VERBOSE",9,"Display ELD format, name, sizes",13,10
  2345 0000027A 446973706C61792045-
  2345 00000283 4C4420666F726D6174-
  2345 0000028C 2C206E616D652C2073-
  2345 00000295 697A65730D0A       
  2346 0000029B 0948454C5009446973-     		db 9,"HELP",9,"Display ELD help",13,10
  2346 000002A4 706C617920454C4420-
  2346 000002AD 68656C700D0A       
  2347 000002B3 0953464E0955736520-     		db 9,"SFN",9,"Use DOS SFN search even if LFN available",13,10
  2347 000002BC 444F532053464E2073-
  2347 000002C5 656172636820657665-
  2347 000002CE 6E206966204C464E20-
  2347 000002D7 617661696C61626C65-
  2347 000002E0 0D0A               
  2348 000002E2 094C49420952656375-     		db 9,"LIB",9,"Recurse into library ELDs",13,10
  2348 000002EB 72736520696E746F20-
  2348 000002F4 6C6962726172792045-
  2348 000002FD 4C44730D0A         
  2349 00000302 092F6E616D65094F6E-     		db 9,"/name",9,"Only display library ELDs matching the name",13,10
  2349 0000030B 6C7920646973706C61-
  2349 00000314 79206C696272617279-
  2349 0000031D 20454C4473206D6174-
  2349 00000326 6368696E6720746865-
  2349 0000032F 206E616D650D0A     
  2350 00000336 00                      		asciz
  2351                                  
  2352                                  uinit_data: equ $
  2353                                  
  2354 00000337 00<rep 9h>              	align 16, db 0
  2355                                  init_data_end:
  2356                                  data_size equ $ - datastart
  2357                                  transient_data_size equ data_size
  2358                                  
  2359                                  %if _COMPRESSED
  2360                                  	absolute depack_stack
  2361 000001FB ??                      	alignb 2
  2362 000001FC <res 100h>              		resb 256
  2363                                  depack_stack.top:
  2364                                  
  2365                                   %if uinit_data > depack_stack.top
  2366                                  	absolute uinit_data
  2367                                   %endif
  2368                                  %else
  2369                                  	absolute uinit_data
  2370                                  %endif
  2371                                  
  2372 00000337 ??                      	alignb 2
  2373 00000338 ????????????????        libnamebuffer:	resb 8
  2374                                  wild_pattern:		; overlaps next variable
  2375                                  boot_parsed:	equ $+2	; overlaps next variable
  2376 00000340 ????????                originaldta:	resd 1
  2377 00000344 ????                    originalinject:	resw 1
  2378                                  findnext_function_number:
  2379 00000346 ????                    		resw 1
  2380 00000348 ????                    findhandle:	resw 1
  2381 0000034A <res 1Eh>               dta:		resb 1Eh
  2382 00000368 <res Dh>                .name:		resb 13
  2383                                  
  2384 00000375 ??                      	alignb 2
  2385 00000376 <res 200h>              pathnamebuffer:	resb 512
  2386                                  
  2387 00000576 <res 2Ch>               finddata:	resb 2Ch
  2388 000005A2 <res 104h>              .fullname:	resb 260
  2389 000006A6 <res Eh>                .shortname:	resb 14
  2390                                  
  2391                                  %if _COMPRESSED
  2392                                  	alignb 2
  2393                                  libtab_compressed_length:
  2394 000006B4 ????????                		resd 1
  2395 000006B8 ????????                libseek:	resd 1
  2396 000006BC ????????                eldheader:	resd 1
  2397 000006C0 ????????                depackskip:	resd 1
  2398 000006C4 ????????                depackseek:	resd 1
  2399 000006C8 ????????                depacked_buffer:resd 1
  2400 000006CC ????                    depack_left_length:	resw 1
  2401 000006CE ????                    depack_left_address:	resw 1
  2402 000006D0 ????                    depacked_length:resw 1
  2403 000006D2 ????                    depack_prior_sp:resw 1
  2404                                  	alignb 2
  2405 000006D4 <res 200h>              filebuffer:	resb 512
  2406                                  .end:
  2407                                  	alignb 2
  2408 000008D4 ????                    .next:		resw 1
  2409 000008D6 ????                    .tail:		resw 1
  2410 000008D8 ????                    handle:		resw 1
  2411                                  
  2412 000008DA ????????????            	alignb 16
  2413                                  resultbuffer:
  2414                                  .size equ 4096
  2415 000008E0 <res 1000h>             		resb .size
  2416                                  .end:
  2417                                  %endif
  2418                                  
  2419                                  %if _DATABUFFER
  2420                                  	alignb 16
  2421                                  databuffer:
  2422 000018E0 <res 200h>              	resb 512
  2423                                  %endif
  2424                                  
  2425                                  	alignb 16
  2426                                  uinit_data_end:
  2427                                  
  2428                                  total_data_size equ $ - datastart
  2429                                  %assign _DATA_SIZE total_data_size
  2430                                  
  2431                                  	usesection CODE
  2432                                  
  2433                                  %include "eldlink.asm"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug linker
     4                              <1> 
     5                              <1> Copyright (C) 2008-2025 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    16                              <1> %include "eld.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2025 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef ELD_MAC
    16                              <2> %define ELD_MAC 1
    17                              <2> 
    18                              <2> %include "lmacros3.mac"
    19                              <2> 
    20                              <2> 		; ELD executable header
    21                              <2> 	struc ELD_HEADER
    22                              <2> eldhSignature:		resb 4	; "ELD1"
    23                              <2> 			resb 3	; reserved
    24                              <2> 			resb 1	; 26 (Ctrl-Z)
    25                              <2> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26                              <2> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27                              <2> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28                              <2> eldhDataOffset:		resd 1
    29                              <2> eldhDataImageLength:	resw 1	; (zero allowed)
    30                              <2> eldhDataAllocLength:	resw 1	; (zero allowed)
    31                              <2> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32                              <2> eldhReserved:		resb 4	; reserved
    33                              <2> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <2> 	endstruc
    35                              <2> 	endarea ELD_HEADER, 1
    36                              <2> 
    37                              <2> 	struc ELD_HEADERX
    38                              <2> eldhxHeader:		resb ELD_HEADER_size
    39                              <2> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40                              <2> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41                              <2> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42                              <2> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <2> 	alignb 16
    44                              <2> 	endstruc
    45                              <2> 
    46                              <2> 	struc ELD_TRAILER_HEADER
    47                              <2> eldthSignature:		resb 8	; "ELD1TAIL"
    48                              <2> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <2> 				;  add this dword to the seek offset
    50                              <2> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51                              <2> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <2> 	endstruc
    53                              <2> 	endarea ELD_TRAILER_HEADER, 1
    54                              <2> 
    55                              <2> 	struc ELD_LIBTABLE
    56                              <2> eldltFormat:		resw 1
    57                              <2> 	; 0 = uncompressed
    58                              <2> 	; 2 = heatshrink compressed
    59                              <2> 	; 3 = lzexedat -4 compressed
    60                              <2> 	; 4 = lzexedat -4 -l compressed
    61                              <2> eldltAmount:		resw 1
    62                              <2> eldltOffset:		resd 1	; from eldhxHeader
    63                              <2> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <2> 	endstruc
    65                              <2> 	endarea ELD_LIBTABLE, 1
    66                              <2> 
    67                              <2> 		; ELD instance header
    68                              <2> 	struc ELD_INSTANCE
    69                              <2> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70                              <2> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71                              <2> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72                              <2> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73                              <2> eldiIdentifier:		resb 8	; blank-filled text
    74                              <2> eldiFlags:		resw 1	; flags
    75                              <2> eldiListing_size equ 14
    76                              <2> eldiListing:		resb eldiListing_size
    77                              <2> 				; ASCIZ listing file name
    78                              <2> 	endstruc
    79                              <2> 		; flags for eldiFlags:
    80                              <2> eldifResident:		equ 1
    81                              <2> 
    82                              <2> 		; ELD link info header
    83                              <2> 	struc ELD_LINKINFO
    84                              <2> eldlSignature:		resw 1	; 0E1D1h
    85                              <2> eldlReserved:		resw 2
    86                              <2> eldlUseLinkHash:	resw 1
    87                              <2> eldlDataAmount:		resw 1
    88                              <2> eldlDataPrefixes:	resw 1
    89                              <2> eldlDataEntries:	resw 1
    90                              <2> eldlDataAddresses:	resw 1
    91                              <2> eldlCodeAmount:		resw 1
    92                              <2> eldlCodePrefixes:	resw 1
    93                              <2> eldlCodeEntries:	resw 1
    94                              <2> eldlCodeAddresses:	resw 1
    95                              <2> 	endstruc
    96                              <2> 
    97                              <2> 	numdef ELD_CODE_VSTART, 9001h
    98                              <2> 	numdef ELD_DATA_VSTART, 8000h
    99                              <2> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <2> 
   101                              <2> 	numdef ELD_RECLAIM_HINT, 0
   102                              <2> 	strdef ELD_LISTING, ""
   103                              <2> 	numdef ELD_DATETIME, 0
   104                              <2> 
   105                              <2> %if _ELD_DATETIME
   106                              <2>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <2>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <2> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <2> 		asciz		; for future extension
   110                              <2>  %endmacro
   111                              <2> %else
   112                              <2>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <2>  %define PUT_ELD_DATETIME
   114                              <2> %endif
   115                              <2> 
   116                              <2> %endif
    17                              <1> 
    18                              <1> 	cpu 8086
    19                              <1> 
    20                              <1> %if ELDSTRICT
    21                              <1>  %if ELDSTRICTCOUNTER
    22                              <1>   %error Missing relocation
    23                              <1>  %endif
    24                              <1> %endif
    25                              <1> 	eldstrict off		; linker does some relocations
    26                              <1> 
    27                              <1> %ifn ELDCALLCALL_DUMPED
    28 000011DF 90E8[0000]EB020000- <1> 	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
    28 000011E7 C3E8[0000]EB020000- <1>
    28 000011EF C3E8[0000]EB020000- <1>
    28 000011F7 C3E8[0000]EB020000- <1>
    28 000011FF C3E8[0000]EB020000- <1>
    28 00001207 C3E8[0000]EB020000- <1>
    28 0000120F C3E8[0000]EB020000- <1>
    28 00001217 C3E8[0000]EB020000- <1>
    28 0000121F C3E8[0000]EB020000- <1>
    28 00001227 C3E8[0000]EB020000- <1>
    28 0000122F C3E8[0000]EB020000- <1>
    28 00001237 C3E8[0000]EB020000- <1>
    28 0000123F C3E8[0000]EB020000- <1>
    28 00001247 C3E8[0000]EB020000- <1>
    28 0000124F C3E8[0000]EB020000- <1>
    28 00001257 C3E8[0000]EB020000- <1>
    28 0000125F C3E8[0000]EB020000- <1>
    28 00001267 C3E8[0000]EB020000- <1>
    28 0000126F C3E8[0000]EB020000- <1>
    28 00001277 C3E8[0000]EB020000- <1>
    28 0000127F C3E8[0000]EB020000- <1>
    28 00001287 C3E8[0000]EB020000- <1>
    28 0000128F C3E8[0000]EB020000- <1>
    28 00001297 C3E8[0000]EB020000- <1>
    28 0000129F C3E8[0000]EB020000- <1>
    28 000012A7 C3E8[0000]EB020000- <1>
    28 000012AF C3E8[0000]EB020000- <1>
    28 000012B7 C3                  <1>
    29                              <1> %endif
    30                              <1> 
    31                              <1> 	numdef ELD_IDENTICALISE, 0
    32                              <1> 	numdef ELD_DEBUG, 0
    33                              <1> 	numdef ELD_LINKER_PASSES, 1
    34                              <1> 	strdef LISTING, _ELD_LISTING
    35                              <1> 	numdef ELDCALL_OPTIONAL, ELDCALL_OPTIONAL_STATUS
    36                              <1> 	numdef ELDDATA_OPTIONAL, ELDDATA_OPTIONAL_STATUS
    37                              <1> %if _ELD_IDENTICALISE
    38                              <1>  ;%assign _ELDCALL_OPTIONAL 1
    39                              <1> %endif
    40                              <1> %ifn _ELDCALL_OPTIONAL
    41                              <1> %assign ELDCALL_OPTIONAL_STATUS 2		; not allowed
    42                              <1> %endif
    43                              <1> ;%ifn _ELDDATA_OPTIONAL
    44                              <1> ;%assign ELDDATA_OPTIONAL_STATUS 2		; not allowed
    45                              <1> ;%endif
    46                              <1> 	gendef MAP, ""
    47                              <1> 
    48                              <1> %ifnidni _MAP, ""
    49                              <1>  [map all _MAP]
    50                              <1> %endif
    51                              <1> 
    52                              <1> 
    53                              <1> endresident: equ ($ + _CURRENT_SECTION %+ FIXUP + 15) & ~15
    54                              <1> 
    55                              <1> %if _ELD_LINKER_PASSES
    56                              <1> %assign ELDLINKER 1
    57                              <1> 
    58                              <1> 	struc LINKTABLE
    59 00000000 ????????            <1> ltCodeToCode:	resw 2
    60 00000004 ????????            <1> ltCodeToData:	resw 2
    61 00000008 ????????            <1> ltDataToCode:	resw 2
    62 0000000C ????????            <1> ltDataToData:	resw 2
    63 00000010 ????????            <1> ltLinkData:	resw 2
    64 00000014 ????????            <1> ltLinkCode:	resw 2
    65                              <1> 	endstruc
    66                              <1> %endif
    67                              <1> 
    68                              <1> 
    69                              <1> linker:
    70                              <1> 		; The first 15 Bytes of the linker should be
    71                              <1> 		;  the same regardless of the linker options
    72                              <1> 		;  used (debug, passes, vstart). This allows
    73                              <1> 		;  the eldcomp ELD to match even if up to 15
    74                              <1> 		;  Bytes of the linker are trailing in the
    75                              <1> 		;  resident part of the ELD.
    76                              <1> 	lframe
    77                              <1>  %if ELDOTHER
    78                              <1> 	lvar dword, linkinfo_other
    79                              <1> 	lvar word, use_hash_other
    80                              <1>  %endif
    81 000012B8 5589E5              <1> 	lenter
    82                              <1> 	lvar dword, instance
    83 000012BB 06                  <1> 	 push es
    84 000012BC 52                  <1> 	 push dx
    85                              <1> 	lvar word, targetsection_low_optional_high
    86 000012BD 50                  <1> 	 push ax
    87                              <1> 	lequ ?targetsection_low_optional_high, targetsection
    88                              <1> 	lequ ?targetsection_low_optional_high + 1, optional
    89                              <1> 	lvar dword, linkinfo
    90 000012BE 1E                  <1> 	 push ds
    91 000012BF 57                  <1> 	 push di
    92                              <1> 	lvar dword, nextreloc
    93 000012C0 06                  <1> 	 push es
    94 000012C1 52                  <1> 	 push dx
    95                              <1> 	lvar dword, entry
    96 000012C2 06                  <1> 	 push es
    97 000012C3 50                  <1> 	 push ax		; placeholder
    98 000012C4 31C0                <1> 	xor ax, ax
    99 000012C6 813DD1E1            <1> 	cmp word [di + eldlSignature], 0E1D1h
   100                              <1> %if ($ - linker) < 16
   101                              <1>  %error Expected invariant first paragraph of linker
   102                              <1> %endif
   103 000012CA 7403E98C02          <1> 	jne .error_j
   104 000012CF 837D0601            <1> 	cmp word [di + eldlUseLinkHash], 1
   105 000012D3 7603E98302          <1> 	ja .error_j
   106 000012D8 7201                <1> 	jb @F
   107 000012DA 48                  <1> 	dec ax
   108                              <1> @@:
   109                              <1> 	lvar word, use_hash
   110 000012DB 50                  <1> 	 push ax
   111                              <1> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   112                              <1> 	mov ax, linktable - code
   113                              <1> 	lvar word, lt
   114                              <1> 	 push ax
   115                              <1> %endif
   116                              <1> %if _ELD_LINKER_PASSES || ELDOTHER
   117 000012DC 31C0                <1> 	xor ax, ax
   118                              <1>  %if _ELD_LINKER_PASSES
   119                              <1> 	lvar word, pass
   120 000012DE 50                  <1> 	 push ax
   121                              <1> 	lvar word, amounterrors
   122 000012DF 50                  <1> 	 push ax
   123                              <1> 	lvar word, name
   124 000012E0 50                  <1> 	 push ax
   125                              <1>  %endif
   126                              <1>  %if ELDOTHER
   127                              <1> 	lvar word, other
   128                              <1> 	 push ax
   129                              <1>  %endif
   130                              <1> %endif
   131 000012E1 56                  <1> 	push si
   132 000012E2 53                  <1> 	push bx
   133                              <1> 
   134                              <1> 			; simple: add instance base (dx) to code
   135 000012E3 06                  <1> 	push es
   136 000012E4 1F                  <1> 	pop ds
   137                              <1> %if _ELD_LINKER_PASSES
   138                              <1> .pass:
   139 000012E5 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   140 000012E8 01D3                <1> 	add bx, dx
   141                              <1>  %if _ELD_IDENTICALISE
   142                              <1> 	add bx, word [bp + ?lt]
   143                              <1> 	mov si, word [ltCodeToCode + bx]
   144                              <1>  %else
   145 000012EA 8BB74C17            <1> 	mov si, word [linktable - code + ltCodeToCode + bx]
   146                              <1>  %endif
   147                              <1> %else
   148                              <1> 	mov si, internalcodetocoderelocations - code
   149                              <1> %endif
   150 000012EE 01D6                <1> 	add si, dx
   151                              <1> @@:
   152 000012F0 AD                  <1> 	lodsw
   153 000012F1 85C0                <1> 	test ax, ax		; was last ?
   154 000012F3 740B                <1> 	jz @F			; yes -->
   155 000012F5 93                  <1> 	xchg bx, ax		; bx = entry
   156 000012F6 01D3                <1> 	add bx, dx		; relocate the entry itself
   157                              <1> %if _ELD_CODE_VSTART
   158 000012F8 812F[0000]          <1> 	sub word [bx], code	; undo adjustment
   159                              <1> %endif
   160 000012FC 0117                <1> 	add word [bx], dx	; relocate word referenced by entry
   161 000012FE EBF0                <1> 	jmp @B
   162                              <1> 
   163                              <1> @@:
   164                              <1> 			; next, add heap data base (on stack) to code
   165                              <1> %if _ELD_LINKER_PASSES
   166 00001300 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   167 00001303 01D3                <1> 	add bx, dx
   168                              <1>  %if _ELD_IDENTICALISE
   169                              <1> 	add bx, word [bp + ?lt]
   170                              <1> 	mov si, word [ltCodeToData + bx]
   171                              <1>  %else
   172 00001305 8BB75017            <1> 	mov si, word [linktable - code + ltCodeToData + bx]
   173                              <1>  %endif
   174                              <1> %else
   175                              <1> 	mov si, internalcodetodatarelocations - code
   176                              <1> %endif
   177 00001309 01D6                <1> 	add si, dx
   178                              <1> @@:
   179 0000130B AD                  <1> 	lodsw
   180 0000130C 85C0                <1> 	test ax, ax		; was last ?
   181 0000130E 740C                <1> 	jz @F			; yes -->
   182 00001310 93                  <1> 	xchg bx, ax		; bx = entry
   183 00001311 01D3                <1> 	add bx, dx		; relocate the entry itself
   184 00001313 58                  <1> 	pop ax			; ax -> heap data
   185 00001314 50                  <1> 	push ax
   186                              <1> %if _ELD_DATA_VSTART
   187 00001315 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   188                              <1> %endif
   189 00001318 0107                <1> 	add word [bx], ax	; relocate word referenced by entry
   190 0000131A EBEF                <1> 	jmp @B
   191                              <1> 
   192                              <1> @@:
   193                              <1> 
   194                              <1> 			; add instance base (dx) to data
   195                              <1> %if _ELD_LINKER_PASSES
   196 0000131C 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   197 0000131F 01D3                <1> 	add bx, dx
   198                              <1>  %if _ELD_IDENTICALISE
   199                              <1> 	add bx, word [bp + ?lt]
   200                              <1> 	mov si, word [ltDataToCode + bx]
   201                              <1>  %else
   202 00001321 8BB75417            <1> 	mov si, word [linktable - code + ltDataToCode + bx]
   203                              <1>  %endif
   204                              <1> %else
   205                              <1> 	mov si, internaldatatocoderelocations - code
   206                              <1> %endif
   207 00001325 01D6                <1> 	add si, dx
   208                              <1> @@:
   209 00001327 AD                  <1> 	lodsw
   210 00001328 83F8FF              <1> 	cmp ax, -1		; was last ?
   211 0000132B 740F                <1> 	je @F			; yes -->
   212 0000132D 93                  <1> 	xchg bx, ax		; bx = entry
   213 0000132E 58                  <1> 	pop ax
   214 0000132F 50                  <1> 	push ax
   215 00001330 01C3                <1> 	add bx, ax		; relocate the entry itself
   216                              <1> %if _ELD_CODE_VSTART
   217 00001332 36812F[0000]        <1> 	sub word [ss:bx], code	; undo adjustment
   218                              <1> %endif
   219 00001337 360117              <1> 	add word [ss:bx], dx	; relocate word referenced by entry
   220 0000133A EBEB                <1> 	jmp @B
   221                              <1> 
   222                              <1> @@:
   223                              <1> 			; next, add heap data base (on stack) to data
   224                              <1> %if _ELD_LINKER_PASSES
   225 0000133C 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   226 0000133F 01D3                <1> 	add bx, dx
   227                              <1>  %if _ELD_IDENTICALISE
   228                              <1> 	add bx, word [bp + ?lt]
   229                              <1> 	mov si, word [ltDataToData + bx]
   230                              <1>  %else
   231 00001341 8BB75817            <1> 	mov si, word [linktable - code + ltDataToData + bx]
   232                              <1>  %endif
   233                              <1> %else
   234                              <1> 	mov si, internaldatatodatarelocations - code
   235                              <1> %endif
   236 00001345 01D6                <1> 	add si, dx
   237                              <1> @@:
   238 00001347 AD                  <1> 	lodsw
   239 00001348 83F8FF              <1> 	cmp ax, -1		; was last ?
   240 0000134B 740D                <1> 	je @F			; yes -->
   241 0000134D 93                  <1> 	xchg bx, ax		; bx = entry
   242 0000134E 58                  <1> 	pop ax			; ax -> heap data
   243 0000134F 50                  <1> 	push ax
   244 00001350 01C3                <1> 	add bx, ax		; relocate the entry itself
   245                              <1> %if _ELD_DATA_VSTART
   246 00001352 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   247                              <1> %endif
   248 00001355 360107              <1> 	add word [ss:bx], ax	; relocate word referenced by entry
   249 00001358 EBED                <1> 	jmp @B
   250                              <1> 
   251                              <1> @@:
   252 0000135A 8B56FC              <1> 	mov dx, word [bp + ?instance]
   253                              <1> %if _ELD_LINKER_PASSES
   254 0000135D 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   255 00001360 01D3                <1> 	add bx, dx
   256                              <1>  %if _ELD_IDENTICALISE
   257                              <1> 	add bx, word [bp + ?lt]
   258                              <1> 	add dx, word [ltLinkData + bx]
   259                              <1>  %else
   260 00001362 03975C17            <1> 	add dx, word [linktable - code + ltLinkData + bx]
   261                              <1>  %endif
   262                              <1> %else
   263                              <1> 	add dx, linkerdatarelocations - code
   264                              <1> %endif
   265                              <1> .otherloop:
   266 00001366 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   267                              <1> 
   268                              <1> .datarelocloop:		; must be done before further relocs
   269 00001369 C576F2              <1> 	lds si, [bp + ?nextreloc]
   270 0000136C AD                  <1> 	lodsw			; ax = section indicator
   271 0000136D 85C0                <1> 	test ax, ax		; end of table ?
   272 0000136F 7503E95401          <1> 	jz .donedatareloc
   273 00001374 48                  <1> 	dec ax			; al = 1 if data, 0 if code
   274 00001375 5B                  <1> 	pop bx
   275 00001376 53                  <1> 	push bx			; bx -> ELD data block
   276 00001377 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   277 0000137A 84C0                <1> 	test al, al		; data ?
   278 0000137C AD                  <1> 	lodsw
   279 0000137D 7504                <1> 	jnz @F			; yes -->
   280 0000137F 0346FC              <1> 	add ax, word [bp + ?instance]
   281                              <1> 				; relocate entry into code
   282 00001382 A9                  <1> 	db __TEST_IMM16		; (skip add)
   283                              <1> @@:
   284 00001383 01D8                <1> 	add ax, bx		; relocate entry into data
   285 00001385 8946EE              <1> 	mov word [bp + ?entry], ax
   286 00001388 AD                  <1> 	lodsw
   287 00001389 8976F2              <1> 	mov word [bp + ?nextreloc], si
   288 0000138C E80D01              <1> 	call .build_match
   289                              <1> %if _ELD_LINKER_PASSES
   290 0000138F 73D8                <1> 	jnc .datarelocloop
   291                              <1> %endif
   292 00001391 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   293                              <1> %if ELDOTHER
   294                              <1> 	rol byte [bp + ?other], 1
   295                              <1> 	jnc @F
   296                              <1> 	les bx, [bp + ?linkinfo_other]
   297                              <1> @@:
   298                              <1> %endif
   299 00001394 268B4F08            <1> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   300 00001398 268B7F0A            <1> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   301                              <1> .datarelocfind:
   302 0000139C F2AF                <1> 	repne scasw			; scan initial
   303 0000139E 7541                <1> 	jne .datarelocnotfound
   304 000013A0 57                  <1> 	push di
   305 000013A1 51                  <1> 	push cx
   306 000013A2 56                  <1> 	push si
   307 000013A3 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   308 000013A7 4F                  <1> 	dec di
   309 000013A8 4F                  <1> 	dec di				; 0-based
   310 000013A9 26037F0C            <1> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   311 000013AD 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   312 000013B0 B500                <1> 	mov ch, 0
   313 000013B2 8A0C                <1> 	mov cl, byte [si]		; cx = length
   314 000013B4 41                  <1> 	inc cx
   315                              <1> 	; cmp al, al			; ZR if length is zero
   316 000013B5 F3A6                <1> 	repe cmpsb			; match ?
   317 000013B7 5E                  <1> 	pop si
   318 000013B8 59                  <1> 	pop cx
   319 000013B9 5F                  <1> 	pop di
   320 000013BA 75E0                <1> 	jne .datarelocfind
   321 000013BC 8814                <1> 	mov byte [si], dl
   322 000013BE 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   323 000013C2 4F                  <1> 	dec di
   324 000013C3 4F                  <1> 	dec di				; 0-based
   325 000013C4 26037F0E            <1> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   326 000013C8 268B05              <1> 	mov ax, word [es:di]
   327 000013CB E80700              <1> 	call .address_data_reloc
   328                              <1> %if _ELD_RELOC_VSTART
   329 000013CE 2D[0000]            <1> 	sub ax, relocateddata		; *not* a relocation
   330                              <1> %endif
   331 000013D1 0104                <1> 	add word [si], ax		; relocate
   332 000013D3 EB94                <1> 	jmp .datarelocloop
   333                              <1> 
   334                              <1> .address_data_reloc:
   335 000013D5 C576EE              <1> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   336 000013D8 807EFA00            <1> 	cmp byte [bp + ?targetsection], 0
   337                              <1> 					; relocation in code ?
   338 000013DC 7402                <1> 	je @F				; yes -->
   339 000013DE 16                  <1> 	push ss
   340 000013DF 1F                  <1> 	pop ds				; => our ELD data block
   341                              <1> @@:
   342 000013E0 C3                  <1> 	retn
   343                              <1> 
   344                              <1> .datarelocnotfound:
   345 000013E1 8814                <1> 	mov byte [si], dl
   346 000013E3 807EFB00            <1> 	cmp byte [bp + ?optional], 0
   347                              <1> %if _ELD_DEBUG
   348                              <1> 	jne @F
   349                              <1>  %ifn _ELD_LINKER_PASSES
   350                              <1> 	mov si, 0			; (invalid link)
   351                              <1> linkdatarelocation internalflags6
   352                              <1> 	test si, si
   353                              <1> 	jz .datanotfound
   354                              <1> 	mov si, 0			; (invalid link)
   355                              <1> linkdatarelocation options7
   356                              <1> 	test si, si
   357                              <1> 	jz .datanotfound
   358                              <1>  %else
   359                              <1> 	cmp byte [bp + ?pass], 0
   360                              <1> 	je .datanotfound
   361                              <1>  %endif
   362                              <1> 	houdini
   363                              <1> 	jmp .datanotfound
   364                              <1> @@:
   365                              <1> %else
   366 000013E7 7448                <1> 	je .datanotfound
   367                              <1> %endif
   368                              <1> 
   369                              <1> %if ELDDATA_PMREQUIRED_STATUS
   370                              <1> 	mov si, relocateddata
   371                              <1> linkdatarelocation build_option_PM
   372                              <1> 	test si, si
   373                              <1> 	jz @F
   374                              <1> 	test byte [bp + ?optional], 2
   375                              <1> 	jnz .datanotfound
   376                              <1> @@:
   377                              <1> %endif
   378                              <1> 
   379                              <1> %if _ELD_LINKER_PASSES
   380 000013E9 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2
   381                              <1> linkdatarelocation options7, -3
   382 000013EF 7406                <1> 	jz @F
   383 000013F1 BE[CB1F]            <1> 	mov si, lmsg.warning_data_optional
   384                              <1> internalcoderelocation
   385 000013F4 E85C00              <1> 	call .notfound
   386                              <1> @@:
   387                              <1> %endif
   388 000013F7 E8DBFF              <1> 	call .address_data_reloc
   389 000013FA 832400              <1> 	and word [si], 0		; indicate optional data link failed
   390 000013FD E969FF              <1> 	jmp .datarelocloop
   391                              <1> 
   392                              <1> 
   393                              <1> %if _ELDCALL_OPTIONAL
   394                              <1> .coderelocnotfound:
   395 00001400 8814                <1> 	mov byte [si], dl
   396 00001402 807EFB00            <1> 	cmp byte [bp + ?optional], 0
   397                              <1> %if _ELD_DEBUG
   398                              <1> 	jne @F
   399                              <1>  %ifn _ELD_LINKER_PASSES
   400                              <1> 	mov si, 0			; (invalid link)
   401                              <1> linkdatarelocation internalflags6
   402                              <1> 	test si, si
   403                              <1> 	jz .codenotfound
   404                              <1> 	mov si, 0			; (invalid link)
   405                              <1> linkdatarelocation options7
   406                              <1> 	test si, si
   407                              <1> 	jz .codenotfound
   408                              <1>  %else
   409                              <1> 	cmp byte [bp + ?pass], 0
   410                              <1> 	je .codenotfound
   411                              <1>  %endif
   412                              <1> 	houdini
   413                              <1> 	jmp .codenotfound
   414                              <1> @@:
   415                              <1> %else
   416 00001406 743A                <1> 	je .codenotfound
   417                              <1> %endif
   418                              <1> 
   419                              <1> %if ELDCALL_PMREQUIRED_STATUS
   420                              <1>  %if _ELD_LINKER_PASSES
   421                              <1>   %assign ELDLINKER 0
   422                              <1>  %endif
   423 00001408 BE[0000]            <1> 	mov si, relocateddata
   424                              <1> linkdatarelocation build_option_PM
   425                              <1>  %if _ELD_LINKER_PASSES
   426                              <1>   %assign ELDLINKER 1
   427                              <1>  %endif
   428 0000140B 85F6                <1> 	test si, si
   429 0000140D 7406                <1> 	jz @F
   430 0000140F F646FB02            <1> 	test byte [bp + ?optional], 2
   431 00001413 752D                <1> 	jnz .codenotfound
   432                              <1> @@:
   433                              <1> %endif
   434                              <1> 
   435                              <1> %if _ELD_LINKER_PASSES
   436 00001415 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2
   437                              <1> linkdatarelocation options7, -3
   438 0000141B 7406                <1> 	jz @F
   439 0000141D BE[A91F]            <1> 	mov si, lmsg.warning_code_optional
   440                              <1> internalcoderelocation
   441 00001420 E83000              <1> 	call .notfound
   442                              <1> @@:
   443                              <1> %endif
   444 00001423 C576EE              <1> 	lds si, [bp + ?entry]
   445 00001426 C7049090            <1> 	mov word [si], 9090h
   446 0000142A C6440290            <1> 	mov byte [si + 2], 90h		; indicate optional code link failed
   447 0000142E E9A600              <1> 	jmp .coderelocloop
   448                              <1> %endif
   449                              <1> 
   450                              <1> 
   451                              <1> %if _ELD_LINKER_PASSES
   452                              <1> .datanotfound:
   453 00001431 BE[ED1F]            <1> 	mov si, lmsg.error_data
   454                              <1> internalcoderelocation
   455 00001434 E81C00              <1> 	call .notfound
   456 00001437 7203E91F01          <1> 	jnc .error_j
   457 0000143C FF46E8              <1> 	inc word [bp + ?amounterrors]
   458 0000143F E927FF              <1> 	jmp .datarelocloop
   459                              <1> 
   460                              <1> .codenotfound:
   461 00001442 BE[0620]            <1> 	mov si, lmsg.error_code
   462                              <1> internalcoderelocation
   463 00001445 E80B00              <1> 	call .notfound
   464 00001448 7203E90E01          <1> 	jnc .error_j
   465 0000144D FF46E8              <1> 	inc word [bp + ?amounterrors]
   466 00001450 E98400              <1> 	jmp .coderelocloop
   467                              <1> 
   468                              <1> .notfound:
   469 00001453 807EEA00            <1> 	cmp byte [bp + ?pass], 0
   470 00001457 743A                <1> 	je @F				; --> (NC)
   471 00001459 16                  <1> 	 push ss
   472 0000145A 07                  <1> 	 pop es
   473 0000145B BF[0000]            <1> 	mov di, relocateddata
   474                              <1> linkdatarelocation line_out
   475 0000145E E83300              <1> 	call .copy
   476 00001461 8B76E6              <1> 	mov si, word [bp + ?name]
   477 00001464 AD                  <1> 	lodsw
   478 00001465 E8[0000]EB020000    <1> 	extcall hexword
   479 0000146C 56                  <1> 	push si
   480 0000146D BE[1F20]            <1> 	mov si, lmsg.error.2
   481                              <1> internalcoderelocation
   482 00001470 E82100              <1> 	call .copy
   483 00001473 5E                  <1> 	pop si
   484                              <1> %if _ELD_LINKER_PASSES
   485 00001474 56                  <1> 	push si
   486 00001475 E81C00              <1> 	call .copy
   487 00001478 5E                  <1> 	pop si
   488 00001479 C60400              <1> 	mov byte [si], 0		; mark as failed
   489                              <1> %else
   490                              <1> 	call .copy
   491                              <1> %endif
   492 0000147C B022                <1> 	mov al, '"'
   493 0000147E AA                  <1> 	stosb
   494 0000147F 16                  <1> 	 push ss
   495 00001480 1F                  <1> 	 pop ds
   496 00001481 E8[0000]EB020000    <1> 	extcall putsline_crlf
   497 00001488 B8350E              <1> 	mov ax, 0E35h
   498 0000148B E8[0000]EB020000    <1> 	extcall setrc
   499 00001492 F9                  <1> 	stc				; CY, diagnostic displayed
   500                              <1> @@:
   501 00001493 C3                  <1> 	retn
   502                              <1> 
   503                              <1> .copy:
   504 00001494 E8[0000]EB020000    <1> 	extcall copy_single_counted_string
   505 0000149B C3                  <1> 	retn
   506                              <1> %else
   507                              <1> .datanotfound: equ .error_j
   508                              <1> .codenotfound: equ .error_j
   509                              <1> %endif
   510                              <1> 
   511                              <1> .build_match:
   512                              <1> %if _ELD_CODE_VSTART
   513 0000149C 2D[0000]            <1> 	sub ax, code
   514                              <1> %endif
   515 0000149F 0346FC              <1> 	add ax, word [bp + ?instance]
   516 000014A2 96                  <1> 	xchg si, ax
   517                              <1> %if _ELD_LINKER_PASSES
   518 000014A3 8976E6              <1> 	mov word [bp + ?name], si
   519                              <1> %endif
   520 000014A6 AD                  <1> 	lodsw			; = hash, si -> counted string
   521 000014A7 8A14                <1> 	mov dl, byte [si]
   522                              <1> %if _ELD_LINKER_PASSES
   523 000014A9 84D2                <1> 	test dl, dl		; marked as already failed ?
   524 000014AB 750A                <1> 	jnz @F
   525 000014AD 837EE800            <1> 	cmp word [bp + ?amounterrors], 0
   526 000014B1 7503E9A500          <1> 	je .error_j
   527 000014B6 C3                  <1> 	retn			; (NC)
   528                              <1> 
   529                              <1> @@:
   530                              <1> %endif
   531                              <1> %if ELDOTHER
   532                              <1> 	rol byte [bp + ?other], 1
   533                              <1> 	jnc @F
   534                              <1> 	rol byte [bp + ?use_hash_other], 1
   535                              <1> 	jmp @FF
   536                              <1> 
   537                              <1> @@:
   538                              <1> %endif
   539 000014B7 D046EC              <1> 	rol byte [bp + ?use_hash], 1
   540                              <1> @@:
   541 000014BA 720A                <1> 	jc @F
   542 000014BC AC                  <1> 	lodsb
   543 000014BD 91                  <1> 	xchg cx, ax		; cl = length
   544 000014BE AD                  <1> 	lodsw			; ax = prefix
   545 000014BF 49                  <1> 	dec cx
   546 000014C0 49                  <1> 	dec cx
   547 000014C1 4E                  <1> 	dec si
   548 000014C2 8A14                <1> 	mov dl, byte [si]
   549 000014C4 880C                <1> 	mov byte [si], cl	; si -> counted string suffix
   550                              <1> @@:
   551                              <1> %if _ELD_LINKER_PASSES
   552 000014C6 F9                  <1> 	stc			; CY
   553                              <1> %endif
   554 000014C7 C3                  <1> 	retn
   555                              <1> 
   556                              <1> 
   557                              <1> .donedatareloc:
   558                              <1> %if ELDOTHER
   559                              <1> 	rol byte [bp + ?other], 1
   560                              <1> 	jc .otherdone
   561                              <1> %endif
   562                              <1> 
   563 000014C8 8B56FC              <1> 	mov dx, word [bp + ?instance]
   564                              <1> %if _ELD_LINKER_PASSES
   565 000014CB 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   566 000014CE 01D3                <1> 	add bx, dx
   567                              <1>  %if _ELD_IDENTICALISE
   568                              <1> 	add bx, word [bp + ?lt]
   569                              <1> 	add dx, word [ltLinkCode + bx]
   570                              <1>  %else
   571 000014D0 03976017            <1> 	add dx, word [linktable - code + ltLinkCode + bx]
   572                              <1>  %endif
   573                              <1> %else
   574                              <1> 	add dx, linkercoderelocations - code
   575                              <1> %endif
   576 000014D4 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   577                              <1> 
   578                              <1> .coderelocloop:
   579 000014D7 C576F2              <1> 	lds si, [bp + ?nextreloc]
   580 000014DA AD                  <1> 	lodsw
   581                              <1> %if _ELDCALL_OPTIONAL
   582 000014DB 48                  <1> 	dec ax
   583 000014DC 7903E98C00          <1> 	js .donecodereloc
   584 000014E1 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   585 000014E4 AD                  <1> 	lodsw
   586                              <1> %endif
   587 000014E5 0346FC              <1> 	add ax, word [bp + ?instance]
   588 000014E8 8946EE              <1> 	mov word [bp + ?entry], ax
   589 000014EB AD                  <1> 	lodsw
   590 000014EC 8976F2              <1> 	mov word [bp + ?nextreloc], si
   591                              <1> %ifn _ELDCALL_OPTIONAL
   592                              <1> 	test ax, ax
   593                              <1> 	jz .donecodereloc
   594                              <1> %endif
   595 000014EF E8AAFF              <1> 	call .build_match
   596                              <1> %if _ELD_LINKER_PASSES
   597 000014F2 73E3                <1> 	jnc .coderelocloop
   598                              <1> %endif
   599 000014F4 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   600 000014F7 268B4F10            <1> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   601 000014FB 268B7F12            <1> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   602                              <1> .coderelocfind:
   603 000014FF F2AF                <1> 	repne scasw			; scan initial
   604                              <1> %if _ELDCALL_OPTIONAL
   605 00001501 7403E9FAFE          <1> 	jne .coderelocnotfound
   606                              <1> %else
   607                              <1>  %if _ELD_DEBUG
   608                              <1> 	je @F
   609                              <1> 	houdini
   610                              <1> 	jmp .codenotfound
   611                              <1> @@:
   612                              <1>  %else
   613                              <1> 	jne .codenotfound
   614                              <1>  %endif
   615                              <1> %endif
   616 00001506 57                  <1> 	push di
   617 00001507 51                  <1> 	push cx
   618 00001508 56                  <1> 	push si
   619 00001509 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   620 0000150D 4F                  <1> 	dec di
   621 0000150E 4F                  <1> 	dec di				; 0-based
   622 0000150F 26037F14            <1> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   623 00001513 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   624 00001516 B500                <1> 	mov ch, 0
   625 00001518 8A0C                <1> 	mov cl, byte [si]		; cx = length
   626 0000151A 41                  <1> 	inc cx
   627                              <1> 	; cmp al, al			; ZR if length is zero
   628 0000151B F3A6                <1> 	repe cmpsb			; match ?
   629 0000151D 5E                  <1> 	pop si
   630 0000151E 59                  <1> 	pop cx
   631 0000151F 5F                  <1> 	pop di
   632 00001520 75DD                <1> 	jne .coderelocfind
   633 00001522 8814                <1> 	mov byte [si], dl
   634 00001524 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   635 00001528 4F                  <1> 	dec di
   636 00001529 4F                  <1> 	dec di				; 0-based
   637 0000152A 01FF                <1> 	add di, di			; quadruple index
   638 0000152C 26037F16            <1> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   639 00001530 26FF35              <1> 	push word [es:di]
   640 00001533 C576EE              <1> 	lds si, [bp + ?entry]
   641 00001536 8F4405              <1> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   642                              <1> 					;  patch the destination address
   643 00001539 803CE8              <1> 	cmp byte [si], 0E8h		; is it as expected ?
   644 0000153C 751D                <1> 	jne .error_j
   645 0000153E 268B7D02            <1> 	mov di, word [es:di + 2]
   646 00001542 BB[0000]            <1> 	mov bx, relocateddata
   647                              <1> linkdatarelocation linkcall_table	; ss:bx -> link call table
   648 00001545 36833F01            <1> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   649 00001549 7510                <1> 	jne .error_j			; no -->
   650 0000154B 368B4F02            <1> 	mov cx, word [ss:bx + 2]	; get amount of segments
   651 0000154F E30A                <1> 	jcxz .error_j			; none -->
   652                              <1> @@:
   653 00001551 83C304              <1> 	add bx, 4			; -> next segment
   654 00001554 36393F              <1> 	cmp word [ss:bx], di		; value matches ?
   655 00001557 7405                <1> 	je @F				; yes, found -->
   656 00001559 E2F6                <1> 	loop @B				; try remaining segments
   657                              <1> .error_j:
   658 0000155B E98A00              <1> 	jmp .error
   659                              <1> 
   660                              <1> @@:
   661 0000155E 368B5F02            <1> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   662                              <1> 		; si + 3 + delta = bx
   663                              <1> 		; delta = bx - si - 3
   664 00001562 29F3                <1> 	sub bx, si
   665 00001564 83EB03              <1> 	sub bx, 3
   666 00001567 895C01              <1> 	mov word [si + 1], bx		; patch the call instruction
   667 0000156A E96AFF              <1> 	jmp .coderelocloop
   668                              <1> 
   669                              <1> .donecodereloc:
   670                              <1> %if _ELD_LINKER_PASSES
   671 0000156D 8B46E8              <1> 	mov ax, word [bp + ?amounterrors]
   672 00001570 85C0                <1> 	test ax, ax
   673 00001572 75E7                <1> 	jnz .error_j
   674 00001574 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   675 00001577 85DB                <1> 	test bx, bx
   676 00001579 750B                <1> 	jnz @F
   677 0000157B 43                  <1> 	inc bx
   678 0000157C 43                  <1> 	inc bx
   679 0000157D 895EEA              <1> 	mov word [bp + ?pass], bx
   680 00001580 8B56FC              <1> 	mov dx, word [bp + ?instance]
   681 00001583 E95FFD              <1> 	jmp .pass
   682                              <1> 
   683                              <1> @@:
   684                              <1> %endif
   685                              <1> 
   686                              <1> %ifnidni _LISTING, ""
   687                              <1> %assign ELDLINKER 0
   688                              <1> .hint:
   689 00001586 16                  <1> 	push ss
   690 00001587 1F                  <1> 	pop ds
   691 00001588 B02D                <1> 	mov al, 2Dh
   692 0000158A E8[0000]EB020000    <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   693                              <1> 					; CHG: ax, dx, bx
   694 00001591 7437                <1> 	jz .no_hint
   695                              <1> 
   696 00001593 8A26[0000]          <1> 	mov ah, byte [relocateddata]
   697                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   698 00001597 E85500              <1> 	call plex_check
   699 0000159A 7305                <1> 	jnc @F
   700                              <1> 
   701 0000159C B4FF                <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   702                              <1> .loop_hint:
   703 0000159E E84E00              <1> 	call plex_check
   704                              <1> @@:
   705 000015A1 7307                <1> 	jnc .end_hint		; if found --> (NC)
   706 000015A3 80EC01              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   707 000015A6 73F6                <1> 	jnc .loop_hint		; try next if we didn't check all yet -->
   708 000015A8 EB20                <1> 	jmp .no_hint
   709                              <1> 
   710                              <1> .end_hint:
   711 000015AA 50                  <1> 	push ax
   712 000015AB C446FC              <1> 	les ax, [bp + ?instance]
   713 000015AE BF[441B]            <1> 	mov di, listmsg.hint.offset
   714                              <1> internalcoderelocation
   715 000015B1 E8[0000]EB020000    <1> 	extcall hexword
   716 000015B8 BB[261B]            <1> 	mov bx, listmsg.hint
   717                              <1> internalcoderelocation
   718 000015BB 368B16[0000]        <1> 	mov dx, [ss:relocateddata]
   719                              <1> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   720 000015C0 58                  <1> 	pop ax
   721 000015C1 B040                <1> 	mov al, 40h		; AMIS message display service
   722 000015C3 E8[0000]EB020000    <1> 	extcall call_int2D
   723                              <1> .no_hint:
   724                              <1> %endif
   725                              <1> 
   726                              <1> %if ELDOTHER
   727                              <1> %assign ELDLINKER 0
   728                              <1> 	not byte [bp + ?other]
   729                              <1> 
   730                              <1> 	push ss
   731                              <1> 	pop ds
   732                              <1> 	mov al, 2Dh
   733                              <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   734                              <1> 					; CHG: ax, dx, bx
   735                              <1> 	jz .no_other
   736                              <1> 
   737                              <1> 	mov ah, byte [relocateddata]
   738                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   739                              <1> 	call plex_check
   740                              <1> 	jnc @F
   741                              <1> 
   742                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   743                              <1> .loop_other:
   744                              <1> 	call plex_check
   745                              <1> @@:
   746                              <1> 	jnc .end_other		; if found --> (NC)
   747                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   748                              <1> 	jnc .loop_other		; try next if we didn't check all yet -->
   749                              <1> 	jmp .no_other
   750                              <1> 
   751                              <1> .end_other:
   752                              <1> 	mov al, 42h		; AMIS get other link info service
   753                              <1> 	extcall call_int2D
   754                              <1> 	cmp al, 0FFh
   755                              <1> 	jne .no_other
   756                              <1> 
   757                              <1> 	mov ax, si		; selector => PSP
   758                              <1> 	extcall ispm
   759                              <1> 	jz @F
   760                              <1> 	mov ax, dx		; segment => PSP
   761                              <1> @@:
   762                              <1> 	 push ss
   763                              <1> 	 pop ds
   764                              <1> 	mov word [otherds], ax
   765                              <1> internaldatarelocation		; current mode sel/seg
   766                              <1> 	mov word [otherseg], dx
   767                              <1> internaldatarelocation		; remember segment
   768                              <1> 
   769                              <1> 	mov ax, cx		; selector => link info
   770                              <1> 	extcall ispm
   771                              <1> 	jz @F
   772                              <1> 	mov ax, bx		; segment => link info
   773                              <1> @@:
   774                              <1> 	mov word [bp + ?linkinfo_other], di
   775                              <1> 	mov word [bp + ?linkinfo_other + 2], ax
   776                              <1> 
   777                              <1> 	mov ds, ax		; => link info
   778                              <1> 	xor ax, ax
   779                              <1> 	cmp word [di + eldlSignature], 0E1D1h
   780                              <1> 	jne .error_other
   781                              <1> 	cmp word [di + eldlUseLinkHash], 1
   782                              <1> 	ja .error_other
   783                              <1> 	jb @F
   784                              <1> 	dec ax
   785                              <1> @@:
   786                              <1> 	mov word [bp + ?use_hash_other], ax
   787                              <1> 
   788                              <1> 	mov dx, word [bp + ?instance]
   789                              <1> 	add dx, linkerotherdatarelocations - code
   790                              <1> 	jmp .otherloop
   791                              <1> 
   792                              <1> .error_other:
   793                              <1> 	push cs
   794                              <1> 	pop ds
   795                              <1> 	mov ax, 0E33h
   796                              <1> 	extcall setrc
   797                              <1> 	mov dx, lmsg.error_other
   798                              <1> internalcoderelocation
   799                              <1> 	jmp @F
   800                              <1> 
   801                              <1> .no_other:
   802                              <1> 	push cs
   803                              <1> 	pop ds
   804                              <1> 	mov ax, 0E34h
   805                              <1> 	extcall setrc
   806                              <1> 	mov dx, lmsg.no_other
   807                              <1> internalcoderelocation
   808                              <1> @@:
   809                              <1> 	extcall putsz
   810                              <1> 	jmp .error
   811                              <1> 
   812                              <1> .otherdone:
   813                              <1> %endif
   814                              <1> 
   815 000015CA 5B                  <1> 	pop bx				; -> our heap data
   816 000015CB 5E                  <1> 	pop si				; -> our command line tail
   817 000015CC 16                  <1> 	 push ss
   818 000015CD 1F                  <1> 	 pop ds
   819 000015CE C47EFC              <1> 	les di, [bp + ?instance]
   820 000015D1 268B4502            <1> 	mov ax, word [es:di + eldiEndCode]
   821                              <1> houdini
   822 000015D5 2D[C012]            <1> 	sub ax, strict word endresident + code
   823                              <1> internalcoderelocation
   824 000015D8 26C74502[C012]      <1> 	mov word [es:di + eldiEndCode], endresident + code
   825                              <1> internalcoderelocation
   826 000015DE 2906[0000]          <1> 	sub word [relocateddata], ax
   827                              <1> linkdatarelocation extseg_used
   828                              <1> %if _DATA_SIZE == 0
   829                              <1> 	xor ax, ax
   830                              <1> 	mov word [es:di + eldiStartData], ax
   831                              <1> 	mov word [es:di + eldiEndData], ax
   832                              <1> %endif
   833 000015E2 89EC5D              <1> 	lleave code
   834                              <1> 		; INP:	es => ELD code segment
   835                              <1> 		;	ds:si -> command line tail
   836                              <1> 		;	ds:bx -> ELD data block
   837                              <1> 		;	ss:sp -> far return address for current mode
   838                              <1> 		; STT:	ds = ss, UP, EI
   839 000015E5 E9B7FB              <1> 	jmp start
   840                              <1> 
   841                              <1> .error:
   842 000015E8 89EC5D              <1> 	lleave
   843 000015EB B8FFFF              <1> 	mov ax, -1
   844 000015EE CB                  <1> 	retf
   845                              <1> 
   846                              <1> 
   847                              <1> %ifnidni _LISTING, ""
   848                              <1>  %assign ELDHINT 1
   849                              <1> %else
   850                              <1>  %assign ELDHINT 0
   851                              <1> %endif
   852                              <1> 
   853                              <1> %if ELDOTHER || ELDHINT
   854                              <1> 		; INP:	ah = multiplex number to check
   855                              <1> 		; OUT:	CY if multiplex number unused or no signature match,
   856                              <1> 		;	 bp, ah, ds unmodified
   857                              <1> 		;	NC if match found,
   858                              <1> 		;	 ah = multiplex number (unmodified)
   859                              <1> 		; CHG:	si, di, es, cx, dx
   860                              <1> plex_check:
   861 000015EF 16                  <1> 	push ss
   862 000015F0 1F                  <1> 	pop ds
   863 000015F1 F606[0000]08        <1> 	testopt [relocateddata], 8
   864                              <1> linkdatarelocation internalflags4, -3
   865 000015F6 740B                <1> 	jz @F
   866 000015F8 BE[0000]            <1> 	mov si, relocateddata
   867                              <1> linkdatarelocation amis_multiplex_number, -2, optional
   868 000015FB 85F6                <1> 	test si, si
   869 000015FD 7404                <1> 	jz @F
   870 000015FF 3A24                <1> 	cmp ah, byte [si]
   871 00001601 7420                <1> 	je .notfound		; do not use our own multiplexer -->
   872                              <1> @@:
   873 00001603 B000                <1> 	mov al, 00h		; AMIS installation check
   874 00001605 E8[0000]EB020000    <1> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
   875 0000160C 3CFF                <1> 	cmp al, 0FFh
   876 0000160E 7513                <1> 	jne .notfound
   877 00001610 0E                  <1> 	push cs
   878 00001611 1F                  <1> 	pop ds
   879 00001612 BE[161B]            <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   880                              <1> internalcoderelocation
   881 00001615 E8[0000]EB020000    <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
   882 0000161C B90800              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
   883 0000161F F3A7                <1> 	repe cmpsw
   884 00001621 7401                <1> 	je .checkret		; ZR, NC = match -->
   885                              <1> .notfound:
   886 00001623 F9                  <1> 	stc			; CY no match
   887                              <1> .checkret:
   888 00001624 C3                  <1> 	retn
   889                              <1> %endif
   890                              <1> 
   891                              <1> 
   892 00001625 00<rep 3h>          <1> 	align 4, db 0
   893                              <1> linkercoderelocations:
   894                              <1> %if _ELDCALL_OPTIONAL
   895 00001628 01005700[4C1B]0100- <1> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   895 00001630 7200[601B]0100AB00- <1>
   895 00001638 [771B]0100D100-     <1>
   895 0000163E [601B]0100EE01-     <1>
   895 00001644 [861B]0100FB01-     <1>
   895 0000164A [941B]01038302-     <1>
   895 00001650 [AF1B]0103D30C-     <1>
   895 00001656 [AF1B]01000D0D-     <1>
   895 0000165C [C71B]0100520D-     <1>
   895 00001662 [D91B]01005F0D-     <1>
   895 00001668 [E41B]0100740D-     <1>
   895 0000166E [F61B]0100E011-     <1>
   895 00001674 [101C]0100E811-     <1>
   895 0000167A [261C]0100F011-     <1>
   895 00001680 [361C]0100F811-     <1>
   895 00001686 [441C]01000012-     <1>
   895 0000168C [5D1C]01000812-     <1>
   895 00001692 [651C]01001012-     <1>
   895 00001698 [6D1C]01001812-     <1>
   895 0000169E [741C]01002012-     <1>
   895 000016A4 [891C]01002812-     <1>
   895 000016AA [911C]01003012-     <1>
   895 000016B0 [A51C]01003812-     <1>
   895 000016B6 [D91B]01004012-     <1>
   895 000016BC [AC1C]01004812-     <1>
   895 000016C2 [BB1C]01005012-     <1>
   895 000016C8 [C71C]01005812-     <1>
   895 000016CE [D31C]01006012-     <1>
   895 000016D4 [DC1C]01006812-     <1>
   895 000016DA [E81C]01007012-     <1>
   895 000016E0 [F41C]01007812-     <1>
   895 000016E6 [FB1C]01008012-     <1>
   895 000016EC [181D]01008812-     <1>
   895 000016F2 [281D]01009012-     <1>
   895 000016F8 [321D]01009812-     <1>
   895 000016FE [3D1D]0100A012-     <1>
   895 00001704 [481D]0100A812-     <1>
   895 0000170A [4F1D]0100B012-     <1>
   895 00001710 [571D]01008A15-     <1>
   895 00001716 [6D1D]0100B115-     <1>
   895 0000171C [631D]0100C315-     <1>
   895 00001722 [761D]01000516-     <1>
   895 00001728 [761D]01001516-     <1>
   895 0000172E [831D]0000          <1>
   896                              <1> %else
   897                              <1> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
   898                              <1> %endif
   899                              <1> 
   900                              <1> %if _ELD_LINKER_PASSES
   901                              <1> linkerlinkercoderelocations:
   902                              <1> %if _ELDCALL_OPTIONAL
   903 00001732 01006514[631D]0100- <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   903 0000173A 8114[181D]01008B14- <1>
   903 00001742 [5D1C]01009414-     <1>
   903 00001748 [FB1C]0000          <1>
   904                              <1> %else
   905                              <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   906                              <1> %endif
   907                              <1> 
   908                              <1> 	align 2, db 0
   909                              <1> linktable:
   910                              <1> 	istruc LINKTABLE
   911                              <1> at ltCodeToCode
   912 0000174C 041B                <1> 	dw internallinkercodetocoderelocations - code
   913 0000174E 5219                <1> 	dw internalcodetocoderelocations - code
   914                              <1> at ltCodeToData
   915 00001750 101B                <1> 	dw internallinkercodetodatarelocations - code
   916 00001752 9819                <1> 	dw internalcodetodatarelocations - code
   917                              <1> at ltDataToCode
   918 00001754 121B                <1> 	dw internallinkerdatatocoderelocations - code
   919 00001756 E61A                <1> 	dw internaldatatocoderelocations - code
   920                              <1> at ltDataToData
   921 00001758 141B                <1> 	dw internallinkerdatatodatarelocations - code
   922 0000175A E81A                <1> 	dw internaldatatodatarelocations - code
   923                              <1> at ltLinkData
   924 0000175C EA1A                <1> 	dw linkerlinkerdatarelocations - code
   925 0000175E 6417                <1> 	dw linkerdatarelocations - code
   926                              <1> at ltLinkCode
   927 00001760 3217                <1> 	dw linkerlinkercoderelocations - code
   928 00001762 2816                <1> 	dw linkercoderelocations - code
   929                              <1> 	iend
   930                              <1> %endif
   931                              <1> 
   932                              <1> 	align 2, db 0
   933                              <1> linkerdatarelocations:
   934 00001764 01002400[8E1D]0100- <1> 	dw LINK_DATA_RELOCATIONS, 0
   934 0000176C 6000[9E1D]01006500- <1>
   934 00001774 [B41D]01008400-     <1>
   934 0000177A [9E1D]01008900-     <1>
   934 00001780 [C81D]0100A300-     <1>
   934 00001786 [DB1D]0100A700-     <1>
   934 0000178C [EE1D]0100A900-     <1>
   934 00001792 [0A1E]0100B900-     <1>
   934 00001798 [9E1D]0100C500-     <1>
   934 0000179E [9E1D]0100CA00-     <1>
   934 000017A4 [C81D]0100E500-     <1>
   934 000017AA [9E1D]0100EA00-     <1>
   934 000017B0 [C81D]01000B01-     <1>
   934 000017B6 [131E]01000D01-     <1>
   934 000017BC [2B1E]01001501-     <1>
   934 000017C2 [3C1E]01001B01-     <1>
   934 000017C8 [131E]01001D01-     <1>
   934 000017CE [581E]01002101-     <1>
   934 000017D4 [721E]01005F01-     <1>
   934 000017DA [721E]01008701-     <1>
   934 000017E0 [DB1D]0100CD01-     <1>
   934 000017E6 [851E]0100D401-     <1>
   934 000017EC [961E]0100DB01-     <1>
   934 000017F2 [851E]0100EC01-     <1>
   934 000017F8 [A91E]01000A02-     <1>
   934 000017FE [851E]01003202-     <1>
   934 00001804 [851E]01003702-     <1>
   934 0000180A [8E1D]01004D02-     <1>
   934 00001810 [C31E]01005202-     <1>
   934 00001816 [C31E]01005502-     <1>
   934 0000181C [C31E]01005902-     <1>
   934 00001822 [C31E]01005E02-     <1>
   934 00001828 [B41D]01006602-     <1>
   934 0000182E [961E]01009B02-     <1>
   934 00001834 [CF1E]0100A202-     <1>
   934 0000183A [CF1E]01003903-     <1>
   934 00001840 [E41E]01007C05-     <1>
   934 00001846 [F11E]0100A705-     <1>
   934 0000184C [F11E]01000F06-     <1>
   934 00001852 [F11E]0100B206-     <1>
   934 00001858 [F11E]0100BB06-     <1>
   934 0000185E [F11E]0100C306-     <1>
   934 00001864 [F11E]0100D506-     <1>
   934 0000186A [F11E]0100F606-     <1>
   934 00001870 [F11E]01000607-     <1>
   934 00001876 [F11E]0100E607-     <1>
   934 0000187C [F11E]0100AD09-     <1>
   934 00001882 [F11E]01005C0A-     <1>
   934 00001888 [F11E]01006C0A-     <1>
   934 0000188E [F11E]0100860A-     <1>
   934 00001894 [F11E]0100AD0A-     <1>
   934 0000189A [F11E]0100C90A-     <1>
   934 000018A0 [8E1D]0100CF0A-     <1>
   934 000018A6 [C31E]0100D30A-     <1>
   934 000018AC [C31E]0100090B-     <1>
   934 000018B2 [F11E]0100800B-     <1>
   934 000018B8 [F11E]0100850B-     <1>
   934 000018BE [F11E]01009D0B-     <1>
   934 000018C4 [F11E]0100A10B-     <1>
   934 000018CA [F11E]0100010C-     <1>
   934 000018D0 [F11E]01006D0C-     <1>
   934 000018D6 [F11E]0100960C-     <1>
   934 000018DC [F11E]0100AC0C-     <1>
   934 000018E2 [F11E]01004D0D-     <1>
   934 000018E8 [8E1D]01006E0D-     <1>
   934 000018EE [C31E]0100720D-     <1>
   934 000018F4 [C31E]01007C0D-     <1>
   934 000018FA [C31E]0100800D-     <1>
   934 00001900 [C31E]01008F0D-     <1>
   934 00001906 [C31E]0100930D-     <1>
   934 0000190C [C31E]01009311-     <1>
   934 00001912 [FC1E]01009C11-     <1>
   934 00001918 [071F]0100BF11-     <1>
   934 0000191E [101F]0100CF11-     <1>
   934 00001924 [1B1F]0100DC11-     <1>
   934 0000192A [291F]01000914-     <1>
   934 00001930 [381F]01009515-     <1>
   934 00001936 [5B1F]0100BE15-     <1>
   934 0000193C [071F]0100E015-     <1>
   934 00001942 [1B1F]0100F315-     <1>
   934 00001948 [801F]0101F915-     <1>
   934 0000194E [911F]0000          <1>
   935                              <1> 
   936                              <1> 	align 2, db 0
   937                              <1> internalcodetocoderelocations:
   938 00001952 1701A402AC02AA09F2- <1> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
   938 0000195B 09F909080A0D0A1C0A- <1>
   938 00001964 260A300A3A0A490A06- <1>
   938 0000196D 0B430B520B590B680B- <1>
   938 00001976 AF0BC90BD10BE00BE7- <1>
   938 0000197F 0BF60B040DC611CB11- <1>
   938 00001988 D311D811AF15B915D6- <1>
   938 00001991 15DC1513160000      <1>
   939                              <1> 
   940                              <1> 	align 2, db 0
   941                              <1> internalcodetodatarelocations:
   942 00001998 3400550002018F01F7- <1> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
   942 000019A1 0104020F0220024102- <1>
   942 000019AA 940298029E02B202BC- <1>
   942 000019B3 02CA02CE02E502E902- <1>
   942 000019BC F0020C0315031C0322- <1>
   942 000019C5 03430347034D036B03- <1>
   942 000019CE 7F0388038E0397039D- <1>
   942 000019D7 03A603AC03B503C303- <1>
   942 000019E0 D003D603EC03FE0345- <1>
   942 000019E9 044904640498059F05- <1>
   942 000019F2 AA05F0051C062D0639- <1>
   942 000019FB 064A06560697079D07- <1>
   942 00001A04 DE07E907F507000807- <1>
   942 00001A0D 080E0815081F082608- <1>
   942 00001A16 2908390878088008E7- <1>
   942 00001A1F 08EB08F208F9081409- <1>
   942 00001A28 180935093B094A0955- <1>
   942 00001A31 095A0988099309D609- <1>
   942 00001A3A A80AB00ABB0AE30AEF- <1>
   942 00001A43 0A3A0BA40B3F0C8D0C- <1>
   942 00001A4C C40CCF0CE00CE80CEC- <1>
   942 00001A55 0CF20CFC0C270D2B0D- <1>
   942 00001A5E 2F0D330DEE0FF20FF6- <1>
   942 00001A67 0FFA0FFE0F04100A10- <1>
   942 00001A70 0E10131017101C1020- <1>
   942 00001A79 102310271032103C10- <1>
   942 00001A82 40104D104F10531055- <1>
   942 00001A8B 105C105F106B106E10- <1>
   942 00001A94 721076107A107D1080- <1>
   942 00001A9D 1087108F1093109710- <1>
   942 00001AA6 9B109F10A410BC10C1- <1>
   942 00001AAF 10D010D410D810DF10- <1>
   942 00001AB8 F110021113111A1122- <1>
   942 00001AC1 112D1130113E114211- <1>
   942 00001ACA 4B114F1157115B1160- <1>
   942 00001AD3 1168116D1171117711- <1>
   942 00001ADC 7B1181118511B51100- <1>
   942 00001AE5 00                  <1>
   943                              <1> 
   944                              <1> 	align 2, db 0
   945                              <1> internaldatatocoderelocations:
   946 00001AE6 FFFF                <1> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
   947                              <1> 
   948                              <1> 	align 2, db 0
   949                              <1> internaldatatodatarelocations:
   950 00001AE8 FFFF                <1> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
   951                              <1> 
   952                              <1> %if _ELD_LINKER_PASSES
   953                              <1> 	align 2, db 0
   954                              <1> linkerlinkerdatarelocations:
   955 00001AEA 0100EC13[101F]0100- <1> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
   955 00001AF2 1814[101F]01005C14- <1>
   955 00001AFA [F11E]01004315-     <1>
   955 00001B00 [4A1F]0000          <1>
   956                              <1> 
   957                              <1> 	align 2, db 0
   958                              <1> internallinkercodetocoderelocations:
   959 00001B04 F2131E14321443146E- <1> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
   959 00001B0D 140000              <1>
   960                              <1> 
   961                              <1> 	align 2, db 0
   962                              <1> internallinkercodetodatarelocations:
   963 00001B10 0000                <1> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
   964                              <1> 
   965                              <1> 	align 2, db 0
   966                              <1> internallinkerdatatocoderelocations:
   967 00001B12 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
   968                              <1> 
   969                              <1> 	align 2, db 0
   970                              <1> internallinkerdatatodatarelocations:
   971 00001B14 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
   972                              <1> %endif
   973                              <1> 
   974                              <1> %if ELDOTHER
   975                              <1> 	align 2, db 0
   976                              <1> linkerotherdatarelocations:
   977                              <1> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
   978                              <1> 
   979                              <1>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
   980                              <1>   %error Other linker data links not supported
   981                              <1>  %endif
   982                              <1> %endif
   983                              <1> 
   984                              <1> %if ELDOTHER || ELDHINT
   985                              <1> 	align 2, db 0
   986                              <1> debuggeramissig:
   987 00001B16 65636D20<rep 5h>    <1> 		fill 8, 32, db "ecm"
   988 00001B1E 6C446562756720-     <1> 		fill 8, 32, db "lDebug"
   988 00001B1E <rep 2h>            <1>
   989                              <1> %endif
   990                              <1> 
   991                              <1> %ifnidni _LISTING, ""
   992                              <1> listmsg:
   993 00001B26 547261634C6973742D- <1> .hint:		db "TracList-add-offset=",_LISTING,"::"
   993 00001B2F 6164642D6F66667365- <1>
   993 00001B38 743D6C6973742E6C73- <1>
   993 00001B41 743A3A              <1>
   994 00001B44 2D2D2D2D680D0A00    <1> .hint.offset:	asciz "----h",13,10
   995                              <1> %endif
   996                              <1> 
   997 00001B4C 25D71179795F626F6F- <1> 	eldcall_dump_names ELDCALL_CODE_NAMES
   997 00001B55 745F696E69745F6469- <1>
   997 00001B5E 72321527142E2E4079- <1>
   997 00001B67 795F66696C656E616D- <1>
   997 00001B70 655F656D707479D1C6- <1>
   997 00001B79 0C7363616E5F646972- <1>
   997 00001B82 5F6175788ECB0B7265- <1>
   997 00001B8B 61645F736563746F72- <1>
   997 00001B94 4C04186E6561725F74- <1>
   997 00001B9D 72616E736665725F65- <1>
   997 00001BA6 78745F72657475726E- <1>
   997 00001BAF 2C9A15696E7463616C- <1>
   997 00001BB8 6C5F6578745F726574- <1>
   997 00001BC1 75726E5F657322580F- <1>
   997 00001BCA 636D64335F6E6F745F- <1>
   997 00001BD3 696E6A656374683108- <1>
   997 00001BDC 5F646F7363616C6CFF- <1>
   997 00001BE5 8B0F79795F626F6F74- <1>
   997 00001BEE 5F726561642E627863- <1>
   997 00001BF7 E41779795F626F6F74- <1>
   997 00001C00 5F7365656B5F637572- <1>
   997 00001C09 72656E742E62784C4E- <1>
   997 00001C12 1379795F626F6F745F- <1>
   997 00001C1B 70617273655F6E616D- <1>
   997 00001C24 653220660D626F6F74- <1>
   997 00001C2D 5F70617273655F666E- <1>
   997 00001C36 FEFD0B676F745F7979- <1>
   997 00001C3F 656E747279B0CC1672- <1>
   997 00001C48 657472795F6F70656E- <1>
   997 00001C51 5F7363726970747370- <1>
   997 00001C5A 617468B21205736574- <1>
   997 00001C63 726355120570757473- <1>
   997 00001C6C 7ABABD04636D643310- <1>
   997 00001C75 9A1279795F626F6F74- <1>
   997 00001C7E 5F6F70656E5F66696C- <1>
   997 00001C87 6532629605496E444F- <1>
   997 00001C90 530C211179795F646F- <1>
   997 00001C99 735F70617273655F6E- <1>
   997 00001CA2 616D65289004697370- <1>
   997 00001CAB 6D738E0C79795F6F70- <1>
   997 00001CB4 656E5F66696C65794C- <1>
   997 00001CBD 09636C6F73655F6578- <1>
   997 00001CC6 74A45509736B697063- <1>
   997 00001CCF 6F6D6D30E83A066973- <1>
   997 00001CD8 656F6C3F03C3096973- <1>
   997 00001CE1 737472696E673FF123- <1>
   997 00001CEA 097570706572636173- <1>
   997 00001CF3 65B5C60470757463D0- <1>
   997 00001CFC BB1A636F70795F7369- <1>
   997 00001D05 6E676C655F636F756E- <1>
   997 00001D0E 7465645F737472696E- <1>
   997 00001D17 676FA20D707574736C- <1>
   997 00001D20 696E655F63726C66EB- <1>
   997 00001D29 A607646563776F7264- <1>
   997 00001D32 398C08707574736C69- <1>
   997 00001D3B 6E65AD110864656364- <1>
   997 00001D44 776F7264C5C6047075- <1>
   997 00001D4D 7473A7AA056572726F- <1>
   997 00001D56 72D55509736B697063- <1>
   997 00001D5F 6F6D6D618481076865- <1>
   997 00001D68 78776F726498690669- <1>
   997 00001D71 6E7463686B21300A63- <1>
   997 00001D7A 616C6C5F696E743244- <1>
   997 00001D83 B77408736574657332- <1>
   997 00001D8C 6478                <1>
   998 00001D8E 899F0D696E7465726E- <1> 	link_data_dump_names LINK_DATA_NAMES
   998 00001D97 616C666C61677392AA- <1>
   998 00001DA0 136C6F61645F636865- <1>
   998 00001DA9 636B5F6469725F6174- <1>
   998 00001DB2 74720EB5116C6F6164- <1>
   998 00001DBB 5F79796E616D655F69- <1>
   998 00001DC4 6E7075742F75106C6F- <1>
   998 00001DCD 61645F79796E616D65- <1>
   998 00001DD6 5F6E6578746C52106C- <1>
   998 00001DDF 6F61645F79795F6469- <1>
   998 00001DE8 72656E74727938D219- <1>
   998 00001DF1 68616E646C655F7363- <1>
   998 00001DFA 616E5F6469725F6E6F- <1>
   998 00001E03 745F666F756E646B5D- <1>
   998 00001E0C 06646D79636D6494C0- <1>
   998 00001E15 1568616E646C655F73- <1>
   998 00001E1E 63616E5F6469725F65- <1>
   998 00001E27 6E7472793F850E7363- <1>
   998 00001E30 616E5F6469725F656E- <1>
   998 00001E39 74727958B8196E6561- <1>
   998 00001E42 725F7472616E736665- <1>
   998 00001E4B 725F6578745F616464- <1>
   998 00001E54 72657373D6ED176E65- <1>
   998 00001E5D 61725F7472616E7366- <1>
   998 00001E66 65725F6578745F656E- <1>
   998 00001E6F 74727975DD106C6F61- <1>
   998 00001E78 645F6B65726E656C5F- <1>
   998 00001E81 6E616D65CA510E696E- <1>
   998 00001E8A 7465726E616C666C61- <1>
   998 00001E93 6773330F08106C6F61- <1>
   998 00001E9C 645F646174615F6C6F- <1>
   998 00001EA5 77657374227F176C6F- <1>
   998 00001EAE 61645F6164725F6469- <1>
   998 00001EB7 726275665F7365676D- <1>
   998 00001EC0 656E748274096C6F61- <1>
   998 00001EC9 645F646174613B2612- <1>
   998 00001ED2 6578745F696E6A6563- <1>
   998 00001EDB 745F68616E646C6572- <1>
   998 00001EE4 C71C0A6578745F6861- <1>
   998 00001EED 6E646C6584E3086C69- <1>
   998 00001EF6 6E655F6F7574EB4208- <1>
   998 00001EFF 657874647373656CD5- <1>
   998 00001F08 2D066578747365675A- <1>
   998 00001F11 BC086F7074696F6E73- <1>
   998 00001F1A 37E7D30B6578747365- <1>
   998 00001F23 675F75736564B2400C- <1>
   998 00001F2C 657874646174615F75- <1>
   998 00001F35 73656455030F627569- <1>
   998 00001F3E 6C645F6F7074696F6E- <1>
   998 00001F47 5F504D68440E6C696E- <1>
   998 00001F50 6B63616C6C5F746162- <1>
   998 00001F59 6C65F09E227472795F- <1>
   998 00001F62 64656275676765725F- <1>
   998 00001F6B 616D69735F6D756C74- <1>
   998 00001F74 69706C65785F6E756D- <1>
   998 00001F7D 626572CB510E696E74- <1>
   998 00001F86 65726E616C666C6167- <1>
   998 00001F8F 7334688C15616D6973- <1>
   998 00001F98 5F6D756C7469706C65- <1>
   998 00001FA1 785F6E756D626572    <1>
   999                              <1> %if ELDOTHER
  1000                              <1> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1001                              <1> %endif
  1002                              <1> 
  1003                              <1> lmsg:
  1004                              <1> %if _ELD_LINKER_PASSES
  1005                              <1> %if _ELDCALL_OPTIONAL
  1006 00001FA9 214F7074696F6E616C- <1> .warning_code_optional:		counted "Optional code link missing, hash="
  1006 00001FB2 20636F6465206C696E- <1>
  1006 00001FBB 6B206D697373696E67- <1>
  1006 00001FC4 2C20686173683D      <1>
  1007                              <1> %endif
  1008 00001FCB 214F7074696F6E616C- <1> .warning_data_optional:		counted "Optional data link missing, hash="
  1008 00001FD4 2064617461206C696E- <1>
  1008 00001FDD 6B206D697373696E67- <1>
  1008 00001FE6 2C20686173683D      <1>
  1009 00001FED 1844617461206C696E- <1> .error_data:			counted "Data link missing, hash="
  1009 00001FF6 6B206D697373696E67- <1>
  1009 00001FFF 2C20686173683D      <1>
  1010 00002006 18436F6465206C696E- <1> .error_code:			counted "Code link missing, hash="
  1010 0000200F 6B206D697373696E67- <1>
  1010 00002018 2C20686173683D      <1>
  1011 0000201F 0A682C206C6162656C- <1> .error.2:			counted "h, label ",'"'
  1011 00002028 2022                <1>
  1012                              <1> %endif
  1013                              <1> %if ELDOTHER
  1014                              <1> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1015                              <1> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1016                              <1> %endif
  1017                              <1> 
  1018 0000202A 00<rep 6h>          <1> 	align 16, db 0
  2434                                  
  2435                                  	align 16
  2436                                  code_size equ $ - code
