     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> %assign ELDDATA_NEXT_STATUS 0			; not any seen yet
    36                              <2> %assign ELDDATA_NEXT_ENTRY -1
    37                              <2> %assign ELDDATA_NEXT_SECTION -1
    38                              <2> %assign ELDDATA_NEXT_OTHER -1
    39                              <2> 
    40                              <2> 	%imacro internalcoderelocation 0-1.nolist -2
    41                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    42                              <2> %if ELDLINKER
    43                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    44                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    45                              <2>  %else
    46                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    47                              <2>  %endif
    48                              <2> %else
    49                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    50                              <2>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    51                              <2>  %else
    52                              <2>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    53                              <2>  %endif
    54                              <2> %endif
    55                              <2> 	eldstrictcheck
    56                              <2> 	%endmacro
    57                              <2> 
    58                              <2> 	%imacro internaldatarelocation 0-1.nolist -2
    59                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    60                              <2> %if ELDLINKER
    61                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    62                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    63                              <2>  %else
    64                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    65                              <2>  %endif
    66                              <2> %else
    67                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    68                              <2>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    69                              <2>  %else
    70                              <2>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    71                              <2>  %endif
    72                              <2> %endif
    73                              <2> 	eldstrictcheck
    74                              <2> 	%endmacro
    75                              <2> 
    76                              <2> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    77                              <2> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    78                              <2> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    79                              <2> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    80                              <2> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    81                              <2> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    82                              <2> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    83                              <2> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    84                              <2> 
    85                              <2> 
    86                              <2> %define LINK_DATA_RELOCATIONS ""
    87                              <2> %define LINK_LINKER_DATA_RELOCATIONS ""
    88                              <2> %define LINK_DATA_NAMES db ""
    89                              <2> %define LINK_DATA_DETECTION none, none
    90                              <2> 
    91                              <2> %define LINK_OTHER_DATA_RELOCATIONS ""
    92                              <2> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    93                              <2> %define LINK_OTHER_DATA_NAMES db ""
    94                              <2> %define LINK_OTHER_DATA_DETECTION none, none
    95                              <2> 
    96                              <2> %ifndef ELDOTHER
    97                              <2>  %assign ELDOTHER 0
    98                              <2> %endif
    99                              <2> %assign ELDOTHERLINK 0
   100                              <2> 
   101                              <2> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
   102                              <2> %if ELDOTHER
   103                              <2>  %assign ELDOTHERLINK 1
   104                              <2> %endif
   105                              <2> 	linkdatarelocation %1, %2, %3
   106                              <2> %assign ELDOTHERLINK 0
   107                              <2> 	%endmacro
   108                              <2> 
   109                              <2> 	%imacro linkdatarelocation 1-4.nolist -2, required, single
   110                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   111                              <2> %ifidni %3, required
   112                              <2>  %assign %%optional 0
   113                              <2> %elifidni %3, optional
   114                              <2>  %assign %%optional 100h
   115                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   116                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   117                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   118                              <2>  %else
   119                              <2>   %error Optional data link not allowed here
   120                              <2>  %endif
   121                              <2> %elifidni %3, PM required
   122                              <2>  %assign %%optional 300h
   123                              <2>  %assign ELDDATA_PMREQUIRED_STATUS 1
   124                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   125                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   126                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   127                              <2>  %else
   128                              <2>   %error Optional data link not allowed here
   129                              <2>  %endif
   130                              <2> %else
   131                              <2>  %fatal Unknown optional keyword
   132                              <2> %endif
   133                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
   134                              <2>  %assign %%DATASECTION 1
   135                              <2> %else
   136                              <2>  %assign %%DATASECTION 0
   137                              <2> %endif
   138                              <2> %ifidni %4, single
   139                              <2>  %if ELDDATA_NEXT_STATUS == 1		; after next ?
   140                              <2>   %error Unexpected single data link after next data link
   141                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   142                              <2>   %assign ELDDATA_NEXT_STATUS 3		; note single with next/last present
   143                              <2>  %endif
   144                              <2>  %assign %%next 0
   145                              <2> %elifidni %4, next
   146                              <2>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   147                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   148                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   149                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   150                              <2>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   151                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   152                              <2>  %elif ELDDATA_NEXT_STATUS == 1		; repeated next ?
   153                              <2>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   156                              <2>    %error Unexpected next data link
   157                              <2>   %endif
   158                              <2>  %else
   159                              <2>   %error Next data link not allowed here
   160                              <2>  %endif
   161                              <2>  %ifn %%optional
   162                              <2>   %error Next data link only valid as optional or PM required
   163                              <2>  %endif
   164                              <2>  %assign %%next 400h
   165                              <2>  %assign ELDDATA_NEXT_ENTRY %%entry
   166                              <2>  %assign ELDDATA_NEXT_SECTION %%DATASECTION
   167                              <2>  %assign ELDDATA_NEXT_OTHER ELDOTHERLINK
   168                              <2> %elifidni %4, last
   169                              <2>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   170                              <2>   %error Next last data link not allowed here
   171                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   172                              <2>   %error Next last data link not allowed here
   173                              <2>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   174                              <2>   %error Next last data link not allowed here
   175                              <2>  %elif ELDDATA_NEXT_STATUS == 1		; after next ?
   176                              <2>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   179                              <2>    %error Unexpected next data link
   180                              <2>   %endif
   181                              <2>   %assign ELDDATA_NEXT_STATUS 2		; note now after last
   182                              <2>  %else
   183                              <2>   %error Next data link not allowed here
   184                              <2>  %endif
   185                              <2>  %assign %%next 800h
   186                              <2>  %assign ELDDATA_NEXT_ENTRY -1
   187                              <2>  %assign ELDDATA_NEXT_SECTION -1
   188                              <2> %else
   189                              <2>  %fatal Unknown next keyword
   190                              <2> %endif
   191                              <2> 	%if ELDOTHERLINK
   192                              <2> %if ELDLINKER
   193                              <2>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   194                              <2> %else
   195                              <2>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   196                              <2> %endif
   197                              <2> 	%else
   198                              <2> %if ELDLINKER
   199                              <2>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   200                              <2> %else
   201                              <2>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   202                              <2> %endif
   203                              <2> 	%endif
   204                              <2> %defstr %%string %1
   205                              <2> %strlen %%length %%string
   206                              <2> %if %%length > 64
   207                              <2> 	; Could be increased, but mustn't exceed 127 bytes
   208                              <2> 	;  because flag 80h is used to mark optional links
   209                              <2> 	;  that failed to be matched.
   210                              <2>  %error Too long link name: %1
   211                              <2> %endif
   212                              <2> %define LINK_DATA_CHECK %1
   213                              <2> 	%if ELDOTHERLINK
   214                              <2> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   215                              <2> %if LINK_DATA_NEW
   216                              <2>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   217                              <2> 	hashdef HASH, %%string
   218                              <2>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   220                              <2> %else
   221                              <2>  %%name equ LINK_DATA_DUPLICATE
   222                              <2> %endif
   223                              <2> 	%else
   224                              <2> 	linkdata_detect LINK_DATA_DETECTION
   225                              <2> %if LINK_DATA_NEW
   226                              <2>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   227                              <2> 	hashdef HASH, %%string
   228                              <2>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   230                              <2> %else
   231                              <2>  %%name equ LINK_DATA_DUPLICATE
   232                              <2> %endif
   233                              <2> 	%endif
   234                              <2> 	eldstrictcheck
   235                              <2> 	%endmacro
   236                              <2> 
   237                              <2> 	%imacro linkdata_detect 2-*.nolist
   238                              <2> %assign LINK_DATA_NEW 1
   239                              <2> %rep (%0 - 2) / 2
   240                              <2>  %rotate 2
   241                              <2>  %ifidni %1, LINK_DATA_CHECK
   242                              <2>   %assign LINK_DATA_NEW 0
   243                              <2>   %xdefine LINK_DATA_DUPLICATE %2
   244                              <2>   %exitrep
   245                              <2>  %endif
   246                              <2> %endrep
   247                              <2> 	%endmacro
   248                              <2> 
   249                              <2> 	%imacro link_data_dump_names 1-*.nolist
   250                              <2> %rep %0
   251                              <2> 	%1
   252                              <2>  %rotate 1
   253                              <2> %endrep
   254                              <2> 	%endmacro
   255                              <2> 
   256                              <2> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   257                              <2> ; dw LINK_DATA_RELOCATIONS, 0, 0
   258                              <2> ; link_data_dump_names ELDCALL_CODE_NAMES
   259                              <2> 
   260                              <2> %endif
    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> %assign ELDCALL_NEXT_STATUS 0			; not any seen yet
    55                              <1> %assign ELDCALL_NEXT_ENTRY -1
    56                              <1> 
    57                              <1> 	%imacro extcall 1-3.nolist required, single
    58                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
    59                              <1>  %error "ELD call cannot be used in ELD data block"
    60                              <1> %endif
    61                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP
    62                              <1> %ifidni %2, required
    63                              <1>  %assign %%optional 0
    64                              <1> %elifidni %2, optional
    65                              <1>  %assign %%optional 100h
    66                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    67                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    68                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    69                              <1>  %else
    70                              <1>   %error Optional code link not allowed here
    71                              <1>  %endif
    72                              <1> %elifidni %2, PM required
    73                              <1>  %assign %%optional 300h
    74                              <1>  %assign ELDCALL_PMREQUIRED_STATUS 1
    75                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    76                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    77                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    78                              <1>  %else
    79                              <1>   %error Optional code link not allowed here
    80                              <1>  %endif
    81                              <1> %else
    82                              <1>  %fatal Unknown optional keyword
    83                              <1> %endif
    84                              <1> %ifidni %3, single
    85                              <1>  %if ELDCALL_NEXT_STATUS == 1		; after next ?
    86                              <1>   %error Unexpected single code link after next code link
    87                              <1>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
    88                              <1>   %assign ELDCALL_NEXT_STATUS 3		; note single with next/last present
    89                              <1>  %endif
    90                              <1>  %assign %%next 0
    91                              <1> %elifidni %3, next
    92                              <1>  %if ELDCALL_NEXT_STATUS == 0		; no next/last yet ?
    93                              <1>   %assign ELDCALL_NEXT_STATUS 1		; in next
    94                              <1>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
    95                              <1>   %assign ELDCALL_NEXT_STATUS 1		; in next
    96                              <1>  %elif ELDCALL_NEXT_STATUS == 3		; after single ?
    97                              <1>   %assign ELDCALL_NEXT_STATUS 1		; in next
    98                              <1>  %elif ELDCALL_NEXT_STATUS == 1		; repeated next ?
    99                              <1>   %if ELDCALL_NEXT_ENTRY != %%entry
   100                              <1>    %error Unexpected next code link
   101                              <1>   %endif
   102                              <1>  %else
   103                              <1>   %error Next code link not allowed here
   104                              <1>  %endif
   105                              <1>  %ifn %%optional
   106                              <1>   %error Next code link only valid as optional or PM required
   107                              <1>  %endif
   108                              <1>  %assign %%next 400h
   109                              <1>  %assign ELDCALL_NEXT_ENTRY %%entry
   110                              <1> %elifidni %3, last
   111                              <1>  %if ELDCALL_NEXT_STATUS == 0		; no next/last yet ?
   112                              <1>   %error Next last code link not allowed here
   113                              <1>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
   114                              <1>   %error Next last code link not allowed here
   115                              <1>  %elif ELDCALL_NEXT_STATUS == 3		; after single ?
   116                              <1>   %error Next last code link not allowed here
   117                              <1>  %elif ELDCALL_NEXT_STATUS == 1		; after next ?
   118                              <1>   %if ELDCALL_NEXT_ENTRY != %%entry
   119                              <1>    %error Unexpected next code link
   120                              <1>   %endif
   121                              <1>   %assign ELDCALL_NEXT_STATUS 2		; note now after last
   122                              <1>  %else
   123                              <1>   %error Next code link not allowed here
   124                              <1>  %endif
   125                              <1>  %assign %%next 800h
   126                              <1>  %assign ELDCALL_NEXT_ENTRY -1
   127                              <1>  %assign ELDCALL_NEXT_SECTION -1
   128                              <1> %else
   129                              <1>  %fatal Unknown next keyword
   130                              <1> %endif
   131                              <1> %if %%next != 400h
   132                              <1> %if 0
   133                              <1> [warning -reloc-rel-word]
   134                              <1> 	call near relocatedzero
   135                              <1> [warning +reloc-rel-word]
   136                              <1> %else
   137                              <1> 	db 0E8h
   138                              <1> reloc	dw relocatedzero
   139                              <1> 	eldstrictcheck
   140                              <1> %endif
   141                              <1> 	jmp strict short %%skipparameter
   142                              <1> 	dw 0
   143                              <1> %%skipparameter:
   144                              <1> %endif
   145                              <1> %if ELDLINKER
   146                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS ELDCALL_LINKER_CODE_RELOCATIONS, %%entry, %%name
   147                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional + %%next, %%entry, %%name
   148                              <1> %else
   149                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS ELDCALL_CODE_RELOCATIONS, %%entry, %%name
   150                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS_OPTIONAL ELDCALL_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional + %%next, %%entry, %%name
   151                              <1> %endif
   152                              <1> %defstr %%string %1
   153                              <1> %strlen %%length %%string
   154                              <1> %if %%length > 64
   155                              <1> 	; Could be increased, but mustn't exceed 127 bytes
   156                              <1> 	;  because flag 80h is used to mark optional links
   157                              <1> 	;  that failed to be matched.
   158                              <1>  %error Too long link name: %1
   159                              <1> %endif
   160                              <1> %define ELDCALL_CODE_CHECK %1
   161                              <1> 	linkcode_detect ELDCALL_CODE_DETECTION
   162                              <1> %if ELDCALL_CODE_NEW
   163                              <1>  %xdefine ELDCALL_CODE_DETECTION ELDCALL_CODE_DETECTION, %1, %%name
   164                              <1> 	hashdef HASH, %%string
   165                              <1> %xdefine ELDCALL_CODE_NAMES 	ELDCALL_CODE_NAMES, %%name:, dw _HASH, {counted %%string}
   167                              <1> %else
   168                              <1>  %%name equ ELDCALL_CODE_DUPLICATE
   169                              <1> %endif
   170                              <1> 	%endmacro
   171                              <1> 
   172                              <1> 	%imacro linkcode_detect 2-*.nolist
   173                              <1> %assign ELDCALL_CODE_NEW 1
   174                              <1> %rep (%0 - 2) / 2
   175                              <1>  %rotate 2
   176                              <1>  %ifidni %1, ELDCALL_CODE_CHECK
   177                              <1>   %assign ELDCALL_CODE_NEW 0
   178                              <1>   %xdefine ELDCALL_CODE_DUPLICATE %2
   179                              <1>   %exitrep
   180                              <1>  %endif
   181                              <1> %endrep
   182                              <1> 	%endmacro
   183                              <1> 
   184                              <1> 
   185                              <1> %define ELDCALL_CALLCALL_LIST none
   186                              <1> %define ELDCALL_CALLCALL_PROCESSED_PRIOR ""
   187                              <1> 
   188                              <1> 	%imacro extcallcall 1.nolist
   189                              <1> 	call %1
   190                              <1> %xdefine ELDCALL_CALLCALL_LIST ELDCALL_CALLCALL_LIST, %1
   191                              <1> 	%endmacro
   192                              <1> 
   193                              <1> %assign ELDCALLCALL_DUMPED 0
   194                              <1> 
   195                              <1> 	%imacro eldcall_dump_callcall 1-*.nolist
   196                              <1> %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED_PRIOR
   197                              <1>  %rep %0 - 1
   198                              <1>   %rotate 1
   199                              <1>   %define ELDCALL_CHECK %1
   200                              <1> 	eldcall_callcall_detect ELDCALL_CALLCALL_PROCESSED
   201                              <1>   %if ELDCALL_NEW
   202                              <1>    %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED, %1
   203                              <1> 	align 8, nop
   204                              <1> %1:
   205                              <1> 	extcall %1
   206                              <1> 	retn
   207                              <1>   %endif
   208                              <1>  %endrep
   209                              <1> %assign ELDCALLCALL_DUMPED 1
   210                              <1> %define ELDCALL_CALLCALL_LIST none
   211                              <1> 	%endmacro
   212                              <1> 
   213                              <1> 	%imacro eldcall_new_callcall 0.nolist
   214                              <1> %if ELDCALLCALL_DUMPED
   215                              <1>  %xdefine ELDCALL_CALLCALL_PROCESSED_PRIOR   ELDCALL_CALLCALL_PROCESSED_PRIOR, ELDCALL_CALLCALL_PROCESSED
   217                              <1>  %assign ELDCALLCALL_DUMPED 0
   218                              <1>  %define ELDCALL_CALLCALL_LIST none
   219                              <1> %endif
   220                              <1> 	%endmacro
   221                              <1> 
   222                              <1> 	%imacro eldcall_callcall_detect 1-*.nolist
   223                              <1> %assign ELDCALL_NEW 1
   224                              <1> %rep %0
   225                              <1>  %ifidni %1, ELDCALL_CHECK
   226                              <1>   %assign ELDCALL_NEW 0
   227                              <1>   %exitrep
   228                              <1>  %endif
   229                              <1>  %rotate 1
   230                              <1> %endrep
   231                              <1> 	%endmacro
   232                              <1> 
   233                              <1> 	%imacro eldcall_dump_names 1-*.nolist
   234                              <1> %rep %0
   235                              <1> 	%1
   236                              <1>  %rotate 1
   237                              <1> %endrep
   238                              <1> 	%endmacro
   239                              <1> 
   240                              <1> ; eldcall_dump_callcall ELDCALL_CALLCALL_LIST
   241                              <1> ; if using optional code links:
   242                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   243                              <1> ;  dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   244                              <1> ; if not using optional code links:
   245                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   246                              <1> ;  dw ELDCALL_CODE_RELOCATIONS, 0, 0
   247                              <1> ; eldcall_dump_names ELDCALL_CODE_NAMES
   248                              <1> 
   249                              <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> %assign ELDDATA_NEXT_STATUS 0			; not any seen yet
    36                              <1> %assign ELDDATA_NEXT_ENTRY -1
    37                              <1> %assign ELDDATA_NEXT_SECTION -1
    38                              <1> %assign ELDDATA_NEXT_OTHER -1
    39                              <1> 
    40                              <1> 	%imacro internalcoderelocation 0-1.nolist -2
    41                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    42                              <1> %if ELDLINKER
    43                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    44                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    45                              <1>  %else
    46                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    47                              <1>  %endif
    48                              <1> %else
    49                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    50                              <1>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    51                              <1>  %else
    52                              <1>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    53                              <1>  %endif
    54                              <1> %endif
    55                              <1> 	eldstrictcheck
    56                              <1> 	%endmacro
    57                              <1> 
    58                              <1> 	%imacro internaldatarelocation 0-1.nolist -2
    59                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    60                              <1> %if ELDLINKER
    61                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    62                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    63                              <1>  %else
    64                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    65                              <1>  %endif
    66                              <1> %else
    67                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    68                              <1>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    69                              <1>  %else
    70                              <1>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    71                              <1>  %endif
    72                              <1> %endif
    73                              <1> 	eldstrictcheck
    74                              <1> 	%endmacro
    75                              <1> 
    76                              <1> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    77                              <1> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    78                              <1> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    79                              <1> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    80                              <1> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    81                              <1> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    82                              <1> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    83                              <1> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    84                              <1> 
    85                              <1> 
    86                              <1> %define LINK_DATA_RELOCATIONS ""
    87                              <1> %define LINK_LINKER_DATA_RELOCATIONS ""
    88                              <1> %define LINK_DATA_NAMES db ""
    89                              <1> %define LINK_DATA_DETECTION none, none
    90                              <1> 
    91                              <1> %define LINK_OTHER_DATA_RELOCATIONS ""
    92                              <1> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    93                              <1> %define LINK_OTHER_DATA_NAMES db ""
    94                              <1> %define LINK_OTHER_DATA_DETECTION none, none
    95                              <1> 
    96                              <1> %ifndef ELDOTHER
    97                              <1>  %assign ELDOTHER 0
    98                              <1> %endif
    99                              <1> %assign ELDOTHERLINK 0
   100                              <1> 
   101                              <1> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
   102                              <1> %if ELDOTHER
   103                              <1>  %assign ELDOTHERLINK 1
   104                              <1> %endif
   105                              <1> 	linkdatarelocation %1, %2, %3
   106                              <1> %assign ELDOTHERLINK 0
   107                              <1> 	%endmacro
   108                              <1> 
   109                              <1> 	%imacro linkdatarelocation 1-4.nolist -2, required, single
   110                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   111                              <1> %ifidni %3, required
   112                              <1>  %assign %%optional 0
   113                              <1> %elifidni %3, optional
   114                              <1>  %assign %%optional 100h
   115                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   116                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   117                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   118                              <1>  %else
   119                              <1>   %error Optional data link not allowed here
   120                              <1>  %endif
   121                              <1> %elifidni %3, PM required
   122                              <1>  %assign %%optional 300h
   123                              <1>  %assign ELDDATA_PMREQUIRED_STATUS 1
   124                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   125                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   126                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   127                              <1>  %else
   128                              <1>   %error Optional data link not allowed here
   129                              <1>  %endif
   130                              <1> %else
   131                              <1>  %fatal Unknown optional keyword
   132                              <1> %endif
   133                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
   134                              <1>  %assign %%DATASECTION 1
   135                              <1> %else
   136                              <1>  %assign %%DATASECTION 0
   137                              <1> %endif
   138                              <1> %ifidni %4, single
   139                              <1>  %if ELDDATA_NEXT_STATUS == 1		; after next ?
   140                              <1>   %error Unexpected single data link after next data link
   141                              <1>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   142                              <1>   %assign ELDDATA_NEXT_STATUS 3		; note single with next/last present
   143                              <1>  %endif
   144                              <1>  %assign %%next 0
   145                              <1> %elifidni %4, next
   146                              <1>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   147                              <1>   %assign ELDDATA_NEXT_STATUS 1		; in next
   148                              <1>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   149                              <1>   %assign ELDDATA_NEXT_STATUS 1		; in next
   150                              <1>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   151                              <1>   %assign ELDDATA_NEXT_STATUS 1		; in next
   152                              <1>  %elif ELDDATA_NEXT_STATUS == 1		; repeated next ?
   153                              <1>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   156                              <1>    %error Unexpected next data link
   157                              <1>   %endif
   158                              <1>  %else
   159                              <1>   %error Next data link not allowed here
   160                              <1>  %endif
   161                              <1>  %ifn %%optional
   162                              <1>   %error Next data link only valid as optional or PM required
   163                              <1>  %endif
   164                              <1>  %assign %%next 400h
   165                              <1>  %assign ELDDATA_NEXT_ENTRY %%entry
   166                              <1>  %assign ELDDATA_NEXT_SECTION %%DATASECTION
   167                              <1>  %assign ELDDATA_NEXT_OTHER ELDOTHERLINK
   168                              <1> %elifidni %4, last
   169                              <1>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   170                              <1>   %error Next last data link not allowed here
   171                              <1>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   172                              <1>   %error Next last data link not allowed here
   173                              <1>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   174                              <1>   %error Next last data link not allowed here
   175                              <1>  %elif ELDDATA_NEXT_STATUS == 1		; after next ?
   176                              <1>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   179                              <1>    %error Unexpected next data link
   180                              <1>   %endif
   181                              <1>   %assign ELDDATA_NEXT_STATUS 2		; note now after last
   182                              <1>  %else
   183                              <1>   %error Next data link not allowed here
   184                              <1>  %endif
   185                              <1>  %assign %%next 800h
   186                              <1>  %assign ELDDATA_NEXT_ENTRY -1
   187                              <1>  %assign ELDDATA_NEXT_SECTION -1
   188                              <1> %else
   189                              <1>  %fatal Unknown next keyword
   190                              <1> %endif
   191                              <1> 	%if ELDOTHERLINK
   192                              <1> %if ELDLINKER
   193                              <1>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   194                              <1> %else
   195                              <1>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   196                              <1> %endif
   197                              <1> 	%else
   198                              <1> %if ELDLINKER
   199                              <1>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   200                              <1> %else
   201                              <1>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   202                              <1> %endif
   203                              <1> 	%endif
   204                              <1> %defstr %%string %1
   205                              <1> %strlen %%length %%string
   206                              <1> %if %%length > 64
   207                              <1> 	; Could be increased, but mustn't exceed 127 bytes
   208                              <1> 	;  because flag 80h is used to mark optional links
   209                              <1> 	;  that failed to be matched.
   210                              <1>  %error Too long link name: %1
   211                              <1> %endif
   212                              <1> %define LINK_DATA_CHECK %1
   213                              <1> 	%if ELDOTHERLINK
   214                              <1> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   215                              <1> %if LINK_DATA_NEW
   216                              <1>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   217                              <1> 	hashdef HASH, %%string
   218                              <1>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   220                              <1> %else
   221                              <1>  %%name equ LINK_DATA_DUPLICATE
   222                              <1> %endif
   223                              <1> 	%else
   224                              <1> 	linkdata_detect LINK_DATA_DETECTION
   225                              <1> %if LINK_DATA_NEW
   226                              <1>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   227                              <1> 	hashdef HASH, %%string
   228                              <1>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   230                              <1> %else
   231                              <1>  %%name equ LINK_DATA_DUPLICATE
   232                              <1> %endif
   233                              <1> 	%endif
   234                              <1> 	eldstrictcheck
   235                              <1> 	%endmacro
   236                              <1> 
   237                              <1> 	%imacro linkdata_detect 2-*.nolist
   238                              <1> %assign LINK_DATA_NEW 1
   239                              <1> %rep (%0 - 2) / 2
   240                              <1>  %rotate 2
   241                              <1>  %ifidni %1, LINK_DATA_CHECK
   242                              <1>   %assign LINK_DATA_NEW 0
   243                              <1>   %xdefine LINK_DATA_DUPLICATE %2
   244                              <1>   %exitrep
   245                              <1>  %endif
   246                              <1> %endrep
   247                              <1> 	%endmacro
   248                              <1> 
   249                              <1> 	%imacro link_data_dump_names 1-*.nolist
   250                              <1> %rep %0
   251                              <1> 	%1
   252                              <1>  %rotate 1
   253                              <1> %endrep
   254                              <1> 	%endmacro
   255                              <1> 
   256                              <1> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   257                              <1> ; dw LINK_DATA_RELOCATIONS, 0, 0
   258                              <1> ; link_data_dump_names ELDCALL_CODE_NAMES
   259                              <1> 
   260                              <1> %endif
    10                                  
    11                                  %assign _CATCHINT0C 0
    12                                  %assign _CATCHINT0D 0
    13                                  %assign _CATCHINTFAULTCOND 0
    14                                  %assign _LOADER 0
    15                                  %assign _DEBUG 0
    16                                  %assign _DELAY_BEFORE_BP 0
    17                                  %assign _DHIGHLIGHT 0
    18                                  %assign _GETLINEHIGHLIGHT 0
    19                                  %assign _IMMASM 0
    20                                  %assign _INPUT_FILE_BOOT 0
    21                                  %assign _INPUT_FILE_HANDLES 0
    22                                  %assign _MS_0RANGE_COMPAT 0
    23                                  %assign _PM 0
    24                                  %assign _RH 0
    25                                  %assign _SYMBOLIC 0
    26                                  %assign _VXCHG 0
    27                                  %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-2025 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_debug_run:			equ 200h
   203                              <1> opt7_no_ensure:			equ 1000h
   204                              <1> opt7_no_tsr_ll:			equ 2000h
   205                              <1> 
   206                              <1> 
   207                              <1> oldpacket	equ	  1	; Int25/Int26 packet method available (L, W)
   208                              <1> newpacket	equ	  2	; Int21.7305 packet method available (L, W)
   209                              <1> ntpacket	equ	  4	; VDD registered and usable (L, W)
   210                              <1> pagedcommand	equ	  8	; allows paging in puts
   211                              <1> notstdinput	equ	 10h	; DEBUG's StdIn isn't a device with StdIn bit (is file or other device)
   212                              <1> inputfile	equ	 20h	; DEBUG's StdIn is a file, notstdinput also set
   213                              <1> notstdoutput	equ	 40h	; DEBUG's StdOut isn't a device with StdOut bit (is file or other device)
   214                              <1> outputfile	equ	  80h	; DEBUG's StdOut is a file, notstdoutput also set
   215                              <1> hooked2F	equ	 100h	; Int2F hooked
   216                              <1> nohook2F	equ	 200h	; don't hook Int2F.1687 (required for Win9x, DosEmu?)
   217                              <1> unused_dif1_dpminohlt equ 400h	; DPMI doesn't like hlt
   218                              <1> protectedmode	equ	 800h	; in (DPMI) protected mode
   219                              <1> debuggeeA20	equ	1000h	; state of debuggee's A20
   220                              <1> debuggerA20	equ	2000h	; state of debugger's A20 (will be on if possible)
   221                              <1> nodosloaded	equ	4000h	; No DOS loaded currently (Boot loader mode)
   222                              <1> has386		equ	8000h	; CPU is a 386
   223                              <1> usecharcounter	equ    1_0000h	; don't reset charcounter between calls to puts
   224                              <1> runningnt	equ    2_0000h	; running in NTVDM
   225                              <1> canswitchmode	equ    4_0000h	; can switch modes (auxbuff large enough, DPMI mode switch set up)
   226                              <1> modeswitched	equ    8_0000h	; switched mode (now in the mode that we weren't entered in)
   227                              <1> promptwaiting	equ   10_0000h	; puts: any more output needs to display a prompt first
   228                              <1> switchbuffer	equ   20_0000h	; mode switch needs a buffer (auxbuff)
   229                              <1> tsrmode		equ   40_0000h	; in TSR mode; DPI and DPP not valid
   230                              <1> attachedterm	equ   80_0000h	; the attached process terminated
   231                              <1> runningdosemu	equ  100_0000h	; running in dosemu
   232                              <1> ; load_is_ldp	equ  200_0000h	; boot load: partition specified as "ldp"
   233                              <1> tt_while:	equ  400_0000h	; tt: while condition specified
   234                              <1> tt_p:		equ  800_0000h	; tt: proceed past repeated string instructions
   235                              <1> tt_silent_mode:	equ 1000_0000h	; tt: run should be silent (dump at end)
   236                              <1> tt_silence:	equ 2000_0000h	; tt: silent writing (write to auxbuff instead)
   237                              <1> tt_no_bb:	equ 4000_0000h	; tt: do not use bb breakpoints
   238                              <1> tt_no_bb_first:	equ 8000_0000h	; tt: do not use bb breakpoints at first
   239                              <1> 
   240                              <1> 
   241                              <1> dif2_gg_is_first:	equ   1
   242                              <1> dif2_gg_skip_non_cseip:	equ   2
   243                              <1> dif2_gg_skip_cseip:	equ   4
   244                              <1> dif2_gg_is_gg:		equ   8
   245                              <1> dif2_gg_first_detected:	equ  10h
   246                              <1> dif2_gg_again:		equ  20h
   247                              <1> dif2_tpg_proceed_bp_set:equ  40h
   248                              <1> dif2_tpg_keep_proceed_bp: equ 80h
   249                              <1> dif2_tpg_have_bp:	equ 100h
   250                              <1> dif2_tpg_adjusted_cseip:equ 200h
   251                              <1> dif2_tpg_do_not_adjust:	equ 400h
   252                              <1> dif2_bp_failure:	equ 800h
   253                              <1> dif2_is_pp:		equ 1000h
   254                              <1> %if _SYMBOLIC
   255                              <1> dif2_createdprocess:	equ 800_0000h	; created empty debuggee process
   256                              <1> dif2_sym_req_xms:	equ 2000h
   257                              <1> dif2_sym_req_86mm:	equ 4000h
   258                              <1> dif2_sym_req_mask equ dif2_sym_req_86mm | dif2_sym_req_xms
   259                              <1> dif2_no_pm_xms:		equ 1_0000h
   260                              <1> dif2_xms_detection_done:equ 2_0000h
   261                              <1> %endif
   262                              <1> %if _INPUT_FILE_HANDLES
   263                              <1> dif2_input_file:	equ 10_0000h
   264                              <1> dif2_closed_input_file:	equ 20_0000h
   265                              <1> %endif
   266                              <1> dif2_did_getline_file:	equ 40_0000h
   267                              <1> %if _SYMBOLIC
   268                              <1> dif2_poison:		equ 80_0000h
   269                              <1> %endif
   270                              <1> dif2_boot_loaded_kernel:equ 100_0000h
   271                              <1> %if _INPUT_FILE_BOOT
   272                              <1> dif2_input_file_boot:	equ 200_0000h
   273                              <1> dif2_closed_input_file_boot:	equ 400_0000h
   274                              <1> %endif
   275                              <1> dif2_in_silence_dump:	equ 1000_0000h
   276                              <1> dif2_int31_segment:	equ 2000_0000h
   277                              <1> dif2_nn_compat:		equ 4000_0000h
   278                              <1> dif2_nn_capitalise:	equ 8000_0000h
   279                              <1> 
   280                              <1> 
   281                              <1> dif3_load_is_ldp:	equ 1	; boot load: partition specified as "ldp"
   282                              <1> dif3_load_is_sdp:	equ 2	; boot load: partition specified as "sdp"
   283                              <1> dif3_load_is_ydp:	equ 4	; boot load: partition specified as "ydp"
   284                              <1> dif3_load_is_dp:	equ dif3_load_is_ldp 				| dif3_load_is_sdp 				| dif3_load_is_ydp
   287                              <1> dif3_load_dir_dir:	equ 8
   288                              <1> dif3_input_terminal_override:	equ 10h
   289                              <1> dif3_input_serial_override:	equ 20h
   290                              <1> dif3_if_not:		equ 40h
   291                              <1> dif3_partition_changed:	equ 80h
   292                              <1> ;
   293                              <1> dif3_input_cmdline:	equ 100h; input reading from cmdline_buffer
   294                              <1> dif3_input_cmdline_closed: equ 200h
   295                              <1> dif3_at_line_end:	equ 400h
   296                              <1> dif3_quiet_input_single:equ 800h
   297                              <1> dif3_quiet_output:	equ 1000h
   298                              <1> dif3_unquiet_error:	equ 2000h
   299                              <1> dif3_unquiet_prompt:	equ 4000h
   300                              <1> dif3_unquiet:		equ dif3_unquiet_error | dif3_unquiet_prompt
   301                              <1> dif3_return_eof:	equ 8000h
   302                              <1> dif3_highlighting:	equ 1_0000h
   303                              <1> dif3_do_not_highlight:	equ 2_0000h
   304                              <1> dif3_int10_highlight:	equ 2_0000h
   305                              <1> dif3_nosymbols_1:	equ 4_0000h
   306                              <1> dif3_nosymbols_2:	equ 8_0000h
   307                              <1> %if _PM
   308                              <1> dif3_ss_b_bit_set:	equ  10_0000h
   309                              <1> %endif
   310                              <1> dif3_gotint19:		equ  20_0000h
   311                              <1> dif3_prior_pm:		equ  40_0000h
   312                              <1> %if _DELAY_BEFORE_BP
   313                              <1> dif3_delayed		equ  80_0000h
   314                              <1> %endif
   315                              <1> dif3_input_re:		equ 100_0000h	; input reading from re_buffer
   316                              <1> dif3_input_re_closed:	equ 200_0000h
   317                              <1> dif3_accept_getrange_0:	equ 400_0000h
   318                              <1> %if _INPUT_FILE_HANDLES || _INPUT_FILE_BOOT
   319                              <1> dif3_in_if:		equ 800_0000h
   320                              <1> %endif
   321                              <1> dif3_auxbuff_guarded_1:	equ 1000_0000h
   322                              <1> dif3_auxbuff_guarded_2:	equ 2000_0000h
   323                              <1> dif3_auxbuff_guarded_3:	equ 4000_0000h
   324                              <1> dif3_sss_is_reverse:	equ 8000_0000h
   325                              <1> 
   326                              <1> 
   327                              <1> dif4_int_serial_hooked:	equ 1
   328                              <1> dif4_int_2F_hooked:	equ 2
   329                              <1> dif4_int_08_hooked:	equ 4
   330                              <1> dif4_int_2D_hooked:	equ 8
   331                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0D
   332                              <1> dif4_int_0D_hooked:	equ 10h
   333                              <1> %endif
   334                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0C
   335                              <1> dif4_int_0C_hooked:	equ 20h
   336                              <1> %endif
   337                              <1> %if _LOADER
   338                              <1> dif4_int_18_hooked:	equ 1000h
   339                              <1> dif4_int_19_hooked:	equ 2000h
   340                              <1> %endif
   341                              <1> 
   342                              <1> 
   343                              <1> %if _VXCHG
   344                              <1> dif6_vv_mode:		equ 1
   345                              <1> %endif
   346                              <1> dif6_in_hook2F:		equ 2
   347                              <1> dif6_in_amis_hook2F:	equ 4
   348                              <1> dif6_debug_mode:	equ 100h
   349                              <1> dif6_locked:		equ 200h
   350                              <1> dif6_mcp:		equ 400h
   351                              <1> %if _RH
   352                              <1> dif6_rh_mode_was:	equ  8_0000h
   353                              <1> dif6_rh_mode:		equ 10_0000h
   354                              <1> dif6_rh_mode_2:		equ 20_0000h
   355                              <1> %endif
   356                              <1> dif6_device_mode:	equ 40_0000h
   357                              <1> dif6_cpdepchars:	equ 80_0000h
   358                              <1> %if _IMMASM
   359                              <1> dif6_immasm_no_output:	equ 100_0000h
   360                              <1> dif6_immasm:		equ 200_0000h
   361                              <1> dif6_immasm_rel8:	equ 400_0000h
   362                              <1> %endif
   363                              <1> 
   364                              <1> 
   365                              <1> disasm_lowercase	equ 1
   366                              <1> disasm_commablank	equ 2
   367                              <1> disasm_nasm		equ 4
   368                              <1> disasm_lowercase_refmem:equ 8
   369                              <1> disasm_show_short:	equ 10h
   370                              <1> disasm_show_near:	equ 20h
   371                              <1> disasm_show_far:	equ 40h
   372                              <1> disasm_nec:		equ 80h
   373                              <1> disasm_40_columns:	equ 100h
   374                              <1> disasm_no_indent:	equ 200h
   375                              <1> disasm_msdebug_mnemonofs: equ 400h
   376                              <1> disasm_a16_memref:	equ 1000h
   377                              <1> disasm_a32_memref:	equ 2000h
   378                              <1> disasm_a16_string:	equ 4000h
   379                              <1> disasm_a32_string:	equ 8000h
   380                              <1> disasm_hide_modrm:	equ 10000h
   381                              <1> disasm_asize_loop_nasm:	equ 20000h
   382                              <1> disasm_modrm_always:	equ 40000h
   383                              <1> DEFAULTASMOPTIONS equ disasm_lowercase|disasm_commablank|disasm_nasm 	| disasm_a16_memref | disasm_a32_memref 	| disasm_a16_string | disasm_a32_string
   386                              <1> 
   387                              <1> 	; serial_flags values
   388                              <1> sf_init_done:	equ 1
   389                              <1> sf_ctrl_c:	equ 2
   390                              <1> sf_double_ctrl_c:	equ 4
   391                              <1> sf_built_in_fifo:	equ 8
   392                              <1> sf_use_serial:		equ 10h
    28                                  
    29                                  %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-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> 
    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> ldhlfPreserveLoader	equ 4
   109                              <1> 
   110                              <1> lsvefNoDataStart	equ 1
   111                              <1> lsvefPartitionNumber	equ 2
   112                              <1> lsvefPreserveLoader	equ 4
   113                              <1> 
   114                              <1> %if lsvefPreserveLoader != ldhlfPreserveLoader
   115                              <1>  %error Unexpected flag values
   116                              <1> %endif
   117                              <1> 
   118                              <1> 	struc LOADCMDLINE, LOADDATA - lsvclBufferLength
   119                              <1> ldCommandLine:
   120 FFFFFEE0 <res 100h>          <1> .start:		resb lsvclBufferLength
   121                              <1> 	endstruc
   122                              <1> 
   123                              <1> ldfHasLBA:	equ 1
   124                              <1> ldfFATInvalid:	equ 2
   125                              <1> ldfFATBuffered:	equ 4
   126                              <1> ldfDataBuffered: equ 8
   127                              <1> 
   128                              <1> 	struc LOADDATA2, LOADDATA - 10h
   129 FFFFFFD0 ????????            <1> ldRootSector:		resd 1
   130 FFFFFFD4 ????                <1> ldEntriesPerSector:	resw 1
   131                              <1> ldDataSegment:		; word
   132 FFFFFFD6 ????                <1> ldLastAvailableSector:	resw 1
   133                              <1> ldDataSector:		; dword
   134 FFFFFFD8 ????                <1> ldParasLeft:		resw 1
   135 FFFFFFDA ????                <1> ldParasDone:		resw 1
   136                              <1> 	endstruc
   137                              <1> 
   138                              <1> 	struc LOADDATA3, LOADDATA2 - 10h
   139 FFFFFFC0 ????????            <1> ldMaxCluster:		resd 1
   140 FFFFFFC4 ????????            <1> ldFileSize:		resd 1
   141 FFFFFFC8 ????????            <1> ldCurrentCluster:	resd 1
   142 FFFFFFCC ????????            <1> ldCurrentSeek:		resd 1
   143                              <1> 	endstruc
   144                              <1> 
   145                              <1> 	struc LOADERIMAGEIDENT
   146 00000000 ????????            <1> liiSignature:		resb 4		; "NLDR"
   147 00000004 ????                <1> liiVersion:		resb 2		; "00"
   148 00000006 ????                <1> liiChecksum:		resw 1		; word sum of first 8 words = 0
   149 00000008 ????                <1> liiAmountParagraphs:	resw 1
   150 0000000A ????????????        <1> liiReserved:		resw 3
   151 00000010 ????                <1> liiEntryQuerySize:	resw 1		; 0 if not supported
   152                              <1> 		; INP:	cs => NLDR image ident
   153                              <1> 		;	ip = this word field content
   154                              <1> 		;	ax = 60h
   155                              <1> 		; OUT:	ax => behind memory requested (should be >= 60h)
   156                              <1> 		; CHG:	es, ds, di, si, bx, cx, dx
   157                              <1> 		; STT:	far called, UP, EI
   158 00000012 ????                <1> liiEntryRelocate:	resw 1		; 0 if not supported
   159                              <1> 		; INP:	cs => NLDR image ident
   160                              <1> 		;	ip = this word field content
   161                              <1> 		;	ax = 60h
   162                              <1> 		; OUT:	ax => relocated NLDR segment (usually 60h)
   163                              <1> 		; CHG:	es, ds, di, si, bx, cx, dx
   164                              <1> 		; STT:	far called, UP, EI
   165 00000014 ????                <1> liiEntryDebug:		resw 1		; 0 if not supported
   166                              <1> 		; INP:	es = ds = cs = ss => relocated NLDR
   167                              <1> 		;	ip = this word field content
   168                              <1> 		;	sp = next word field content
   169                              <1> 		; STT:	running as debuggee, UP, EI
   170 00000016 ????                <1> liiStackPointer:	resw 1
   171                              <1> 	endstruc
   172                              <1> 
   173                              <1> 	struc LBAPACKET
   174 00000000 ????                <1> lpSize:		resw 1
   175 00000002 ????                <1> lpCount:	resw 1
   176 00000004 ????????            <1> lpBuffer:	resd 1
   177 00000008 ????????????????    <1> lpSector:	resq 1
   178                              <1> 	endstruc
   179                              <1> 
   180                              <1> 	struc PARTINFO
   181 00000000 ??                  <1> piBoot:		resb 1
   182 00000001 ??????              <1> piStartCHS:	resb 3
   183 00000004 ??                  <1> piType:		resb 1
   184 00000005 ??????              <1> piEndCHS:	resb 3
   185 00000008 ????????            <1> piStart:	resd 1
   186 0000000C ????????            <1> piLength:	resd 1
   187                              <1> 	endstruc
   188                              <1> 
   189                              <1> ptEmpty:		equ 0
   190                              <1> ptFAT12:		equ 1
   191                              <1> ptFAT16_16BIT_CHS:	equ 4
   192                              <1> ptExtendedCHS:		equ 5
   193                              <1> ptFAT16_CHS:		equ 6
   194                              <1> ptFAT32_CHS:		equ 0Bh
   195                              <1> ptFAT32:		equ 0Ch
   196                              <1> ptFAT16:		equ 0Eh
   197                              <1> ptExtended:		equ 0Fh
   198                              <1> ptLinux:		equ 83h
   199                              <1> ptExtendedLinux:	equ 85h
   200                              <1> 
   201                              <1> 
   202                              <1> 		; Flags of load_unit_flags
   203                              <1> lufForceCHS:		equ 1
   204                              <1> lufForceLBA:		equ 2
   205                              <1> lufForceGeometry:	equ 4
   206                              <1> luf_mask_writable equ lufForceCHS | lufForceLBA | lufForceGeometry
    30                                  
    31                                  	numdef BOOTLDR, 1
    32                                  	numdef BOOTLDR_WILD, 1
    33                                  	numdef COMPRESSED, 1
    34                                  	numdef DATABUFFER, 1
    35                                  	numdef ELDTRAILER, 1
    36                                  
    37                                  	cpu 8086
    38                                  
    39                                  	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
    40                                  relocateddata:
    41                                  
    42                                  	addsection HEADER, start=0
    43                                  
    44                                  	istruc ELD_HEADERX
    45                                  at eldhxHeader
    46                                  		; ELD executable header
    47                                  	istruc ELD_HEADER
    48 00000000 454C4431                at eldhSignature,	db "ELD1"
    49 00000004 000000                  			db 0,0,0
    50 00000007 1A                      			db 26
    51 00000008 50000000                at eldhCodeOffset,	dd CODEOFFSET
    52 0000000C 2020                    at eldhCodeImageLength,	dw code_size
    53 0000000E 0000                    at eldhCodeAllocLength,	dw 0
    54 00000010 70200000                at eldhDataOffset,	dd DATAOFFSET
    55 00000014 4003                    at eldhDataImageLength,	dw data_size
    56 00000016 A017                    at eldhDataAllocLength,	dw total_data_size - data_size
    57 00000018 C012                    at eldhCodeEntrypoint,	dw linker - code
    58                                  at eldhReserved
    59 0000001A 00<rep 4h>2800          at eldhExtensionSize,	dw header_extension_end - $$
    60                                  	iend
    61 00000020 [30000000]              at eldhxDescriptionOffset,	dd description
    62 00000024 6B220000                at eldhxHelpOffset,		dd DATAOFFSET + msg.help - datastart
    63                                  PUT_ELDHX_DATETIME_OFFSET
    64                                  header_extension_end:
    65 00000028 00<rep 8h>              	iend
    66                                  
    67 00000030 446973706C61792045-     description:		asciz "Display ELD description lines."
    67 00000039 4C4420646573637269-
    67 00000042 7074696F6E206C696E-
    67 0000004B 65732E00           
    68                                  
    69 0000004F 00                      	align 16, db 0
    70                                  
    71                                  	eldstrict on
    72                                  
    73                                  CODEOFFSET equ $ - $$
    74                                  	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
    75                                  %define CODEFIXUP - code + 0
    76                                  code:
    77                                  		; ELD instance header
    78                                  	istruc ELD_INSTANCE
    79                                  at eldiStartCode
    80 00000000 00<rep 2h>              at eldiEndCode
    81 00000002 00<rep 2h>              at eldiStartData
    82 00000004 00<rep 2h>              at eldiEndData
    83 00000006 00<rep 2h>4C495354-     at eldiIdentifier,	fill 8, 32, db "LIST"
    83 0000000C 20<rep 4h>         
    84 00000010 00<rep 2h>6C697374-     at eldiListing,		asciz _ELD_LISTING
    84 00000016 2E6C737400         
    85 0000001B 00<rep 5h>              	iend
    86                                  
    87                                  
    88                                  run:
    89 00000020 16                      	push ss
    90 00000021 07                      	pop es
    91                                  %if _BOOTLDR
    92 00000022 F606[0100]40            reloc	testopt [relocateddata], nodosloaded
    93                                  linkdatarelocation internalflags, -3
    94 00000027 7503E94202              	jz run_dos
    95                                  .boot:
    96 0000002C E8C111                  	extcallcall yy_boot_parse_name2
    97 0000002F E85103                  	call parse_verbose
    98                                  
    99                                  boot_find:
   100 00000032 891E[4203]              reloc	mov word [boot_parsed], bx
   101                                  internaldatarelocation
   102                                   %if _BOOTLDR_WILD
   103 00000036 53                      	push bx
   104 00000037 89DF                    	mov di, bx
   105 00000039 E8EB03                  	call find_dir
   106 0000003C 5B                      	pop bx
   107 0000003D 89FA                    	mov dx, di
   108 0000003F A8                      	db __TEST_IMM8			; (skip inc)
   109                                  @@:
   110 00000040 47                      	inc di
   111 00000041 803D00                  	cmp byte [di], 0
   112 00000044 7503E9E401              	je boot_no_wild
   113 00000049 803D3F                  	cmp byte [di], '?'
   114 0000004C 7405                    	je boot_wild
   115 0000004E 803D2A                  	cmp byte [di], '*'
   116 00000051 75ED                    	jne @B
   117                                  
   118                                  boot_wild:
   119 00000053 8916[4003]              reloc	mov word [wild_pattern], dx
   120                                  internaldatarelocation
   121                                  
   122 00000057 E8[0000]EB020000        	extcall yy_boot_init_dir2	; calls initialise_fs
   123 0000005E C606[0000]00            reloc	mov byte [relocateddata], 0
   124                                  linkdatarelocation load_check_dir_attr, -3
   125 00000063 8B36[0000]              reloc	mov si, word [relocateddata]
   126                                  linkdatarelocation load_yyname_input
   127 00000067 803C2F                  	cmp byte [si], '/'
   128 0000006A 7501                    	jne @F
   129 0000006C 46                      	inc si
   130                                  @@:
   131 0000006D 803C00                  	cmp byte [si], 0
   132 00000070 7507                    	jne @F
   133 00000072 E8[0000]EB020000        	extcall ..@yy_filename_empty
   134                                  @@:
   135 00000079 16                      	 push ss
   136 0000007A 07                      	 pop es
   137 0000007B E88200                  	call boot_parse_name
   138 0000007E 3C2F                    	cmp al, '/'
   139 00000080 7509                    	jne @F
   140 00000082 C606[0000]10            reloc	mov byte [relocateddata], ATTR_DIRECTORY
   141                                  linkdatarelocation load_check_dir_attr, -3
   142 00000087 8936[0000]              reloc	mov word [relocateddata], si
   143                                  linkdatarelocation load_yyname_next
   144                                  @@:
   145                                  
   146 0000008B BFFFFF                  	mov di, -1
   147 0000008E 89FE                    	mov si, di
   148 00000090 897EF4                  	mov [bp + lsvFATSector], di
   149 00000093 8976F6                  	mov [bp + lsvFATSector + 2], si
   150                                  
   151 00000096 31C0                    	xor ax, ax
   152 00000098 31D2                    	xor dx, dx
   153                                  
   154                                  scan_dir_yyname_loop:
   155 0000009A 8946EC                  	mov word [bp + ldDirCluster], ax
   156 0000009D 8956EE                  	mov word [bp + ldDirCluster + 2], dx
   157                                  
   158 000000A0 16                      	push ss
   159 000000A1 07                      	pop es
   160 000000A2 BB[0000]                reloc	mov bx, relocateddata
   161                                  linkdatarelocation load_yy_direntry
   162                                  
   163 000000A5 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   164                                  linkdatarelocation handle_scan_dir_not_found, -4
   165                                  ;linkdatarelocation near_transfer_ext_entry
   166                                  linkdatarelocation dmycmd
   167 000000AB E8[0000]EB020000        	extcall scan_dir_aux
   168 000000B2 7303E94B01              	jc end_of_directory
   169                                  
   170 000000B7 803E[0000]10            reloc	cmp byte [relocateddata], ATTR_DIRECTORY
   171                                  linkdatarelocation load_check_dir_attr, -3
   172 000000BC 7403E96701              	jne got_single_yyentry
   173                                  
   174 000000C1 56                      	push si
   175 000000C2 57                      	push di
   176 000000C3 C606[0000]00            reloc	mov byte [relocateddata], 0
   177                                  linkdatarelocation load_check_dir_attr, -3
   178 000000C8 8B36[0000]              reloc	mov si, word [relocateddata]
   179                                  linkdatarelocation load_yyname_next
   180 000000CC 803C00                  	cmp byte [si], 0
   181 000000CF 7507                    	jne @F
   182 000000D1 E8[0000]EB020000        	extcall ..@yy_filename_empty
   183                                  @@:
   184 000000D8 06                      	push es
   185 000000D9 16                      	 push ss
   186 000000DA 07                      	 pop es
   187 000000DB E82200                  	call boot_parse_name
   188 000000DE 07                      	pop es
   189 000000DF 3C2F                    	cmp al, '/'
   190 000000E1 7509                    	jne @F
   191 000000E3 C606[0000]10            reloc	mov byte [relocateddata], ATTR_DIRECTORY
   192                                  linkdatarelocation load_check_dir_attr, -3
   193 000000E8 8936[0000]              reloc	mov word [relocateddata], si
   194                                  linkdatarelocation load_yyname_next
   195                                  @@:
   196 000000EC 5F                      	pop di
   197 000000ED 5E                      	pop si
   198                                  
   199 000000EE 31D2                    	xor dx, dx
   200 000000F0 268B471A                	mov ax, [es:bx + deClusterLow]
   201                                  				; = first cluster (not FAT32)
   202 000000F4 807EE620                	cmp byte [bp + ldFATType], 32
   203 000000F8 7504                    	jne @F
   204 000000FA 268B5714                	mov dx, [es:bx + deClusterHigh]
   205                                  				; dx:ax = first cluster (FAT32)
   206                                  @@:
   207                                  
   208 000000FE EB9A                    	jmp scan_dir_yyname_loop
   209                                  
   210                                  boot_parse_name:
   211 00000100 3936[4003]              reloc	cmp word [wild_pattern], si
   212                                  internaldatarelocation
   213 00000104 740A                    	je @F
   214 00000106 E8EF10                  	extcallcall boot_parse_fn	; get next pathname
   215                                  
   216 00000109 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   217                                  linkdatarelocation handle_scan_dir_entry, -4
   218                                  linkdatarelocation scan_dir_entry
   219                                  
   220 0000010F C3                      	retn
   221                                  
   222                                  @@:
   223 00000110 E8E510                  	extcallcall boot_parse_fn	; get next pathname
   224                                  
   225 00000113 C706[0000][3D01]        reloc2	mov word [relocateddata], match_wildcard
   226                                  linkdatarelocation near_transfer_ext_address, -4
   227                                  internalcoderelocation
   228 00000119 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   229                                  linkdatarelocation handle_scan_dir_entry, -4
   230                                  linkdatarelocation near_transfer_ext_entry
   231                                  
   232 0000011F 50                      	push ax
   233 00000120 BF[0000]                reloc	mov di, relocateddata
   234                                  linkdatarelocation load_kernel_name
   235 00000123 B90800                  	mov cx, 8
   236 00000126 E80700                  	call .handle_asterisk		; handle in basename
   237 00000129 B103                    	mov cl, 3
   238 0000012B E80200                  	call .handle_asterisk		; handle in extension
   239 0000012E 58                      	pop ax
   240 0000012F C3                      	retn
   241                                  
   242                                  .handle_asterisk:
   243 00000130 B02A                    	mov al, '*'
   244 00000132 F2AE                    	repne scasb			; scan for asterisk
   245 00000134 7506                    	jne @F				; not found -->
   246 00000136 B03F                    	mov al, '?'			; fill with question marks
   247 00000138 4F                      	dec di				; -> at the asterisk
   248 00000139 41                      	inc cx				; = how many bytes remain
   249 0000013A F3AA                    	rep stosb			; fill this field
   250                                  @@:
   251 0000013C C3                      	retn
   252                                  
   253                                  
   254                                  		; INP:	es:di -> DIRENTRY
   255                                  		;	dx:ax - 1 = sector
   256                                  		;	cx, si in use
   257                                  		; OUT:	CY if end of directory
   258                                  		;	NC if to continue,
   259                                  		;	 ZR if match
   260                                  		;	 NZ if mismatch
   261                                  		; CHG:	bx
   262                                  match_wildcard:
   263 0000013D 26803D00                	cmp byte [es:di], 0
   264 00000141 F9                      	stc
   265 00000142 7503E9B400              	je .ret
   266 00000147 268A5D0B                	mov bl, byte [es:di + deAttrib]
   267 0000014B F6C308                  	test bl, ATTR_VOLLABEL
   268 0000014E 7403E9A700              	jnz .ret_NC		; skip volume labels (and LFNs) --> (NZ)
   269 00000153 80E310                  	and bl, ATTR_DIRECTORY	; isolate directory bit
   270                                  	; cmp bl, byte [load_check_dir_attr]	; is it what we're searching?
   271                                  	; jne .ret_NC				; no -->
   272 00000156 7403E99F00              	jnz .ret_NC		; must not be directory -->
   273 0000015B 56                      	push si
   274 0000015C 57                      	push di
   275 0000015D 51                      	push cx
   276 0000015E BE[0000]                reloc	mov si, relocateddata	; ds:si-> name to match
   277                                  linkdatarelocation load_kernel_name
   278 00000161 B90B00                  	mov cx, 11		; length of padded 8.3 FAT filename
   279                                  @@:
   280 00000164 F3A6                    	repe cmpsb		; check entry
   281 00000166 7406                    	je @F			; match -->
   282 00000168 807CFF3F                	cmp byte [si - 1], '?'	; wildcard ?
   283 0000016C 74F6                    	je @B			; yes --> (ZR)
   284                                  				; no (NZ)
   285                                  @@:
   286 0000016E 59                      	pop cx
   287 0000016F 5F                      	pop di
   288 00000170 5E                      	pop si
   289 00000171 7403E98400              	jne .ret_NC
   290                                  
   291 00000176 56                      	push si
   292 00000177 06                      	push es
   293 00000178 57                      	push di
   294 00000179 52                      	push dx
   295 0000017A 50                      	push ax
   296 0000017B 51                      	push cx
   297                                  
   298 0000017C B92000                  	mov cx, DIRENTRY_size
   299 0000017F 1E                      	push ds
   300 00000180 06                      	 push es
   301 00000181 1F                      	 pop ds
   302 00000182 89FE                    	mov si, di		; ds:si -> entry in directory buffer
   303 00000184 16                      	push ss
   304 00000185 07                      	pop es
   305 00000186 BF[0000]                reloc	mov di, relocateddata	; es:di -> destination for entry
   306                                  linkdatarelocation load_yy_direntry
   307 00000189 57                      	push di
   308 0000018A F3A4                    	rep movsb
   309 0000018C 5E                      	pop si
   310 0000018D 1F                      	pop ds
   311                                  
   312 0000018E BF[7503]                reloc	mov di, pathnamebuffer - 1
   313                                  internaldatarelocation		; di -> buffer
   314 00000191 B000                    	mov al, 0
   315 00000193 AA                      	stosb
   316 00000194 57                      	push di
   317 00000195 B108                    	mov cl, 8
   318 00000197 803C05                  	cmp byte [si], 05h
   319 0000019A 7505                    	jne @F
   320 0000019C B0E5                    	mov al, 0E5h
   321 0000019E AA                      	stosb
   322 0000019F 49                      	dec cx
   323 000001A0 46                      	inc si
   324                                  @@:
   325 000001A1 F3A4                    	rep movsb
   326 000001A3 B109                    	mov cl, 9
   327 000001A5 A8                      	db __TEST_IMM8
   328                                  @@:
   329 000001A6 4F                      	dec di
   330 000001A7 807DFF20                	cmp byte [di - 1], 32
   331 000001AB E1F9                    	loope @B
   332 000001AD B02E                    	mov al, '.'
   333 000001AF AA                      	stosb
   334 000001B0 B103                    	mov cl, 3
   335 000001B2 F3A4                    	rep movsb
   336 000001B4 B104                    	mov cl, 4
   337 000001B6 A8                      	db __TEST_IMM8
   338                                  @@:
   339 000001B7 4F                      	dec di
   340 000001B8 807DFF20                	cmp byte [di - 1], 32
   341 000001BC E1F9                    	loope @B
   342 000001BE 807DFF2E                	cmp byte [di - 1], '.'
   343 000001C2 7501                    	jne @F
   344 000001C4 4F                      	dec di
   345                                  @@:
   346 000001C5 B000                    	mov al, 0
   347 000001C7 AA                      	stosb
   348                                  
   349 000001C8 E83510                  	extcallcall got_yyentry
   350 000001CB 8026[0300]EF            reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   351                                  linkdatarelocation internalflags3, -3
   352 000001D0 16                      	 push ss
   353 000001D1 07                      	 pop es
   354 000001D2 5A                      	pop dx
   355 000001D3 B8[0000]                reloc	mov ax, relocateddata
   356                                  linkdatarelocation load_data_lowest	; make yy_boot_get and yy_boot_update no-ops
   357 000001D6 E86E02                  	call commonhandle
   358 000001D9 800E[0300]10            reloc	setopt [relocateddata], dif3_auxbuff_guarded_1
   359                                  linkdatarelocation internalflags3, -3
   360 000001DE 59                      	pop cx
   361 000001DF 58                      	pop ax
   362 000001E0 5A                      	pop dx
   363 000001E1 5F                      	pop di
   364 000001E2 07                      	pop es
   365 000001E3 5E                      	pop si			; restore registers
   366                                  
   367 000001E4 83E801                  	sub ax, 1
   368 000001E7 83DA00                  	sbb dx, 0
   369 000001EA 8B1E[0000]              reloc	mov bx, [relocateddata]
   370                                  linkdatarelocation load_adr_dirbuf_segment
   371 000001EE E8[0000]EB020000        	extcall read_sector	; restore sector
   372                                  
   373 000001F5 800E[0500]FF            reloc	or byte [found], -1
   374                                  internaldatarelocation -3	; NZ
   375                                  .ret_NC:
   376 000001FA F8                      	clc
   377                                  .ret:
   378 000001FB E8[0000]EB020000        	extcall near_transfer_ext_return, required ; must NOT be extcallcall
   379                                  
   380                                  
   381                                  end_of_directory:
   382 00000202 D006[0500]              reloc	rol byte [found], 1
   383                                  internaldatarelocation
   384 00000206 721D                    	jc @F
   385                                  
   386                                  	; pushf
   387 00000208 8026[0300]EF            reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   388                                  linkdatarelocation internalflags3, -3
   389                                  	; popf
   390                                  
   391                                  	houdini
   392                                  ;reloc	mov di, word [relocateddata]
   393                                  ;linkdatarelocation load_yyname_input
   394 0000020D 8B3E[4203]              reloc	mov di, word [boot_parsed]
   395                                  internaldatarelocation
   396 00000211 E8F40F                  	extcallcall retry_open_scriptspath
   397 00000214 7503E919FE              	jz boot_find
   398                                  
   399 00000219 B8470E                  	mov ax, 0E47h
   400 0000021C E8F10F                  	extcallcall setrc
   401 0000021F BA[2300]                reloc	mov dx, msg.notfound
   402                                  internaldatarelocation
   403 00000222 E8F30F                  	extcallcall putsz
   404                                  @@:
   405 00000225 E8F80F                  	extcallcall cmd3
   406                                  
   407                                  got_single_yyentry:
   408 00000228 E8D50F                  	extcallcall got_yyentry
   409 0000022B EB03                    	jmp @F
   410                                  
   411                                  boot_no_wild:
   412                                   %endif
   413                                  
   414 0000022D E8F80F                  	extcallcall yy_boot_open_file2	; calls initialise_fs
   415                                  @@:
   416 00000230 8026[0300]EF            reloc	clropt [relocateddata], dif3_auxbuff_guarded_1
   417                                  linkdatarelocation internalflags3, -3
   418                                  
   419                                  %if _DATABUFFER
   420 00000235 F606[0100]40            reloc	testopt [relocateddata], nodosloaded
   421                                  linkdatarelocation internalflags, -3
   422 0000023A 7420                    	jz .skipdatabuffer
   423 0000023C B104                    	mov cl, 4
   424 0000023E 8CD0                    	mov ax, ss
   425 00000240 BB[E018]                reloc	mov bx, databuffer
   426                                  internaldatarelocation
   427 00000243 F6C30F                  	test bl, 15
   428 00000246 7514                    	jnz .skipdatabuffer
   429 00000248 D3EB                    	shr bx, cl
   430 0000024A 01D8                    	add ax, bx
   431 0000024C A3[0600]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSegment], ax
   432                                  linkdatarelocation load_data
   433 0000024F 31C0                    	xor ax, ax
   434 00000251 A3[0A00]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSector + 2], ax
   435                                  linkdatarelocation load_data
   436 00000254 A3[0800]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSector], ax
   437                                  linkdatarelocation load_data
   438 00000257 800E[1700]08            reloc	setopt [relocateddata - LOADDATA2 + ldFlags], ldfDataBuffered
   439                                  linkdatarelocation load_data, -3
   440                                  .skipdatabuffer:
   441                                  %endif
   442                                  
   443 0000025C 8B3E[0000]              reloc	mov di, word [relocateddata]
   444                                  linkdatarelocation load_yyname_input
   445 00000260 E8C401                  	call find_dir
   446 00000263 89FA                    	mov dx, di
   447 00000265 B8[0000]                reloc	mov ax, relocateddata
   448                                  linkdatarelocation load_data_lowest	; make yy_boot_get and yy_boot_update no-ops
   449 00000268 E8DC01                  	call commonhandle
   450 0000026B E8B20F                  	extcallcall cmd3
   451                                  %endif
   452                                  
   453                                  run_dos:
   454 0000026E 2E803E[7C02]90          reloc	cmp byte [cs:@F], 90h
   455                                  internalcoderelocation -3
   456 00000274 7503E93710              	je error
   457 00000279 E8B40F                  	extcallcall InDOS
   458                                  @@:
   459 0000027C E8[0000]EB020000        	extcall yy_dos_parse_name, optional
   460 00000283 E8FD00                  	call parse_verbose
   461                                  
   462 00000286 53                      	push bx
   463                                  
   464 00000287 B42F                    	mov ah, 2Fh			; get DTA
   465 00000289 E8AC0F                  	extcallcall ispm
   466 0000028C 750F                    	jnz .rm
   467                                  
   468                                  subcpu 286
   469 0000028E 6A00                    	push word 0
   470 00000290 6A21                    	push word 21h
   471 00000292 E8[0000]EB020000        	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
   472 00000299 5A                      	pop dx				; discard interrupt number
   473 0000029A 5A                      	pop dx				; get es
   474                                  subcpureset
   475 0000029B EB04                    	jmp @F
   476                                  .rm:
   477 0000029D CD21                    	int 21h
   478 0000029F 8CC2                    	mov dx, es
   479                                  @@:
   480                                  
   481 000002A1 891E[4003]              reloc	mov word [originaldta], bx
   482                                  internaldatarelocation
   483 000002A5 8916[4203]              reloc	mov word [originaldta + 2], dx
   484                                  internaldatarelocation
   485                                  
   486 000002A9 A1[0000]                reloc	mov ax, word [relocateddata]
   487                                  linkdatarelocation ext_inject_handler
   488 000002AC A3[4403]                reloc	mov word [originalinject], ax
   489                                  internaldatarelocation
   490 000002AF C706[0000][D10C]        reloc2	mov word [relocateddata], inject
   491                                  linkdatarelocation ext_inject_handler, -4
   492                                  internalcoderelocation
   493 000002B5 E8E70E                  	call get_es_ext
   494 000002B8 26800E[1000]01          reloc	setopt [es:code + eldiFlags], eldifResident
   495                                  internalcoderelocation -3	; mark block as resident
   496 000002BE 16                      	 push ss
   497 000002BF 07                      	 pop es
   498                                  
   499                                  	houdini
   500 000002C0 BA[4A03]                reloc	mov dx, dta
   501                                  internaldatarelocation
   502 000002C3 B41A                    	mov ah, 1Ah		; set DTA
   503 000002C5 E8780F                  	extcallcall _doscall
   504                                  
   505 000002C8 5A                      	pop dx
   506                                  
   507                                  .find:
   508 000002C9 C706[4603]4F71          reloc	mov word [findnext_function_number], 714Fh
   509                                  internaldatarelocation -4
   510 000002CF B84E71                  	mov ax, 714Eh
   511 000002D2 B90600                  	mov cx, 6		; find all files, no directories
   512 000002D5 BE0100                  	mov si, 1
   513 000002D8 BF[7605]                reloc	mov di, finddata
   514                                  internaldatarelocation
   515 000002DB D006[0800]              reloc	rol byte [prefersfn], 1
   516                                  internaldatarelocation
   517 000002DF 721C                    	jc .sfn_try
   518 000002E1 F9                      	stc
   519 000002E2 E85B0F                  	extcallcall _doscall
   520 000002E5 730C                    	jnc .lfn_found
   521 000002E7 83F801                  	cmp ax, 1
   522 000002EA 7411                    	je .sfn_try
   523 000002EC 3D0071                  	cmp ax, 7100h
   524 000002EF 740C                    	je .sfn_try
   525 000002F1 EB74                    	jmp .notfound
   526                                  
   527                                  .lfn_found:
   528 000002F3 A3[4803]                reloc	mov word [findhandle], ax
   529                                  internaldatarelocation
   530 000002F6 C606[0400]FF            reloc	mov byte [findhandle_set], 0FFh
   531                                  internaldatarelocation -3
   532 000002FB EB11                    	jmp .next
   533                                  
   534                                  .sfn_try:
   535 000002FD C706[4603]004F          reloc	mov word [findnext_function_number], 4F00h
   536                                  internaldatarelocation -4
   537 00000303 B8004E                  	mov ax, 4E00h
   538 00000306 B90600                  	mov cx, 6		; find all files, no directories
   539 00000309 E8340F                  	extcallcall _doscall
   540 0000030C 7259                    	jc .notfound
   541                                  
   542                                  .next:
   543 0000030E 52                      	push dx
   544 0000030F 89D7                    	mov di, dx
   545 00000311 E81301                  	call find_dir
   546 00000314 89DE                    	mov si, bx		; si -> path
   547 00000316 89F9                    	mov cx, di
   548 00000318 29F1                    	sub cx, si		; cx = length of path
   549 0000031A BF[7603]                reloc	mov di, pathnamebuffer
   550                                  internaldatarelocation		; di -> buffer
   551 0000031D 89FB                    	mov bx, di		; bx -> buffer
   552 0000031F F3A4                    	rep movsb
   553 00000321 89FA                    	mov dx, di		; dx -> where we store filename
   554 00000323 BE[6803]                reloc	mov si, dta.name
   555                                  internaldatarelocation
   556 00000326 B90D00                  	mov cx, 13
   557                                  
   558 00000329 803E[4703]71            reloc	cmp byte [findnext_function_number + 1], 71h
   559                                  internaldatarelocation -3
   560 0000032E 7510                    	jne .sfn_copy
   561                                  
   562 00000330 BE[A205]                reloc	mov si, finddata.fullname
   563                                  internaldatarelocation
   564 00000333 57                      	push di
   565 00000334 B9FFFF                  	mov cx, -1
   566 00000337 B000                    	mov al, 0
   567 00000339 89F7                    	mov di, si
   568 0000033B F2AE                    	repne scasb		; cx = -2, copy 1 byte
   569 0000033D F7D1                    	not cx
   570 0000033F 5F                      	pop di
   571                                  
   572                                  .sfn_copy:
   573 00000340 F3A4                    	rep movsb
   574                                  
   575 00000342 52                      	push dx
   576 00000343 E8020F                  	extcallcall yy_open_file
   577 00000346 5A                      	pop dx
   578 00000347 A3[0000]                reloc	mov word [relocateddata], ax
   579                                  linkdatarelocation ext_handle
   580                                  @@:
   581 0000034A E8FA00                  	call commonhandle
   582 0000034D E8000F                  	extcallcall close_ext
   583 00000350 5A                      	pop dx
   584 00000351 A1[4603]                reloc	mov ax, word [findnext_function_number]
   585                                  internaldatarelocation
   586 00000354 8B1E[4803]              reloc	mov bx, word [findhandle]
   587                                  internaldatarelocation
   588 00000358 BE0100                  	mov si, 1
   589 0000035B BF[7605]                reloc	mov di, finddata
   590                                  internaldatarelocation
   591 0000035E F9                      	stc
   592 0000035F E8DE0E                  	extcallcall _doscall
   593 00000362 73AA                    	jnc .next
   594                                  
   595 00000364 E8B90E                  	extcallcall cmd3
   596                                  
   597                                  
   598                                  .notfound:
   599 00000367 89D7                    	mov di, dx
   600 00000369 E89C0E                  	extcallcall retry_open_scriptspath
   601 0000036C 89DA                    	mov dx, bx
   602 0000036E 7503E956FF              	jz .find
   603                                  
   604 00000373 B8480E                  	mov ax, 0E48h
   605 00000376 E8970E                  	extcallcall setrc
   606 00000379 BA[2300]                reloc	mov dx, msg.notfound
   607                                  internaldatarelocation
   608 0000037C E8990E                  	extcallcall putsz
   609 0000037F E89E0E                  	extcallcall cmd3
   610                                  
   611                                  
   612                                  parse_verbose.loop:
   613 00000382 AC                      	lodsb
   614                                  parse_verbose:
   615 00000383 E8D20E                  	extcallcall skipcomm0
   616 00000386 E8D70E                  	extcallcall iseol?
   617 00000389 7501                    	jne @F
   618 0000038B C3                      	retn
   619                                  
   620                                  @@:
   621 0000038C 4E                      	dec si
   622 0000038D BA[0B00]                reloc	mov dx, msg.verbose
   623                                  internaldatarelocation
   624 00000390 E8D50E                  	extcallcall isstring?
   625 00000393 7507                    	jne @F
   626 00000395 C606[0600]FF            reloc	mov byte [verbose], 0FFh
   627                                  internaldatarelocation -3
   628 0000039A EBE6                    	jmp .loop
   629                                  
   630                                  @@:
   631 0000039C BA[1300]                reloc	mov dx, msg.string_help
   632                                  internaldatarelocation
   633 0000039F E8C60E                  	extcallcall isstring?
   634 000003A2 7507                    	jne @F
   635 000003A4 C606[0700]FF            reloc	mov byte [do_help], 0FFh
   636                                  internaldatarelocation -3
   637 000003A9 EBD7                    	jmp .loop
   638                                  
   639                                  @@:
   640 000003AB BA[1800]                reloc	mov dx, msg.string_sfn
   641                                  internaldatarelocation
   642 000003AE E8B70E                  	extcallcall isstring?
   643 000003B1 7507                    	jne @F
   644 000003B3 C606[0800]FF            reloc	mov byte [prefersfn], 0FFh
   645                                  internaldatarelocation -3
   646 000003B8 EBC8                    	jmp .loop
   647                                  
   648                                  @@:
   649 000003BA BA[1C00]                reloc	mov dx, msg.string_lib
   650                                  internaldatarelocation
   651 000003BD E8A80E                  	extcallcall isstring?
   652 000003C0 750A                    	jne @F
   653 000003C2 C606[0900]FF            reloc	mov byte [lib], 0FFh
   654                                  internaldatarelocation -3
   655 000003C7 EBB9                    	jmp .loop
   656                                  
   657                                  .error:
   658 000003C9 E9E40E                  	jmp error
   659                                  
   660                                  @@:
   661 000003CC AC                      	lodsb
   662 000003CD 3C2F                    	cmp al, '/'
   663 000003CF 75F8                    	jne .error
   664 000003D1 BF[3803]                reloc	mov di, libnamebuffer
   665                                  internaldatarelocation
   666 000003D4 B82020                  	mov ax, 2020h
   667 000003D7 57                      	push di
   668 000003D8 AB<rep 4h>              	times 4 stosw
   669 000003DC 5F                      	pop di
   670 000003DD D006[0A00]              reloc	rol byte [libname], 1
   671                                  internaldatarelocation
   672 000003E1 72E6                    	jc .error
   673 000003E3 F616[0A00]              reloc	not byte [libname]
   674                                  internaldatarelocation
   675                                  @@:
   676 000003E7 AC                      	lodsb
   677 000003E8 E8750E                  	extcallcall iseol?
   678 000003EB 7436                    	je .nameend
   679 000003ED 3C20                    	cmp al, 32
   680 000003EF 7432                    	je .nameend
   681 000003F1 3C09                    	cmp al, 9
   682 000003F3 742E                    	je .nameend
   683 000003F5 3C2C                    	cmp al, ','
   684 000003F7 742A                    	je .nameend
   685 000003F9 81FF[4003]              reloc	cmp di, strict word libnamebuffer + 8
   686                                  internaldatarelocation
   687 000003FD 73CA                    	jae .error
   688 000003FF E86E0E                  	extcallcall uppercase
   689 00000402 AA                      	stosb
   690 00000403 3C2A                    	cmp al, '*'
   691 00000405 75E0                    	jne @B
   692 00000407 4F                      	dec di
   693 00000408 B03F                    	mov al, '?'
   694                                  @@:
   695 0000040A AA                      	stosb
   696 0000040B 81FF[4003]              reloc	cmp di, strict word libnamebuffer + 8
   697                                  internaldatarelocation
   698 0000040F 72F9                    	jb @B
   699 00000411 AC                      	lodsb
   700 00000412 E84B0E                  	extcallcall iseol?
   701 00000415 740C                    	je .nameend
   702 00000417 3C20                    	cmp al, 32
   703 00000419 7408                    	je .nameend
   704 0000041B 3C09                    	cmp al, 9
   705 0000041D 7404                    	je .nameend
   706 0000041F 3C2C                    	cmp al, ','
   707 00000421 75A6                    	jne .error
   708                                  .nameend:
   709 00000423 4E                      	dec si
   710 00000424 E95BFF                  	jmp .loop
   711                                  
   712                                  
   713                                  find_dir:
   714 00000427 89FB                    	mov bx, di		; bx -> start of path
   715 00000429 B9FFFF                  	mov cx, -1
   716 0000042C B000                    	mov al, 0
   717 0000042E F2AE                    	repne scasb
   718 00000430 4F                      	dec di
   719                                  @@:
   720 00000431 39DF                    	cmp di, bx
   721 00000433 7611                    	jbe .di
   722 00000435 4F                      	dec di
   723 00000436 803D2F                  	cmp byte [di], '/'
   724 00000439 740A                    	je .di_plus_one
   725 0000043B 803D5C                  	cmp byte [di], '\'
   726 0000043E 7405                    	je .di_plus_one
   727 00000440 803D3A                  	cmp byte [di], ':'
   728 00000443 75EC                    	jne @B
   729                                  .di_plus_one:
   730 00000445 47                      	inc di
   731                                  .di:				; di -> end of path
   732 00000446 C3                      	retn
   733                                  
   734                                  
   735                                  		; INP:	file is opened
   736                                  		;	file seek is at ELD/SLD header
   737                                  		;	ax = file handle or bootloaded file structure offset
   738                                  		;	 (write to bx for file access functions)
   739                                  		;	dx -> ASCIZ name of matched file
   740                                  commonhandle:
   741                                  %if _COMPRESSED
   742 00000447 F9                      	stc
   743                                  %endif
   744 00000448 B300                    	mov bl, 0
   745                                  .lib:
   746                                  		; INP:	CY, bl = 0 if top level file (SLD or ELD),
   747                                  		;	 file seek is zero
   748                                  		;	CY, bl = 1 if uncompressed library's ELD,
   749                                  		;	 file seek is at ELD header
   750                                  		;	NC, bl = 1 if compressed library's ELD,
   751                                  		;	 cx:di = offset within compressed library
   752                                  	lframe
   753                                  	lvar word, more_help
   754                                  	lvar dword, liboffset
   755                                  	lvar dword, libnext
   756                                  	lvar word, libamount
   757                                  	lvar 12 + 2, libentry
   758                                  	lequ ?libentry, state
   759                                  	lequ ?libentry + 2, tail
   760                                  	lequ ?libentry + 4, next
   761                                  	lequ ?libentry + 6, helpstarted
   762 0000044A 5589E58D66E6            	lenter
   763                                  	lvar word, not_sld_bit_0
   764 00000450 53                      	 push bx
   765                                  %if _COMPRESSED
   766                                  	lvar word, uncompressed_bit_0
   767 00000451 9C                      	 pushf
   768 00000452 893E[C006]              reloc	mov word [depackskip], di
   769                                  internaldatarelocation
   770 00000456 890E[C206]              reloc	mov word [depackskip + 2], cx
   771                                  internaldatarelocation
   772                                  %endif
   773                                  	lvar word, handle
   774 0000045A 50                      	 push ax
   775 0000045B 93                      	xchg bx, ax		; bx = handle
   776 0000045C E8B90D                  	extcallcall putsz
   777 0000045F 89D7                    	mov di, dx
   778                                  
   779 00000461 31C9                    	xor cx, cx
   780 00000463 31D2                    	xor dx, dx
   781 00000465 B80142                  	mov ax, 4201h
   782 00000468 E8B808                  	call seek_compressed_or_dos_or_boot_io
   783 0000046B 7303E9E204              	jc .io_error
   784                                  	lvar dword, eldheader
   785 00000470 52                      	 push dx
   786 00000471 50                      	 push ax
   787                                  
   788 00000472 BA[2000]                reloc	mov dx, msg.colon
   789                                  internaldatarelocation
   790 00000475 E8A00D                  	extcallcall putsz
   791                                  
   792 00000478 B000                    	mov al, 0
   793 0000047A B9FFFF                  	mov cx, -1
   794 0000047D F2AE                    	repne scasb		; cx = -2 means 0 bytes, -3 means 1 bytes
   795                                  %if 0
   796                                  	not cx			; cx = 1 means 0 bytes
   797                                  	cmp cx, 8 + 1 + 3 + 1
   798                                  	jae @FF
   799                                  	neg cx
   800                                  	add cx, 8 + 1 + 3 + 1
   801                                  %else
   802                                  		; I give up, it's magic
   803 0000047F 83C10E                  	add cx, (8 + 1 + 3 + 1) + 1
   804 00000482 7309                    	jnc @FF
   805 00000484 7407                    	jz @FF
   806                                  %endif
   807                                  @@:
   808 00000486 B020                    	mov al, 32
   809 00000488 E8ED0D                  	extcallcall putc
   810 0000048B E2F9                    	loop @B
   811                                  @@:
   812                                  
   813                                  %if _ELDTRAILER
   814 0000048D F646E401                	testopt [bp + ?not_sld_bit_0], 1
   815 00000491 7403E99000              	jnz .no_trailer_no_seek
   816 00000496 B80242                  	mov ax, 4202h
   817 00000499 31C9                    	xor cx, cx
   818 0000049B 31D2                    	xor dx, dx
   819 0000049D E88308                  	call seek_compressed_or_dos_or_boot_io
   820 000004A0 7303E9AD04              	jc .io_error
   821                                  
   822 000004A5 85D2                    	test dx, dx
   823 000004A7 7505                    	jnz @F
   824 000004A9 83F830                  	cmp ax, ELD_HEADER_size + ELD_TRAILER_HEADER_size
   825 000004AC 7267                    	jb .no_trailer
   826                                  @@:
   827                                  
   828 000004AE B80142                  	mov ax, 4201h
   829 000004B1 B9FFFF                  	mov cx, -1
   830 000004B4 BAF0FF                  	mov dx, - ELD_TRAILER_HEADER_size
   831 000004B7 E86908                  	call seek_compressed_or_dos_or_boot_io
   832 000004BA 7303E99304              	jc .io_error
   833                                  
   834 000004BF 52                      	push dx
   835 000004C0 50                      	push ax
   836                                  
   837 000004C1 B91000                  	mov cx, fromwords(ELD_TRAILER_HEADER_size_w)
   838 000004C4 29CC                    	sub sp, cx
   839 000004C6 89E2                    	mov dx, sp
   840                                  
   841 000004C8 B43F                    	mov ah, 3Fh
   842 000004CA E87C08                  	call read_compressed_or_dos_or_boot_io
   843 000004CD 7303E98004              	jc .io_error
   844 000004D2 89E7                    	mov di, sp
   845 000004D4 89E6                    	mov si, sp
   846                                  
   847 000004D6 39C8                    	cmp ax, cx
   848 000004D8 7538                    	jne .no_trailer_pop
   849                                  
   850 000004DA 31D2                    	xor dx, dx
   851 000004DC D1E9                    	shr cx, 1
   852                                  @@:
   853 000004DE AD                      	lodsw
   854 000004DF 01C2                    	add dx, ax
   855 000004E1 E2FB                    	loop @B
   856 000004E3 752D                    	jnz .no_trailer_pop
   857                                  
   858 000004E5 58                      	pop ax
   859 000004E6 3D454C                  	cmp ax, "EL"
   860 000004E9 7527                    	jne .no_trailer_pop
   861 000004EB 58                      	pop ax
   862 000004EC 3D4431                  	cmp ax, "D1"
   863 000004EF 7521                    	jne .no_trailer_pop
   864 000004F1 58                      	pop ax
   865 000004F2 3D5441                  	cmp ax, "TA"
   866 000004F5 751B                    	jne .no_trailer_pop
   867 000004F7 58                      	pop ax
   868 000004F8 3D494C                  	cmp ax, "IL"
   869 000004FB 7515                    	jne .no_trailer_pop
   870                                  
   871 000004FD 5E                      	pop si
   872 000004FE 59                      	pop cx			; cx:si = displacement to subtract
   873 000004FF 58                      	pop ax			; reserved
   874 00000500 58                      	pop ax			; checksum
   875                                  
   876 00000501 58                      	pop ax
   877 00000502 5A                      	pop dx			; dx:ax = offset of trailer header
   878 00000503 01F0                    	add ax, si
   879 00000505 11CA                    	adc dx, cx		; dx:ax = offset of header
   880 00000507 7203E94604              	jnc .io_error
   881                                  
   882 0000050C 8946DC                  	mov word [bp + ?eldheader], ax
   883 0000050F 8956DE                  	mov word [bp + ?eldheader + 2], dx
   884                                  
   885                                  .no_trailer_pop:
   886 00000512 8D6514                  	lea sp, [di + fromwords(ELD_TRAILER_HEADER_size_w) + 4]
   887                                  
   888                                  .no_trailer:
   889 00000515 B80042                  	mov ax, 4200h
   890 00000518 8B56DC                  	mov dx, word [bp + ?eldheader]
   891 0000051B 8B4EDE                  	mov cx, word [bp + ?eldheader + 2]
   892 0000051E E80208                  	call seek_compressed_or_dos_or_boot_io
   893 00000521 7303E92C04              	jc .io_error
   894                                  
   895                                  .no_trailer_no_seek:
   896                                  %endif
   897                                  
   898 00000526 B43F                    	mov ah, 3Fh
   899 00000528 B92000                  	mov cx, fromwords(ELD_HEADER_size_w)
   900                                  	lvar fromwords(ELD_HEADER_size_w), header
   901 0000052B 29CC                    	sub sp, cx
   902 0000052D 89E2                    	mov dx, sp
   903 0000052F E81708                  	call read_compressed_or_dos_or_boot_io
   904 00000532 7303E91B04              	jc .io_error
   905 00000537 39C8                    	cmp ax, cx
   906 00000539 750C                    	jne .invalid_check_sld_NZ
   907 0000053B 817EBC454C              	cmp word [bp + ?header + eldhSignature], "EL"
   908 00000540 7505                    	jne .invalid_check_sld_NZ
   909 00000542 817EBE4431              	cmp word [bp + ?header + eldhSignature + 2], "D1"
   910                                  .invalid_check_sld_NZ:
   911 00000547 7403E92804              	jne .invalid_check_sld
   912                                  	houdini
   913 0000054C 837EDA24                	cmp word [bp + ?header + eldhExtensionSize], eldhxDescriptionOffset + 4
   914 00000550 7303E9EE03              	jb .nodesc
   915 00000555 83EC04                  	sub sp, 4
   916                                  %if eldhxDescriptionOffset - ELD_HEADER_size
   917                                  	mov dx, eldhxDescriptionOffset - ELD_HEADER_size
   918                                  	xor cx, cx
   919                                  	mov ax, 4201h
   920                                  	call seek_compressed_or_dos_or_boot_io
   921                                  	jc .io_error
   922                                  %endif
   923 00000558 89E2                    	mov dx, sp
   924 0000055A B90400                  	mov cx, 4
   925 0000055D B43F                    	mov ah, 3Fh
   926 0000055F E8E707                  	call read_compressed_or_dos_or_boot_io
   927 00000562 7303E9EB03              	jc .io_error
   928 00000567 39C8                    	cmp ax, cx
   929 00000569 7403E92D04              	jne .invalid
   930 0000056E 5A                      	pop dx
   931 0000056F 59                      	pop cx
   932 00000570 89D0                    	mov ax, dx
   933 00000572 09C8                    	or ax, cx
   934 00000574 7503E9CA03              	jz .nodesc
   935 00000579 0356DC                  	add dx, word [bp + ?eldheader]
   936 0000057C 134EDE                  	adc cx, word [bp + ?eldheader + 2]
   937 0000057F B80042                  	mov ax, 4200h
   938 00000582 E89E07                  	call seek_compressed_or_dos_or_boot_io
   939 00000585 7303E9C803              	jc .io_error
   940                                  
   941 0000058A BF[0000]                reloc	mov di, relocateddata
   942                                  linkdatarelocation line_out
   943 0000058D B94000                  	mov cx, words(128)
   944 00000590 31C0                    	xor ax, ax
   945 00000592 89FA                    	mov dx, di
   946 00000594 F3AB                    	rep stosw
   947 00000596 B43F                    	mov ah, 3Fh
   948 00000598 B97F00                  	mov cx, 127
   949 0000059B E8AB07                  	call read_compressed_or_dos_or_boot_io
   950 0000059E 7303E9AF03              	jc .io_error
   951 000005A3 E8720C                  	extcallcall putsz
   952 000005A6 BA[0301]                reloc	mov dx, msg.linebreak
   953                                  internaldatarelocation
   954                                  .putsz_desc_done:
   955 000005A9 E86C0C                  	extcallcall putsz
   956                                  
   957 000005AC D006[0600]              reloc	rol byte [verbose], 1
   958                                  internaldatarelocation
   959 000005B0 7203E9AE00              	jnc .help
   960 000005B5 BF[0000]                reloc	mov di, relocateddata
   961                                  linkdatarelocation line_out
   962 000005B8 BE[3A01]                reloc	mov si, msg.verbose.1
   963                                  internaldatarelocation
   964 000005BB E8C20C                  	extcallcall copy_single_counted_string
   965                                  
   966 000005BE 8D76BC                  	lea si, [bp + ?header]
   967 000005C1 A5                      	movsw
   968 000005C2 A5                      	movsw
   969                                  
   970 000005C3 83EC08                  	sub sp, 8
   971 000005C6 B80042                  	mov ax, 4200h
   972 000005C9 8B4EC6                  	mov cx, word [bp + ?header + eldhCodeOffset + 2]
   973 000005CC 8B56C4                  	mov dx, word [bp + ?header + eldhCodeOffset]
   974 000005CF 0356DC                  	add dx, word [bp + ?eldheader]
   975 000005D2 134EDE                  	adc cx, word [bp + ?eldheader + 2]
   976                                  		; ELD header is at seek 0
   977 000005D5 83C208                  	add dx, eldiIdentifier
   978 000005D8 83D100                  	adc cx, 0
   979 000005DB 7303E98803              	jc .invalid_instance
   980 000005E0 E84007                  	call seek_compressed_or_dos_or_boot_io
   981 000005E3 7303E96A03              	jc .io_error
   982 000005E8 89E2                    	mov dx, sp
   983 000005EA B43F                    	mov ah, 3Fh
   984 000005EC B90800                  	mov cx, 8
   985 000005EF E85707                  	call read_compressed_or_dos_or_boot_io
   986 000005F2 7303E95B03              	jc .io_error
   987 000005F7 39C8                    	cmp ax, cx
   988 000005F9 7403E96A03              	jne .invalid_instance
   989                                  
   990 000005FE BE[4601]                reloc	mov si, msg.verbose.2
   991                                  internaldatarelocation
   992 00000601 51                      	push cx
   993 00000602 E87B0C                  	extcallcall copy_single_counted_string
   994 00000605 59                      	pop cx
   995                                  
   996 00000606 89E6                    	mov si, sp
   997 00000608 F3A4                    	rep movsb
   998 0000060A A8                      	db __TEST_IMM8		; (skip dec)
   999                                  @@:
  1000 0000060B 4F                      	dec di
  1001 0000060C 807DFF20                	cmp byte [di - 1], 32
  1002 00000610 74F9                    	je @B
  1003                                  
  1004 00000612 83C408                  	add sp, 8
  1005                                  
  1006 00000615 B022                    	mov al, '"'
  1007 00000617 AA                      	stosb
  1008                                  
  1009                                  .after_invalid_instance:
  1010 00000618 53                      	push bx
  1011 00000619 E86C0C                  	extcallcall putsline_crlf
  1012 0000061C 5B                      	pop bx
  1013 0000061D BF[0000]                reloc	mov di, relocateddata
  1014                                  linkdatarelocation line_out
  1015                                  
  1016 00000620 B82020                  	mov ax, 2020h
  1017 00000623 AB                      	stosw
  1018                                  
  1019 00000624 8B46C8                  	mov ax, word [bp + ?header + eldhCodeImageLength]
  1020 00000627 E8660C                  	extcallcall decword
  1021                                  
  1022 0000062A BE[5501]                reloc	mov si, msg.verbose.3
  1023                                  internaldatarelocation
  1024 0000062D E8500C                  	extcallcall copy_single_counted_string
  1025                                  
  1026 00000630 0346CA                  	add ax, word [bp + ?header + eldhCodeAllocLength]
  1027 00000633 83C00F                  	add ax, 15
  1028 00000636 24F0                    	and al, ~15
  1029 00000638 E8550C                  	extcallcall decword
  1030                                  
  1031 0000063B BE[5D01]                reloc	mov si, msg.verbose.4
  1032                                  internaldatarelocation
  1033 0000063E E83F0C                  	extcallcall copy_single_counted_string
  1034                                  
  1035 00000641 8B46D0                  	mov ax, word [bp + ?header + eldhDataImageLength]
  1036 00000644 E8490C                  	extcallcall decword
  1037                                  
  1038 00000647 BE[6601]                reloc	mov si, msg.verbose.5
  1039                                  internaldatarelocation
  1040 0000064A E8330C                  	extcallcall copy_single_counted_string
  1041                                  
  1042 0000064D 0346D2                  	add ax, word [bp + ?header + eldhDataAllocLength]
  1043 00000650 83C00F                  	add ax, 15
  1044 00000653 24F0                    	and al, ~15
  1045 00000655 E8380C                  	extcallcall decword
  1046                                  
  1047 00000658 BE[6E01]                reloc	mov si, msg.verbose.6
  1048                                  internaldatarelocation
  1049 0000065B E8220C                  	extcallcall copy_single_counted_string
  1050                                  
  1051 0000065E 53                      	push bx
  1052 0000065F E8260C                  	extcallcall putsline_crlf
  1053 00000662 5B                      	pop bx
  1054                                  
  1055                                  .help:
  1056 00000663 D006[0700]              reloc	rol byte [do_help], 1
  1057                                  internaldatarelocation
  1058 00000667 7203E9B600              	jnc .help_done
  1059                                  
  1060 0000066C 837EDA28                	cmp word [bp + ?header + eldhExtensionSize], eldhxHelpOffset + 4
  1061 00000670 7303E9D402              	jb .nohelp
  1062 00000675 83EC04                  	sub sp, 4
  1063 00000678 BA2400                  	mov dx, eldhxHelpOffset
  1064 0000067B 31C9                    	xor cx, cx
  1065 0000067D 0356DC                  	add dx, word [bp + ?eldheader]
  1066 00000680 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1067 00000683 B80042                  	mov ax, 4200h
  1068 00000686 E89A06                  	call seek_compressed_or_dos_or_boot_io
  1069 00000689 7303E9C402              	jc .io_error
  1070 0000068E 89E2                    	mov dx, sp
  1071 00000690 B90400                  	mov cx, 4
  1072 00000693 B43F                    	mov ah, 3Fh
  1073 00000695 E8B106                  	call read_compressed_or_dos_or_boot_io
  1074 00000698 7303E9B502              	jc .io_error
  1075 0000069D 39C8                    	cmp ax, cx
  1076 0000069F 7403E9F702              	jne .invalid
  1077 000006A4 5A                      	pop dx
  1078 000006A5 59                      	pop cx
  1079 000006A6 89D0                    	mov ax, dx
  1080 000006A8 09C8                    	or ax, cx
  1081 000006AA 7503E99A02              	jz .nohelp
  1082 000006AF 0356DC                  	add dx, word [bp + ?eldheader]
  1083 000006B2 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1084 000006B5 B80042                  	mov ax, 4200h
  1085 000006B8 E86806                  	call seek_compressed_or_dos_or_boot_io
  1086 000006BB 7303E99202              	jc .io_error
  1087                                  
  1088 000006C0 BF[0000]                reloc	mov di, relocateddata
  1089                                  linkdatarelocation line_out
  1090 000006C3 C646FEFF                	mov byte [bp + ?more_help], 0FFh
  1091                                  
  1092                                  .loop:
  1093 000006C7 89F8                    	mov ax, di
  1094 000006C9 2D[0000]                reloc	sub ax, strict word relocateddata
  1095                                  linkdatarelocation line_out	; ax = how much already buffered
  1096                                  
  1097 000006CC 50                      	push ax
  1098 000006CD 89FA                    	mov dx, di		; dx -> buffer tail
  1099 000006CF B43F                    	mov ah, 3Fh		; read
  1100 000006D1 B9[0001]                reloc	mov cx, 256 + relocateddata
  1101                                  linkdatarelocation line_out
  1102 000006D4 29D1                    	sub cx, dx		; cx = how much space in buffer
  1103 000006D6 E87006                  	call read_compressed_or_dos_or_boot_io
  1104 000006D9 7303E97402              	jc .io_error
  1105                                  %if 0
  1106                                  	mov si, dx
  1107                                  	add si, ax		; -> behind read data
  1108                                  	mov byte [si], 0	; may write byte [line_out + 256]
  1109                                  %endif
  1110 000006DE 59                      	pop cx
  1111 000006DF 01C1                    	add cx, ax		; = how much data we have now
  1112 000006E1 743F                    	jz .help_done		; if done -->
  1113                                  
  1114 000006E3 BF[0000]                reloc	mov di, relocateddata
  1115                                  linkdatarelocation line_out
  1116                                  
  1117 000006E6 57                      	push di
  1118 000006E7 51                      	push cx			; cx = 8 if 8 bytes
  1119 000006E8 B000                    	mov al, 0
  1120 000006EA F2AE                    	repne scasb		; if cx was = 8 and second byte is NUL, cx = 6
  1121 000006EC 91                      	xchg ax, cx		; ax = 6
  1122 000006ED 59                      	pop cx
  1123 000006EE 5F                      	pop di
  1124 000006EF 7506                    	jne @F
  1125 000006F1 F656FE                  	not byte [bp + ?more_help]
  1126 000006F4 29C1                    	sub cx, ax		; cx = 8 - 6 = 2
  1127 000006F6 49                      	dec cx			; cx = 1 (one data byte)
  1128                                  @@:
  1129                                  
  1130 000006F7 B00A                    	mov al, 10
  1131 000006F9 01CF                    	add di, cx		; di -> behind data
  1132 000006FB 51                      	push cx
  1133 000006FC 4F                      	dec di			; NZ, di -> last data byte
  1134 000006FD FD                      	std
  1135 000006FE F2AE                    	repne scasb		; scan for last LF
  1136 00000700 FC                      	cld
  1137 00000701 59                      	pop cx
  1138 00000702 7405                    	je .partial		; found an LF -->
  1139                                  .full:
  1140 00000704 BF[FEFF]                reloc	mov di, relocateddata - 2
  1141                                  linkdatarelocation line_out	; minus 2 to counteract inc inc
  1142 00000707 01CF                    	add di, cx		; -> behind last data byte (minus 2)
  1143                                  .partial:
  1144 00000709 47                      	inc di			; -> at LF
  1145 0000070A 47                      	inc di			; -> behind LF
  1146 0000070B 51                      	push cx
  1147 0000070C 53                      	push bx
  1148 0000070D E8880B                  	extcallcall putsline	; display line_out .. di-1
  1149 00000710 5B                      	pop bx
  1150 00000711 59                      	pop cx
  1151 00000712 89FE                    	mov si, di		; -> behind data displayed
  1152 00000714 BF[0000]                reloc	mov di, relocateddata
  1153                                  linkdatarelocation line_out
  1154                                  		; cx = cx - (si - di)
  1155 00000717 01F9                    	add cx, di
  1156 00000719 29F1                    	sub cx, si		; cx = how much data remains
  1157 0000071B F3A4                    	rep movsb		; move data to start of line_out
  1158                                  				; di -> where to write
  1159 0000071D D046FE                  	rol byte [bp + ?more_help], 1
  1160 00000720 72A5                    	jc .loop
  1161                                  
  1162                                  .help_done:
  1163 00000722 837EDA2C                	cmp word [bp + ?header + eldhExtensionSize], eldhxLibTable + 4
  1164 00000726 7303E97C02              	jb .nolib
  1165 0000072B 83EC04                  	sub sp, 4
  1166 0000072E BA2800                  	mov dx, eldhxLibTable
  1167 00000731 31C9                    	xor cx, cx
  1168 00000733 0356DC                  	add dx, word [bp + ?eldheader]
  1169 00000736 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1170 00000739 B80042                  	mov ax, 4200h
  1171 0000073C E8E405                  	call seek_compressed_or_dos_or_boot_io
  1172 0000073F 7303E90E02              	jc .io_error
  1173 00000744 89E2                    	mov dx, sp
  1174 00000746 B90400                  	mov cx, 4
  1175 00000749 B43F                    	mov ah, 3Fh
  1176 0000074B E8FB05                  	call read_compressed_or_dos_or_boot_io
  1177 0000074E 7303E9FF01              	jc .io_error
  1178 00000753 39C8                    	cmp ax, cx
  1179 00000755 7403E94102              	jne .invalid
  1180 0000075A 5A                      	pop dx
  1181 0000075B 59                      	pop cx
  1182 0000075C 89D0                    	mov ax, dx
  1183 0000075E 09C8                    	or ax, cx
  1184 00000760 7503E94202              	jz .nolib
  1185 00000765 0356DC                  	add dx, word [bp + ?eldheader]
  1186 00000768 134EDE                  	adc cx, word [bp + ?eldheader + 2]
  1187 0000076B B80042                  	mov ax, 4200h
  1188 0000076E E8B205                  	call seek_compressed_or_dos_or_boot_io
  1189 00000771 7303E9DC01              	jc .io_error
  1190                                  
  1191 00000776 B90800                  	mov cx, fromwords(ELD_LIBTABLE_size_w)
  1192 00000779 29CC                    	sub sp, cx
  1193 0000077B 89E2                    	mov dx, sp
  1194 0000077D B43F                    	mov ah, 3Fh
  1195 0000077F E8C705                  	call read_compressed_or_dos_or_boot_io
  1196 00000782 7303E9CB01              	jc .io_error
  1197 00000787 39C8                    	cmp ax, cx
  1198 00000789 7403E90D02              	jne .invalid
  1199 0000078E 89E7                    	mov di, sp
  1200                                  %ifn _COMPRESSED
  1201                                  	cmp word [di + eldltFormat], 0
  1202                                  	jne .invalid
  1203                                  %else
  1204 00000790 31D2                    	xor dx, dx		; init to zero compression layers
  1205 00000792 8B05                    	mov ax, word [di + eldltFormat]
  1206                                  		; 0 = uncompressed
  1207                                  		; 2 = compressed heatshrink
  1208                                  		; 3 = compressed lzexedat -4
  1209                                  		; 4 = compressed lzexedat -4 -l
  1210 00000794 83F804                  	cmp ax, 4
  1211 00000797 7603E9FF01              	ja .invalid
  1212 0000079C 3C01                    	cmp al, 1
  1213 0000079E 7503E9F801              	je .invalid
  1214 000007A3 721D                    	jb @F
  1215 000007A5 A2[0300]                reloc	mov byte [depack_format], al
  1216                                  internaldatarelocation
  1217                                  
  1218 000007A8 B90400                  	mov cx, 4
  1219 000007AB BA[B406]                reloc	mov dx, libtab_compressed_length
  1220                                  internaldatarelocation
  1221 000007AE B43F                    	mov ah, 3Fh
  1222 000007B0 E89605                  	call read_compressed_or_dos_or_boot_io
  1223 000007B3 7303E99A01              	jc .io_error
  1224 000007B8 39C8                    	cmp ax, cx
  1225 000007BA 7403E9DC01              	jne .invalid
  1226                                  
  1227 000007BF BA0100                  	mov dx, 1
  1228                                  @@:
  1229 000007C2 F646E201                	testopt [bp + ?uncompressed_bit_0], 1
  1230                                   %if 0
  1231                                  	jnz @F
  1232                                  	inc dx			; count compression layers
  1233                                  	inc dh			; was already compressed
  1234                                  @@:
  1235                                  	cmp dl, 2		; compressed within compressed ?
  1236                                  	jae .doublepacked	; yes -->
  1237                                   %else
  1238 000007C6 7503E99201              	jz .doublepacked	; lib inside compressed is invalid -->
  1239                                   %endif
  1240                                  %endif
  1241 000007CB 8B4D02                  	mov cx, word [di + eldltAmount]
  1242 000007CE 85C9                    	test cx, cx
  1243 000007D0 7503E9D201              	jz .nolib
  1244 000007D5 894EF4                  	mov word [bp + ?libamount], cx
  1245 000007D8 8B4504                  	mov ax, word [di + eldltOffset]
  1246 000007DB 0346DC                  	add ax, word [bp + ?eldheader]
  1247 000007DE 8946FA                  	mov word [bp + ?liboffset], ax
  1248 000007E1 8B4506                  	mov ax, word [di + eldltOffset + 2]
  1249 000007E4 1346DE                  	adc ax, word [bp + ?eldheader + 2]
  1250 000007E7 8946FC                  	mov word [bp + ?liboffset + 2], ax
  1251                                  
  1252                                  %if _COMPRESSED
  1253 000007EA 52                      	push dx			; on stack: ah = was compressed,
  1254                                  				;  al = next is compressed
  1255                                  %endif
  1256 000007EB D006[0600]              reloc	rol byte [verbose], 1
  1257                                  internaldatarelocation
  1258 000007EF 7350                    	jnc .lib_verbose_done
  1259                                  
  1260 000007F1 53                      	push bx
  1261 000007F2 89FB                    	mov bx, di
  1262 000007F4 BF[0000]                reloc	mov di, relocateddata
  1263                                  linkdatarelocation line_out
  1264                                  
  1265                                  ;	mov ax, 2020h
  1266                                  ;	stosw
  1267                                  
  1268 000007F7 BE[8A01]                reloc	mov si, msg.verbose.lib.1
  1269                                  internaldatarelocation
  1270 000007FA E8830A                  	extcallcall copy_single_counted_string
  1271                                  
  1272 000007FD 8B4702                  	mov ax, word [bx + eldltAmount]
  1273 00000800 E88D0A                  	extcallcall decword
  1274                                  
  1275 00000803 BE[9E01]                reloc	mov si, msg.verbose.lib.2
  1276                                  internaldatarelocation
  1277 00000806 E8770A                  	extcallcall copy_single_counted_string
  1278                                  
  1279 00000809 8B07                    	mov ax, word [bx + eldltFormat]
  1280 0000080B E8820A                  	extcallcall decword
  1281                                  
  1282 0000080E BE[AD01]                reloc	mov si, msg.verbose.lib.3.un
  1283                                  internaldatarelocation
  1284 00000811 3C00                    	cmp al, 0
  1285 00000813 7411                    	je @F
  1286 00000815 BE[BD01]                reloc	mov si, msg.verbose.lib.3.hs
  1287                                  internaldatarelocation
  1288 00000818 3C02                    	cmp al, 2
  1289 0000081A 740A                    	je @F
  1290 0000081C BE[CB01]                reloc	mov si, msg.verbose.lib.3.lze
  1291                                  internaldatarelocation
  1292 0000081F 3C03                    	cmp al, 3
  1293 00000821 7403                    	je @F
  1294 00000823 BE[DA01]                reloc	mov si, msg.verbose.lib.3.lzel
  1295                                  internaldatarelocation
  1296                                  @@:
  1297 00000826 E8570A                  	extcallcall copy_single_counted_string
  1298                                  
  1299 00000829 3C00                    	cmp al, 0
  1300 0000082B 7410                    	je @F
  1301 0000082D BE[EC01]                reloc	mov si, msg.verbose.lib.4
  1302                                  internaldatarelocation
  1303 00000830 E84D0A                  	extcallcall copy_single_counted_string
  1304                                  
  1305 00000833 8B16[B606]              reloc	mov dx, [libtab_compressed_length + 2]
  1306                                  internaldatarelocation
  1307 00000837 A1[B406]                reloc	mov ax, [libtab_compressed_length]
  1308                                  internaldatarelocation
  1309 0000083A E8630A                  	extcallcall decdword
  1310                                  @@:
  1311                                  
  1312 0000083D E8480A                  	extcallcall putsline_crlf
  1313 00000840 5B                      	pop bx
  1314                                  
  1315                                  .lib_verbose_done:
  1316                                  %if _COMPRESSED
  1317 00000841 5A                      	pop dx
  1318                                  %endif
  1319 00000842 83C408                  	add sp, fromwords(ELD_LIBTABLE_size_w)
  1320                                  %if _COMPRESSED
  1321 00000845 52                      	push dx			; on stack: ah = was compressed,
  1322                                  				;  al = next is compressed
  1323                                  %endif
  1324                                  
  1325 00000846 D006[0900]              reloc	rol byte [lib], 1
  1326                                  internaldatarelocation
  1327 0000084A 7203E95801              	jnc .lib_done
  1328                                  
  1329                                   %if _COMPRESSED
  1330 0000084F 31D2                    	xor dx, dx
  1331 00000851 52                      	push dx
  1332 00000852 52                      	push dx
  1333                                   %endif
  1334                                  
  1335                                  .looplib:
  1336 00000853 8D56E6                  	lea dx, [bp + ?libentry]
  1337 00000856 B90C00                  	mov cx, 12
  1338 00000859 B43F                    	mov ah, 3Fh
  1339 0000085B E8EB04                  	call read_compressed_or_dos_or_boot_io
  1340 0000085E 7303E9EF00              	jc .io_error
  1341 00000863 39C8                    	cmp ax, cx
  1342 00000865 7403E93101              	jne .invalid
  1343                                  
  1344 0000086A 31C9                    	xor cx, cx
  1345 0000086C 31D2                    	xor dx, dx
  1346 0000086E B80142                  	mov ax, 4201h
  1347 00000871 E8AF04                  	call seek_compressed_or_dos_or_boot_io
  1348 00000874 7303E9D900              	jc .io_error
  1349 00000879 8946F6                  	mov word [bp + ?libnext], ax
  1350 0000087C 8956F8                  	mov word [bp + ?libnext + 2], dx
  1351                                  
  1352                                  .libname:
  1353                                  %if _ELDTRAILER
  1354 0000087F F646E401                	testopt [bp + ?not_sld_bit_0], 1
  1355 00000883 7521                    	jnz .nolibname
  1356                                  %else
  1357                                  	cmp word [bp + ?eldheader], 0
  1358                                  	jne .nolibname
  1359                                  	cmp word [bp + ?eldheader + 2], 0
  1360                                  	jne .nolibname
  1361                                  %endif
  1362 00000885 D006[0A00]              reloc	rol byte [libname], 1
  1363                                  internaldatarelocation
  1364 00000889 731B                    	jnc .nolibname
  1365 0000088B 8D76EA                  	lea si, [bp + ?libentry + 4]
  1366 0000088E BF[3803]                reloc	mov di, libnamebuffer
  1367                                  internaldatarelocation
  1368 00000891 B90800                  	mov cx, 8
  1369                                  @@:
  1370 00000894 AC                      	lodsb
  1371 00000895 E8D809                  	extcallcall uppercase
  1372 00000898 AE                      	scasb
  1373 00000899 7404                    	je @F
  1374 0000089B 807DFF3F                	cmp byte [di - 1], '?'
  1375                                  @@:
  1376 0000089F E1F3                    	loope @BB
  1377 000008A1 7403E98500              	jne .libskip
  1378                                  .nolibname:
  1379                                  
  1380                                  %if _COMPRESSED
  1381 000008A6 B80042                  	mov ax, 4200h
  1382 000008A9 5A                      	pop dx
  1383 000008AA 59                      	pop cx
  1384 000008AB E8AC04                  	call dos_or_boot_io
  1385                                  
  1386 000008AE 58                      	pop ax
  1387 000008AF 50                      	push ax
  1388 000008B0 3C01                    	cmp al, 1		; CY if uncompressed
  1389 000008B2 7208                    	jb .uncomp_seek
  1390                                  
  1391 000008B4 8B7EE6                  	mov di, word [bp + ?libentry]
  1392 000008B7 8B4EE8                  	mov cx, word [bp + ?libentry + 2]
  1393                                  
  1394                                   %if 0
  1395                                  	test ah, ah
  1396                                  	jz .comp_in_uncomp_seek
  1397                                  .uncomp_in_comp_seek:
  1398                                  	add di, word [bp + ?eldheader]
  1399                                  	adc cx, word [bp + ?eldheader]
  1400                                   %endif
  1401                                  
  1402                                  .comp_in_uncomp_seek:
  1403 000008BA EB1B                    	jmp .seek_done
  1404                                  %endif
  1405                                  .uncomp_seek:
  1406 000008BC 8B56FA                  	mov dx, word [bp + ?liboffset]
  1407 000008BF 8B4EFC                  	mov cx, word [bp + ?liboffset + 2]
  1408 000008C2 0356E6                  	add dx, word [bp + ?libentry]
  1409 000008C5 134EE8                  	adc cx, word [bp + ?libentry + 2]
  1410 000008C8 B80042                  	mov ax, 4200h
  1411 000008CB E85504                  	call seek_compressed_or_dos_or_boot_io
  1412 000008CE 7303E97F00              	jc .io_error
  1413                                  %if _COMPRESSED
  1414 000008D3 31C9                    	xor cx, cx
  1415 000008D5 31FF                    	xor di, di
  1416                                  
  1417                                  .seek_done:
  1418 000008D7 57                      	push di
  1419                                  %endif
  1420                                  
  1421 000008D8 8D7EF3                  	lea di, [bp + ?libentry + 12 + 1]
  1422 000008DB 8D56EA                  	lea dx, [bp + ?libentry + 4]
  1423                                  @@:
  1424 000008DE 4F                      	dec di
  1425 000008DF 39D7                    	cmp di, dx
  1426 000008E1 7606                    	jbe @F
  1427 000008E3 807DFF20                	cmp byte [di - 1], 32
  1428 000008E7 74F5                    	je @B
  1429                                  @@:
  1430 000008E9 C60500                  	mov byte [di], 0
  1431                                  
  1432 000008EC B020                    	mov al, 32
  1433 000008EE E88709                  	extcallcall putc
  1434                                  
  1435                                  %if _COMPRESSED
  1436 000008F1 5F                      	pop di
  1437                                  
  1438 000008F2 58                      	pop ax
  1439 000008F3 50                      	push ax
  1440                                  
  1441 000008F4 FF36[BA06]              reloc	push word [libseek + 2]
  1442                                  internaldatarelocation
  1443 000008F8 FF36[B806]              reloc	push word [libseek]
  1444                                  internaldatarelocation
  1445                                  
  1446                                  %if 0
  1447                                  	test ah, ah		; already was compressed ?
  1448                                  	jnz @F			; yes, leave libseek as is -->
  1449                                  %endif
  1450 000008FC FF76FC                  	push word [bp + ?liboffset + 2]
  1451 000008FF 8F06[BA06]              reloc	pop word [libseek + 2]
  1452                                  internaldatarelocation
  1453 00000903 FF76FA                  	push word [bp + ?liboffset]
  1454 00000906 8F06[B806]              reloc	pop word [libseek]
  1455                                  internaldatarelocation
  1456                                  @@:
  1457                                  
  1458 0000090A 3C01                    	cmp al, 1		; CY if uncompressed
  1459                                  %endif
  1460 0000090C 8B46E0                  	mov ax, word [bp + ?handle]
  1461 0000090F B301                    	mov bl, 1
  1462 00000911 E836FB                  	call commonhandle.lib
  1463 00000914 8B5EE0                  	mov bx, word [bp + ?handle]
  1464                                  
  1465                                  %if _COMPRESSED
  1466 00000917 B80142                  	mov ax, 4201h
  1467 0000091A 31C9                    	xor cx, cx
  1468 0000091C 31D2                    	xor dx, dx
  1469 0000091E E83904                  	call dos_or_boot_io
  1470                                  
  1471 00000921 8F06[B806]              reloc	pop word [libseek]
  1472                                  internaldatarelocation
  1473 00000925 8F06[BA06]              reloc	pop word [libseek + 2]
  1474                                  internaldatarelocation
  1475                                  
  1476 00000929 52                      	push dx
  1477 0000092A 50                      	push ax
  1478                                  %endif
  1479                                  
  1480                                  .libskip:
  1481 0000092B 8B56F6                  	mov dx, word [bp + ?libnext]
  1482 0000092E 8B4EF8                  	mov cx, word [bp + ?libnext + 2]
  1483 00000931 B80042                  	mov ax, 4200h
  1484 00000934 E8EC03                  	call seek_compressed_or_dos_or_boot_io
  1485 00000937 7219                    	jc .io_error
  1486 00000939 FF4EF4                  	dec word [bp + ?libamount]
  1487 0000093C 7403E912FF              	jnz .looplib
  1488 00000941 EB64                    	jmp .lib_done
  1489                                  
  1490                                  .nodesc:
  1491 00000943 BA[3500]                reloc	mov dx, msg.nodesc
  1492                                  internaldatarelocation
  1493 00000946 E960FC                  	jmp .putsz_desc_done
  1494                                  
  1495                                  .nohelp:
  1496 00000949 BA[4700]                reloc	mov dx, msg.nohelp
  1497                                  internaldatarelocation
  1498 0000094C E8C908                  	extcallcall putsz
  1499 0000094F E9D0FD                  	jmp .help_done
  1500                                  
  1501                                  .io_error:
  1502 00000952 B8490E                  	mov ax, 0E49h
  1503 00000955 E8B808                  	extcallcall setrc
  1504 00000958 BA[6400]                reloc	mov dx, msg.io_error
  1505                                  internaldatarelocation
  1506 0000095B EB47                    	jmp .error
  1507                                  
  1508                                  %if _COMPRESSED
  1509                                  .doublepacked:
  1510 0000095D B84A0E                  	mov ax, 0E4Ah
  1511 00000960 E8AD08                  	extcallcall setrc
  1512 00000963 BA[7E00]                reloc	mov dx, msg.doublepacked_error
  1513                                  internaldatarelocation
  1514 00000966 EB3C                    	jmp .error
  1515                                  %endif
  1516                                  
  1517                                  .invalid_instance:
  1518 00000968 BE[BD00]                reloc	mov si, msg.invalid_instance
  1519                                  internaldatarelocation
  1520 0000096B E81209                  	extcallcall copy_single_counted_string
  1521                                  
  1522 0000096E 83C408                  	add sp, 8
  1523 00000971 E9A4FC                  	jmp .after_invalid_instance
  1524                                  
  1525                                  .invalid_check_sld:
  1526 00000974 F646E401                	test byte [bp + ?not_sld_bit_0], 1
  1527 00000978 7521                    	jnz .invalid			; in a lib -->
  1528 0000097A 83F806                  	cmp ax, 6			; "@;SLD0"
  1529 0000097D 7217                    	jb @F
  1530 0000097F 817EBC403B              	cmp word [bp + ?header], "@;"
  1531 00000984 7510                    	jne @F
  1532 00000986 817EBE534C              	cmp word [bp + ?header + 2], "SL"
  1533 0000098B 7509                    	jne @F
  1534 0000098D 817EC04430              	cmp word [bp + ?header + 4], "D0"
  1535 00000992 7502                    	jne @F
  1536 00000994 EB15                    	jmp .sld
  1537                                  
  1538                                  @@:
  1539 00000996 BA[0601]                reloc	mov dx, msg.invalid_sld
  1540                                  internaldatarelocation
  1541 00000999 EB09                    	jmp .error
  1542                                  
  1543                                  .invalid:
  1544 0000099B B84B0E                  	mov ax, 0E4Bh
  1545 0000099E E86F08                  	extcallcall setrc
  1546 000009A1 BA[D900]                reloc	mov dx, msg.invalid
  1547                                  internaldatarelocation
  1548                                  .error:
  1549                                  .putsz_ret:
  1550 000009A4 E87108                  	extcallcall putsz
  1551                                  .ret:
  1552                                  .lib_done:
  1553                                  .nolib:
  1554 000009A7 89EC5D                  	lleave code, forcerestoresp
  1555 000009AA C3                      	retn
  1556                                  
  1557                                  
  1558                                  .sld:
  1559                                  %if 0
  1560                                  	mov cx, word [bp + ?eldheader + 2]
  1561                                  	mov dx, word [bp + ?eldheader]
  1562                                  	add dx, 6
  1563                                  	adc cx, 0
  1564                                  %else
  1565 000009AB 31C9                    	xor cx, cx
  1566 000009AD BA0600                  	mov dx, 6
  1567                                  %endif
  1568 000009B0 B80042                  	mov ax, 4200h
  1569                                  	; call seek_compressed_or_dos_or_boot_io
  1570 000009B3 E8A403                  	call dos_or_boot_io
  1571 000009B6 729A                    	jc .io_error
  1572                                  
  1573 000009B8 B9[ED09]                reloc	mov cx, .check_d
  1574                                  internalcoderelocation
  1575                                  
  1576                                  .sldreload:
  1577 000009BB BA[0000]                reloc	mov dx, relocateddata
  1578                                  linkdatarelocation line_out
  1579 000009BE 8956EA                  	mov word [bp + ?next], dx	; reset ?next
  1580 000009C1 51                      	push cx				; ! preserve state
  1581 000009C2 B90001                  	mov cx, 256
  1582 000009C5 B43F                    	mov ah, 3Fh
  1583 000009C7 E89003                  	call dos_or_boot_io		; fill buffer
  1584 000009CA 59                      	pop cx				; ! preserve state
  1585 000009CB 7285                    	jc .io_error
  1586 000009CD 85C0                    	test ax, ax			; no more data ?
  1587 000009CF 7413                    	jz .sld_no_desc			; yes -->
  1588 000009D1 01D0                    	add ax, dx
  1589 000009D3 8946E8                  	mov word [bp + ?tail], ax	; set ?tail
  1590                                  
  1591                                  .sldloop:
  1592 000009D6 8B76EA                  	mov si, word [bp + ?next]	; -> next data
  1593 000009D9 3B76E8                  	cmp si, word [bp + ?tail]	; have one more byte ?
  1594 000009DC 74DD                    	je .sldreload			; no -->
  1595                                  
  1596 000009DE AC                      	lodsb				; get the byte
  1597 000009DF 8976EA                  	mov word [bp + ?next], si	; update ?next
  1598 000009E2 FFE1                    	jmp cx				; jump to state
  1599                                  
  1600                                  .sldnext: equ .sldloop			; get next byte -->
  1601                                  
  1602                                  .sld_no_desc:
  1603 000009E4 BA[3500]                reloc	mov dx, msg.nodesc
  1604                                  internaldatarelocation
  1605 000009E7 E82E08                  	extcallcall putsz
  1606 000009EA E9C800                  	jmp .sld_desc_done
  1607                                  
  1608                                  .check_d:				; D may be prepended by blanks,
  1609                                  					;  commas, or semicolons
  1610                                  				; state unchanged
  1611 000009ED 3C2C                    	cmp al, ','			; skip any commas
  1612 000009EF 74E5                    	je .sldnext
  1613 000009F1 3C3B                    	cmp al, ';'			; or semicolons
  1614 000009F3 74E1                    	je .sldnext
  1615 000009F5 3C20                    	cmp al, 32
  1616 000009F7 74DD                    	je .sldnext
  1617 000009F9 3C09                    	cmp al, 9			; or blanks
  1618 000009FB 74D9                    	je .sldnext
  1619 000009FD E87008                  	extcallcall uppercase
  1620 00000A00 B9[310A]                reloc	mov cx, .check_e 	; change state if D found
  1621                                  internalcoderelocation
  1622 00000A03 3C44                    	cmp al, 'D'			; is it a D ?
  1623                                  .sldnext_ZR_else_skip_to_eol:
  1624 00000A05 74CF                    	je .sldnext			; yes -->
  1625                                  				; skip to next line
  1626                                  .skip_to_eol:
  1627 00000A07 B9[1B0A]                reloc	mov cx, .check_at	; change state if EOL found
  1628                                  internalcoderelocation
  1629 00000A0A 3C0D                    	cmp al, 13			; EOL ?
  1630 00000A0C 74C8                    	je .sldnext
  1631 00000A0E 3C0A                    	cmp al, 10
  1632 00000A10 74C4                    	je .sldnext
  1633 00000A12 3C00                    	cmp al, 0
  1634 00000A14 74C0                    	je .sldnext			; yes -->
  1635 00000A16 B9[070A]                reloc	mov cx, .skip_to_eol		; loop back to this state
  1636                                  internalcoderelocation
  1637 00000A19 EBBB                    	jmp .sldnext
  1638                                  
  1639                                  .check_at:				; @ must be in first column
  1640 00000A1B B9[220A]                reloc	mov cx, .check_semicolon
  1641                                  internalcoderelocation
  1642 00000A1E 3C40                    	cmp al, '@'
  1643 00000A20 EBE3                    	jmp .sldnext_ZR_else_skip_to_eol
  1644                                  
  1645                                  .check_semicolon:			; semicolon may be prepended by blanks
  1646 00000A22 3C20                    	cmp al, 32
  1647 00000A24 74B0                    	je .sldnext
  1648 00000A26 3C09                    	cmp al, 9
  1649                                  .sldnext_ZR_j1:
  1650 00000A28 74AC                    	je .sldnext
  1651 00000A2A B9[ED09]                reloc	mov cx, .check_d
  1652                                  internalcoderelocation
  1653 00000A2D 3C3B                    	cmp al, ';'
  1654 00000A2F EBD4                    	jmp .sldnext_ZR_else_skip_to_eol
  1655                                  
  1656                                  .check_e:				; E must be immediately after D
  1657 00000A31 E83C08                  	extcallcall uppercase
  1658 00000A34 B9[3B0A]                reloc	mov cx, .check_s
  1659                                  internalcoderelocation
  1660 00000A37 3C45                    	cmp al, 'E'
  1661 00000A39 EBCA                    	jmp .sldnext_ZR_else_skip_to_eol
  1662                                  
  1663                                  .check_s:				; S must be immediately after E
  1664 00000A3B E83208                  	extcallcall uppercase
  1665 00000A3E B9[450A]                reloc	mov cx, .check_c
  1666                                  internalcoderelocation
  1667 00000A41 3C53                    	cmp al, 'S'
  1668 00000A43 EBC0                    	jmp .sldnext_ZR_else_skip_to_eol
  1669                                  
  1670                                  .check_c:				; C must be immediately after S
  1671 00000A45 E82808                  	extcallcall uppercase
  1672 00000A48 B9[4F0A]                reloc	mov cx, .check_equals_sign
  1673                                  internalcoderelocation
  1674 00000A4B 3C43                    	cmp al, 'C'
  1675 00000A4D EBB6                    	jmp .sldnext_ZR_else_skip_to_eol
  1676                                  
  1677                                  .check_equals_sign:			; = or : may be prepended by blanks
  1678 00000A4F 3C20                    	cmp al, 32
  1679 00000A51 74D5                    	je .sldnext_ZR_j1
  1680 00000A53 3C09                    	cmp al, 9
  1681 00000A55 74D1                    	je .sldnext_ZR_j1
  1682 00000A57 B9[620A]                reloc	mov cx, .skip_blanks
  1683                                  internalcoderelocation
  1684 00000A5A 3C3D                    	cmp al, '='
  1685 00000A5C 74CA                    	je .sldnext_ZR_j1
  1686 00000A5E 3C3A                    	cmp al, ':'
  1687 00000A60 EBA3                    	jmp .sldnext_ZR_else_skip_to_eol
  1688                                  
  1689                                  .skip_blanks:				; description may be prepended by blanks
  1690 00000A62 3C20                    	cmp al, 32
  1691 00000A64 74C2                    	je .sldnext_ZR_j1
  1692 00000A66 3C09                    	cmp al, 9
  1693 00000A68 74BE                    	je .sldnext_ZR_j1
  1694                                  
  1695 00000A6A BF[0000]                reloc	mov di, relocateddata
  1696                                  linkdatarelocation line_out		; -> start of buffer
  1697 00000A6D 8B76EA                  	mov si, word [bp + ?next]
  1698 00000A70 4E                      	dec si				; -> first nonblank (at least 1 byte)
  1699 00000A71 8B4EE8                  	mov cx, word [bp + ?tail]	; -> after last buffered byte
  1700 00000A74 29F1                    	sub cx, si			; = length of buffered data
  1701 00000A76 F3A4                    	rep movsb			; move down in buffer
  1702 00000A78 89FA                    	mov dx, di			; -> after buffered data
  1703 00000A7A B9[7F00]                reloc	mov cx, relocateddata + 127
  1704                                  linkdatarelocation line_out		; -> after last byte we want to read
  1705 00000A7D 89CF                    	mov di, cx			; -> where to place terminator
  1706 00000A7F 29D1                    	sub cx, dx			; = length to read after buffered data
  1707 00000A81 760E                    	jbe @F				; if below-or-equal zero, none to read -->
  1708 00000A83 B43F                    	mov ah, 3Fh
  1709 00000A85 E8D202                  	call dos_or_boot_io		; read it
  1710 00000A88 7303E9C5FE              	jc .io_error			; on error -->
  1711                                  					; (valid to read 0 up to 126 Bytes)
  1712 00000A8D 89C7                    	mov di, ax
  1713 00000A8F 01D7                    	add di, dx			; -> after last read byte
  1714                                  @@:
  1715 00000A91 C60500                  	mov byte [di], 0		; store a terminator
  1716                                  
  1717 00000A94 BA[0000]                reloc	mov dx, relocateddata
  1718                                  linkdatarelocation line_out		; -> message data
  1719 00000A97 89D6                    	mov si, dx			; -> text to scan
  1720                                  @@:
  1721 00000A99 AC                      	lodsb				; get a text byte
  1722 00000A9A 3C00                    	cmp al, 0			; EOL ?
  1723 00000A9C 7408                    	je @F
  1724 00000A9E 3C0D                    	cmp al, 13
  1725 00000AA0 7404                    	je @F
  1726 00000AA2 3C0A                    	cmp al, 10
  1727 00000AA4 75F3                    	jne @B				; not yet -->
  1728                                  @@:
  1729 00000AA6 46                      	inc si				; (si - 2) -> behind message data
  1730 00000AA7 C744FE0D0A              	mov word [si - 2], 13 | (10 << 8)
  1731                                  					; append a linebreak
  1732 00000AAC 89F1                    	mov cx, si
  1733 00000AAE 29D1                    	sub cx, dx			; cx = message data length including CR LF
  1734 00000AB0 53                      	push bx
  1735 00000AB1 E8F407                  	extcallcall puts		; display message
  1736 00000AB4 5B                      	pop bx
  1737                                  
  1738                                  .sld_desc_done:
  1739 00000AB5 D006[0600]              reloc	rol byte [verbose], 1
  1740                                  internaldatarelocation
  1741 00000AB9 7341                    	jnc .sld_verbose_done
  1742 00000ABB BF[0000]                reloc	mov di, relocateddata
  1743                                  linkdatarelocation line_out
  1744 00000ABE BE[3A01]                reloc	mov si, msg.verbose.1
  1745                                  internaldatarelocation
  1746 00000AC1 E8BC07                  	extcallcall copy_single_counted_string
  1747                                  
  1748 00000AC4 8D76BE                  	lea si, [bp + ?header + 2]
  1749 00000AC7 A5                      	movsw
  1750 00000AC8 A5                      	movsw
  1751                                  
  1752 00000AC9 BE[7501]                reloc	mov si, msg.verbose.2.sld
  1753                                  internaldatarelocation
  1754 00000ACC E8B107                  	extcallcall copy_single_counted_string
  1755                                  
  1756 00000ACF 31D2                    	xor dx, dx
  1757 00000AD1 31C9                    	xor cx, cx
  1758 00000AD3 B80242                  	mov ax, 4202h
  1759                                  %if 0
  1760                                  	call dos_or_boot_io
  1761                                  	jc .io_error
  1762                                  %else
  1763                                   %if _BOOTLDR
  1764 00000AD6 F606[0100]40            reloc	testopt [relocateddata], nodosloaded
  1765                                  linkdatarelocation internalflags, -3
  1766 00000ADB 7409                    	jz @F
  1767 00000ADD A1[F4FF]                reloc	mov ax, word [relocateddata - LOADDATA2 + ldFileSize]
  1768                                  linkdatarelocation load_data
  1769 00000AE0 8B16[F6FF]              reloc	mov dx, word [relocateddata - LOADDATA2 + ldFileSize + 2]
  1770                                  linkdatarelocation load_data
  1771 00000AE4 EB08                    	jmp @FF
  1772                                  @@:
  1773                                   %endif
  1774 00000AE6 E87802                  	call dos_or_boot_io.dos
  1775 00000AE9 7303E964FE              	jc .io_error
  1776                                  @@:
  1777                                  %endif
  1778 00000AEE E8AF07                  	extcallcall decdword
  1779                                  
  1780 00000AF1 BE[8301]                reloc	mov si, msg.verbose.3.sld
  1781                                  internaldatarelocation
  1782 00000AF4 E88907                  	extcallcall copy_single_counted_string
  1783                                  
  1784 00000AF7 53                      	push bx
  1785 00000AF8 E88D07                  	extcallcall putsline_crlf
  1786 00000AFB 5B                      	pop bx
  1787                                  
  1788                                  .sld_verbose_done:
  1789                                  sld_help:
  1790 00000AFC D006[0700]              reloc	rol byte [do_help], 1
  1791                                  internaldatarelocation
  1792 00000B00 734C                    	jnc .done
  1793                                  
  1794 00000B02 31D2                    	xor dx, dx
  1795 00000B04 31C9                    	xor cx, cx
  1796 00000B06 894EEC                  	mov word [bp + ?helpstarted], cx
  1797 00000B09 B80042                  	mov ax, 4200h
  1798 00000B0C E84B02                  	call dos_or_boot_io
  1799 00000B0F 7303E93EFE              	jc commonhandle.io_error
  1800                                  
  1801 00000B14 B9[510B]                reloc	mov cx, .check_at_or_semicolon
  1802                                  internalcoderelocation
  1803                                  
  1804                                  .reload:
  1805 00000B17 BA[0000]                reloc	mov dx, relocateddata
  1806                                  linkdatarelocation line_out
  1807 00000B1A 8956EA                  	mov word [bp + ?next], dx	; reset ?next
  1808 00000B1D 51                      	push cx				; ! preserve state
  1809 00000B1E B90001                  	mov cx, 256
  1810 00000B21 B43F                    	mov ah, 3Fh
  1811 00000B23 E83402                  	call dos_or_boot_io		; fill buffer
  1812 00000B26 59                      	pop cx				; ! preserve state
  1813 00000B27 7303E926FE              	jc commonhandle.io_error
  1814 00000B2C 85C0                    	test ax, ax			; no more data ?
  1815 00000B2E 7413                    	jz .eof				; yes -->
  1816 00000B30 01D0                    	add ax, dx
  1817 00000B32 8946E8                  	mov word [bp + ?tail], ax	; set ?tail
  1818                                  
  1819                                  .loop:
  1820 00000B35 8B76EA                  	mov si, word [bp + ?next]	; -> next data
  1821 00000B38 3B76E8                  	cmp si, word [bp + ?tail]	; have one more byte ?
  1822 00000B3B 74DA                    	je .reload			; no -->
  1823                                  
  1824 00000B3D AC                      	lodsb				; get the byte
  1825 00000B3E 8976EA                  	mov word [bp + ?next], si	; update ?next
  1826 00000B41 FFE1                    	jmp cx				; jump to state
  1827                                  
  1828                                  .next: equ .loop			; get next byte -->
  1829                                  
  1830                                  .eof:
  1831 00000B43 D046EC                  	rol byte [bp + ?helpstarted], 1
  1832 00000B46 7206                    	jc .done
  1833                                  
  1834                                  .no_help:
  1835 00000B48 BA[4700]                reloc	mov dx, msg.nohelp
  1836                                  internaldatarelocation
  1837 00000B4B E8CA06                  	extcallcall putsz
  1838                                  .done:
  1839 00000B4E E956FE                  	jmp commonhandle.ret
  1840                                  
  1841                                  .check_at_or_semicolon:
  1842 00000B51 B9[580B]                reloc	mov cx, .check_semicolon
  1843                                  internalcoderelocation
  1844 00000B54 3C40                    	cmp al, '@'			; is it an @ ?
  1845 00000B56 74DD                    	je .next
  1846                                  .check_semicolon:
  1847 00000B58 3C20                    	cmp al, 32			; blanks
  1848 00000B5A 74D9                    	je .next
  1849 00000B5C 3C09                    	cmp al, 9			; or tabs
  1850 00000B5E 74D5                    	je .next
  1851 00000B60 B9[7B0B]                reloc	mov cx, .check_h
  1852                                  internalcoderelocation
  1853 00000B63 3C3B                    	cmp al, ';'			; semicolon ?
  1854                                  .next_ZR_else_skip_to_eol:
  1855 00000B65 74CE                    	je .next			; yes -->
  1856                                  				; skip to next line
  1857                                  .skip_to_eol:
  1858 00000B67 B9[510B]                reloc	mov cx, .check_at_or_semicolon	; change state if EOL found
  1859                                  internalcoderelocation
  1860 00000B6A 3C0D                    	cmp al, 13			; EOL ?
  1861 00000B6C 74C7                    	je .next
  1862 00000B6E 3C0A                    	cmp al, 10
  1863 00000B70 74C3                    	je .next
  1864 00000B72 3C00                    	cmp al, 0
  1865 00000B74 74BF                    	je .next			; yes -->
  1866                                  .next_skip_to_eol:
  1867 00000B76 B9[670B]                reloc	mov cx, .skip_to_eol		; loop back to this state
  1868                                  internalcoderelocation
  1869 00000B79 EBBA                    	jmp .next
  1870                                  
  1871                                  .check_h:
  1872 00000B7B 3C20                    	cmp al, 32			; blanks
  1873 00000B7D 74B6                    	je .next
  1874 00000B7F 3C09                    	cmp al, 9			; or tabs
  1875 00000B81 74B2                    	je .next
  1876 00000B83 E8EA06                  	extcallcall uppercase
  1877 00000B86 3C48                    	cmp al, 'H'
  1878 00000B88 75DD                    	jne .skip_to_eol
  1879 00000B8A E81701                  	call .fill
  1880 00000B8D 81FA[0A00]              reloc	cmp dx, relocateddata + msg.helpstart.length + 1
  1881                                  linkdatarelocation line_out
  1882 00000B91 72B5                    	jb .no_help
  1883 00000B93 A0[0900]                reloc	mov al, byte [relocateddata + msg.helpstart.length]
  1884                                  linkdatarelocation line_out
  1885 00000B96 3C20                    	cmp al, 32			; blank ?
  1886 00000B98 7415                    	je @F
  1887 00000B9A 3C09                    	cmp al, 9
  1888 00000B9C 7411                    	je @F
  1889 00000B9E 3C0D                    	cmp al, 13			; CR ?
  1890 00000BA0 740D                    	je @F
  1891 00000BA2 3C00                    	cmp al, 0			; NUL ?
  1892 00000BA4 7409                    	je @F
  1893 00000BA6 3C0A                    	cmp al, 10			; LF ?
  1894                                  .next_skip_to_eol_NZ:
  1895 00000BA8 75CC                    	jne .next_skip_to_eol
  1896 00000BAA C606[0900]0D            reloc	mov byte [relocateddata + msg.helpstart.length], 13
  1897                                  linkdatarelocation line_out, -3		; insert CR for isstring?
  1898                                  		; Modifying the buffered data!
  1899                                  @@:
  1900 00000BAF BE[0000]                reloc	mov si, relocateddata
  1901                                  linkdatarelocation line_out
  1902 00000BB2 BA[5200]                reloc	mov dx, msg.helpstart
  1903                                  internaldatarelocation
  1904 00000BB5 E8B006                  	extcallcall isstring?
  1905 00000BB8 75EE                    	jne .next_skip_to_eol_NZ
  1906                                  
  1907 00000BBA 8976EA                  	mov word [bp + ?next], si
  1908 00000BBD B9[C30B]                reloc	mov cx, .check_eol
  1909                                  internalcoderelocation
  1910                                  .next_j:
  1911 00000BC0 E972FF                  	jmp .next
  1912                                  
  1913                                  .check_eol:
  1914 00000BC3 3C20                    	cmp al, 32
  1915 00000BC5 74F9                    	je .next_j
  1916 00000BC7 3C09                    	cmp al, 9
  1917 00000BC9 74F5                    	je .next_j
  1918 00000BCB 3C0D                    	cmp al, 13
  1919 00000BCD 7408                    	je @F
  1920 00000BCF 3C0A                    	cmp al, 10
  1921 00000BD1 7404                    	je @F
  1922 00000BD3 3C00                    	cmp al, 0
  1923 00000BD5 75D1                    	jne .next_skip_to_eol_NZ
  1924                                  @@:
  1925 00000BD7 B9[DF0B]                reloc	mov cx, .check_help_at_or_semicolon
  1926                                  internalcoderelocation
  1927 00000BDA F656EC                  	not byte [bp + ?helpstarted]
  1928                                  .next_j2:
  1929 00000BDD EBE1                    	jmp .next_j
  1930                                  
  1931                                  .check_help_at_or_semicolon:
  1932 00000BDF B9[E60B]                reloc	mov cx, .check_help_semicolon
  1933                                  internalcoderelocation
  1934 00000BE2 3C40                    	cmp al, '@'			; is it an @ ?
  1935 00000BE4 74F7                    	je .next_j2
  1936                                  .check_help_semicolon:
  1937 00000BE6 3C20                    	cmp al, 32			; blanks
  1938 00000BE8 74F3                    	je .next_j2
  1939 00000BEA 3C09                    	cmp al, 9			; or tabs
  1940 00000BEC 74EF                    	je .next_j2
  1941 00000BEE B9[090C]                reloc	mov cx, .display_help
  1942                                  internalcoderelocation
  1943 00000BF1 3C3B                    	cmp al, ';'			; semicolon ?
  1944                                  ;.next_ZR_else_skip_to_eol:
  1945 00000BF3 74E8                    	je .next_j2			; yes -->
  1946                                  				; skip to next line
  1947                                  .help_skip_to_eol:
  1948 00000BF5 B9[DF0B]                reloc	mov cx, .check_help_at_or_semicolon
  1949                                  internalcoderelocation			; change state if EOL found
  1950 00000BF8 3C0D                    	cmp al, 13			; EOL ?
  1951 00000BFA 74E1                    	je .next_j2
  1952 00000BFC 3C0A                    	cmp al, 10
  1953 00000BFE 74DD                    	je .next_j2
  1954 00000C00 3C00                    	cmp al, 0
  1955 00000C02 74D9                    	je .next_j2			; yes -->
  1956                                  .next_help_skip_to_eol:
  1957 00000C04 B9[F50B]                reloc	mov cx, .help_skip_to_eol	; loop back to this state
  1958                                  internalcoderelocation
  1959 00000C07 EBD4                    	jmp .next_j2
  1960                                  
  1961                                  .display_help:
  1962 00000C09 E89800                  	call .fill
  1963 00000C0C FF4EEA                  	dec word [bp + ?next]
  1964 00000C0F BE[0000]                reloc	mov si, relocateddata
  1965                                  linkdatarelocation line_out		; -> buffer
  1966                                  @@:
  1967 00000C12 39D6                    	cmp si, dx
  1968 00000C14 7365                    	jae .do_display_help
  1969 00000C16 AC                      	lodsb
  1970 00000C17 3C20                    	cmp al, 32
  1971 00000C19 74F7                    	je @B
  1972 00000C1B 3C09                    	cmp al, 9
  1973 00000C1D 74F3                    	je @B
  1974 00000C1F E84E06                  	extcallcall uppercase
  1975 00000C22 3C48                    	cmp al, 'H'
  1976 00000C24 7555                    	jne .do_display_help
  1977                                  
  1978 00000C26 4E                      	dec si				; -> at the H
  1979 00000C27 8D7C07                  	lea di, [si + msg.helpend.length]
  1980                                  					; -> at candidate separator
  1981 00000C2A 39FA                    	cmp dx, di			; string is in buffer ?
  1982 00000C2C 724D                    	jb .do_display_help		; no -->
  1983 00000C2E 7703                    	ja .havesep			; yes, separator too -->
  1984 00000C30 C60500                  	mov byte [di], 0		; store a separator here
  1985                                  					;  (can overflow line_out+256)
  1986                                  .havesep:
  1987 00000C33 8A05                    	mov al, byte [di]		; get separator
  1988 00000C35 3C20                    	cmp al, 32			; one of the valid separators ?
  1989 00000C37 7413                    	je @F
  1990 00000C39 3C09                    	cmp al, 9
  1991 00000C3B 740F                    	je @F
  1992 00000C3D 3C0D                    	cmp al, 13
  1993 00000C3F 740B                    	je @F
  1994 00000C41 3C00                    	cmp al, 0
  1995 00000C43 7407                    	je @F
  1996 00000C45 3C0A                    	cmp al, 10			; LF ?
  1997 00000C47 7532                    	jne .do_display_help		; no -->
  1998 00000C49 C6050D                  	mov byte [di], 13		; insert CR for isstring?
  1999                                  		; Modifying the buffered data!
  2000                                  @@:
  2001 00000C4C 52                      	push dx
  2002 00000C4D BA[5C00]                reloc	mov dx, msg.helpend
  2003                                  internaldatarelocation
  2004 00000C50 E81506                  	extcallcall isstring?		; is it "helpend" ?
  2005 00000C53 5A                      	pop dx
  2006 00000C54 7525                    	jne .do_display_help		; no -->
  2007                                  @@:
  2008 00000C56 39D6                    	cmp si, dx			; reached EOL ?
  2009 00000C58 7203E9F1FE              	jae .done			; then it was helpend
  2010 00000C5D AC                      	lodsb
  2011 00000C5E 3C20                    	cmp al, 32			; blank ?
  2012 00000C60 74F4                    	je @B
  2013 00000C62 3C09                    	cmp al, 9
  2014 00000C64 74F0                    	je @B				; yes, loop here -->
  2015 00000C66 3C0D                    	cmp al, 13			; linebreak ?
  2016 00000C68 7503E9E1FE              	je .done
  2017 00000C6D 3C0A                    	cmp al, 10
  2018 00000C6F 7503E9DAFE              	je .done
  2019 00000C74 3C00                    	cmp al, 0
  2020 00000C76 7503E9D3FE              	je .done			; yes, it was helpend -->
  2021                                  
  2022                                  		; Not "helpend". Display this line.
  2023                                  .do_display_help:
  2024 00000C7B BE[0000]                reloc	mov si, relocateddata
  2025                                  linkdatarelocation line_out		; -> buffer
  2026 00000C7E 56                      	push si				; -> buffer
  2027                                  @@:
  2028 00000C7F 39D6                    	cmp si, dx			; reached end ?
  2029 00000C81 730E                    	jae .si				; yes, si -> end
  2030 00000C83 AC                      	lodsb				; get next byte
  2031 00000C84 3C0D                    	cmp al, 13			; linebreak ?
  2032 00000C86 7408                    	je .si_minus_1
  2033 00000C88 3C0A                    	cmp al, 10
  2034 00000C8A 7404                    	je .si_minus_1
  2035 00000C8C 3C00                    	cmp al, 0
  2036 00000C8E 75EF                    	jne @B				; no, loop -->
  2037                                  .si_minus_1:
  2038 00000C90 4E                      	dec si				; -> end of text
  2039                                  .si:
  2040 00000C91 89F1                    	mov cx, si			; -> end of text
  2041 00000C93 5A                      	pop dx
  2042 00000C94 29D1                    	sub cx, dx			; = length
  2043 00000C96 53                      	push bx
  2044 00000C97 E80E06                  	extcallcall puts
  2045 00000C9A 5B                      	pop bx
  2046 00000C9B BA[0301]                reloc	mov dx, msg.linebreak		; display a linebreak
  2047                                  internaldatarelocation
  2048 00000C9E E87705                  	extcallcall putsz
  2049 00000CA1 E960FF                  	jmp .next_help_skip_to_eol	; skip to next line
  2050                                  
  2051                                  
  2052                                  		; INP:	?next, ?tail
  2053                                  		;	?next - 1 -> buffered data, at least 1 byte
  2054                                  		; OUT:	line_out -> buffered data, at least 1 byte
  2055                                  		;	?next = line_out + 1
  2056                                  		;	dx = ?tail -> behind buffered data
  2057                                  		;	 (up to EOF or == line_out + 256)
  2058                                  		;	branches to commonhandle.io_error on I/O error
  2059                                  		; CHG:	di, si, ax, cx
  2060                                  .fill:
  2061 00000CA4 BF[0000]                reloc	mov di, relocateddata
  2062                                  linkdatarelocation line_out		; -> buffer
  2063 00000CA7 8B76EA                  	mov si, word [bp + ?next]
  2064 00000CAA 4E                      	dec si				; -> H in buffer
  2065 00000CAB 8B4EE8                  	mov cx, word [bp + ?tail]	; -> behind last buffered text
  2066 00000CAE 29F1                    	sub cx, si			; length of buffered data
  2067 00000CB0 8D5501                  	lea dx, [di + 1]		; -> behind the H's destination
  2068 00000CB3 F3A4                    	rep movsb			; move down buffered data
  2069 00000CB5 8956EA                  	mov word [bp + ?next], dx	; -> behind the H
  2070                                  	; mov word [bp + ?tail], di
  2071 00000CB8 89FA                    	mov dx, di
  2072 00000CBA B9[0001]                reloc	mov cx, relocateddata + 256
  2073                                  linkdatarelocation line_out
  2074 00000CBD 29D1                    	sub cx, dx
  2075 00000CBF 7434                    	jz @F
  2076 00000CC1 B43F                    	mov ah, 3Fh
  2077 00000CC3 E89400                  	call dos_or_boot_io		; fill buffer
  2078 00000CC6 7303E987FC              	jc commonhandle.io_error
  2079 00000CCB 01C2                    	add dx, ax
  2080 00000CCD 8956E8                  	mov word [bp + ?tail], dx
  2081 00000CD0 C3                      	retn
  2082                                  
  2083                                  
  2084                                  inject:
  2085 00000CD1 8B16[4003]              reloc	mov dx, word [originaldta]	; dx -> original DTA
  2086                                  internaldatarelocation
  2087 00000CD5 B41A                    	mov ah, 1Ah			; set DTA (restoring)
  2088 00000CD7 E85E05                  	extcallcall ispm
  2089 00000CDA 7511                    	jnz .rm
  2090                                  
  2091                                  subcpu 286
  2092 00000CDC FF36[4203]              reloc	push word [originaldta + 2]
  2093                                  internaldatarelocation			; ds => original DTA (86M segment)
  2094 00000CE0 6A21                    	push word 21h
  2095 00000CE2 E8[0000]EB020000        	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
  2096 00000CE9 5A                      	pop dx				; discard interrupt number
  2097 00000CEA 5A                      	pop dx				; discard es
  2098                                  subcpureset
  2099 00000CEB EB08                    	jmp @F
  2100                                  .rm:
  2101 00000CED 8E1E[4203]              reloc	mov ds, word [originaldta + 2]	; ds => original DTA
  2102                                  internaldatarelocation
  2103 00000CF1 CD21                    	int 21h
  2104 00000CF3 16                      	 push ss
  2105 00000CF4 1F                      	 pop ds
  2106                                  @@:
  2107                                  
  2108 00000CF5 8B1E[4803]              reloc	mov bx, word [findhandle]	; bx = find handle, if any
  2109                                  internaldatarelocation
  2110 00000CF9 D006[0400]              reloc	rol byte [findhandle_set], 1	; find handle set ?
  2111                                  internaldatarelocation
  2112 00000CFD 730A                    	jnc @F				; no -->
  2113 00000CFF F616[0400]              reloc	not byte [findhandle_set]
  2114                                  internaldatarelocation
  2115 00000D03 B8A171                  	mov ax, 71A1h
  2116 00000D06 E83705                  	extcallcall _doscall		; LFN find close
  2117                                  @@:
  2118                                  
  2119 00000D09 8B0E[4403]              reloc	mov cx, word [originalinject]
  2120                                  internaldatarelocation
  2121 00000D0D E88F04                  	call get_es_ext
  2122 00000D10 268026[1000]FE          reloc	clropt [es:code + eldiFlags], eldifResident
  2123                                  internalcoderelocation -3		; mark block as no longer resident
  2124 00000D16 16                      	 push ss
  2125 00000D17 07                      	 pop es
  2126 00000D18 E302                    	jcxz @F
  2127 00000D1A FFE1                    	jmp cx
  2128                                  
  2129                                  @@:
  2130 00000D1C E8[0000]EB020000        	extcall cmd3_not_inject
  2131                                  
  2132                                  
  2133                                  %if _COMPRESSED
  2134                                  seek_compressed_or_dos_or_boot_io:
  2135 00000D23 F646E201                	testopt [bp + ?uncompressed_bit_0], 1
  2136 00000D27 7531                    	jnz dos_or_boot_io
  2137 00000D29 80FC42                  	cmp ah, 42h
  2138 00000D2C 7529                    	jne @F
  2139 00000D2E 3C01                    	cmp al, 1
  2140 00000D30 7725                    	ja @F
  2141 00000D32 7208                    	jb .abs
  2142 00000D34 0316[C006]              reloc	add dx, word [depackskip]
  2143                                  internaldatarelocation
  2144 00000D38 130E[C206]              reloc	adc cx, word [depackskip + 2]
  2145                                  internaldatarelocation
  2146                                  .abs:
  2147 00000D3C 8916[C006]              reloc	mov word [depackskip], dx
  2148                                  internaldatarelocation
  2149 00000D40 890E[C206]              reloc	mov word [depackskip + 2], cx
  2150                                  internaldatarelocation
  2151 00000D44 89C8                    	mov ax, cx
  2152 00000D46 92                      	xchg ax, dx
  2153 00000D47 F8                      	clc
  2154 00000D48 C3                      	retn
  2155                                  
  2156                                  
  2157                                  read_compressed_or_dos_or_boot_io:
  2158 00000D49 F646E201                	testopt [bp + ?uncompressed_bit_0], 1
  2159 00000D4D 750B                    	jnz dos_or_boot_io
  2160 00000D4F 80FC3F                  	cmp ah, 3Fh
  2161 00000D52 7503                    	jne @F
  2162 00000D54 E9A302                  	jmp read_and_depack
  2163                                  
  2164                                  @@:
  2165 00000D57 E85605                  	extcallcall error
  2166                                  %else
  2167                                   seek_compressed_or_dos_or_boot_io equ dos_or_boot_io
  2168                                   read_compressed_or_dos_or_boot_io equ dos_or_boot_io
  2169                                  %endif
  2170                                  
  2171                                  	lleave ctx
  2172                                  
  2173                                  
  2174                                  dos_or_boot_io:
  2175                                  %if _BOOTLDR
  2176 00000D5A F606[0100]40            reloc	testopt [relocateddata], nodosloaded
  2177                                  linkdatarelocation internalflags, -3
  2178 00000D5F 7508                    	jnz .boot
  2179                                  %endif
  2180                                  .dos:
  2181 00000D61 E8[0000]EB020000        	extcall _doscall
  2182 00000D68 C3                      	retn
  2183                                  
  2184                                  %if _BOOTLDR
  2185                                  .boot:
  2186 00000D69 80FC3F                  	cmp ah, 3Fh
  2187 00000D6C 7508                    	jne @F
  2188 00000D6E E8[0000]EB020000        	extcall yy_boot_read.bx
  2189 00000D75 C3                      	retn
  2190                                  
  2191                                  @@:
  2192 00000D76 3D0042                  	cmp ax, 4200h
  2193 00000D79 7517                    	jne @F
  2194                                  .boot_seek_absolute:
  2195 00000D7B 2B16[FCFF]              reloc	sub dx, word [relocateddata - LOADDATA2 + ldCurrentSeek]
  2196                                  linkdatarelocation load_data
  2197 00000D7F 1B0E[FEFF]              reloc	sbb cx, word [relocateddata - LOADDATA2 + ldCurrentSeek + 2]
  2198                                  linkdatarelocation load_data
  2199                                  
  2200                                  .boot_seek_current:
  2201 00000D83 E8[0000]EB020000        	extcall yy_boot_seek_current.bx
  2202 00000D8A A1[FCFF]                reloc	mov ax, word [relocateddata - LOADDATA2 + ldCurrentSeek]
  2203                                  linkdatarelocation load_data
  2204 00000D8D 8B16[FEFF]              reloc	mov dx, word [relocateddata - LOADDATA2 + ldCurrentSeek + 2]
  2205                                  linkdatarelocation load_data
  2206 00000D91 C3                      	retn
  2207                                  
  2208                                  @@:
  2209 00000D92 3D0142                  	cmp ax, 4201h
  2210 00000D95 74EC                    	je .boot_seek_current
  2211                                   %if _ELDTRAILER
  2212 00000D97 3D0242                  	cmp ax, 4202h
  2213 00000D9A 750A                    	jne @F
  2214                                  .boot_seek_eof:
  2215 00000D9C 0316[F4FF]              reloc	add dx, word [relocateddata - LOADDATA2 + ldFileSize]
  2216                                  linkdatarelocation load_data
  2217 00000DA0 130E[F6FF]              reloc	adc cx, word [relocateddata - LOADDATA2 + ldFileSize + 2]
  2218                                  linkdatarelocation load_data
  2219 00000DA4 EBD5                    	jmp .boot_seek_absolute
  2220                                   %endif
  2221                                  @@:
  2222 00000DA6 E80705                  	extcallcall error
  2223                                  %endif
  2224                                  
  2225                                  
  2226                                  %if _COMPRESSED
  2227                                   %assign _STANDALONE 0
  2228                                   %assign _MULTI 1
  2229                                   %include "depack.asm"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> lDebug heatshrink/lzexedat depacker
     4                              <1> 
     5                              <1> Copyright (C) 2008-2026 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 00000DA9 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 00000DAC 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 00000DAE 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 00000DAF 06                  <1> 	 push es
   521 00000DB0 57                  <1> 	 push di
   522                              <1> 	lvar dword,	dst
   523 00000DB1 06                  <1> 	 push es
   524 00000DB2 57                  <1> 	 push di
   525                              <1> 	lvar dword,	src_remaining
   526 00000DB3 51                  <1> 	 push cx
   527 00000DB4 52                  <1> 	 push dx
   528                              <1> 
   529 00000DB5 89F1                <1> 	mov cx, si
   530 00000DB7 29F9                <1> 	sub cx, di		; same flags as cmp si, di
   531 00000DB9 7703E9E900          <1> 	jbe .error
   532                              <1> 
   533                              <1> %if _DXTAG
   534                              <1> 	lvar word,	dst_end
   535 00000DBE 56                  <1> 	 push si		; push into [bp + ?dst_end]
   536                              <1> %else
   537                              <1> 	mov dx, si
   538                              <1> %endif
   539                              <1> 
   540 00000DBF 31C0                <1> 	xor ax, ax
   541 00000DC1 F3AA                <1> 	rep stosb		; prepare for matches before first data byte
   542                              <1> %if _LZEXEDAT || _MULTI
   543 00000DC3 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 00000DC4 807EFE02            <1> 	cmp byte [bp + ?format], 2
   551 00000DC8 7303E9DA00          <1> 	jb .error
   552 00000DCD 806EFE03            <1> 	sub byte [bp + ?format], 3
   553                              <1> 		; -1 = heatshrink, 0 = lzexedat -4, 1 = lzexedat -4 -l
   554 00000DD1 7303E98E00          <1> 	jb .hs_init
   555 00000DD6 3846FE              <1> 	cmp byte [bp + ?format], al
   556 00000DD9 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 00000DDE 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 00000DDF E8B501              <1> 	call get_bit			; ?tagbitscycle init to 1, ror sets CY
   576                              <1> 					;  (bogus result in CF is ignored)
   577                              <1> 
   578 00000DE2 EB26                <1> 	jmp .lze_loop
   579                              <1> 
   580                              <1> .lze_literal:
   581                              <1> %if _LONGLITERAL
   582 00000DE4 41                  <1> 	inc cx
   583                              <1> .loop_literal:
   584                              <1> %endif
   585                              <1> 
   586 00000DE5 E8C901              <1> 	call load_byte
   587                              <1> %if _LONGLITERAL
   588 00000DE8 51                  <1> 	push cx
   589                              <1> %endif
   590                              <1> %if _DEPACKINLINELITERAL
   591                              <1> %if _LONGLITERAL
   592 00000DE9 B90100              <1> 	mov cx, 1
   593                              <1> %else
   594                              <1> 	inc cx				; cx = 1
   595                              <1> %endif
   596 00000DEC C47EF6              <1> 	les di, [bp + ?dst]		; -> destination
   597                              <1> %if _DXTAG
   598 00000DEF 3B7EF0              <1> 	cmp di, [bp + ?dst_end]		; at end of circular buffer ?
   599                              <1> %else
   600                              <1> 	cmp di, dx
   601                              <1> %endif
   602 00000DF2 7603E9B000          <1> 	ja .error			; invalid -->
   603 00000DF7 7203                <1> 	jb @F				; no -->
   604 00000DF9 8B7EFA              <1> 	mov di, word [bp + ?original_dst]	; yes, reset
   605                              <1> @@:
   606 00000DFC 06                  <1> 	push es
   607 00000DFD 1F                  <1> 	pop ds
   608 00000DFE 89FE                <1> 	mov si, di			; ds:si -> where to store
   609 00000E00 AA                  <1> 	stosb				; store it
   610 00000E01 897EF6              <1> 	mov word [bp + ?dst], di	; update ?dst
   611 00000E04 E80D03              <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 00000E07 59                  <1> 	pop cx
   632 00000E08 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 00000E0A 31C9                <1> 	xor cx, cx			; ! ch = 0, cx = 0
   640 00000E0C E88801              <1> 	call get_bit
   641 00000E0F 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 00000E11 E88301              <1> 	call get_bit
   654 00000E14 7219                <1> 	jc .lze_combined
   655                              <1> 
   656                              <1> .lze_shortmatch:
   657                              <1> 		; cx = 0
   658 00000E16 E87E01              <1> 	call get_bit
   659 00000E19 D1D1                <1> 	rcl cx, 1
   660 00000E1B E87901              <1> 	call get_bit
   661 00000E1E D1D1                <1> 	rcl cx, 1			; cx = 0..3
   662                              <1> 
   663 00000E20 E88E01              <1> 	call load_byte			; load displacement
   664                              <1> 
   665 00000E23 B4FF                <1> 	mov ah, -1			; sign extend for negative number
   666 00000E25 93                  <1> 	xchg bx, ax			; bx = displacement (-1 to -256)
   667                              <1> 
   668                              <1> .lze_match_cx_plus_2:
   669 00000E26 41                  <1> 	inc cx
   670                              <1> .lze_match_cx_plus_1:
   671 00000E27 41                  <1> 	inc cx
   672                              <1> 
   673                              <1> 		; INP:	bx = match displacement (-1 to -4096)
   674                              <1> 		;	cx = match count (2 to 256)
   675 00000E28 93                  <1> 	xchg ax, bx			; ax = displacement, cx = count
   676 00000E29 91                  <1> 	xchg ax, cx			; cx = displacement, ax = length of match
   677 00000E2A F7D9                <1> 	neg cx				; cx = index
   678 00000E2C E9BC00              <1> 	jmp .lze_match
   679                              <1> .lze_loop_j1: equ .lze_loop
   680                              <1> 
   681                              <1> .lze_combined:
   682 00000E2F E87401              <1> 	call load_word			; load combined word
   683                              <1> 
   684 00000E32 89C3                <1> 	mov bx, ax
   685 00000E34 F9                  <1> 	stc				; CY
   686 00000E35 D0DF                <1> 	rcr bh, 1			; rotate in a 1
   687 00000E37 D0FF                <1> 	sar bh, 1
   688 00000E39 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 00000E3B D0FF                <1> 	sar bh, 1			; fill top *four* bits with 1s
   702 00000E3D 80E40F              <1> 	and ah, 15
   703                              <1>  %else
   704                              <1> 	and ah, 7
   705                              <1>  %endif
   706                              <1> %endif
   707 00000E40 88E1                <1> 	mov cl, ah			; ch already = 0
   708 00000E42 75E2                <1> 	jnz .lze_match_cx_plus_2	; length = cx + 2, bx = displacement
   709                              <1> 
   710                              <1> .lze_escape:
   711 00000E44 E86A01              <1> 	call load_byte			; ah = 0
   712 00000E47 3C01                <1> 	cmp al, 1
   713 00000E49 724F                <1> 	jb .end_check
   714 00000E4B 91                  <1> 	xchg cx, ax			; cx = length
   715 00000E4C 77D9                <1> 	ja .lze_match_cx_plus_1		; length = cx + 1, bx = displacement
   716                              <1> 
   717                              <1> %if _LONGLITERAL
   718                              <1>  %if _MULTI
   719 00000E4E 807EFE01            <1> 	cmp byte [bp + ?format], 1
   720 00000E52 750E                <1> 	jne .lze_normalise		; not lzexedat -4 -l -->
   721                              <1>  %endif
   722 00000E54 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 00000E56 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 00000E59 E307                <1>  	jcxz .lze_normalise		; displacement 0 means segment change -->
   737 00000E5B 83F91A              <1>  	cmp cx, 26			; long literals command needs >= 26 bytes
   738 00000E5E 7247                <1>  	jb .error			; (reserved for future expansion)
   739 00000E60 EB83                <1>  	jmp .loop_literal		; process the literals -->
   740                              <1> %endif
   741                              <1> .lze_normalise:
   742 00000E62 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 00000E64 E87B01              <1> 	call read_byte
   776                              <1> d0	mov byte [bp + ?errordata], 70h
   777 00000E67 723E                <1> 	jc .error
   778                              <1> 
   779 00000E69 B400                <1> 	mov ah, 0
   780 00000E6B 85C0                <1> 	test ax, ax
   781                              <1> d0	mov byte [bp + ?errordata], 71h
   782 00000E6D 7438                <1> 	jz .error
   783 00000E6F 3C0F                <1> 	cmp al, 15
   784 00000E71 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 00000E73 50                  <1> 	 push ax
   792                              <1> 
   793 00000E74 91                  <1> 	xchg cx, ax
   794 00000E75 B80100              <1> 	mov ax, 1
   795 00000E78 D3E0                <1> 	shl ax, cl
   796 00000E7A 3D0010              <1> 	cmp ax, resultbuffer.size
   797 00000E7D 7728                <1> 	ja .error
   798                              <1> 
   799 00000E7F E86001              <1> 	call read_byte
   800                              <1> d0	mov byte [bp + ?errordata], 72h
   801 00000E82 7223                <1> 	jc .error
   802                              <1> 
   803 00000E84 B400                <1> 	mov ah, 0
   804 00000E86 85C0                <1> 	test ax, ax
   805                              <1> d0	mov byte [bp + ?errordata], 73h
   806 00000E88 741D                <1> 	jz .error
   807 00000E8A 3B46EE              <1> 	cmp ax, word [bp + ?window_size_bits]
   808 00000E8D 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 00000E8F 50                  <1> 	 push ax
   816                              <1> 
   817                              <1> %if _DXTAG
   818 00000E90 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 00000E92 B90100              <1> 	mov cx, 1
   840 00000E95 E82201              <1> 	call get_bits
   841 00000E98 7312                <1> 	jnc .notend			; (cx = 0 if jumping)
   842                              <1> 
   843                              <1> d0	mov byte [bp + ?errordata], 7Dh
   844                              <1> .end_check:
   845 00000E9A 31C0                <1> 	xor ax, ax
   846 00000E9C 3946F2              <1> 	cmp word [bp + ?src_remaining], ax
   847 00000E9F 7506                <1> 	jne .error
   848 00000EA1 3946F4              <1> 	cmp word [bp + ?src_remaining + 2], ax
   849 00000EA4 7501                <1> 	jne .error
   850                              <1> 
   851 00000EA6 A8                  <1> 	db __TEST_IMM8			; (NC)
   852                              <1> .error:
   853 00000EA7 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 00000EA8 89EC5D              <1> 	lleave code
   865 00000EAB C3                  <1> 	lret
   866                              <1> 
   867                              <1> .notend:				; (cx = 0)
   868 00000EAC 84C0                <1> 	test al, al
   869 00000EAE 7422                <1> 	jz .notliteral
   870                              <1> 
   871                              <1> .hs_literal:
   872 00000EB0 B108                <1> 	mov cl, 8
   873 00000EB2 E80501              <1> 	call get_bits			; cx = 0
   874                              <1> d0	mov byte [bp + ?errordata], 74h
   875 00000EB5 72E3                <1> 	jc .end_check
   876                              <1> %if _DEPACKINLINELITERAL
   877 00000EB7 41                  <1> 	inc cx				; cx = 1
   878 00000EB8 C47EF6              <1> 	les di, [bp + ?dst]		; -> destination
   879                              <1> %if _DXTAG
   880 00000EBB 3B7EF0              <1> 	cmp di, [bp + ?dst_end]		; at end of circular buffer ?
   881                              <1> %else
   882                              <1> 	cmp di, dx
   883                              <1> %endif
   884 00000EBE 77E7                <1> 	ja .error			; invalid -->
   885 00000EC0 7203                <1> 	jb @F				; no -->
   886 00000EC2 8B7EFA              <1> 	mov di, word [bp + ?original_dst]	; yes, reset
   887                              <1> @@:
   888 00000EC5 06                  <1> 	push es
   889 00000EC6 1F                  <1> 	pop ds
   890 00000EC7 89FE                <1> 	mov si, di			; ds:si -> where to store
   891 00000EC9 AA                  <1> 	stosb				; store it
   892 00000ECA 897EF6              <1> 	mov word [bp + ?dst], di	; update ?dst
   893 00000ECD E84402              <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 00000ED0 EBC0                <1> 	jmp .loop
   910                              <1> 
   911                              <1> .notliteral:				; (cx = 0)
   912                              <1> 
   913 00000ED2 8A4EEE              <1> 	mov cl, byte [bp + ?window_size_bits]
   914                              <1> 					; cx = -w parameter
   915 00000ED5 E8E200              <1> 	call get_bits
   916                              <1> d0	mov byte [bp + ?errordata], 76h
   917 00000ED8 72C0                <1> 	jc .end_check
   918                              <1> 		; ax = output index
   919                              <1> 		; cx = 0
   920 00000EDA 93                  <1> 	xchg bx, ax
   921 00000EDB 8A4EEC              <1> 	mov cl, byte [bp + ?lookahead_size_bits]
   922                              <1> 					; cx = -l parameter
   923 00000EDE E8D900              <1> 	call get_bits
   924                              <1> d0	mov byte [bp + ?errordata], 77h
   925 00000EE1 72B7                <1> 	jc .end_check
   926                              <1> 		; bx = output index less 1
   927                              <1> 		; ax = output count less 1
   928 00000EE3 43                  <1> 	inc bx				; = output index
   929                              <1> d0	mov byte [bp + ?errordata], 78h
   930 00000EE4 74C1                <1> 	jz .error
   931                              <1> 
   932                              <1> 					; ax = length of match less one
   933 00000EE6 40                  <1> 	inc ax				; = length of match
   934 00000EE7 74BE                <1> 	jz .error
   935                              <1> 
   936 00000EE9 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 00000EEB C576F6              <1> 	lds si, [bp + ?dst]
   945 00000EEE 8B5EFA              <1> 	mov bx, word [bp + ?original_dst]
   946 00000EF1 F7DB                <1> 	neg bx
   947 00000EF3 01F3                <1> 	add bx, si			; dst - original = length at start
   948 00000EF5 29CE                <1> 	sub si, cx			; -> into buffer (if branching)
   949 00000EF7 29CB                <1> 	sub bx, cx			; length start - match distance
   950 00000EF9 7323                <1> 	jae @F				; length start >= match distance -->
   951                              <1> 		; bx = negative length of matchable at end of buffer
   952                              <1> 
   953                              <1> %if _DXTAG
   954 00000EFB 8B76F0              <1> 	mov si, [bp + ?dst_end]
   955                              <1> %else
   956                              <1> 	mov si, dx
   957                              <1> %endif
   958 00000EFE 01DE                <1> 	add si, bx			; si -> match data
   959 00000F00 89F3                <1> 	mov bx, si
   960 00000F02 01C3                <1> 	add bx, ax			; -> behind match data (if fits)
   961 00000F04 7205                <1> 	jc .full			; if doesn't fit, copy full -->
   962                              <1> %if _DXTAG
   963 00000F06 3B5EF0              <1> 	cmp bx, [bp + ?dst_end]		; -> behind is above-or-equal end ?
   964                              <1> %else
   965                              <1> 	cmp bx, dx
   966                              <1> %endif
   967                              <1> 	; jae .full			; yes -->
   968 00000F09 7213                <1> 	jb .copy_data			; ax has full length from tail of buffer -->
   969                              <1> 
   970                              <1> 		; if we branch to here,
   971                              <1> 		;  si + ax >= (word [bp + ?dst_end] or dx)
   972                              <1> 		;  therefore  ax >= (word [bp + ?dst_end] or dx) - si
   973                              <1> .full:
   974 00000F0B 50                  <1> 	push ax				; save original length
   975                              <1> 		; calculate word [bp + ?dst_end] - si
   976                              <1> %if _DXTAG
   977 00000F0C 8B46F0              <1> 	mov ax, [bp + ?dst_end]
   978                              <1> %else
   979                              <1> 	mov ax, dx
   980                              <1> %endif
   981 00000F0F 29F0                <1> 	sub ax, si			; -> end minus -> match data
   982 00000F11 50                  <1> 	push ax				; save length
   983 00000F12 E81F00              <1> 	call copy_data
   984                              <1> d0	mov byte [bp + ?errordata], 1
   985 00000F15 7290                <1> 	jc .error
   986 00000F17 5B                  <1> 	pop bx				; = done length
   987 00000F18 58                  <1> 	pop ax				; = entire length
   988 00000F19 29D8                <1> 	sub ax, bx			; entire length minus done length
   989 00000F1B 8B76FA              <1> 	mov si, word [bp + ?original_dst]	; -> start of buffer
   990                              <1> @@:
   991                              <1> 
   992                              <1> .copy_data:
   993 00000F1E E81300              <1> 	call copy_data			; give ?dst -> dest, ds:si -> source
   994                              <1> 		; returns: ?dst incremented, ds:si -> after match source
   995                              <1> d0	mov byte [bp + ?errordata], 7Bh
   996 00000F21 7284                <1> 	jc .error
   997                              <1> 
   998                              <1> %if _MULTI
   999                              <1> 		; end of common code, dispatch back to main loop
  1000 00000F23 807EFE01            <1> 	cmp byte [bp + ?format], 1
  1001 00000F27 7408                <1> 	je @F				; lzexedat -4 -l -->
  1002 00000F29 D046FE              <1> 	rol byte [bp + ?format], 1
  1003 00000F2C 7303E961FF          <1> 	jc .loop
  1004                              <1> @@:
  1005 00000F31 E9D6FE              <1> 	jmp .lze_loop
  1006                              <1> %elif _LZEXEDAT
  1007                              <1> 	jmp .lze_loop
  1008                              <1> %else
  1009                              <1> 	jmp .loop
  1010                              <1> %endif
  1011                              <1> 
  1012                              <1> 
  1013                              <1> 		; INP:	?dst -> destination,
  1014                              <1> 		;	 destination may overlap the circular buffer boundary.
  1015                              <1> 		;	ds:si -> source
  1016                              <1> 		;	ax = how long the data is (0 is valid),
  1017                              <1> 		;	 always 1 for literals.
  1018                              <1> 		;	 source must fit in circular buffer, except if
  1019                              <1> 		;	 source and destination overlap. in this case the
  1020                              <1> 		;	 source starts in the buffer but may extend past
  1021                              <1> 		;	 the circular buffer boundary.
  1022                              <1> 		;	word [?dst_end] or dx -> end of circular buffer
  1023                              <1> 		;	word [?original_dst] -> start of circular buffer
  1024                              <1> 		; OUT:	?dst incremented
  1025                              <1> 		;	CY if error (buffer too small)
  1026                              <1> 		;	NC if success
  1027                              <1> 		; CHG:	cx, bx, ax, es, di, ds, si
  1028                              <1> copy_data:
  1029                              <1> %ifn _DEPACKINLINELITERAL
  1030                              <1> 	xor bx, bx
  1031                              <1> .bx:
  1032                              <1> 		; bx = nonzero if literal
  1033                              <1> %endif
  1034                              <1> 
  1035                              <1> %if 0
  1036                              <1> 	push ax
  1037                              <1> 	push bx
  1038                              <1> 	push cx
  1039                              <1> 	push dx
  1040                              <1> 	mov ax, 4201h
  1041                              <1> 	mov cx, 0
  1042                              <1> 	mov dx, 0
  1043                              <1> 	mov bx, word [handle2]
  1044                              <1> 	int 21h
  1045                              <1> 	nop
  1046                              <1> 	pop dx
  1047                              <1> 	pop cx
  1048                              <1> 	pop bx
  1049                              <1> 	pop ax
  1050                              <1> %endif
  1051                              <1> 
  1052                              <1> d0	inc byte [bp + ?errordata + 1]
  1053                              <1> 
  1054 00000F34 C47EF6              <1> 	les di, [bp + ?dst]
  1055                              <1> 
  1056 00000F37 91                  <1> 	xchg cx, ax			; cx = remaining length
  1057 00000F38 E344                <1> 	jcxz .end
  1058                              <1> 
  1059                              <1> %if _DXTAG
  1060 00000F3A 3B7EF0              <1> 	cmp di, [bp + ?dst_end]
  1061                              <1> %else
  1062                              <1> 	cmp di, dx
  1063                              <1> %endif
  1064 00000F3D 7744                <1> 	ja .ret_CY			; error
  1065                              <1> 		; literals may branch to .start_maybe_part
  1066 00000F3F 741D                <1> 	je .start_maybe_part		; ?dst -> at end (put whole data at start)
  1067 00000F41 01CF                <1> 	add di, cx			; -> behind data chunk (if fits)
  1068 00000F43 720A                <1> 	jc .fill			; doesn't fit -->
  1069                              <1> %if _DXTAG
  1070 00000F45 3B7EF0              <1> 	cmp di, [bp + ?dst_end]		; fits ?
  1071                              <1> %else
  1072                              <1> 	cmp di, dx
  1073                              <1> %endif
  1074                              <1> 		; literals never branch to .fill
  1075 00000F48 7705                <1> 	ja .fill			; doesn't fit -->
  1076 00000F4A 8B7EF6              <1> 	mov di, word [bp + ?dst]	; restore -> destination
  1077                              <1> 		; ds:si l cx fits in circular buffer
  1078 00000F4D EB2C                <1> 	jmp .mov			; store full up to below-or-equal -> end
  1079                              <1> 
  1080                              <1> .fill:
  1081 00000F4F 8B7EF6              <1> 	mov di, word [bp + ?dst]	; restore -> destination
  1082                              <1> %if _DXTAG
  1083 00000F52 8B46F0              <1> 	mov ax, [bp + ?dst_end]		; -> behind buffer
  1084                              <1> %else
  1085                              <1> 	mov ax, dx
  1086                              <1> %endif
  1087 00000F55 29F8                <1> 	sub ax, di			; -> behind buffer minus -> destination
  1088                              <1> 					; = length fitting at end
  1089 00000F57 29C1                <1> 	sub cx, ax			; cx -= length fitting at end
  1090                              <1> 					; = remaining length to store at start
  1091 00000F59 91                  <1> 	xchg cx, ax			; cx = length fitting at end
  1092 00000F5A E82800              <1> 	call .mov_and_put		; store at end
  1093 00000F5D 91                  <1> 	xchg cx, ax			; cx = remaining length to store at start
  1094                              <1> 
  1095                              <1> .start_maybe_part:
  1096 00000F5E 8B7EFA              <1> 	mov di, word [bp + ?original_dst]
  1097                              <1> %ifn _DEPACKINLINELITERAL
  1098                              <1> 	test bx, bx			; literal ?
  1099                              <1> 	jnz .mov			; yes -->
  1100                              <1> %endif
  1101                              <1> 		; literals never go here
  1102                              <1> 		; the following handles source overlapping destination
  1103                              <1> 		;  s.t. source crosses the circular buffer boundary.
  1104 00000F61 89F0                <1> 	mov ax, si
  1105 00000F63 01C8                <1> 	add ax, cx			; -> behind source
  1106 00000F65 7205                <1> 	jc .part			; CY, must copy part -->
  1107                              <1> %if _DXTAG
  1108 00000F67 3B46F0              <1> 	cmp ax, [bp + ?dst_end]		; below-or-equal end of buffer ?
  1109                              <1> %else
  1110                              <1> 	cmp ax, dx
  1111                              <1> %endif
  1112 00000F6A 760F                <1> 	jbe .mov			; yes -->
  1113                              <1> .part:
  1114                              <1> %if _DXTAG
  1115 00000F6C 8B46F0              <1> 	mov ax, [bp + ?dst_end]
  1116                              <1> %else
  1117                              <1> 	mov ax, dx
  1118                              <1> %endif
  1119 00000F6F 29F0                <1> 	sub ax, si			; ax = how much source data remains
  1120 00000F71 29C1                <1> 	sub cx, ax			; cx = how much to copy after
  1121 00000F73 91                  <1> 	xchg cx, ax			; cx = part length (source data remains)
  1122 00000F74 E80E00              <1> 	call .mov_and_put		; put from end
  1123 00000F77 91                  <1> 	xchg cx, ax			; cx = how much to copy from buffer start
  1124 00000F78 8B76FA              <1> 	mov si, word [bp + ?original_dst]	; -> start of buffer
  1125                              <1> 					; continue with di -> near start of buffer
  1126                              <1> .mov:
  1127 00000F7B E80700              <1> 	call .mov_and_put
  1128                              <1> 
  1129                              <1> .end:
  1130 00000F7E 897EF6              <1> 	mov word [bp + ?dst], di
  1131 00000F81 F8                  <1> 	clc
  1132                              <1> .ret:
  1133 00000F82 C3                  <1> 	retn
  1134                              <1> 
  1135                              <1> .ret_CY:
  1136 00000F83 F9                  <1> 	stc
  1137 00000F84 C3                  <1> 	retn
  1138                              <1> 
  1139                              <1> .mov_and_put:
  1140 00000F85 1E                  <1> 	 push ds
  1141 00000F86 56                  <1> 	 push si
  1142 00000F87 06                  <1> 	push es
  1143 00000F88 57                  <1> 	push di
  1144 00000F89 51                  <1> 	push cx
  1145 00000F8A F3A4                <1> 	rep movsb
  1146 00000F8C 59                  <1> 	pop cx
  1147 00000F8D 5E                  <1> 	pop si
  1148 00000F8E 1F                  <1> 	pop ds
  1149 00000F8F E88201              <1> 	call put_file_data
  1150 00000F92 5E                  <1> 	 pop si
  1151 00000F93 1F                  <1> 	 pop ds
  1152 00000F94 01CE                <1> 	add si, cx
  1153 00000F96 C3                  <1> 	retn
  1154                              <1> 
  1155                              <1> 
  1156                              <1> %if _LZEXEDAT
  1157                              <1> 		; INP:	?src_remaining
  1158                              <1> 		;	dx / word [?tagword] = tag word
  1159                              <1> 		;	word [?tagbitscycle] = circular tag bits indicator
  1160                              <1> 		;	 (there's always a single bit set in this word.
  1161                              <1> 		;	 if this word is equal to 1 on INP then the tag
  1162                              <1> 		;	 word must be reloaded, and the last bit shifted
  1163                              <1> 		;	 out of the INP prior tag word.)
  1164                              <1> 		; OUT:	NC if read a zero,
  1165                              <1> 		;	CY if read a one,
  1166                              <1> 		;	 ?src_remaining decremented
  1167                              <1> 		;	 dx / word [?tagword] updated
  1168                              <1> 		;	 word [?tagbitscycle] updated
  1169                              <1> 		;	branches to depack.error on error
  1170                              <1> 		; CHG:	ds, si, ax
  1171                              <1> get_bit:
  1172 00000F97 D14EEE              <1> 	ror word [bp + ?tagbitscycle], 1
  1173 00000F9A 7307                <1> 	jnc .left
  1174                              <1> 		; after this branch not taken, the cycle word
  1175                              <1> 		;  wraps around to be equal to 8000h. this
  1176                              <1> 		;  will wrap around again after 15 more ror.
  1177 00000F9C E80700              <1> 	call load_word
  1178                              <1> %if _DXTAG
  1179 00000F9F D1EA                <1> 	shr dx, 1
  1180 00000FA1 92                  <1> 	xchg dx, ax
  1181 00000FA2 C3                  <1> 	retn
  1182                              <1> 
  1183                              <1> .left:
  1184 00000FA3 D1EA                <1> 	shr dx, 1
  1185 00000FA5 C3                  <1> 	retn
  1186                              <1> %else
  1187                              <1> 	shr word [bp + ?tagword], 1
  1188                              <1> 	mov word [bp + ?tagword], ax
  1189                              <1> 	retn
  1190                              <1> 
  1191                              <1> .left:
  1192                              <1> 	shr word [bp + ?tagword], 1
  1193                              <1> 	retn
  1194                              <1> %endif
  1195                              <1> 
  1196                              <1> 		; lodsw with ?src_remaining check
  1197                              <1> load_word:
  1198 00000FA6 E80800              <1> 	call load_byte
  1199 00000FA9 86C4                <1> 	xchg al, ah
  1200 00000FAB E80300              <1> 	call load_byte
  1201 00000FAE 86C4                <1> 	xchg al, ah
  1202 00000FB0 C3                  <1> 	retn
  1203                              <1> 
  1204                              <1> 		; lodsb with ?src_remaining check
  1205                              <1> load_byte:
  1206 00000FB1 E82E00              <1> 	call read_byte
  1207                              <1> d0	mov byte [bp + ?errordata], 84h
  1208 00000FB4 7303E9EEFE          <1> 	jc depack.error
  1209 00000FB9 C3                  <1> 	retn
  1210                              <1> %endif
  1211                              <1> 
  1212                              <1> %if _MULTI || !_LZEXEDAT
  1213                              <1> 		; INP:	cx = 0..15
  1214                              <1> 		;	dl = bit index, dh = current byte
  1215                              <1> 		; OUT:	NC if successful,
  1216                              <1> 		;	 ax = value read
  1217                              <1> 		;	 cx = 0
  1218                              <1> 		;	 dx updated
  1219                              <1> 		;	CY if error
  1220                              <1> 		; CHG:	ds, si
  1221                              <1> get_bits:
  1222                              <1> %ifn _DXTAG
  1223                              <1> 	push dx
  1224                              <1> 	mov dx, word [bp + ?low_bit_index_and_high_current_byte]
  1225                              <1> %endif
  1226 00000FBA 83F90F              <1> 	cmp cx, 15
  1227 00000FBD 7721                <1> 	ja .error
  1228 00000FBF 85C9                <1> 	test cx, cx
  1229 00000FC1 741D                <1> 	jz .error
  1230 00000FC3 31C0                <1> 	xor ax, ax
  1231                              <1> .loop:
  1232 00000FC5 84D2                <1> 	test dl, dl
  1233 00000FC7 750B                <1> 	jnz .havebit
  1234 00000FC9 50                  <1> 	push ax
  1235 00000FCA E81500              <1> 	call read_byte
  1236 00000FCD 88C6                <1> 	mov dh, al
  1237 00000FCF B280                <1> 	mov dl, 80h
  1238 00000FD1 58                  <1> 	pop ax
  1239 00000FD2 720C                <1> 	jc .error
  1240                              <1> .havebit:
  1241 00000FD4 D1E0                <1> 	shl ax, 1
  1242 00000FD6 84D6                <1> 	test dh, dl
  1243 00000FD8 7401                <1> 	jz @F
  1244 00000FDA 40                  <1> 	inc ax
  1245                              <1> @@:
  1246 00000FDB D0EA                <1> 	shr dl, 1
  1247 00000FDD E2E6                <1> 	loop .loop
  1248                              <1> .end:
  1249 00000FDF A8                  <1> 	db __TEST_IMM8		; skip stc, NC
  1250                              <1> .error:
  1251 00000FE0 F9                  <1> 	stc
  1252                              <1> %ifn _DXTAG
  1253                              <1> 	mov word [bp + ?low_bit_index_and_high_current_byte], dx
  1254                              <1> 	pop dx
  1255                              <1> %endif
  1256 00000FE1 C3                  <1> 	retn
  1257                              <1> %endif
  1258                              <1> 
  1259                              <1> 
  1260                              <1> 		; INP:	?src_remaining
  1261                              <1> 		; OUT:	NC if success,
  1262                              <1> 		;	 al = value read
  1263                              <1> 		;	 ?src_remaining decremented
  1264                              <1> 		;	CY if error (source buffer too small),
  1265                              <1> 		;	 ?src_remaining = 0
  1266                              <1> 		; CHG:	ds, si
  1267                              <1> read_byte:
  1268 00000FE2 836EF201            <1> 	sub word [bp + ?src_remaining], 1
  1269 00000FE6 835EF400            <1> 	sbb word [bp + ?src_remaining + 2], 0
  1270 00000FEA 7204                <1> 	jb .empty
  1271                              <1> 
  1272 00000FEC E8D800              <1> 	call get_file_byte
  1273 00000FEF C3                  <1> 	retn
  1274                              <1> 
  1275                              <1> .empty:
  1276 00000FF0 8366F200            <1> 	and word [bp + ?src_remaining], 0
  1277 00000FF4 8366F400            <1> 	and word [bp + ?src_remaining + 2], 0
  1278 00000FF8 F9                  <1> 	stc
  1279 00000FF9 C3                  <1> 	retn
  1280                              <1> 
  1281                              <1> 	lleave ctx
  1282                              <1> 
  1283                              <1> %if _MULTI
  1284                              <1> 	resetdef LONGLITERAL
  1285                              <1> 	resetdef LZEXEDAT
  1286                              <1> %endif
  1287                              <1> 
  1288                              <1> %ifn _STANDALONE
  1289                              <1> 	resetdef COUNTER
  1290                              <1> 	resetdef DEBUG0
  1291                              <1> 
  1292                              <1> 
  1293                              <1> read_and_depack:
  1294                              <1> 	houdini
  1295                              <1> 
  1296                              <1> 		; common setup for depacking
  1297 00000FFA 891E[D808]          <1> reloc	mov word [handle], bx
  1298                              <1> internaldatarelocation
  1299                              <1> 
  1300 00000FFE 8916[C806]          <1> reloc	mov word [depacked_buffer], dx
  1301                              <1> internaldatarelocation
  1302 00001002 8C06[CA06]          <1> reloc	mov word [depacked_buffer + 2], es
  1303                              <1> internaldatarelocation
  1304 00001006 890E[D006]          <1> reloc	mov word [depacked_length], cx
  1305                              <1> internaldatarelocation
  1306                              <1> 
  1307                              <1> %ifndef ELD_OMIT_PARTIALDEPACK
  1308 0000100A D006[0200]          <1> reloc	rol byte [partialdepack], 1
  1309                              <1> internaldatarelocation
  1310 0000100E 7335                <1> 	jnc .new
  1311                              <1> %endif
  1312                              <1> 		; did we save a prior partial depack ?
  1313 00001010 833E[0000]FF        <1> reloc	cmp word [depack_saved_sp], strict byte 0FFFFh
  1314                              <1> internaldatarelocation -3
  1315 00001015 742E                <1> 	je .new				; no -->
  1316 00001017 A1[C606]            <1> reloc	mov ax, word [depackseek + 2]
  1317                              <1> internaldatarelocation
  1318 0000101A 3B06[C206]          <1> reloc	cmp ax, word [depackskip + 2]
  1319                              <1> internaldatarelocation
  1320 0000101E 7507                <1> 	jne @F
  1321 00001020 A1[C406]            <1> reloc	mov ax, word [depackseek]
  1322                              <1> internaldatarelocation
  1323 00001023 3B06[C006]          <1> reloc	cmp ax, word [depackskip]
  1324                              <1> internaldatarelocation
  1325                              <1> @@:
  1326 00001027 771C                <1> 	ja .new				; seek is > skip, must rewind -->
  1327                              <1> 
  1328 00001029 A1[C406]            <1> reloc	mov ax, word [depackseek]
  1329                              <1> internaldatarelocation
  1330 0000102C 2906[C006]          <1> reloc	sub word [depackskip], ax
  1331                              <1> internaldatarelocation
  1332 00001030 A1[C606]            <1> reloc	mov ax, word [depackseek + 2]
  1333                              <1> internaldatarelocation
  1334 00001033 1906[C206]          <1> reloc	sbb word [depackskip + 2], ax	; skip -= seek
  1335                              <1> internaldatarelocation
  1336                              <1> 
  1337 00001037 52                  <1> 	push dx
  1338 00001038 53                  <1> 	push bx
  1339 00001039 57                  <1> 	push di
  1340 0000103A 56                  <1> 	push si
  1341 0000103B 06                  <1> 	push es
  1342 0000103C 55                  <1> 	push bp
  1343 0000103D 51                  <1> 	push cx				; stack frame must match what .read expects
  1344                              <1> 
  1345 0000103E 8926[D206]          <1> reloc	mov word [depack_prior_sp], sp
  1346                              <1> internaldatarelocation			; store our sp
  1347 00001042 E92F01              <1> 	jmp put_file_data.entry		; continue depacking
  1348                              <1> 
  1349                              <1> 
  1350                              <1> .new:
  1351 00001045 52                  <1> 	push dx
  1352 00001046 51                  <1> 	push cx
  1353 00001047 06                  <1> 	push es
  1354 00001048 8B16[B806]          <1> reloc	mov dx, word [libseek]
  1355                              <1> internaldatarelocation
  1356 0000104C 8B0E[BA06]          <1> reloc	mov cx, word [libseek + 2]
  1357                              <1> internaldatarelocation
  1358 00001050 B80042              <1> 	mov ax, 4200h
  1359 00001053 E804FD              <1> 	call dos_or_boot_io
  1360 00001056 07                  <1> 	pop es
  1361 00001057 7269                <1> 	jc .io_error
  1362                              <1> 
  1363 00001059 C706[D408][D406]    <1> reloc2	mov word [filebuffer.next], filebuffer
  1364                              <1> internaldatarelocation -4
  1365                              <1> internaldatarelocation
  1366 0000105F C706[D608][D406]    <1> reloc2	mov word [filebuffer.tail], filebuffer
  1367                              <1> internaldatarelocation -4
  1368                              <1> internaldatarelocation
  1369                              <1> 
  1370 00001065 59                  <1> 	pop cx
  1371 00001066 5A                  <1> 	pop dx
  1372                              <1> 
  1373 00001067 31C0                <1> 	xor ax, ax
  1374 00001069 A3[C406]            <1> reloc	mov word [depackseek], ax
  1375                              <1> internaldatarelocation
  1376 0000106C A3[C606]            <1> reloc	mov word [depackseek + 2], ax
  1377                              <1> internaldatarelocation
  1378                              <1> 
  1379 0000106F 52                  <1> 	push dx
  1380 00001070 53                  <1> 	push bx
  1381 00001071 57                  <1> 	push di
  1382 00001072 56                  <1> 	push si
  1383 00001073 06                  <1> 	push es
  1384 00001074 55                  <1> 	push bp
  1385 00001075 51                  <1> 	push cx
  1386 00001076 16                  <1> 	 push ss
  1387 00001077 07                  <1> 	 pop es
  1388 00001078 BF[E008]            <1> reloc	mov di, resultbuffer
  1389                              <1> internaldatarelocation
  1390 0000107B BE[E018]            <1> reloc	mov si, resultbuffer.end
  1391                              <1> internaldatarelocation
  1392                              <1> 
  1393 0000107E 8B0E[B606]          <1> reloc	mov cx, word [libtab_compressed_length + 2]
  1394                              <1> internaldatarelocation
  1395 00001082 8B16[B406]          <1> reloc	mov dx, word [libtab_compressed_length]
  1396                              <1> internaldatarelocation
  1397                              <1> 
  1398 00001086 8926[D206]          <1> reloc	mov word [depack_prior_sp], sp
  1399                              <1> internaldatarelocation
  1400 0000108A BC[FC02]            <1> reloc	mov sp, depack_stack.top
  1401                              <1> internaldatarelocation
  1402                              <1> %if _MULTI
  1403 0000108D A0[0300]            <1> reloc	mov al, byte [depack_format]
  1404                              <1> internaldatarelocation
  1405                              <1> %endif
  1406 00001090 E816FD              <1> 	call depack
  1407 00001093 C706[0000]FFFF      <1> reloc	mov word [depack_saved_sp], 0FFFFh
  1408                              <1> internaldatarelocation -4
  1409                              <1> .read:
  1410 00001099 16                  <1> 	 push ss
  1411 0000109A 1F                  <1> 	 pop ds
  1412                              <1> 
  1413 0000109B FF36[C406]          <1> reloc	push word [depackseek]
  1414                              <1> internaldatarelocation
  1415 0000109F FF36[C606]          <1> reloc	push word [depackseek + 2]
  1416                              <1> internaldatarelocation
  1417 000010A3 8F06[C206]          <1> reloc	pop word [depackskip + 2]
  1418                              <1> internaldatarelocation
  1419 000010A7 8F06[C006]          <1> reloc	pop word [depackskip]
  1420                              <1> internaldatarelocation
  1421                              <1> 
  1422 000010AB 8B26[D206]          <1> reloc	mov sp, word [depack_prior_sp]
  1423                              <1> internaldatarelocation
  1424 000010AF 7209                <1> 	jc @F
  1425 000010B1 A1[D006]            <1> reloc	mov ax, word [depacked_length]
  1426                              <1> internaldatarelocation
  1427 000010B4 F7D8                <1> 	neg ax			; - remain
  1428 000010B6 59                  <1> 	pop cx
  1429 000010B7 01C8                <1> 	add ax, cx		; requested - remain = how much read
  1430 000010B9 A8                  <1> 	db __TEST_IMM8		; skip pop, NC
  1431                              <1> @@:
  1432 000010BA 59                  <1> 	pop cx
  1433 000010BB 5D                  <1> 	pop bp
  1434 000010BC 07                  <1> 	pop es
  1435 000010BD 5E                  <1> 	pop si
  1436 000010BE 5F                  <1> 	pop di
  1437 000010BF 5B                  <1> 	pop bx
  1438 000010C0 5A                  <1> 	pop dx
  1439 000010C1 C3                  <1> 	retn
  1440                              <1> 
  1441                              <1> .io_error:
  1442 000010C2 83C404              <1> 	add sp, 4
  1443 000010C5 F9                  <1> 	stc
  1444 000010C6 C3                  <1> 	retn
  1445                              <1> 
  1446                              <1> 
  1447                              <1> get_file_byte:
  1448 000010C7 368B36[D408]        <1> reloc	mov si, [ss:filebuffer.next]
  1449                              <1> internaldatarelocation
  1450 000010CC 363B36[D608]        <1> reloc	cmp si, [ss:filebuffer.tail]
  1451                              <1> internaldatarelocation
  1452 000010D1 7238                <1> 	jb .buffered
  1453                              <1> 
  1454 000010D3 50                  <1> 	push ax
  1455 000010D4 53                  <1> 	push bx
  1456 000010D5 51                  <1> 	push cx
  1457 000010D6 52                  <1> 	push dx
  1458 000010D7 06                  <1> 	push es
  1459 000010D8 1E                  <1> 	push ds
  1460                              <1> 
  1461 000010D9 16                  <1> 	 push ss
  1462 000010DA 1F                  <1> 	 pop ds
  1463 000010DB 16                  <1> 	 push ss
  1464 000010DC 07                  <1> 	 pop es
  1465 000010DD BA[D406]            <1> reloc	mov dx, filebuffer
  1466                              <1> internaldatarelocation
  1467 000010E0 8916[D408]          <1> reloc	mov [filebuffer.next], dx
  1468                              <1> internaldatarelocation
  1469 000010E4 8916[D608]          <1> reloc	mov [filebuffer.tail], dx
  1470                              <1> internaldatarelocation
  1471 000010E8 B8003F              <1> 	mov ax, 3F00h
  1472 000010EB 8B1E[D808]          <1> reloc	mov bx, [handle]
  1473                              <1> internaldatarelocation
  1474 000010EF B90002              <1> 	mov cx, filebuffer.end - filebuffer
  1475 000010F2 E865FC              <1> 	call dos_or_boot_io
  1476 000010F5 720C                <1> 	jc @F			; CY -->
  1477 000010F7 85C0                <1> 	test ax, ax
  1478 000010F9 F9                  <1> 	stc			; CY
  1479 000010FA 7407                <1> 	jz @F
  1480 000010FC 01D0                <1> 	add ax, dx		; NC
  1481 000010FE A3[D608]            <1> reloc	mov word [filebuffer.tail], ax
  1482                              <1> internaldatarelocation
  1483 00001101 89D6                <1> 	mov si, dx
  1484                              <1> @@:
  1485 00001103 1F                  <1> 	pop ds
  1486 00001104 07                  <1> 	pop es
  1487 00001105 5A                  <1> 	pop dx
  1488 00001106 59                  <1> 	pop cx
  1489 00001107 5B                  <1> 	pop bx
  1490 00001108 58                  <1> 	pop ax
  1491 00001109 7208                <1> 	jc .ret
  1492                              <1> .buffered:
  1493 0000110B 36AC                <1> 	ss lodsb
  1494 0000110D 368936[D408]        <1> reloc	mov [ss:filebuffer.next], si
  1495                              <1> internaldatarelocation
  1496 00001112 F8                  <1> 	clc
  1497                              <1> .ret:
  1498 00001113 C3                  <1> 	retn
  1499                              <1> 
  1500                              <1> 
  1501                              <1> 		; INP:	ds:si -> data to write
  1502                              <1> 		;	cx = length of data (may be zero)
  1503                              <1> 		; OUT:	Does not return if error
  1504                              <1> 		; CHG:	-
  1505                              <1> put_file_data:
  1506 00001114 50                  <1> 	push ax
  1507 00001115 53                  <1> 	push bx
  1508 00001116 51                  <1> 	push cx
  1509 00001117 52                  <1> 	push dx
  1510 00001118 1E                  <1> 	push ds
  1511 00001119 56                  <1> 	push si
  1512 0000111A 06                  <1> 	push es
  1513 0000111B 57                  <1> 	push di
  1514 0000111C 16                  <1> 	 push ss
  1515 0000111D 1F                  <1> 	 pop ds
  1516                              <1> .entry2:
  1517                              <1> %if 0
  1518                              <1> reloc	cmp word [depackseek], strict word 0AFh
  1519                              <1> internaldatarelocation -4
  1520                              <1> 	jne @F
  1521                              <1> reloc	cmp word [depackseek + 2], strict byte 0
  1522                              <1> internaldatarelocation -3
  1523                              <1> 	jne @F
  1524                              <1> 	houdini
  1525                              <1> @@:
  1526                              <1> %endif
  1527 0000111E 51                  <1> 	push cx			; put data length, add to depackseek maybe
  1528 0000111F 833E[C206]00        <1> reloc	cmp word [depackskip + 2], strict byte 0
  1529                              <1> internaldatarelocation -3
  1530 00001124 755D                <1> 	jne .skip
  1531 00001126 390E[C006]          <1> reloc	cmp word [depackskip], cx
  1532                              <1> internaldatarelocation
  1533 0000112A 7357                <1> 	jae .skip		; still have to skip -->
  1534 0000112C 31D2                <1> 	xor dx, dx
  1535 0000112E 8716[C006]          <1> reloc	xchg dx, word [depackskip]
  1536                              <1> internaldatarelocation		; how much to skip in this step
  1537                              <1> 				; dx = how many bytes skipped
  1538 00001132 01D6                <1> 	add si, dx		; -> data to copy (part of put data)
  1539 00001134 29D1                <1> 	sub cx, dx		; data - skip = length of data to copy, at least 1
  1540 00001136 7454                <1> 	jz .ret_cx		; (not needed ?)
  1541 00001138 51                  <1> 	push cx			; = how many bytes left at si
  1542 00001139 C43E[C806]          <1> reloc	les di, [depacked_buffer]
  1543                              <1> internaldatarelocation
  1544 0000113D A1[D006]            <1> reloc	mov ax, word [depacked_length]
  1545                              <1> internaldatarelocation		; how much we want to read
  1546 00001140 39C8                <1> 	cmp ax, cx
  1547 00001142 7302                <1> 	jae @F
  1548 00001144 89C1                <1> 	mov cx, ax		; cx = min(ax, cx) lesser of requested, available
  1549                              <1> @@:
  1550 00001146 89C8                <1> 	mov ax, cx		; how much we want to copy
  1551 00001148 F3A4                <1> 	rep movsb		; copy to user buffer, si -> data left if any
  1552                              <1> 
  1553 0000114A 893E[C806]          <1> reloc	mov word [depacked_buffer], di
  1554                              <1> internaldatarelocation		; -> past copied data
  1555 0000114E 2906[D006]          <1> reloc	sub word [depacked_length], ax
  1556                              <1> internaldatarelocation		; decrement count of how much still wanted
  1557                              <1> 		; this is NZ only if available < requested
  1558 00001152 59                  <1> 	pop cx			; = how many bytes left at prior si -> data just copied
  1559 00001153 7537                <1> 	jnz .ret_cx		; go add full length of put data to depackseek
  1560 00001155 01C2                <1> 	add dx, ax		; how many bytes processed (skipped + copied)
  1561 00001157 0116[C406]          <1> reloc	add word [depackseek], dx
  1562                              <1> internaldatarelocation
  1563 0000115B 8316[C606]00        <1> reloc	adc word [depackseek + 2], strict byte 0
  1564                              <1> internaldatarelocation -3	; add to seek the last bit processed
  1565 00001160 5A                  <1> 	pop dx			; discard cx on stack
  1566 00001161 29C1                <1> 	sub cx, ax		; = how many bytes left after new si ->
  1567 00001163 890E[CC06]          <1> reloc	mov word [depack_left_length], cx
  1568                              <1> internaldatarelocation		; = amount data left after new si ->
  1569 00001167 8936[CE06]          <1> reloc	mov word [depack_left_address], si
  1570                              <1> internaldatarelocation		; at current depackseek -> data left if any
  1571 0000116B 55                  <1> 	push bp
  1572 0000116C 8926[0000]          <1> reloc	mov word [depack_saved_sp], sp
  1573                              <1> internaldatarelocation
  1574 00001170 F8                  <1> 	clc
  1575 00001171 E925FF              <1> 	jmp read_and_depack.read
  1576                              <1> 
  1577                              <1> .entry:
  1578 00001174 8B26[0000]          <1> reloc	mov sp, word [depack_saved_sp]
  1579                              <1> internaldatarelocation
  1580 00001178 5D                  <1> 	pop bp
  1581 00001179 8B0E[CC06]          <1> reloc	mov cx, word [depack_left_length]
  1582                              <1> internaldatarelocation
  1583 0000117D 8B36[CE06]          <1> reloc	mov si, word [depack_left_address]
  1584                              <1> internaldatarelocation
  1585 00001181 EB9B                <1> 	jmp .entry2
  1586                              <1> 
  1587                              <1> .skip:
  1588 00001183 290E[C006]          <1> reloc	sub word [depackskip], cx
  1589                              <1> internaldatarelocation
  1590 00001187 831E[C206]00        <1> reloc	sbb word [depackskip + 2], strict byte 0
  1591                              <1> internaldatarelocation -3
  1592                              <1> 
  1593                              <1> .ret_cx:
  1594 0000118C 59                  <1> 	pop cx
  1595 0000118D 010E[C406]          <1> reloc	add word [depackseek], cx
  1596                              <1> internaldatarelocation
  1597 00001191 8316[C606]00        <1> reloc	adc word [depackseek + 2], strict byte 0
  1598                              <1> internaldatarelocation -3
  1599                              <1> 
  1600                              <1> .ret:
  1601 00001196 5F                  <1> 	pop di
  1602 00001197 07                  <1> 	pop es
  1603 00001198 5E                  <1> 	pop si
  1604 00001199 1F                  <1> 	pop ds
  1605 0000119A 5A                  <1> 	pop dx
  1606 0000119B 59                  <1> 	pop cx
  1607 0000119C 5B                  <1> 	pop bx
  1608 0000119D 58                  <1> 	pop ax
  1609 0000119E C3                  <1> 	retn
  1610                              <1> %endif
  2230                                  %endif
  2231                                  
  2232                                  
  2233                                  get_es_ext:
  2234 0000119F 8E06[0000]              reloc	mov es, word [relocateddata]
  2235                                  linkdatarelocation extdssel
  2236 000011A3 E89200                  	extcallcall ispm
  2237 000011A6 7404                    	jz @F
  2238 000011A8 8E06[0000]              reloc	mov es, word [relocateddata]
  2239                                  linkdatarelocation extseg
  2240                                  @@:
  2241 000011AC C3                      	retn
  2242                                  
  2243                                  
  2244                                  start:
  2245 000011AD 8CC3                    	mov bx, es
  2246 000011AF 16                      	 push ss
  2247 000011B0 07                      	 pop es
  2248 000011B1 E80401                  	extcallcall skipcomma
  2249 000011B4 E8A900                  	extcallcall iseol?
  2250 000011B7 7409                    	je .help
  2251 000011B9 E864EE                  	call run
  2252                                  @@:
  2253 000011BC E80B00                  	call uninstall_oneshot
  2254 000011BF 31C0                    	xor ax, ax
  2255 000011C1 CB                      	retf
  2256                                  
  2257                                  .help:
  2258 000011C2 BA[FB01]                reloc	mov dx, msg.help
  2259                                  internaldatarelocation
  2260 000011C5 E85000                  	extcallcall putsz
  2261 000011C8 EBF2                    	jmp @B
  2262                                  
  2263                                  
  2264                                  uninstall_oneshot:
  2265 000011CA 36F606[0000]01          reloc	testopt [ss:relocateddata], 1
  2266                                  linkdatarelocation options7, -3
  2267 000011D0 751A                    	jnz @F
  2268                                  
  2269 000011D2 2EA1[0200]              reloc	mov ax, word [cs:code + eldiEndCode]
  2270                                  internalcoderelocation
  2271 000011D6 2E2B06[0000]            reloc	sub ax, word [cs:code + eldiStartCode]
  2272                                  internalcoderelocation
  2273 000011DB 2906[0000]              reloc	sub word [relocateddata], ax
  2274                                  linkdatarelocation extseg_used
  2275                                  
  2276 000011DF 2EA1[0600]              reloc	mov ax, word [cs:code + eldiEndData]
  2277                                  internalcoderelocation
  2278 000011E3 2E2B06[0400]            reloc	sub ax, word [cs:code + eldiStartData]
  2279                                  internalcoderelocation
  2280 000011E8 2906[0000]              reloc	sub word [relocateddata], ax
  2281                                  linkdatarelocation extdata_used
  2282                                  @@:
  2283 000011EC C3                      	retn
  2284                                  
  2285                                  
  2286                                  DATAOFFSET equ CODEOFFSET + code_size
  2287                                  	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
  2288                                  %define DATAFIXUP - datastart + 0
  2289                                  datastart:
  2290                                  PUT_ELD_DATETIME
  2291                                  
  2292                                  %if _COMPRESSED
  2293                                  	align 2, db 0
  2294 00000000 FFFF                    depack_saved_sp:	dw 0FFFFh
  2295 00000002 FF                      partialdepack:		db 0FFh
  2296 00000003 00                      depack_format:		db 0
  2297                                  %endif
  2298                                  
  2299 00000004 00                      findhandle_set:		db 0
  2300 00000005 00                      found:			db 0
  2301 00000006 00                      verbose:		db 0
  2302 00000007 00                      do_help:		db 0
  2303 00000008 00                      prefersfn:		db 0
  2304 00000009 00                      lib:			db 0
  2305 0000000A 00                      libname:		db 0
  2306                                  
  2307                                  msg:
  2308 0000000B 564552424F534500        .verbose:		asciz "VERBOSE"
  2309 00000013 48454C5000              .string_help:		asciz "HELP"
  2310 00000018 53464E00                .string_sfn:		asciz "SFN"
  2311 0000001C 4C494200                .string_lib:		asciz "LIB"
  2312 00000020 3A2000                  .colon:			asciz ": "
  2313 00000023 46696C65206E6F7420-     .notfound:		asciz "File not found.",13,10
  2313 0000002C 666F756E642E0D0A00 
  2314 00000035 4E6F20646573637269-     .nodesc:		asciz "No description.",13,10
  2314 0000003E 7074696F6E2E0D0A00 
  2315 00000047 4E6F2068656C702E0D-     .nohelp:		asciz "No help.",13,10
  2315 00000050 0A00               
  2316 00000052 48454C505354415254-     .helpstart:		asciz "HELPSTART"
  2316 0000005B 00                 
  2317                                  .helpstart.length equ $ - 1 - .helpstart
  2318 0000005C 48454C50454E4400        .helpend:		asciz "HELPEND"
  2319                                  .helpend.length equ $ - 1 - .helpend
  2320 00000064 4C49535420454C4420-     .io_error:		asciz "LIST ELD got I/O error.",13,10
  2320 0000006D 676F7420492F4F2065-
  2320 00000076 72726F722E0D0A00   
  2321                                  %if _COMPRESSED
  2322 0000007E 4C49535420454C4420-     .doublepacked_error:	asciz "LIST ELD cannot recurse into nested compressed library ELDs.",13,10
  2322 00000087 63616E6E6F74207265-
  2322 00000090 637572736520696E74-
  2322 00000099 6F206E657374656420-
  2322 000000A2 636F6D707265737365-
  2322 000000AB 64206C696272617279-
  2322 000000B4 20454C44732E0D0A00 
  2323                                  %endif
  2324 000000BD 1B222E20496E76616C-     .invalid_instance:	counted '". Invalid instance header.'
  2324 000000C6 696420696E7374616E-
  2324 000000CF 636520686561646572-
  2324 000000D8 2E                 
  2325 000000D9 4E6F206F7220696E76-     .invalid:		db "No or invalid Extension for lDebug header."
  2325 000000E2 616C69642045787465-
  2325 000000EB 6E73696F6E20666F72-
  2325 000000F4 206C44656275672068-
  2325 000000FD 65616465722E       
  2326 00000103 0D0A00                  .linebreak:		asciz 13,10
  2327 00000106 4E6F206F7220696E76-     .invalid_sld:		asciz "No or invalid Script/Extension for lDebug header.",13,10
  2327 0000010F 616C69642053637269-
  2327 00000118 70742F457874656E73-
  2327 00000121 696F6E20666F72206C-
  2327 0000012A 446562756720686561-
  2327 00000133 6465722E0D0A00     
  2328 0000013A 0B2020466F726D6174-     .verbose.1:	counted "  Format: ",'"'
  2328 00000143 3A2022             
  2329 00000146 0E222C20454C44206E-     .verbose.2:	counted '", ELD name: "'
  2329 0000014F 616D653A2022       
  2330 00000155 0720636F64652C20        .verbose.3:	counted " code, "
  2331 0000015D 0820616C6C6F632C20      .verbose.4:	counted " alloc, "
  2332 00000166 0720646174612C20        .verbose.5:	counted " data, "
  2333 0000016E 0620616C6C6F63          .verbose.6:	counted " alloc"
  2334 00000175 0D222C2066696C6520-     .verbose.2.sld:	counted '", file size '
  2334 0000017E 73697A6520         
  2335 00000183 06206279746573          .verbose.3.sld:	counted " bytes"
  2336 0000018A 1320204C6962726172-     .verbose.lib.1:	counted "  Library contains "
  2336 00000193 7920636F6E7461696E-
  2336 0000019C 7320               
  2337 0000019E 0E20454C44732C2066-     .verbose.lib.2:	counted " ELDs, format "
  2337 000001A7 6F726D617420       
  2338 000001AD 0F2028756E636F6D70-     .verbose.lib.3.un:	counted " (uncompressed)"
  2338 000001B6 72657373656429     
  2339 000001BD 0D2028686561747368-     .verbose.lib.3.hs:	counted " (heatshrink)"
  2339 000001C6 72696E6B29         
  2340 000001CB 0E20286C7A65786564-     .verbose.lib.3.lze:	counted " (lzexedat -4)"
  2340 000001D4 6174202D3429       
  2341 000001DA 1120286C7A65786564-     .verbose.lib.3.lzel:	counted " (lzexedat -4 -l)"
  2341 000001E3 6174202D34202D6C29 
  2342 000001EC 0E2C207061636B6564-     .verbose.lib.4:	counted ", packed size "
  2342 000001F5 2073697A6520       
  2343                                  
  2344                                  depack_stack: equ $
  2345                                  
  2346 000001FB 52756E207769746820-     .help:		db "Run with a pathname as parameter.",13,10
  2346 00000204 6120706174686E616D-
  2346 0000020D 652061732070617261-
  2346 00000216 6D657465722E0D0A   
  2347 0000021E 4C61737420636F6D70-     		db "Last component may include wildcards.",13,10
  2347 00000227 6F6E656E74206D6179-
  2347 00000230 20696E636C75646520-
  2347 00000239 77696C646361726473-
  2347 00000242 2E0D0A             
  2348 00000245 0D0A                    		db 13,10
  2349 00000247 416674657220746865-     		db "After the pathname, keywords may follow:",13,10
  2349 00000250 20706174686E616D65-
  2349 00000259 2C206B6579776F7264-
  2349 00000262 73206D617920666F6C-
  2349 0000026B 6C6F773A0D0A       
  2350 00000271 09564552424F534509-     		db 9,"VERBOSE",9,"Display ELD format, name, sizes",13,10
  2350 0000027A 446973706C61792045-
  2350 00000283 4C4420666F726D6174-
  2350 0000028C 2C206E616D652C2073-
  2350 00000295 697A65730D0A       
  2351 0000029B 0948454C5009446973-     		db 9,"HELP",9,"Display ELD help",13,10
  2351 000002A4 706C617920454C4420-
  2351 000002AD 68656C700D0A       
  2352 000002B3 0953464E0955736520-     		db 9,"SFN",9,"Use DOS SFN search even if LFN available",13,10
  2352 000002BC 444F532053464E2073-
  2352 000002C5 656172636820657665-
  2352 000002CE 6E206966204C464E20-
  2352 000002D7 617661696C61626C65-
  2352 000002E0 0D0A               
  2353 000002E2 094C49420952656375-     		db 9,"LIB",9,"Recurse into library ELDs",13,10
  2353 000002EB 72736520696E746F20-
  2353 000002F4 6C6962726172792045-
  2353 000002FD 4C44730D0A         
  2354 00000302 092F6E616D65094F6E-     		db 9,"/name",9,"Only display library ELDs matching the name",13,10
  2354 0000030B 6C7920646973706C61-
  2354 00000314 79206C696272617279-
  2354 0000031D 20454C4473206D6174-
  2354 00000326 6368696E6720746865-
  2354 0000032F 206E616D650D0A     
  2355 00000336 00                      		asciz
  2356                                  
  2357                                  uinit_data: equ $
  2358                                  
  2359 00000337 00<rep 9h>              	align 16, db 0
  2360                                  init_data_end:
  2361                                  data_size equ $ - datastart
  2362                                  transient_data_size equ data_size
  2363                                  
  2364                                  %if _COMPRESSED
  2365                                  	absolute depack_stack
  2366 000001FB ??                      	alignb 2
  2367 000001FC <res 100h>              		resb 256
  2368                                  depack_stack.top:
  2369                                  
  2370                                   %if uinit_data > depack_stack.top
  2371                                  	absolute uinit_data
  2372                                   %endif
  2373                                  %else
  2374                                  	absolute uinit_data
  2375                                  %endif
  2376                                  
  2377 00000337 ??                      	alignb 2
  2378 00000338 ????????????????        libnamebuffer:	resb 8
  2379                                  wild_pattern:		; overlaps next variable
  2380                                  boot_parsed:	equ $+2	; overlaps next variable
  2381 00000340 ????????                originaldta:	resd 1
  2382 00000344 ????                    originalinject:	resw 1
  2383                                  findnext_function_number:
  2384 00000346 ????                    		resw 1
  2385 00000348 ????                    findhandle:	resw 1
  2386 0000034A <res 1Eh>               dta:		resb 1Eh
  2387 00000368 <res Dh>                .name:		resb 13
  2388                                  
  2389 00000375 ??                      	alignb 2
  2390 00000376 <res 200h>              pathnamebuffer:	resb 512
  2391                                  
  2392 00000576 <res 2Ch>               finddata:	resb 2Ch
  2393 000005A2 <res 104h>              .fullname:	resb 260
  2394 000006A6 <res Eh>                .shortname:	resb 14
  2395                                  
  2396                                  %if _COMPRESSED
  2397                                  	alignb 2
  2398                                  libtab_compressed_length:
  2399 000006B4 ????????                		resd 1
  2400 000006B8 ????????                libseek:	resd 1
  2401 000006BC ????????                eldheader:	resd 1
  2402 000006C0 ????????                depackskip:	resd 1
  2403 000006C4 ????????                depackseek:	resd 1
  2404 000006C8 ????????                depacked_buffer:resd 1
  2405 000006CC ????                    depack_left_length:	resw 1
  2406 000006CE ????                    depack_left_address:	resw 1
  2407 000006D0 ????                    depacked_length:resw 1
  2408 000006D2 ????                    depack_prior_sp:resw 1
  2409                                  	alignb 2
  2410 000006D4 <res 200h>              filebuffer:	resb 512
  2411                                  .end:
  2412                                  	alignb 2
  2413 000008D4 ????                    .next:		resw 1
  2414 000008D6 ????                    .tail:		resw 1
  2415 000008D8 ????                    handle:		resw 1
  2416                                  
  2417 000008DA ????????????            	alignb 16
  2418                                  resultbuffer:
  2419                                  .size equ 4096
  2420 000008E0 <res 1000h>             		resb .size
  2421                                  .end:
  2422                                  %endif
  2423                                  
  2424                                  %if _DATABUFFER
  2425                                  	alignb 16
  2426                                  databuffer:
  2427 000018E0 <res 200h>              	resb 512
  2428                                  %endif
  2429                                  
  2430                                  	alignb 16
  2431                                  uinit_data_end:
  2432                                  
  2433                                  total_data_size equ $ - datastart
  2434                                  %assign _DATA_SIZE total_data_size
  2435                                  
  2436                                  	usesection CODE
  2437                                  
  2438                                  %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 000011ED 90<rep 3h>E8[0000]- <1> 	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
    28 000011F3 EB020000C3E8[0000]- <1>
    28 000011FB EB020000C3E8[0000]- <1>
    28 00001203 EB020000C3E8[0000]- <1>
    28 0000120B EB020000C3E8[0000]- <1>
    28 00001213 EB020000C3E8[0000]- <1>
    28 0000121B EB020000C3E8[0000]- <1>
    28 00001223 EB020000C3E8[0000]- <1>
    28 0000122B EB020000C3E8[0000]- <1>
    28 00001233 EB020000C3E8[0000]- <1>
    28 0000123B EB020000C3E8[0000]- <1>
    28 00001243 EB020000C3E8[0000]- <1>
    28 0000124B EB020000C3E8[0000]- <1>
    28 00001253 EB020000C3E8[0000]- <1>
    28 0000125B EB020000C3E8[0000]- <1>
    28 00001263 EB020000C3E8[0000]- <1>
    28 0000126B EB020000C3E8[0000]- <1>
    28 00001273 EB020000C3E8[0000]- <1>
    28 0000127B EB020000C3E8[0000]- <1>
    28 00001283 EB020000C3E8[0000]- <1>
    28 0000128B EB020000C3E8[0000]- <1>
    28 00001293 EB020000C3E8[0000]- <1>
    28 0000129B EB020000C3E8[0000]- <1>
    28 000012A3 EB020000C3E8[0000]- <1>
    28 000012AB EB020000C3E8[0000]- <1>
    28 000012B3 EB020000C3E8[0000]- <1>
    28 000012BB EB020000C3          <1>
    29                              <1> %endif
    30                              <1> 
    31                              <1> 	numdef ELD_IDENTICALISE, 0
    32                              <1> 	numdef ELD_DEBUG, 0
    33                              <1> 	numdef ELD_LINKER_PASSES, 1
    34                              <1> 	strdef LISTING, _ELD_LISTING
    35                              <1> 	numdef ELDCALL_OPTIONAL, ELDCALL_OPTIONAL_STATUS
    36                              <1> 	numdef ELDDATA_OPTIONAL, ELDDATA_OPTIONAL_STATUS
    37                              <1> 	numdef ELDDATA_NEXT, ELDDATA_NEXT_STATUS
    38                              <1> 	numdef ELDCALL_NEXT, ELDCALL_NEXT_STATUS
    39                              <1> %if _ELD_IDENTICALISE
    40                              <1>  ;%assign _ELDCALL_OPTIONAL 1
    41                              <1> %endif
    42                              <1> %ifn _ELDCALL_OPTIONAL
    43                              <1> %assign ELDCALL_OPTIONAL_STATUS 2		; not allowed
    44                              <1> %endif
    45                              <1> ;%ifn _ELDDATA_OPTIONAL
    46                              <1> ;%assign ELDDATA_OPTIONAL_STATUS 2		; not allowed
    47                              <1> ;%endif
    48                              <1> 	gendef MAP, ""
    49                              <1> 
    50                              <1> %ifnidni _MAP, ""
    51                              <1>  [map all _MAP]
    52                              <1> %endif
    53                              <1> 
    54                              <1> 
    55                              <1> endresident: equ ($ + _CURRENT_SECTION %+ FIXUP + 15) & ~15
    56                              <1> 
    57                              <1> %if _ELD_LINKER_PASSES
    58                              <1> %assign ELDLINKER 1
    59                              <1> 
    60                              <1> 	struc LINKTABLE
    61 00000000 ????????            <1> ltCodeToCode:	resw 2
    62 00000004 ????????            <1> ltCodeToData:	resw 2
    63 00000008 ????????            <1> ltDataToCode:	resw 2
    64 0000000C ????????            <1> ltDataToData:	resw 2
    65 00000010 ????????            <1> ltLinkData:	resw 2
    66 00000014 ????????            <1> ltLinkCode:	resw 2
    67                              <1> 	endstruc
    68                              <1> %endif
    69                              <1> 
    70                              <1> 
    71                              <1> 		; INP:	es:dx -> loaded initial ELD image
    72                              <1> 		;	 ELD instance structure filled
    73                              <1> 		;	es => ELD code area
    74                              <1> 		;	ds:di -> link info
    75                              <1> 		;	ss:bx -> loaded initial data
    76                              <1> 		;	ss:si -> command line tail
    77                              <1> 		;	cs:ip -> entrypoint
    78                              <1> 		;	ss:sp -> far return address for current mode
    79                              <1> 		; STT:	UP, EI
    80                              <1> linker:
    81                              <1> 		; The first 15 Bytes of the linker should be
    82                              <1> 		;  the same regardless of the linker options
    83                              <1> 		;  used (debug, passes, vstart). This allows
    84                              <1> 		;  the eldcomp ELD to match even if up to 15
    85                              <1> 		;  Bytes of the linker are trailing in the
    86                              <1> 		;  resident part of the ELD.
    87                              <1> 	lframe
    88                              <1>  %if ELDOTHER
    89                              <1> 	lvar dword, linkinfo_other
    90                              <1> 	lvar word, use_hash_other
    91                              <1>  %endif
    92 000012C0 5589E5              <1> 	lenter
    93                              <1> 	lvar dword, instance
    94 000012C3 06                  <1> 	 push es
    95 000012C4 52                  <1> 	 push dx		; -> start of where we're loaded in ELD cs
    96                              <1> 	lvar word, targetsection_low_optional_high
    97 000012C5 50                  <1> 	 push ax		; placeholder
    98                              <1> 	lequ ?targetsection_low_optional_high, targetsection
    99                              <1> 	lequ ?targetsection_low_optional_high + 1, optional
   100                              <1> 	lvar dword, linkinfo
   101 000012C6 1E                  <1> 	 push ds
   102 000012C7 57                  <1> 	 push di		; -> link info (in debugger ss or message seg)
   103                              <1> 	lvar dword, nextreloc
   104 000012C8 06                  <1> 	 push es		; => ELD cs
   105 000012C9 52                  <1> 	 push dx		; placeholder
   106                              <1> 	lvar dword, entry
   107 000012CA 06                  <1> 	 push es		; => ELD cs
   108 000012CB 50                  <1> 	 push ax		; placeholder
   109 000012CC 31C0                <1> 	xor ax, ax
   110 000012CE 813DD1E1            <1> 	cmp word [di + eldlSignature], 0E1D1h
   111                              <1> %if ($ - linker) < 16
   112                              <1>  %error Expected invariant first paragraph of linker
   113                              <1> %endif
   114 000012D2 7403                <1> 	je @F
   115                              <1> .error_j1:
   116 000012D4 E92C03              <1> 	jmp .error		; signature mismatch -->
   117                              <1> @@:
   118 000012D7 837D0601            <1> 	cmp word [di + eldlUseLinkHash], 1
   119 000012DB 77F7                <1> 	ja .error_j1		; unknown use link hash number -->
   120 000012DD 7201                <1> 	jb @F
   121                              <1> %if _ELDDATA_NEXT || _ELDCALL_NEXT
   122                              <1> 	dec al			; = -1 if hash used
   123                              <1> %else
   124 000012DF 48                  <1> 	dec ax
   125                              <1> %endif
   126                              <1> @@:
   127                              <1> 	lvar word, use_hash_low_skip_last_high
   128 000012E0 50                  <1> 	 push ax		; = -1 if hash used, else 0
   129                              <1> 	lequ ?use_hash_low_skip_last_high, use_hash
   130                              <1> 	lequ ?use_hash_low_skip_last_high + 1, skip_last
   131                              <1> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   132                              <1> 	mov ax, linktable - code
   133                              <1> 	lvar word, lt
   134                              <1> 	 push ax		; -> link tables (a single reference)
   135                              <1> %endif
   136                              <1> %if _ELD_LINKER_PASSES || ELDOTHER || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   137 000012E1 31C0                <1> 	xor ax, ax
   138                              <1>  %if _ELD_LINKER_PASSES
   139                              <1> 	lvar word, pass
   140 000012E3 50                  <1> 	 push ax		; = 0 for linker itself, = 2 for application
   141                              <1> 	lvar word, amounterrors
   142 000012E4 50                  <1> 	 push ax		; how many distinct errors encountered in pass 2
   143                              <1>  %endif
   144                              <1>  %if _ELD_LINKER_PASSES || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   145                              <1> 	lvar word, name
   146 000012E5 50                  <1> 	 push ax		; -> name currently being sought (in our table)
   147                              <1>  %endif
   148                              <1>  %if ELDOTHER
   149                              <1> 	lvar word, other
   150                              <1> 	 push ax		; byte: 0 = own data links, -1 = other data links
   151                              <1>  %endif
   152                              <1>  %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   153                              <1> 	lvar word, optionalmissing
   154 000012E6 50                  <1> 	 push ax
   155                              <1>  %endif
   156                              <1> %endif
   157 000012E7 56                  <1> 	push si			; -> command line tail
   158 000012E8 53                  <1> 	push bx			; -> data block in ELD data area (segment ss)
   159                              <1> 
   160                              <1> 			; simple: add instance base (dx) to code
   161 000012E9 06                  <1> 	push es
   162 000012EA 1F                  <1> 	pop ds			; ds = es => ELD cs
   163                              <1> %if _ELD_LINKER_PASSES
   164                              <1> .pass:
   165 000012EB 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   166 000012EE 01D3                <1> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   167                              <1>  %if _ELD_IDENTICALISE
   168                              <1> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   169                              <1> 	mov si, word [ltCodeToCode + bx]
   170                              <1>  %else
   171 000012F0 8BB76417            <1> 	mov si, word [linktable - code + ltCodeToCode + bx]
   172                              <1>  %endif
   173                              <1> %else
   174                              <1> 	mov si, internalcodetocoderelocations - code
   175                              <1> %endif		 		; si -> table for code to code (linker or app)
   176 000012F4 01D6                <1> 	add si, dx		; relocate the table pointer itself
   177                              <1> @@:
   178 000012F6 AD                  <1> 	lodsw
   179 000012F7 85C0                <1> 	test ax, ax		; was last ?
   180 000012F9 740B                <1> 	jz @F			; yes -->
   181 000012FB 93                  <1> 	xchg bx, ax		; bx = entry
   182 000012FC 01D3                <1> 	add bx, dx		; relocate the entry itself
   183                              <1> %if _ELD_CODE_VSTART
   184 000012FE 812F[0000]          <1> 	sub word [bx], code	; undo adjustment
   185                              <1> %endif
   186 00001302 0117                <1> 	add word [bx], dx	; relocate word referenced by entry
   187 00001304 EBF0                <1> 	jmp @B
   188                              <1> 
   189                              <1> @@:
   190                              <1> 			; next, add heap data base (on stack) to code
   191                              <1> %if _ELD_LINKER_PASSES
   192 00001306 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   193 00001309 01D3                <1> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   194                              <1>  %if _ELD_IDENTICALISE
   195                              <1> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   196                              <1> 	mov si, word [ltCodeToData + bx]
   197                              <1>  %else
   198 0000130B 8BB76817            <1> 	mov si, word [linktable - code + ltCodeToData + bx]
   199                              <1>  %endif
   200                              <1> %else
   201                              <1> 	mov si, internalcodetodatarelocations - code
   202                              <1> %endif				; si -> table for code to data (linker or app)
   203 0000130F 01D6                <1> 	add si, dx		; relocate the table pointer itself
   204                              <1> @@:
   205 00001311 AD                  <1> 	lodsw
   206 00001312 85C0                <1> 	test ax, ax		; was last ?
   207 00001314 740C                <1> 	jz @F			; yes -->
   208 00001316 93                  <1> 	xchg bx, ax		; bx = entry
   209 00001317 01D3                <1> 	add bx, dx		; relocate the entry itself
   210                              <1> 		; ! access the offset of the data area block, topmost on stack
   211 00001319 58                  <1> 	pop ax			; ax -> heap data
   212 0000131A 50                  <1> 	push ax
   213                              <1> %if _ELD_DATA_VSTART
   214 0000131B 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   215                              <1> %endif
   216 0000131E 0107                <1> 	add word [bx], ax	; relocate word referenced by entry
   217 00001320 EBEF                <1> 	jmp @B
   218                              <1> 
   219                              <1> @@:
   220                              <1> 
   221                              <1> 			; add instance base (dx) to data
   222                              <1> %if _ELD_LINKER_PASSES
   223 00001322 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   224 00001325 01D3                <1> 	add bx, dx
   225                              <1>  %if _ELD_IDENTICALISE
   226                              <1> 	add bx, word [bp + ?lt]
   227                              <1> 	mov si, word [ltDataToCode + bx]
   228                              <1>  %else
   229 00001327 8BB76C17            <1> 	mov si, word [linktable - code + ltDataToCode + bx]
   230                              <1>  %endif
   231                              <1> %else
   232                              <1> 	mov si, internaldatatocoderelocations - code
   233                              <1> %endif
   234 0000132B 01D6                <1> 	add si, dx
   235                              <1> @@:
   236 0000132D AD                  <1> 	lodsw
   237 0000132E 83F8FF              <1> 	cmp ax, -1		; was last ?
   238 00001331 740F                <1> 	je @F			; yes -->
   239 00001333 93                  <1> 	xchg bx, ax		; bx = entry
   240                              <1> 		; ! access the offset of the data area block, topmost on stack
   241 00001334 58                  <1> 	pop ax
   242 00001335 50                  <1> 	push ax
   243 00001336 01C3                <1> 	add bx, ax		; relocate the entry itself
   244                              <1> %if _ELD_CODE_VSTART
   245 00001338 36812F[0000]        <1> 	sub word [ss:bx], code	; undo adjustment
   246                              <1> %endif
   247 0000133D 360117              <1> 	add word [ss:bx], dx	; relocate word referenced by entry
   248 00001340 EBEB                <1> 	jmp @B
   249                              <1> 
   250                              <1> @@:
   251                              <1> 			; next, add heap data base (on stack) to data
   252                              <1> %if _ELD_LINKER_PASSES
   253 00001342 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   254 00001345 01D3                <1> 	add bx, dx
   255                              <1>  %if _ELD_IDENTICALISE
   256                              <1> 	add bx, word [bp + ?lt]
   257                              <1> 	mov si, word [ltDataToData + bx]
   258                              <1>  %else
   259 00001347 8BB77017            <1> 	mov si, word [linktable - code + ltDataToData + bx]
   260                              <1>  %endif
   261                              <1> %else
   262                              <1> 	mov si, internaldatatodatarelocations - code
   263                              <1> %endif
   264 0000134B 01D6                <1> 	add si, dx
   265                              <1> @@:
   266 0000134D AD                  <1> 	lodsw
   267 0000134E 83F8FF              <1> 	cmp ax, -1		; was last ?
   268 00001351 740D                <1> 	je @F			; yes -->
   269 00001353 93                  <1> 	xchg bx, ax		; bx = entry
   270                              <1> 		; ! access the offset of the data area block, topmost on stack
   271 00001354 58                  <1> 	pop ax			; ax -> heap data
   272 00001355 50                  <1> 	push ax
   273 00001356 01C3                <1> 	add bx, ax		; relocate the entry itself
   274                              <1> %if _ELD_DATA_VSTART
   275 00001358 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   276                              <1> %endif
   277 0000135B 360107              <1> 	add word [ss:bx], ax	; relocate word referenced by entry
   278 0000135E EBED                <1> 	jmp @B
   279                              <1> 
   280                              <1> @@:
   281 00001360 8B56FC              <1> 	mov dx, word [bp + ?instance]
   282                              <1> 				; reset (why??) -> ELD instance in ELD cs
   283                              <1> %if _ELD_LINKER_PASSES
   284 00001363 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   285 00001366 01D3                <1> 	add bx, dx
   286                              <1>  %if _ELD_IDENTICALISE
   287                              <1> 	add bx, word [bp + ?lt]
   288                              <1> 	add dx, word [ltLinkData + bx]
   289                              <1>  %else
   290 00001368 03977417            <1> 	add dx, word [linktable - code + ltLinkData + bx]
   291                              <1>  %endif
   292                              <1> %else
   293                              <1> 	add dx, linkerdatarelocations - code
   294                              <1> %endif
   295                              <1> .otherloop:
   296 0000136C 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   297                              <1> 				; -> data link relocation table
   298                              <1> 
   299                              <1> .datarelocloop:		; must be done before further relocs
   300 0000136F C576F2              <1> 	lds si, [bp + ?nextreloc]
   301 00001372 AD                  <1> 	lodsw			; ax = section indicator
   302 00001373 85C0                <1> 	test ax, ax		; end of table ?
   303 00001375 7503E96601          <1> 	jz .donedatareloc
   304 0000137A 48                  <1> 	dec ax			; al = 1 if data, 0 if code (NB ah may != 0)
   305                              <1> 		; ! access the offset of the data area block, topmost on stack
   306 0000137B 5B                  <1> 	pop bx
   307 0000137C 53                  <1> 	push bx			; bx -> ELD data block
   308 0000137D 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   309 00001380 84C0                <1> 	test al, al		; data ?
   310 00001382 AD                  <1> 	lodsw
   311 00001383 7504                <1> 	jnz @F			; yes -->
   312 00001385 0346FC              <1> 	add ax, word [bp + ?instance]
   313                              <1> 				; relocate entry into code
   314 00001388 A9                  <1> 	db __TEST_IMM16		; (skip add)
   315                              <1> @@:
   316 00001389 01D8                <1> 	add ax, bx		; relocate entry into data
   317 0000138B 8946EE              <1> 	mov word [bp + ?entry], ax
   318                              <1> 				; save away -> where to patch
   319 0000138E AD                  <1> 	lodsw			; get unrelocated -> name
   320 0000138F 8976F2              <1> 	mov word [bp + ?nextreloc], si
   321                              <1> 				; update -> behind relocation table entry
   322                              <1> %if _ELDDATA_NEXT
   323                              <1> 	rol byte [bp + ?skip_last], 1	; skipping ?
   324                              <1> 	jnc @F				; no -->
   325                              <1> 	test byte [bp + ?optional], 8	; is it a last relocation ?
   326                              <1> 	jz .datarelocloop		; no, leave skip_last set -->
   327                              <1> 	not byte [bp + ?skip_last]	; disable skip_last
   328                              <1> 	jmp .datarelocloop
   329                              <1> @@:
   330                              <1> %endif
   331 00001392 E81001              <1> 	call .build_match	; get ax = scan value, si -> counted string,
   332                              <1> 				;  dl = original value at byte [si]
   333                              <1> 				; NC if symbol already not found before
   334                              <1> 				; CY if to search for the symbol
   335                              <1> %if _ELD_LINKER_PASSES
   336 00001395 73D8                <1> 	jnc .datarelocloop	; if duplicate of a not found symbol -->
   337                              <1> %endif
   338 00001397 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   339                              <1> %if ELDOTHER
   340                              <1> 	rol byte [bp + ?other], 1
   341                              <1> 	jnc @F
   342                              <1> 	les bx, [bp + ?linkinfo_other]
   343                              <1> @@:
   344                              <1> %endif				; es:bx -> link info table of the ELD host
   345 0000139A 268B4F08            <1> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   346 0000139E 268B7F0A            <1> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   347                              <1> .datarelocfind:
   348 000013A2 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   349 000013A5 F2AF                <1> 	repne scasw			; scan initial
   350                              <1> %if _ELDDATA_OPTIONAL
   351                              <1> 	jne .datanotfound_may_be_optional
   352                              <1> %else
   353 000013A7 7403E98900          <1> 	jne .datanotfound
   354                              <1> %endif
   355 000013AC 57                  <1> 	push di
   356 000013AD 51                  <1> 	push cx
   357 000013AE 56                  <1> 	push si
   358 000013AF 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   359 000013B3 4F                  <1> 	dec di
   360 000013B4 4F                  <1> 	dec di				; 0-based
   361 000013B5 26037F0C            <1> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   362 000013B9 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   363 000013BC B500                <1> 	mov ch, 0
   364 000013BE 8A0C                <1> 	mov cl, byte [si]		; cx = length
   365 000013C0 41                  <1> 	inc cx
   366                              <1> 	; cmp al, al			; ZR if length is zero
   367 000013C1 F3A6                <1> 	repe cmpsb			; match ?
   368 000013C3 5E                  <1> 	pop si
   369 000013C4 59                  <1> 	pop cx
   370 000013C5 5F                  <1> 	pop di
   371 000013C6 75DA                <1> 	jne .datarelocfind		; if not found this time,
   372                              <1> 					;  scan for next initial -->
   373 000013C8 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   374 000013CA 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   375 000013CE 4F                  <1> 	dec di
   376 000013CF 4F                  <1> 	dec di				; 0-based
   377 000013D0 26037F0E            <1> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   378 000013D4 268B05              <1> 	mov ax, word [es:di]		; get link data from the table
   379 000013D7 E80700              <1> 	call .address_data_reloc
   380                              <1> %if _ELD_RELOC_VSTART
   381 000013DA 2D[0000]            <1> 	sub ax, relocateddata		; *not* a relocation
   382                              <1> %endif
   383 000013DD 0104                <1> 	add word [si], ax		; relocate
   384                              <1> %if _ELDDATA_NEXT
   385                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   386                              <1> 	jz .datarelocloop
   387                              <1> 	mov byte [bp + ?skip_last], -1	; skip subsequent next/last relocs
   388                              <1> %endif
   389 000013DF EB8E                <1> 	jmp .datarelocloop
   390                              <1> 
   391                              <1> .address_data_reloc:
   392 000013E1 C576EE              <1> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   393 000013E4 807EFA00            <1> 	cmp byte [bp + ?targetsection], 0
   394                              <1> 					; relocation in code ?
   395 000013E8 7402                <1> 	je @F				; yes -->
   396 000013EA 16                  <1> 	push ss
   397 000013EB 1F                  <1> 	pop ds				; => our ELD data block
   398                              <1> @@:
   399 000013EC C3                  <1> 	retn
   400                              <1> 
   401                              <1> %if _ELDDATA_OPTIONAL
   402                              <1> .datanotfound_may_be_optional:
   403                              <1> 	mov byte [si], dl		; restore the original byte at counter
   404                              <1> %if _ELDDATA_NEXT
   405                              <1> 	test byte [bp + ?optional], 3	; is it an optional relocation ?
   406                              <1> %else
   407                              <1> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   408                              <1> %endif
   409                              <1> %if _ELD_DEBUG
   410                              <1> 	jnz @F
   411                              <1>  %ifn _ELD_LINKER_PASSES
   412                              <1> 	mov si, 0			; (invalid link)
   413                              <1> linkdatarelocation internalflags6
   414                              <1> 	test si, si
   415                              <1> 	jz .datanotfound
   416                              <1> 	mov si, 0			; (invalid link)
   417                              <1> linkdatarelocation options7
   418                              <1> 	test si, si
   419                              <1> 	jz .datanotfound
   420                              <1>  %else
   421                              <1> 	cmp byte [bp + ?pass], 0
   422                              <1> 	je .datanotfound
   423                              <1>  %endif
   424                              <1> 	houdini				; (the above conditions are for this)
   425                              <1> 	jmp .datanotfound
   426                              <1> @@:
   427                              <1> %else
   428                              <1> 	jz .datanotfound		; no, handle as an error -->
   429                              <1> %endif
   430                              <1> 
   431                              <1> %if ELDDATA_PMREQUIRED_STATUS
   432                              <1> 	mov si, relocateddata
   433                              <1> linkdatarelocation build_option_PM
   434                              <1> 	test si, si			; is it a PM build ?
   435                              <1> 	jz @F				; no --> (treat PM required as optional)
   436                              <1> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   437                              <1> 	jnz .datanotfound		; yes, handle as an error -->
   438                              <1> @@:
   439                              <1> %endif
   440                              <1> 
   441                              <1> %if _ELD_LINKER_PASSES
   442                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   443                              <1> 	rol byte [bp + ?optionalmissing], 1
   444                              <1> 	jnc .optionaldatamissingmsg
   445                              <1> 	mov si, [bp + ?name]
   446                              <1> 	or byte [si], 80h
   447                              <1> 	not byte [bp + ?optionalmissing]
   448                              <1> 	jmp @F
   449                              <1> .optionaldatamissingmsg:
   450                              <1> %endif
   451                              <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   452                              <1> linkdatarelocation options7, -3
   453                              <1> 	jz @F				; no -->
   454                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   455                              <1> 	mov byte [bp + ?optionalmissing + 1], -1
   456                              <1> %endif
   457                              <1> 	mov si, lmsg.warning_data_optional
   458                              <1> internalcoderelocation
   459                              <1> 	call .notfound			; display a warning
   460                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   461                              <1> 	not byte [bp + ?optionalmissing + 1]
   462                              <1> %endif
   463                              <1> @@:
   464                              <1> %endif
   465                              <1> %if _ELDDATA_NEXT
   466                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   467                              <1> 	jnz .datarelocloop
   468                              <1> %endif
   469                              <1> 	call .address_data_reloc
   470                              <1> 	and word [si], 0		; indicate optional data link failed
   471                              <1> 	jmp .datarelocloop
   472                              <1> %endif
   473                              <1> 
   474                              <1> 
   475                              <1> %if _ELDCALL_OPTIONAL
   476                              <1> .codenotfound_may_be_optional:
   477 000013ED 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   478                              <1> %if _ELDCALL_NEXT
   479                              <1> 	test byte [bp + ?optional], 3	; is it an optional relocation ?
   480                              <1> %else
   481 000013EF 807EFB00            <1> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   482                              <1> %endif
   483                              <1> %if _ELD_DEBUG
   484                              <1> 	jnz @F
   485                              <1>  %ifn _ELD_LINKER_PASSES
   486                              <1> 	mov si, 0			; (invalid link)
   487                              <1> linkdatarelocation internalflags6
   488                              <1> 	test si, si
   489                              <1> 	jz .codenotfound
   490                              <1> 	mov si, 0			; (invalid link)
   491                              <1> linkdatarelocation options7
   492                              <1> 	test si, si
   493                              <1> 	jz .codenotfound
   494                              <1>  %else
   495                              <1> 	cmp byte [bp + ?pass], 0
   496                              <1> 	je .codenotfound
   497                              <1>  %endif
   498                              <1> 	houdini				; (the above conditions are for this)
   499                              <1> 	jmp .codenotfound
   500                              <1> @@:
   501                              <1> %else
   502 000013F3 7451                <1> 	jz .codenotfound		; no, handle as an error -->
   503                              <1> %endif
   504                              <1> 
   505                              <1> %if ELDCALL_PMREQUIRED_STATUS
   506                              <1>  %if _ELD_LINKER_PASSES
   507                              <1>   %assign ELDLINKER 0
   508                              <1>  %endif
   509 000013F5 BE[0000]            <1> 	mov si, relocateddata
   510                              <1> linkdatarelocation build_option_PM
   511                              <1>  %if _ELD_LINKER_PASSES
   512                              <1>   %assign ELDLINKER 1
   513                              <1>  %endif
   514 000013F8 85F6                <1> 	test si, si			; is it a PM build ?
   515 000013FA 7406                <1> 	jz @F				; no --> (treat PM required as optional)
   516 000013FC F646FB02            <1> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   517 00001400 7544                <1> 	jnz .codenotfound		; yes, handle as an error -->
   518                              <1> @@:
   519                              <1> %endif
   520                              <1> 
   521                              <1> %if _ELD_LINKER_PASSES
   522                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   523 00001402 D046E4              <1> 	rol byte [bp + ?optionalmissing], 1
   524 00001405 730B                <1> 	jnc .optionalcodemissingmsg
   525 00001407 8B76E6              <1> 	mov si, [bp + ?name]
   526 0000140A 800C80              <1> 	or byte [si], 80h
   527 0000140D F656E4              <1> 	not byte [bp + ?optionalmissing]
   528 00001410 EB15                <1> 	jmp @F
   529                              <1> .optionalcodemissingmsg:
   530                              <1> %endif
   531 00001412 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   532                              <1> linkdatarelocation options7, -3
   533 00001418 740D                <1> 	jz @F				; no -->
   534                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   535 0000141A C646E5FF            <1> 	mov byte [bp + ?optionalmissing + 1], -1
   536                              <1> %endif
   537 0000141E BE[BB1F]            <1> 	mov si, lmsg.warning_code_optional
   538                              <1> internalcoderelocation
   539 00001421 E83000              <1> 	call .notfound			; display a warning
   540                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   541 00001424 F656E5              <1> 	not byte [bp + ?optionalmissing + 1]
   542                              <1> %endif
   543                              <1> @@:
   544                              <1> %endif
   545                              <1> %if _ELDCALL_NEXT
   546                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   547                              <1> 	jnz .coderelocloop
   548                              <1> %endif
   549 00001427 C576EE              <1> 	lds si, [bp + ?entry]		; -> code site (must be in ELD cs)
   550 0000142A C7049090            <1> 	mov word [si], 9090h
   551 0000142E C6440290            <1> 	mov byte [si + 2], 90h		; indicate optional code link failed
   552                              <1> 					;  (NOP out the 3-byte call near imm)
   553 00001432 E9BA00              <1> 	jmp .coderelocloop
   554                              <1> %endif
   555                              <1> 
   556                              <1> 
   557                              <1> %if _ELD_LINKER_PASSES
   558                              <1> .datanotfound:
   559 00001435 BE[DD1F]            <1> 	mov si, lmsg.error_data
   560                              <1> internalcoderelocation
   561 00001438 E81900              <1> 	call .notfound			; display error
   562 0000143B 7306                <1> 	jnc .error_j3			; NC if in pass 0, error out now -->
   563 0000143D FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   564 00001440 E92CFF              <1> 	jmp .datarelocloop		; go to next relocation entry -->
   565                              <1> 
   566                              <1> .error_j3:
   567 00001443 E9BD01              <1> 	jmp .error
   568                              <1> 
   569                              <1> .codenotfound:
   570 00001446 BE[F61F]            <1> 	mov si, lmsg.error_code
   571                              <1> internalcoderelocation
   572 00001449 E80800              <1> 	call .notfound			; display error
   573 0000144C 73F5                <1> 	jnc .error_j3			; NC if in pass 0 -->
   574 0000144E FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   575 00001451 E99B00              <1> 	jmp .coderelocloop		; go to next -->
   576                              <1> 
   577                              <1> .notfound:
   578 00001454 807EEA00            <1> 	cmp byte [bp + ?pass], 0	; pass 0 ?
   579 00001458 7442                <1> 	je .notfound.retn		; yes, do not try displaying --> (NC)
   580 0000145A 16                  <1> 	 push ss
   581 0000145B 07                  <1> 	 pop es
   582 0000145C BF[0000]            <1> 	mov di, relocateddata
   583                              <1> linkdatarelocation line_out		; es:di -> line_out buffer
   584 0000145F E83B00              <1> 	call .copy			; copy prefix message
   585 00001462 8B76E6              <1> 	mov si, word [bp + ?name]
   586 00001465 AD                  <1> 	lodsw				; = hash
   587 00001466 E8[0000]EB020000    <1> 	extcall hexword			; display the hash in hex
   588 0000146D 56                  <1> 	push si
   589 0000146E BE[0F20]            <1> 	mov si, lmsg.error.2
   590                              <1> internalcoderelocation
   591 00001471 E82900              <1> 	call .copy			; display message fragment
   592 00001474 5E                  <1> 	pop si
   593                              <1> %if _ELD_LINKER_PASSES
   594 00001475 56                  <1> 	push si
   595 00001476 E82400              <1> 	call .copy			; copy over the full name
   596 00001479 5E                  <1> 	pop si
   597                              <1>  %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   598 0000147A 800C80              <1> 	or byte [si], 80h		; mark as failed optional link
   599 0000147D D046E5              <1> 	rol byte [bp + ?optionalmissing + 1], 1
   600                              <1> 					; was it optional ?
   601 00001480 7203                <1> 	jc @F				; yes -->
   602                              <1>  %endif
   603 00001482 C60400              <1> 	mov byte [si], 0		; mark as failed (counter byte = 0)
   604                              <1> @@:
   605                              <1> %else
   606                              <1> 	call .copy
   607                              <1> %endif
   608 00001485 B022                <1> 	mov al, '"'
   609 00001487 AA                  <1> 	stosb				; end message with a closing quote mark
   610 00001488 16                  <1> 	 push ss
   611 00001489 1F                  <1> 	 pop ds
   612 0000148A E8[0000]EB020000    <1> 	extcall putsline_crlf		; display diagnostic line
   613 00001491 B8350E              <1> 	mov ax, 0E35h
   614 00001494 E8[0000]EB020000    <1> 	extcall setrc
   615 0000149B F9                  <1> 	stc				; CY, diagnostic displayed
   616                              <1> .notfound.retn:
   617 0000149C C3                  <1> 	retn
   618                              <1> 
   619                              <1> .copy:		; (cannot use extcallcall here)
   620 0000149D E8[0000]EB020000    <1> 	extcall copy_single_counted_string
   621 000014A4 C3                  <1> 	retn
   622                              <1> %else
   623                              <1> .datanotfound: equ .error
   624                              <1> .codenotfound: equ .error
   625                              <1> %endif
   626                              <1> 
   627                              <1> .build_match:
   628                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   629 000014A5 C646E400            <1> 	mov byte [bp + ?optionalmissing], 0
   630                              <1> 		; This is needed for eldtestj.asm with debugoptlink.
   631                              <1> 		;  The optional data link sets flag 80h, then the
   632                              <1> 		;  required data link to the same symbol sets this
   633                              <1> 		;  flag but doesn't reset it. So the first optional
   634                              <1> 		;  code link still had this set. Reset here to fix.
   635                              <1> %endif
   636                              <1> %if _ELD_CODE_VSTART
   637 000014A9 2D[0000]            <1> 	sub ax, code			; revert adjustment (= displacement)
   638                              <1> %endif
   639 000014AC 0346FC              <1> 	add ax, word [bp + ?instance]	; make displacement into -> name string
   640 000014AF 96                  <1> 	xchg si, ax			; si -> hash word, counted name string
   641                              <1> %if _ELD_LINKER_PASSES || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   642 000014B0 8976E6              <1> 	mov word [bp + ?name], si	; save away for diagnostics
   643                              <1> %endif
   644 000014B3 AD                  <1> 	lodsw			; = hash, si -> counted string
   645 000014B4 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   646                              <1> %if _ELD_LINKER_PASSES
   647 000014B6 84D2                <1> 	test dl, dl		; marked as already failed ?
   648                              <1> 				;  (80h = optional, 0 = required)
   649 000014B8 750A                <1> 	jnz @F			; no -->
   650 000014BA 837EE800            <1> 	cmp word [bp + ?amounterrors], 0
   651                              <1> 				; validate error status
   652 000014BE 7503E9B300          <1> 	je .error_j		; no error known ?! cancel quickly -->
   653 000014C3 C3                  <1> 	retn			; (NC)
   654                              <1> 
   655                              <1> @@:
   656                              <1> %else
   657                              <1> 	test dl, dl
   658                              <1> %endif
   659                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   660 000014C4 7909                <1> 	jns @F
   661 000014C6 80E27F              <1> 	and dl, 7Fh
   662 000014C9 8814                <1> 	mov byte [si], dl
   663 000014CB C646E4FF            <1> 	mov byte [bp + ?optionalmissing], -1
   664                              <1> @@:
   665                              <1> %endif
   666                              <1> %if ELDOTHER
   667                              <1> 	rol byte [bp + ?other], 1
   668                              <1> 	jnc @F
   669                              <1> 	rol byte [bp + ?use_hash_other], 1
   670                              <1> 	jmp @FF
   671                              <1> 
   672                              <1> @@:
   673                              <1> %endif
   674 000014CF D046EC              <1> 	rol byte [bp + ?use_hash], 1
   675                              <1> @@:
   676                              <1> 		; If to use the hash, then ax = hash and si ->
   677                              <1> 		;  the entire symbol name as a counted string.
   678 000014D2 720A                <1> 	jc @F			; if to use hash, return now -->
   679 000014D4 AC                  <1> 	lodsb			; al = length
   680 000014D5 91                  <1> 	xchg cx, ax		; cl = length
   681 000014D6 AD                  <1> 	lodsw			; ax = prefix
   682 000014D7 49                  <1> 	dec cx
   683 000014D8 49                  <1> 	dec cx			; cl = adjusted length
   684 000014D9 4E                  <1> 	dec si			; -> second byte of prefix
   685 000014DA 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   686 000014DC 880C                <1> 	mov byte [si], cl	; si -> counted string suffix
   687                              <1> 		; (this name entry has been edited to provide the
   688                              <1> 		;  name suffix as a counted string, as required by
   689                              <1> 		;  the old-style non-hash link info tables.
   690                              <1> 		; it will be reset later by writing dl to si -> the
   691                              <1> 		;  first byte of the match string.)
   692                              <1> @@:
   693                              <1> %if _ELD_LINKER_PASSES
   694 000014DE F9                  <1> 	stc			; CY
   695                              <1> %endif
   696 000014DF C3                  <1> 	retn
   697                              <1> 
   698                              <1> 
   699                              <1> .donedatareloc:
   700                              <1> %if ELDOTHER
   701                              <1> 	rol byte [bp + ?other], 1
   702                              <1> 	jc .otherdone		; other link only has data links,
   703                              <1> 				;  so at this point we're done -->
   704                              <1> %endif
   705                              <1> 
   706 000014E0 8B56FC              <1> 	mov dx, word [bp + ?instance]
   707                              <1> %if _ELD_LINKER_PASSES
   708 000014E3 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   709 000014E6 01D3                <1> 	add bx, dx
   710                              <1>  %if _ELD_IDENTICALISE
   711                              <1> 	add bx, word [bp + ?lt]
   712                              <1> 	add dx, word [ltLinkCode + bx]
   713                              <1>  %else
   714 000014E8 03977817            <1> 	add dx, word [linktable - code + ltLinkCode + bx]
   715                              <1>  %endif
   716                              <1> %else
   717                              <1> 	add dx, linkercoderelocations - code
   718                              <1> %endif
   719 000014EC 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   720                              <1> 
   721                              <1> .coderelocloop:
   722 000014EF C576F2              <1> 	lds si, [bp + ?nextreloc]
   723 000014F2 AD                  <1> 	lodsw
   724                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
   725 000014F3 48                  <1> 	dec ax				; optional word is 1-based, get 0-based
   726 000014F4 7903E98F00          <1> 	js .donecodereloc
   727 000014F9 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   728 000014FC AD                  <1> 	lodsw
   729                              <1> %endif
   730 000014FD 0346FC              <1> 	add ax, word [bp + ?instance]
   731 00001500 8946EE              <1> 	mov word [bp + ?entry], ax
   732 00001503 AD                  <1> 	lodsw
   733 00001504 8976F2              <1> 	mov word [bp + ?nextreloc], si
   734                              <1> %ifn _ELDCALL_OPTIONAL || _ELDCALL_NEXT
   735                              <1> 	test ax, ax			; if no optional word, check -> match
   736                              <1> 	jz .donecodereloc
   737                              <1> %endif
   738                              <1> %if _ELDCALL_NEXT
   739                              <1> 	rol byte [bp + ?skip_last], 1	; skipping ?
   740                              <1> 	jnc @F				; no -->
   741                              <1> 	test byte [bp + ?optional], 8	; is it a last relocation ?
   742                              <1> 	jz .coderelocloop		; no, leave skip_last set -->
   743                              <1> 	not byte [bp + ?skip_last]	; disable skip_last
   744                              <1> 	jmp .coderelocloop
   745                              <1> @@:
   746                              <1> %endif
   747 00001507 E89BFF              <1> 	call .build_match
   748                              <1> %if _ELD_LINKER_PASSES
   749 0000150A 73E3                <1> 	jnc .coderelocloop
   750                              <1> %endif
   751 0000150C C45EF6              <1> 	les bx, [bp + ?linkinfo]
   752 0000150F 268B4F10            <1> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   753 00001513 268B7F12            <1> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   754                              <1> .coderelocfind:
   755 00001517 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   756 0000151A F2AF                <1> 	repne scasw			; scan initial
   757                              <1> %if _ELDCALL_OPTIONAL
   758 0000151C 7403E9CCFE          <1> 	jne .codenotfound_may_be_optional
   759                              <1> %else
   760                              <1>  %if _ELD_DEBUG
   761                              <1> 	je @F
   762                              <1> 	houdini
   763                              <1> 	jmp .codenotfound
   764                              <1> @@:
   765                              <1>  %else
   766                              <1> 	jne .codenotfound
   767                              <1>  %endif
   768                              <1> %endif
   769 00001521 57                  <1> 	push di
   770 00001522 51                  <1> 	push cx
   771 00001523 56                  <1> 	push si
   772 00001524 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   773 00001528 4F                  <1> 	dec di
   774 00001529 4F                  <1> 	dec di				; 0-based
   775 0000152A 26037F14            <1> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   776 0000152E 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   777 00001531 B500                <1> 	mov ch, 0
   778 00001533 8A0C                <1> 	mov cl, byte [si]		; cx = length
   779 00001535 41                  <1> 	inc cx
   780                              <1> 	; cmp al, al			; ZR if length is zero
   781 00001536 F3A6                <1> 	repe cmpsb			; match ?
   782 00001538 5E                  <1> 	pop si
   783 00001539 59                  <1> 	pop cx
   784 0000153A 5F                  <1> 	pop di
   785 0000153B 75DA                <1> 	jne .coderelocfind
   786 0000153D 8814                <1> 	mov byte [si], dl
   787 0000153F 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   788 00001543 4F                  <1> 	dec di
   789 00001544 4F                  <1> 	dec di				; 0-based
   790 00001545 01FF                <1> 	add di, di			; quadruple index
   791 00001547 26037F16            <1> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   792 0000154B 26FF35              <1> 	push word [es:di]
   793 0000154E C576EE              <1> 	lds si, [bp + ?entry]
   794 00001551 8F4405              <1> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   795                              <1> 					;  patch the destination address
   796 00001554 803CE8              <1> 	cmp byte [si], 0E8h		; is it as expected ?
   797 00001557 751D                <1> 	jne .error_j
   798 00001559 268B7D02            <1> 	mov di, word [es:di + 2]
   799 0000155D BB[0000]            <1> 	mov bx, relocateddata
   800                              <1> linkdatarelocation linkcall_table	; ss:bx -> link call table
   801 00001560 36833F01            <1> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   802 00001564 7510                <1> 	jne .error_j			; no -->
   803 00001566 368B4F02            <1> 	mov cx, word [ss:bx + 2]	; get amount of segments
   804 0000156A E30A                <1> 	jcxz .error_j			; none -->
   805                              <1> @@:
   806 0000156C 83C304              <1> 	add bx, 4			; -> next segment
   807 0000156F 36393F              <1> 	cmp word [ss:bx], di		; value matches ?
   808 00001572 7405                <1> 	je @F				; yes, found -->
   809 00001574 E2F6                <1> 	loop @B				; try remaining segments
   810                              <1> .error_j:
   811 00001576 E98A00              <1> 	jmp .error
   812                              <1> 
   813                              <1> @@:
   814 00001579 368B5F02            <1> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   815                              <1> 		; si + 3 + delta = bx
   816                              <1> 		; delta = bx - si - 3
   817 0000157D 29F3                <1> 	sub bx, si
   818 0000157F 83EB03              <1> 	sub bx, 3
   819 00001582 895C01              <1> 	mov word [si + 1], bx		; patch the call instruction
   820                              <1> %if _ELDCALL_NEXT
   821                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   822                              <1> 	jz .coderelocloop
   823                              <1> 	mov byte [bp + ?skip_last], -1	; skip subsequent next/last relocs
   824                              <1> %endif
   825 00001585 E967FF              <1> 	jmp .coderelocloop
   826                              <1> 
   827                              <1> .donecodereloc:
   828                              <1> %if _ELD_LINKER_PASSES
   829 00001588 8B46E8              <1> 	mov ax, word [bp + ?amounterrors]
   830 0000158B 85C0                <1> 	test ax, ax
   831 0000158D 75E7                <1> 	jnz .error_j
   832 0000158F 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   833 00001592 85DB                <1> 	test bx, bx
   834 00001594 750B                <1> 	jnz @F
   835 00001596 43                  <1> 	inc bx
   836 00001597 43                  <1> 	inc bx
   837 00001598 895EEA              <1> 	mov word [bp + ?pass], bx
   838 0000159B 8B56FC              <1> 	mov dx, word [bp + ?instance]
   839 0000159E E94AFD              <1> 	jmp .pass
   840                              <1> 
   841                              <1> @@:
   842                              <1> %endif
   843                              <1> 
   844                              <1> %ifnidni _LISTING, ""
   845                              <1> %assign ELDLINKER 0
   846                              <1> .hint:
   847 000015A1 16                  <1> 	push ss
   848 000015A2 1F                  <1> 	pop ds
   849 000015A3 B02D                <1> 	mov al, 2Dh
   850 000015A5 E8[0000]EB020000    <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   851                              <1> 					; CHG: ax, dx, bx
   852 000015AC 7437                <1> 	jz .no_hint
   853                              <1> 
   854                              <1> %if ELDOTHER
   855                              <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   856                              <1> internalcoderelocation
   857                              <1> %endif
   858                              <1> 
   859 000015AE 8A26[0000]          <1> 	mov ah, byte [relocateddata]
   860                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   861 000015B2 E85500              <1> 	call plex_check
   862 000015B5 7305                <1> 	jnc @F
   863                              <1> 
   864 000015B7 B4FF                <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   865                              <1> .loop_hint:
   866 000015B9 E84E00              <1> 	call plex_check
   867                              <1> @@:
   868 000015BC 7307                <1> 	jnc .end_hint		; if found --> (NC)
   869 000015BE 80EC01              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   870 000015C1 73F6                <1> 	jnc .loop_hint		; try next if we didn't check all yet -->
   871 000015C3 EB20                <1> 	jmp .no_hint
   872                              <1> 
   873                              <1> .end_hint:
   874 000015C5 50                  <1> 	push ax
   875 000015C6 C446FC              <1> 	les ax, [bp + ?instance]
   876 000015C9 BF[561B]            <1> 	mov di, listmsg.hint.offset
   877                              <1> internalcoderelocation
   878 000015CC E8[0000]EB020000    <1> 	extcall hexword
   879 000015D3 BB[381B]            <1> 	mov bx, listmsg.hint
   880                              <1> internalcoderelocation
   881 000015D6 368B16[0000]        <1> 	mov dx, [ss:relocateddata]
   882                              <1> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   883 000015DB 58                  <1> 	pop ax
   884 000015DC B040                <1> 	mov al, 40h		; AMIS message display service
   885 000015DE E8[0000]EB020000    <1> 	extcall call_int2D
   886                              <1> .no_hint:
   887                              <1> %endif
   888                              <1> 
   889                              <1> %if ELDOTHER
   890                              <1> %assign ELDLINKER 0
   891                              <1> 	not byte [bp + ?other]
   892                              <1> 
   893                              <1> 	push ss
   894                              <1> 	pop ds
   895                              <1> 	mov al, 2Dh
   896                              <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   897                              <1> 					; CHG: ax, dx, bx
   898                              <1> 	jz .no_other
   899                              <1> 
   900                              <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   901                              <1> internalcoderelocation
   902                              <1> 
   903                              <1> 	mov ah, byte [relocateddata]
   904                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   905                              <1> 	call plex_check
   906                              <1> 	jnc @F
   907                              <1> 
   908                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   909                              <1> .loop_other_debug:
   910                              <1> 	call plex_check
   911                              <1> @@:
   912                              <1> 	jnc .end_other		; if found --> (NC)
   913                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   914                              <1> 	jnc .loop_other_debug	; try next if we didn't check all yet -->
   915                              <1> 
   916                              <1> 	mov si, loaderamissig	; ds:si -> our AMIS name strings
   917                              <1> internalcoderelocation
   918                              <1> 
   919                              <1> 	mov ah, byte [relocateddata]
   920                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   921                              <1> 	call plex_check
   922                              <1> 	jnc @F
   923                              <1> 
   924                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   925                              <1> .loop_other_loader:
   926                              <1> 	call plex_check
   927                              <1> @@:
   928                              <1> 	jnc .end_other		; if found --> (NC)
   929                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   930                              <1> 	jnc .loop_other_loader	; try next if we didn't check all yet -->
   931                              <1> 
   932                              <1> 	jmp .no_other
   933                              <1> 
   934                              <1> .end_other:
   935                              <1> 	mov al, 42h		; AMIS get other link info service
   936                              <1> 	extcall call_int2D
   937                              <1> 	cmp al, 0FFh
   938                              <1> 	jne .no_other
   939                              <1> 
   940                              <1> 	mov ax, si		; selector => PSP
   941                              <1> 	extcall ispm
   942                              <1> 	jz @F
   943                              <1> 	mov ax, dx		; segment => PSP
   944                              <1> @@:
   945                              <1> 	 push ss
   946                              <1> 	 pop ds
   947                              <1> 	mov word [otherds], ax
   948                              <1> internaldatarelocation		; current mode sel/seg
   949                              <1> 	mov word [otherseg], dx
   950                              <1> internaldatarelocation		; remember segment
   951                              <1> 
   952                              <1> 	mov ax, cx		; selector => link info
   953                              <1> 	extcall ispm
   954                              <1> 	jz @F
   955                              <1> 	mov ax, bx		; segment => link info
   956                              <1> @@:
   957                              <1> 	mov word [bp + ?linkinfo_other], di
   958                              <1> 	mov word [bp + ?linkinfo_other + 2], ax
   959                              <1> 
   960                              <1> 	mov ds, ax		; => link info
   961                              <1> 	xor ax, ax
   962                              <1> 	cmp word [di + eldlSignature], 0E1D1h
   963                              <1> 	jne .error_other
   964                              <1> 	cmp word [di + eldlUseLinkHash], 1
   965                              <1> 	ja .error_other
   966                              <1> 	jb @F
   967                              <1> 	dec ax
   968                              <1> @@:
   969                              <1> 	mov word [bp + ?use_hash_other], ax
   970                              <1> 
   971                              <1> 	mov dx, word [bp + ?instance]
   972                              <1> 	add dx, linkerotherdatarelocations - code
   973                              <1> 	jmp .otherloop
   974                              <1> 
   975                              <1> .error_other:
   976                              <1> 	push cs
   977                              <1> 	pop ds
   978                              <1> 	mov ax, 0E33h
   979                              <1> 	extcall setrc
   980                              <1> 	mov dx, lmsg.error_other
   981                              <1> internalcoderelocation
   982                              <1> 	jmp @F
   983                              <1> 
   984                              <1> .no_other:
   985                              <1> 	push cs
   986                              <1> 	pop ds
   987                              <1> 	mov ax, 0E34h
   988                              <1> 	extcall setrc
   989                              <1> 	mov dx, lmsg.no_other
   990                              <1> internalcoderelocation
   991                              <1> @@:
   992                              <1> 	extcall putsz
   993                              <1> .error_j2:
   994                              <1> 	jmp .error
   995                              <1> 
   996                              <1> .otherdone:
   997                              <1>  %if _ELD_LINKER_PASSES
   998                              <1> 	mov ax, word [bp + ?amounterrors]
   999                              <1> 	test ax, ax
  1000                              <1> 	jnz .error_j2
  1001                              <1>  %endif
  1002                              <1> %endif
  1003                              <1> 
  1004 000015E5 5B                  <1> 	pop bx				; -> our heap data
  1005 000015E6 5E                  <1> 	pop si				; -> our command line tail
  1006 000015E7 16                  <1> 	 push ss
  1007 000015E8 1F                  <1> 	 pop ds
  1008 000015E9 C47EFC              <1> 	les di, [bp + ?instance]
  1009 000015EC 268B4502            <1> 	mov ax, word [es:di + eldiEndCode]
  1010                              <1> houdini
  1011 000015F0 2D[C012]            <1> 	sub ax, strict word endresident + code
  1012                              <1> internalcoderelocation
  1013 000015F3 26C74502[C012]      <1> 	mov word [es:di + eldiEndCode], endresident + code
  1014                              <1> internalcoderelocation
  1015 000015F9 2906[0000]          <1> 	sub word [relocateddata], ax
  1016                              <1> linkdatarelocation extseg_used
  1017                              <1> %if _DATA_SIZE == 0
  1018                              <1> 	xor ax, ax
  1019                              <1> 	mov word [es:di + eldiStartData], ax
  1020                              <1> 	mov word [es:di + eldiEndData], ax
  1021                              <1> %endif
  1022 000015FD 89EC5D              <1> 	lleave code
  1023                              <1> 		; INP:	es => ELD code segment
  1024                              <1> 		;	ds:si -> command line tail
  1025                              <1> 		;	ds:bx -> ELD data block
  1026                              <1> 		;	ss:sp -> far return address for current mode
  1027                              <1> 		; STT:	ds = ss, UP, EI
  1028 00001600 E9AAFB              <1> 	jmp start
  1029                              <1> 
  1030                              <1> .error:
  1031 00001603 89EC5D              <1> 	lleave
  1032 00001606 B8FFFF              <1> 	mov ax, -1
  1033 00001609 CB                  <1> 	retf
  1034                              <1> 
  1035                              <1> 
  1036                              <1> %ifnidni _LISTING, ""
  1037                              <1>  %assign ELDHINT 1
  1038                              <1> %else
  1039                              <1>  %assign ELDHINT 0
  1040                              <1> %endif
  1041                              <1> 
  1042                              <1> %if ELDOTHER || ELDHINT
  1043                              <1> 		; INP:	ah = multiplex number to check
  1044                              <1> 		;	(if ELDOTHER:)
  1045                              <1> 		;	 cs:si -> 16-byte AMIS signature to check
  1046                              <1> 		; OUT:	CY if multiplex number unused or no signature match,
  1047                              <1> 		;	 bp, ah, ds unmodified
  1048                              <1> 		;	NC if match found,
  1049                              <1> 		;	 ah = multiplex number (unmodified)
  1050                              <1> 		; CHG:	di, es, cx, dx
  1051                              <1> 		;	(if ELDOTHER:) bx
  1052                              <1> 		;	(if not ELDOTHER:) si
  1053                              <1> plex_check:
  1054 0000160A 16                  <1> 	push ss
  1055 0000160B 1F                  <1> 	pop ds
  1056 0000160C F606[0000]08        <1> 	testopt [relocateddata], 8
  1057                              <1> linkdatarelocation internalflags4, -3
  1058 00001611 740B                <1> 	jz @F
  1059                              <1> %if ELDOTHER
  1060                              <1> 	mov bx, relocateddata
  1061                              <1> linkdatarelocation amis_multiplex_number, -2, optional
  1062                              <1> 	test bx, bx
  1063                              <1> 	jz @F
  1064                              <1> 	cmp ah, byte [bx]
  1065                              <1> 	je .notfound		; do not use our own multiplexer -->
  1066                              <1> %else
  1067 00001613 BE[0000]            <1> 	mov si, relocateddata
  1068                              <1> linkdatarelocation amis_multiplex_number, -2, optional
  1069 00001616 85F6                <1> 	test si, si
  1070 00001618 7404                <1> 	jz @F
  1071 0000161A 3A24                <1> 	cmp ah, byte [si]
  1072 0000161C 7420                <1> 	je .notfound		; do not use our own multiplexer -->
  1073                              <1> %endif
  1074                              <1> @@:
  1075 0000161E B000                <1> 	mov al, 00h		; AMIS installation check
  1076 00001620 E8[0000]EB020000    <1> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
  1077 00001627 3CFF                <1> 	cmp al, 0FFh
  1078 00001629 7513                <1> 	jne .notfound
  1079 0000162B 0E                  <1> 	push cs
  1080 0000162C 1F                  <1> 	pop ds
  1081                              <1> %if ELDOTHER
  1082                              <1> 	push si
  1083                              <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
  1084                              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
  1085                              <1> 	repe cmpsw
  1086                              <1> 	pop si
  1087                              <1> %else
  1088 0000162D BE[281B]            <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
  1089                              <1> internalcoderelocation
  1090 00001630 E8[0000]EB020000    <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
  1091 00001637 B90800              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
  1092 0000163A F3A7                <1> 	repe cmpsw
  1093                              <1> %endif
  1094 0000163C 7401                <1> 	je .checkret		; ZR, NC = match -->
  1095                              <1> .notfound:
  1096 0000163E F9                  <1> 	stc			; CY no match
  1097                              <1> .checkret:
  1098 0000163F C3                  <1> 	retn
  1099                              <1> %endif
  1100                              <1> 
  1101                              <1> 
  1102                              <1> 	align 4, db 0
  1103                              <1> linkercoderelocations:
  1104                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
  1105 00001640 01005700[5E1B]0100- <1> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
  1105 00001648 7200[721B]0100AB00- <1>
  1105 00001650 [891B]0100D100-     <1>
  1105 00001656 [721B]0100EE01-     <1>
  1105 0000165C [981B]0100FB01-     <1>
  1105 00001662 [A61B]01017C02-     <1>
  1105 00001668 [C11B]01039202-     <1>
  1105 0000166E [D51B]0103E20C-     <1>
  1105 00001674 [D51B]01001C0D-     <1>
  1105 0000167A [ED1B]0100610D-     <1>
  1105 00001680 [FF1B]01006E0D-     <1>
  1105 00001686 [0A1C]0100830D-     <1>
  1105 0000168C [1C1C]0100F011-     <1>
  1105 00001692 [361C]0100F811-     <1>
  1105 00001698 [4C1C]01000012-     <1>
  1105 0000169E [5C1C]01000812-     <1>
  1105 000016A4 [6A1C]01001012-     <1>
  1105 000016AA [831C]01001812-     <1>
  1105 000016B0 [8B1C]01002012-     <1>
  1105 000016B6 [931C]01002812-     <1>
  1105 000016BC [9A1C]01003012-     <1>
  1105 000016C2 [AF1C]01003812-     <1>
  1105 000016C8 [B71C]01004012-     <1>
  1105 000016CE [FF1B]01004812-     <1>
  1105 000016D4 [BE1C]01005012-     <1>
  1105 000016DA [CD1C]01005812-     <1>
  1105 000016E0 [D91C]01006012-     <1>
  1105 000016E6 [E51C]01006812-     <1>
  1105 000016EC [EE1C]01007012-     <1>
  1105 000016F2 [FA1C]01007812-     <1>
  1105 000016F8 [061D]01008012-     <1>
  1105 000016FE [0D1D]01008812-     <1>
  1105 00001704 [2A1D]01009012-     <1>
  1105 0000170A [3A1D]01009812-     <1>
  1105 00001710 [441D]0100A012-     <1>
  1105 00001716 [4F1D]0100A812-     <1>
  1105 0000171C [5A1D]0100B012-     <1>
  1105 00001722 [611D]0100B812-     <1>
  1105 00001728 [691D]0100A515-     <1>
  1105 0000172E [7F1D]0100CC15-     <1>
  1105 00001734 [751D]0100DE15-     <1>
  1105 0000173A [881D]01002016-     <1>
  1105 00001740 [881D]01003016-     <1>
  1105 00001746 [951D]0000          <1>
  1106                              <1> %else
  1107                              <1> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
  1108                              <1> %endif
  1109                              <1> 
  1110                              <1> %if _ELD_LINKER_PASSES
  1111                              <1> linkerlinkercoderelocations:
  1112                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
  1113 0000174A 01006614[751D]0100- <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
  1113 00001752 8A14[2A1D]01009414- <1>
  1113 0000175A [831C]01009D14-     <1>
  1113 00001760 [0D1D]0000          <1>
  1114                              <1> %else
  1115                              <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
  1116                              <1> %endif
  1117                              <1> 
  1118                              <1> 	align 2, db 0
  1119                              <1> linktable:
  1120                              <1> 	istruc LINKTABLE
  1121                              <1> at ltCodeToCode
  1122 00001764 181B                <1> 	dw internallinkercodetocoderelocations - code
  1123 00001766 6A19                <1> 	dw internalcodetocoderelocations - code
  1124                              <1> at ltCodeToData
  1125 00001768 221B                <1> 	dw internallinkercodetodatarelocations - code
  1126 0000176A B219                <1> 	dw internalcodetodatarelocations - code
  1127                              <1> at ltDataToCode
  1128 0000176C 241B                <1> 	dw internallinkerdatatocoderelocations - code
  1129 0000176E 001B                <1> 	dw internaldatatocoderelocations - code
  1130                              <1> at ltDataToData
  1131 00001770 261B                <1> 	dw internallinkerdatatodatarelocations - code
  1132 00001772 021B                <1> 	dw internaldatatodatarelocations - code
  1133                              <1> at ltLinkData
  1134 00001774 041B                <1> 	dw linkerlinkerdatarelocations - code
  1135 00001776 7C17                <1> 	dw linkerdatarelocations - code
  1136                              <1> at ltLinkCode
  1137 00001778 4A17                <1> 	dw linkerlinkercoderelocations - code
  1138 0000177A 4016                <1> 	dw linkercoderelocations - code
  1139                              <1> 	iend
  1140                              <1> %endif
  1141                              <1> 
  1142                              <1> 	align 2, db 0
  1143                              <1> linkerdatarelocations:
  1144 0000177C 01002400[A01D]0100- <1> 	dw LINK_DATA_RELOCATIONS, 0
  1144 00001784 6000[B01D]01006500- <1>
  1144 0000178C [C61D]01008400-     <1>
  1144 00001792 [B01D]01008900-     <1>
  1144 00001798 [DA1D]0100A300-     <1>
  1144 0000179E [ED1D]0100A700-     <1>
  1144 000017A4 [001E]0100A900-     <1>
  1144 000017AA [1C1E]0100B900-     <1>
  1144 000017B0 [B01D]0100C500-     <1>
  1144 000017B6 [B01D]0100CA00-     <1>
  1144 000017BC [DA1D]0100E500-     <1>
  1144 000017C2 [B01D]0100EA00-     <1>
  1144 000017C8 [DA1D]01000B01-     <1>
  1144 000017CE [251E]01000D01-     <1>
  1144 000017D4 [3D1E]01001501-     <1>
  1144 000017DA [4E1E]01001B01-     <1>
  1144 000017E0 [251E]01001D01-     <1>
  1144 000017E6 [6A1E]01002101-     <1>
  1144 000017EC [841E]01005F01-     <1>
  1144 000017F2 [841E]01008701-     <1>
  1144 000017F8 [ED1D]0100CD01-     <1>
  1144 000017FE [971E]0100D401-     <1>
  1144 00001804 [A81E]0100DB01-     <1>
  1144 0000180A [971E]0100EC01-     <1>
  1144 00001810 [BB1E]01000A02-     <1>
  1144 00001816 [971E]01003202-     <1>
  1144 0000181C [971E]01003702-     <1>
  1144 00001822 [A01D]01004D02-     <1>
  1144 00001828 [D51E]01005202-     <1>
  1144 0000182E [D51E]01005502-     <1>
  1144 00001834 [D51E]01005902-     <1>
  1144 0000183A [D51E]01005E02-     <1>
  1144 00001840 [C61D]01006602-     <1>
  1144 00001846 [A81E]0100AA02-     <1>
  1144 0000184C [E11E]0100B102-     <1>
  1144 00001852 [E11E]01004803-     <1>
  1144 00001858 [F61E]01008B05-     <1>
  1144 0000185E [031F]0100B605-     <1>
  1144 00001864 [031F]01001E06-     <1>
  1144 0000186A [031F]0100C106-     <1>
  1144 00001870 [031F]0100CA06-     <1>
  1144 00001876 [031F]0100D206-     <1>
  1144 0000187C [031F]0100E406-     <1>
  1144 00001882 [031F]01000507-     <1>
  1144 00001888 [031F]01001507-     <1>
  1144 0000188E [031F]0100F507-     <1>
  1144 00001894 [031F]0100BC09-     <1>
  1144 0000189A [031F]01006B0A-     <1>
  1144 000018A0 [031F]01007B0A-     <1>
  1144 000018A6 [031F]0100950A-     <1>
  1144 000018AC [031F]0100BC0A-     <1>
  1144 000018B2 [031F]0100D80A-     <1>
  1144 000018B8 [A01D]0100DE0A-     <1>
  1144 000018BE [D51E]0100E20A-     <1>
  1144 000018C4 [D51E]0100180B-     <1>
  1144 000018CA [031F]01008F0B-     <1>
  1144 000018D0 [031F]0100940B-     <1>
  1144 000018D6 [031F]0100AC0B-     <1>
  1144 000018DC [031F]0100B00B-     <1>
  1144 000018E2 [031F]0100100C-     <1>
  1144 000018E8 [031F]01007C0C-     <1>
  1144 000018EE [031F]0100A50C-     <1>
  1144 000018F4 [031F]0100BB0C-     <1>
  1144 000018FA [031F]01005C0D-     <1>
  1144 00001900 [A01D]01007D0D-     <1>
  1144 00001906 [D51E]0100810D-     <1>
  1144 0000190C [D51E]01008B0D-     <1>
  1144 00001912 [D51E]01008F0D-     <1>
  1144 00001918 [D51E]01009E0D-     <1>
  1144 0000191E [D51E]0100A20D-     <1>
  1144 00001924 [D51E]0100A111-     <1>
  1144 0000192A [0E1F]0100AA11-     <1>
  1144 00001930 [191F]0100CD11-     <1>
  1144 00001936 [221F]0100DD11-     <1>
  1144 0000193C [2D1F]0100EA11-     <1>
  1144 00001942 [3B1F]0100F613-     <1>
  1144 00001948 [4A1F]0100B015-     <1>
  1144 0000194E [6D1F]0100D915-     <1>
  1144 00001954 [191F]0100FB15-     <1>
  1144 0000195A [2D1F]01000E16-     <1>
  1144 00001960 [921F]01011416-     <1>
  1144 00001966 [A31F]0000          <1>
  1145                              <1> 
  1146                              <1> 	align 2, db 0
  1147                              <1> internalcodetocoderelocations:
  1148 0000196A 17017102B302BB02B9- <1> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
  1148 00001973 09010A080A170A1C0A- <1>
  1148 0000197C 2B0A350A3F0A490A58- <1>
  1148 00001985 0A150B520B610B680B- <1>
  1148 0000198E 770BBE0BD80BE00BEF- <1>
  1148 00001997 0BF60B050C130DD411- <1>
  1148 000019A0 D911E111E611CA15D4- <1>
  1148 000019A9 15F115F7152E160000  <1>
  1149                              <1> 
  1150                              <1> 	align 2, db 0
  1151                              <1> internalcodetodatarelocations:
  1152 000019B2 3400550002018F01F7- <1> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
  1152 000019BB 0104020F0220024102- <1>
  1152 000019C4 A302A702AD02C102CB- <1>
  1152 000019CD 02D902DD02F402F802- <1>
  1152 000019D6 FF021B0324032B0331- <1>
  1152 000019DF 03520356035C037A03- <1>
  1152 000019E8 8E0397039D03A603AC- <1>
  1152 000019F1 03B503BB03C403D203- <1>
  1152 000019FA DF03E503FB030D0454- <1>
  1152 00001A03 0458047304A705AE05- <1>
  1152 00001A0C B905FF052B063C0648- <1>
  1152 00001A15 0659066506A607AC07- <1>
  1152 00001A1E ED07F80704080F0816- <1>
  1152 00001A27 081D0824082E083508- <1>
  1152 00001A30 3808480887088F08F6- <1>
  1152 00001A39 08FA08010908092309- <1>
  1152 00001A42 270944094A09590964- <1>
  1152 00001A4B 0969099709A209E509- <1>
  1152 00001A54 B70ABF0ACA0AF20AFE- <1>
  1152 00001A5D 0A490BB30B4E0C9C0C- <1>
  1152 00001A66 D30CDE0CEF0CF70CFB- <1>
  1152 00001A6F 0C010D0B0D360D3A0D- <1>
  1152 00001A78 3E0D420DFC0F001004- <1>
  1152 00001A81 1008100C1012101810- <1>
  1152 00001A8A 1C10211025102A102E- <1>
  1152 00001A93 103110351040104A10- <1>
  1152 00001A9C 4E105B105D10611063- <1>
  1152 00001AA5 106A106D1079107C10- <1>
  1152 00001AAE 8010841088108B108E- <1>
  1152 00001AB7 1095109D10A110A510- <1>
  1152 00001AC0 A910AD10B210CA10CF- <1>
  1152 00001AC9 10DE10E210E610ED10- <1>
  1152 00001AD2 FF1010112111281130- <1>
  1152 00001ADB 113B113E114C115011- <1>
  1152 00001AE4 59115D11651169116E- <1>
  1152 00001AED 1176117B117F118511- <1>
  1152 00001AF6 89118F119311C31100- <1>
  1152 00001AFF 00                  <1>
  1153                              <1> 
  1154                              <1> 	align 2, db 0
  1155                              <1> internaldatatocoderelocations:
  1156 00001B00 FFFF                <1> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
  1157                              <1> 
  1158                              <1> 	align 2, db 0
  1159                              <1> internaldatatodatarelocations:
  1160 00001B02 FFFF                <1> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
  1161                              <1> 
  1162                              <1> %if _ELD_LINKER_PASSES
  1163                              <1> 	align 2, db 0
  1164                              <1> linkerlinkerdatarelocations:
  1165 00001B04 01001514[221F]0100- <1> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
  1165 00001B0C 5D14[031F]01005E15- <1>
  1165 00001B14 [5C1F]0000          <1>
  1166                              <1> 
  1167                              <1> 	align 2, db 0
  1168                              <1> internallinkercodetocoderelocations:
  1169 00001B18 1F14361447146F1400- <1> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
  1169 00001B21 00                  <1>
  1170                              <1> 
  1171                              <1> 	align 2, db 0
  1172                              <1> internallinkercodetodatarelocations:
  1173 00001B22 0000                <1> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
  1174                              <1> 
  1175                              <1> 	align 2, db 0
  1176                              <1> internallinkerdatatocoderelocations:
  1177 00001B24 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
  1178                              <1> 
  1179                              <1> 	align 2, db 0
  1180                              <1> internallinkerdatatodatarelocations:
  1181 00001B26 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
  1182                              <1> %endif
  1183                              <1> 
  1184                              <1> %if ELDOTHER
  1185                              <1> 	align 2, db 0
  1186                              <1> linkerotherdatarelocations:
  1187                              <1> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
  1188                              <1> 
  1189                              <1>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
  1190                              <1>   %error Other linker data links not supported
  1191                              <1>  %endif
  1192                              <1> %endif
  1193                              <1> 
  1194                              <1> %if ELDOTHER || ELDHINT
  1195                              <1> 	align 2, db 0
  1196                              <1> debuggeramissig:
  1197 00001B28 65636D20<rep 5h>    <1> 		fill 8, 32, db "ecm"
  1198 00001B30 6C446562756720-     <1> 		fill 8, 32, db "lDebug"
  1198 00001B30 <rep 2h>            <1>
  1199                              <1> %endif
  1200                              <1> 
  1201                              <1> %if ELDOTHER
  1202                              <1> 	align 2, db 0
  1203                              <1> loaderamissig:
  1204                              <1> 		fill 8, 32, db "ecm"
  1205                              <1> 		fill 8, 32, db "Loader"
  1206                              <1> %endif
  1207                              <1> 
  1208                              <1> %ifnidni _LISTING, ""
  1209                              <1> listmsg:
  1210 00001B38 547261634C6973742D- <1> .hint:		db "TracList-add-offset=",_LISTING,"::"
  1210 00001B41 6164642D6F66667365- <1>
  1210 00001B4A 743D6C6973742E6C73- <1>
  1210 00001B53 743A3A              <1>
  1211 00001B56 2D2D2D2D680D0A00    <1> .hint.offset:	asciz "----h",13,10
  1212                              <1> %endif
  1213                              <1> 
  1214 00001B5E 25D71179795F626F6F- <1> 	eldcall_dump_names ELDCALL_CODE_NAMES
  1214 00001B67 745F696E69745F6469- <1>
  1214 00001B70 72321527142E2E4079- <1>
  1214 00001B79 795F66696C656E616D- <1>
  1214 00001B82 655F656D707479D1C6- <1>
  1214 00001B8B 0C7363616E5F646972- <1>
  1214 00001B94 5F6175788ECB0B7265- <1>
  1214 00001B9D 61645F736563746F72- <1>
  1214 00001BA6 4C04186E6561725F74- <1>
  1214 00001BAF 72616E736665725F65- <1>
  1214 00001BB8 78745F72657475726E- <1>
  1214 00001BC1 0C211179795F646F73- <1>
  1214 00001BCA 5F70617273655F6E61- <1>
  1214 00001BD3 6D652C9A15696E7463- <1>
  1214 00001BDC 616C6C5F6578745F72- <1>
  1214 00001BE5 657475726E5F657322- <1>
  1214 00001BEE 580F636D64335F6E6F- <1>
  1214 00001BF7 745F696E6A65637468- <1>
  1214 00001C00 31085F646F7363616C- <1>
  1214 00001C09 6CFF8B0F79795F626F- <1>
  1214 00001C12 6F745F726561642E62- <1>
  1214 00001C1B 7863E41779795F626F- <1>
  1214 00001C24 6F745F7365656B5F63- <1>
  1214 00001C2D 757272656E742E6278- <1>
  1214 00001C36 4C4E1379795F626F6F- <1>
  1214 00001C3F 745F70617273655F6E- <1>
  1214 00001C48 616D653220660D626F- <1>
  1214 00001C51 6F745F70617273655F- <1>
  1214 00001C5A 666EFEFD0B676F745F- <1>
  1214 00001C63 7979656E747279B0CC- <1>
  1214 00001C6C 1672657472795F6F70- <1>
  1214 00001C75 656E5F736372697074- <1>
  1214 00001C7E 7370617468B2120573- <1>
  1214 00001C87 657472635512057075- <1>
  1214 00001C90 74737ABABD04636D64- <1>
  1214 00001C99 33109A1279795F626F- <1>
  1214 00001CA2 6F745F6F70656E5F66- <1>
  1214 00001CAB 696C6532629605496E- <1>
  1214 00001CB4 444F53289004697370- <1>
  1214 00001CBD 6D738E0C79795F6F70- <1>
  1214 00001CC6 656E5F66696C65794C- <1>
  1214 00001CCF 09636C6F73655F6578- <1>
  1214 00001CD8 74A45509736B697063- <1>
  1214 00001CE1 6F6D6D30E83A066973- <1>
  1214 00001CEA 656F6C3F03C3096973- <1>
  1214 00001CF3 737472696E673FF123- <1>
  1214 00001CFC 097570706572636173- <1>
  1214 00001D05 65B5C60470757463D0- <1>
  1214 00001D0E BB1A636F70795F7369- <1>
  1214 00001D17 6E676C655F636F756E- <1>
  1214 00001D20 7465645F737472696E- <1>
  1214 00001D29 676FA20D707574736C- <1>
  1214 00001D32 696E655F63726C66EB- <1>
  1214 00001D3B A607646563776F7264- <1>
  1214 00001D44 398C08707574736C69- <1>
  1214 00001D4D 6E65AD110864656364- <1>
  1214 00001D56 776F7264C5C6047075- <1>
  1214 00001D5F 7473A7AA056572726F- <1>
  1214 00001D68 72D55509736B697063- <1>
  1214 00001D71 6F6D6D618481076865- <1>
  1214 00001D7A 78776F726498690669- <1>
  1214 00001D83 6E7463686B21300A63- <1>
  1214 00001D8C 616C6C5F696E743244- <1>
  1214 00001D95 B77408736574657332- <1>
  1214 00001D9E 6478                <1>
  1215 00001DA0 899F0D696E7465726E- <1> 	link_data_dump_names LINK_DATA_NAMES
  1215 00001DA9 616C666C61677392AA- <1>
  1215 00001DB2 136C6F61645F636865- <1>
  1215 00001DBB 636B5F6469725F6174- <1>
  1215 00001DC4 74720EB5116C6F6164- <1>
  1215 00001DCD 5F79796E616D655F69- <1>
  1215 00001DD6 6E7075742F75106C6F- <1>
  1215 00001DDF 61645F79796E616D65- <1>
  1215 00001DE8 5F6E6578746C52106C- <1>
  1215 00001DF1 6F61645F79795F6469- <1>
  1215 00001DFA 72656E74727938D219- <1>
  1215 00001E03 68616E646C655F7363- <1>
  1215 00001E0C 616E5F6469725F6E6F- <1>
  1215 00001E15 745F666F756E646B5D- <1>
  1215 00001E1E 06646D79636D6494C0- <1>
  1215 00001E27 1568616E646C655F73- <1>
  1215 00001E30 63616E5F6469725F65- <1>
  1215 00001E39 6E7472793F850E7363- <1>
  1215 00001E42 616E5F6469725F656E- <1>
  1215 00001E4B 74727958B8196E6561- <1>
  1215 00001E54 725F7472616E736665- <1>
  1215 00001E5D 725F6578745F616464- <1>
  1215 00001E66 72657373D6ED176E65- <1>
  1215 00001E6F 61725F7472616E7366- <1>
  1215 00001E78 65725F6578745F656E- <1>
  1215 00001E81 74727975DD106C6F61- <1>
  1215 00001E8A 645F6B65726E656C5F- <1>
  1215 00001E93 6E616D65CA510E696E- <1>
  1215 00001E9C 7465726E616C666C61- <1>
  1215 00001EA5 6773330F08106C6F61- <1>
  1215 00001EAE 645F646174615F6C6F- <1>
  1215 00001EB7 77657374227F176C6F- <1>
  1215 00001EC0 61645F6164725F6469- <1>
  1215 00001EC9 726275665F7365676D- <1>
  1215 00001ED2 656E748274096C6F61- <1>
  1215 00001EDB 645F646174613B2612- <1>
  1215 00001EE4 6578745F696E6A6563- <1>
  1215 00001EED 745F68616E646C6572- <1>
  1215 00001EF6 C71C0A6578745F6861- <1>
  1215 00001EFF 6E646C6584E3086C69- <1>
  1215 00001F08 6E655F6F7574EB4208- <1>
  1215 00001F11 657874647373656CD5- <1>
  1215 00001F1A 2D066578747365675A- <1>
  1215 00001F23 BC086F7074696F6E73- <1>
  1215 00001F2C 37E7D30B6578747365- <1>
  1215 00001F35 675F75736564B2400C- <1>
  1215 00001F3E 657874646174615F75- <1>
  1215 00001F47 73656455030F627569- <1>
  1215 00001F50 6C645F6F7074696F6E- <1>
  1215 00001F59 5F504D68440E6C696E- <1>
  1215 00001F62 6B63616C6C5F746162- <1>
  1215 00001F6B 6C65F09E227472795F- <1>
  1215 00001F74 64656275676765725F- <1>
  1215 00001F7D 616D69735F6D756C74- <1>
  1215 00001F86 69706C65785F6E756D- <1>
  1215 00001F8F 626572CB510E696E74- <1>
  1215 00001F98 65726E616C666C6167- <1>
  1215 00001FA1 7334688C15616D6973- <1>
  1215 00001FAA 5F6D756C7469706C65- <1>
  1215 00001FB3 785F6E756D626572    <1>
  1216                              <1> %if ELDOTHER
  1217                              <1> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1218                              <1> %endif
  1219                              <1> 
  1220                              <1> lmsg:
  1221                              <1> %if _ELD_LINKER_PASSES
  1222                              <1> %if _ELDCALL_OPTIONAL
  1223 00001FBB 214F7074696F6E616C- <1> .warning_code_optional:		counted "Optional code link missing, hash="
  1223 00001FC4 20636F6465206C696E- <1>
  1223 00001FCD 6B206D697373696E67- <1>
  1223 00001FD6 2C20686173683D      <1>
  1224                              <1> %endif
  1225                              <1> %if _ELDDATA_OPTIONAL
  1226                              <1> .warning_data_optional:		counted "Optional data link missing, hash="
  1227                              <1> %endif
  1228 00001FDD 1844617461206C696E- <1> .error_data:			counted "Data link missing, hash="
  1228 00001FE6 6B206D697373696E67- <1>
  1228 00001FEF 2C20686173683D      <1>
  1229 00001FF6 18436F6465206C696E- <1> .error_code:			counted "Code link missing, hash="
  1229 00001FFF 6B206D697373696E67- <1>
  1229 00002008 2C20686173683D      <1>
  1230 0000200F 0A682C206C6162656C- <1> .error.2:			counted "h, label ",'"'
  1230 00002018 2022                <1>
  1231                              <1> %endif
  1232                              <1> %if ELDOTHER
  1233                              <1> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1234                              <1> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1235                              <1> %endif
  1236                              <1> 
  1237 0000201A 00<rep 6h>          <1> 	align 16, db 0
  2439                                  
  2440                                  	align 16
  2441                                  code_size equ $ - code
