     1                                  
     2                                  ; Public Domain
     3                                  
     4                                  ; test install command: install; ldmem; ldmem uninstall
     5                                  ; test run command: ; .; .
     6                                  
     7                                  %include "lmacros3.mac"
     1                              <1> [list -]
    14                              <2> [list -]
    14                              <1> [list -]
     8                                  
     9                                  	numdef OTHER, 0
    10                                  %if _OTHER
    11                                   %define ELDOTHER 1
    12                                   %define OTH_STRING "OTH"
    13                                   %imacro getotherds 0
    14                                  reloc	mov ds, word [ss:otherds]
    15                                  internaldatarelocation
    16                                   %endmacro
    17                                   %imacro resetds 0
    18                                  	push ss
    19                                  	pop ds
    20                                   %endmacro
    21                                   %imacro getotheres 0
    22                                  reloc	mov es, word [ss:otherds]
    23                                  internaldatarelocation
    24                                   %endmacro
    25                                   %imacro resetes 0
    26                                  	push ss
    27                                  	pop es
    28                                   %endmacro
    29                                  %else
    30                                   %define OTH_STRING ""
    31                                   %idefine getotherds
    32                                   %idefine resetds
    33                                   %idefine getotheres
    34                                   %idefine resetes
    35                                  %endif
    36                                  
    37                                  %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
    38                                  %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
    39                                  %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
    40                                  %include "isvariab.mac"
     1                              <1> 
     2                              <1> %if 0
     3                              <1> 
     4                              <1> lDebug isvariable? function strutures and macros
     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> 	struc ISVARIABLESTRUC
    18 00000000 ????                <1> ivName:		resw 1		; -> name (up to 13 bytes, but actually only 11)
    19                              <1> 				;  (search for ivfNameLengthLimit for limit)
    20                              <1> 				;  (length given by ivFlags & ivfNameLengthMask)
    21                              <1> 	; The ivName pointer is only used for more-byte names. It actually
    22                              <1> 	;  contains the trailer of the name, excluding the prefix formed by
    23                              <1> 	;  the first two bytes. This suffix can be the empty string if the
    24                              <1> 	;  variable in question has a two-byte name.
    25                              <1> 	; (For one-byte names this field is unused and contains zero.)
    26 00000002 ????                <1> ivFlags:	resw 1
    27 00000004 ????                <1> ivAddress:	resw 1		; default -> variable
    28                              <1> 	; The ivAddress field is used by default_variable_setup as the base
    29                              <1> 	;  address for the variable(s). It is also used by var_ext_setup as
    30                              <1> 	;  the ELD code section offset to transfer control to. Otherwise, it
    31                              <1> 	;  is usually set to zero and unused.
    32 00000006 ????                <1> ivSetup:	resw 1		; -> set up code (in expr code section)
    33                              <1> 	; INP:	ax = array index (0-based)
    34                              <1> 	;	di = 0
    35                              <1> 	;	cl = default size of variable (1..4)
    36                              <1> 	;	ch = length of variable name
    37                              <1> 	;	bx -> ISVARIABLESTRUC structure
    38                              <1> 	; CHG:	ax, bx, cx, dx, si, di
    39                              <1> 	; OUT:	NC if valid,
    40                              <1> 	;	 bx -> var, di = 0 or di -> mask
    41                              <1> 	;	 cl = size of variable (1..4)
    42                              <1> 	;	 ch = length of variable name
    43 00000008 ??                  <1> ivArrayLast:	resb 1		; 0 if no array, FFh = 256 entries
    44                              <1> 	; The ivArrayLast field is used by the dispatcher to determine
    45                              <1> 	;  whether to support array index expressions. It is checked
    46                              <1> 	;  before decrementing the index if ivfArrayOneBased is set.
    47 00000009 ??                  <1> ivArrayBetween: resb 1		; how many bytes to skip for each index
    48                              <1> 	; The ivArrayBetween field is only used by default_variable_setup.
    49                              <1> 	endstruc
    50                              <1> 
    51                              <1> ivfNameLengthMask:	equ 15	; gives name trailer length, 0 to 11
    52                              <1> ivfNameLengthLimit:	equ 13
    53                              <1> ivfVarLengthShift:	equ 4
    54                              <1> ivfVarLengthMask:	equ 3 << ivfVarLengthShift
    55                              <1> 				; gives default variable size minus 1
    56                              <1> ivfReadOnly:		equ 80h	; variable cannot be written at all
    57                              <1> ivfArrayOneBased:	equ 100h; first array entry is 1 not 0 (ivArrayLast > 0)
    58                              <1> ivfArrayOptional:	equ 200h; array index expression is optional
    59                              <1> ivfSeparatorSpecial:	equ 400h; used for RIxxP/L/S/O
    60                              <1> 
    61                              <1> %define ISVARIABLESTRINGS db "",db ""
    62                              <1> %define IVS_ONEBYTE_NAMES ""
    63                              <1> %define IVS_MOREBYTE_NAMEHEADERS ""
    64                              <1> %assign IVS_HAVE_ONEBYTE 0
    65                              <1> %assign IVS_SINGLE_ONEBYTE 1
    66                              <1> 
    67                              <1> 		; %1 = name string
    68                              <1> 		; %2 = default variable length, 1 to 4
    69                              <1> 		; %3 = flags to set (except name length and var length)
    70                              <1> 		; %4 = ivAddress value
    71                              <1> 		; %5 = ivArrayLast, defaults to 0 (no array)
    72                              <1> 		; %6 = ivArrayBetween, defaults to 0 (immediately consecutive)
    73                              <1> 		; %7 = ivSetup, defaults to default_variable_setup
    74                              <1> 	%macro isvariablestruc 4-7.nolist 0, 0, default_variable_setup
    75                              <1> %push
    76                              <1> %strlen %$namelength %1
    77                              <1> %if %$namelength > ivfNameLengthLimit
    78                              <1>  %error Expected at most 13-byte name (or adjust isvariable? code)
    79                              <1> %endif
    80                              <1> %if IVS_ONEBYTE && %$namelength != 1
    81                              <1>  %error Expected a one-byte name
    82                              <1> %elif ! IVS_ONEBYTE && %$namelength < 2
    83                              <1>  %error Expected at least a two-byte name
    84                              <1> %endif
    85                              <1> %if IVS_ONEBYTE
    86                              <1>  %define IVS_SINGLE_ONEBYTE_NAME %1
    87                              <1>  %if IVS_HAVE_ONEBYTE
    88                              <1>   %assign IVS_SINGLE_ONEBYTE 0
    89                              <1>  %endif
    90                              <1>  %assign IVS_HAVE_ONEBYTE 1
    91                              <1>  %assign %$namelength 0
    92                              <1>  %xdefine IVS_ONEBYTE_NAMES IVS_ONEBYTE_NAMES, %1
    93                              <1>  %%name equ 0
    94                              <1> %else
    95                              <1>  %assign %$namelength %$namelength - 2
    96                              <1>  %substr %$nametrailer %1 3,-1
    97                              <1>  %substr %$nameheader %1 1,2
    98                              <1>  %xdefine IVS_MOREBYTE_NAMEHEADERS IVS_MOREBYTE_NAMEHEADERS, %$nameheader
    99                              <1>  %xdefine ISVARIABLESTRINGS ISVARIABLESTRINGS, %%name:, {db %$nametrailer}
   100                              <1> %endif
   101                              <1> 
   102                              <1> %assign %$varlength %2 - 1	; 0 means one byte, 1 means two bytes,
   103                              <1> 				;  2 means three bytes, 3 means four bytes
   104                              <1> 	istruc ISVARIABLESTRUC
   105                              <1> at ivName,		dw %%name
   106                              <1>  IV_NAME_RELOCATION
   107                              <1> at ivFlags,		dw %$$namelength | (%$$varlength << ivfVarLengthShift) | %3
   108                              <1> at ivAddress,		dw %4
   109                              <1>  IV_ADDRESS_RELOCATION
   110                              <1> at ivSetup,		dw %7
   111                              <1>  IV_SETUP_RELOCATION
   112                              <1> at ivArrayLast,		db %5
   113                              <1> at ivArrayBetween,	db %6
   114                              <1> 	iend
   115                              <1> %pop
   116                              <1> %ifndef SECTION_OF_%7
   117                              <1>  %error Unknown target section for symbol %7
   118                              <1> %elifnidni %[SECTION_OF_%7], _EXPR_SECTION
   119                              <1>  %error Wrong section for symbol %7: section_of=SECTION_OF_%7, expr=_EXPR_SECTION
   120                              <1> %endif
   121                              <1> 	%endmacro
   122                              <1> 
   123                              <1> %define IV_NAME_RELOCATION
   124                              <1> %define IV_ADDRESS_RELOCATION
   125                              <1> %define IV_SETUP_RELOCATION
   126                              <1> 
   127                              <1> 	%macro isvariablestrings 2-*.nolist
   128                              <1> %rep %0
   129                              <1>  %1
   130                              <1>  %rotate 1
   131                              <1> %endrep
   132                              <1> 	%endmacro
    41                                  
    42                                  	struc HANDLERTABLE
    43 00000000 ????                    htMessage:		resw 1
    44 00000002 ????                    htHandler:		resw 1
    45 00000004 ????                    htTemplate:		resw 1
    46 00000006 ????                    htReturn:		resw 1
    47 00000008 ????                    htFlags:		resw 1
    48                                  	endstruc
    49                                  
    50                                  htfIsAMIS equ 1
    51                                  htfIsInject equ 2
    52                                  
    53                                  
    54                                  	cpu 8086
    55                                  
    56                                  	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
    57                                  relocateddata:
    58                                  
    59                                  	addsection HEADER, start=0
    60                                  
    61                                  	istruc ELD_HEADERX
    62                                  at eldhxHeader
    63                                  		; ELD executable header
    64                                  	istruc ELD_HEADER
    65 00000000 454C4431                at eldhSignature,	db "ELD1"
    66 00000004 000000                  			db 0,0,0
    67 00000007 1A                      			db 26
    68 00000008 50000000                at eldhCodeOffset,	dd CODEOFFSET
    69 0000000C 601D                    at eldhCodeImageLength,	dw code_size
    70 0000000E 0000                    at eldhCodeAllocLength,	dw 0
    71 00000010 B01D0000                at eldhDataOffset,	dd DATAOFFSET
    72 00000014 D00C                    at eldhDataImageLength,	dw data_size
    73 00000016 0000                    at eldhDataAllocLength,	dw total_data_size - data_size
    74 00000018 530B                    at eldhCodeEntrypoint,	dw linker - code
    75                                  at eldhReserved
    76 0000001A 00<rep 4h>2800          at eldhExtensionSize,	dw header_extension_end - $$
    77                                  	iend
    78 00000020 [30000000]              at eldhxDescriptionOffset,	dd description
    79 00000024 09270000                at eldhxHelpOffset,		dd DATAOFFSET + msg.help - datastart
    80                                  PUT_ELDHX_DATETIME_OFFSET
    81                                  header_extension_end:
    82 00000028 00<rep 8h>              	iend
    83                                  
    84 00000030 44756D70206C446562-     description:		asciz "Dump lDebug memory use."
    84 00000039 7567206D656D6F7279-
    84 00000042 207573652E00       
    85                                  
    86                                  
    87 00000048 00<rep 8h>              	align 16, db 0
    88                                  
    89                                  	eldstrict on
    90                                  
    91                                  CODEOFFSET equ $ - $$
    92                                  	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
    93                                  %define CODEFIXUP - code + 0
    94                                  code:
    95                                  		; ELD instance header
    96                                  	istruc ELD_INSTANCE
    97                                  at eldiStartCode
    98 00000000 00<rep 2h>              at eldiEndCode
    99 00000002 00<rep 2h>              at eldiStartData
   100 00000004 00<rep 2h>              at eldiEndData
   101 00000006 00<rep 2h>4C444D45-     at eldiIdentifier,	fill 8, 32, db "LDMEM",OTH_STRING
   101 0000000C 4D20<rep 3h>       
   102 00000010 00<rep 2h>6C646D65-     at eldiListing,		asciz _ELD_LISTING
   102 00000016 6D2E6C737400       
   103 0000001C 00<rep 4h>              	iend
   104                                  
   105                                  
   106                                  	numdef ELD_BUG, 0
   107                                  	numdef ELD_BUG_RELOC, _ELD_BUG
   108                                  	numdef ELD_BUG_LINK, _ELD_BUG
   109                                  	numdef ELD_BUG_LENGTH, _ELD_BUG
   110                                  
   111                                  
   112                                  %rep _ELD_BUG_LINK
   113                                  	eldstrict off
   114                                  
   115                                  	dw relocateddata		; missing linkdatarelocation
   116                                  %endrep
   117                                  
   118                                  %rep _ELD_BUG_RELOC
   119                                  	eldstrict off
   120                                  
   121                                  	dw msg.ldmem			; missing internaldatarelocation
   122                                  %endrep
   123                                  
   124                                  %if _ELD_BUG_LENGTH && _ELD_CODE_VSTART
   125                                  times 64 db 0
   126                                  %endif
   127                                  
   128                                  command:
   129 00000020 EB08                    	jmp strict short .entry
   130                                  .chain:
   131 00000022 E8[0000]EB020000        	extcall cmd3_not_ext, required	; must NOT be extcallcall
   132 00000029 90                      	times 10 - ($ - command) nop
   133                                  .entry:
   134 0000002A 56                      	push si
   135 0000002B 3C2D                    	cmp al, '-'
   136 0000002D 7503                    	jne @F
   137 0000002F E8DE09                  	extcallcall skipcomma
   138                                  @@:
   139 00000032 4E                      	dec si
   140                                  
   141 00000033 BA[8102]                reloc	mov dx, msg.ldmem
   142                                  internaldatarelocation
   143 00000036 E8DF09                  	extcallcall isstring?
   144 00000039 7405                    	je .ours
   145 0000003B 5E                      	pop si
   146 0000003C 4E                      	dec si
   147 0000003D AC                      	lodsb
   148 0000003E EBE2                    	jmp .chain
   149                                  
   150                                  .ours:
   151 00000040 58                      	pop ax
   152 00000041 E8CC09                  	extcallcall skipcomma
   153 00000044 4E                      	dec si
   154 00000045 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   155                                  linkdatarelocation lastcmd, -4
   156                                  linkdatarelocation dmycmd
   157 0000004B BA[0000]                reloc	mov dx, relocateddata
   158                                  linkdatarelocation msg.uninstall
   159 0000004E E8C709                  	extcallcall isstring?
   160 00000051 7406                    	je uninstall
   161                                  
   162                                  %if _OTHER
   163                                  reloc	mov ax, word [otherseg]
   164                                  internaldatarelocation
   165                                  	extcallcall ispm
   166                                  	jnz @F
   167                                  	xchg dx, ax
   168                                  	extcallcall setes2dx
   169                                  reloc	mov ax, word [es:relocateddata]
   170                                  otherlinkdatarelocation dssel
   171                                  @@:
   172                                  reloc	mov word [otherds], ax
   173                                  internaldatarelocation
   174                                  %endif
   175                                  
   176 00000053 E88300                  	call run
   177 00000056 E8C709                  	extcallcall cmd3
   178                                  
   179                                  uninstall:
   180 00000059 AC                      	lodsb
   181 0000005A E8CB09                  	extcallcall chkeol
   182                                  
   183 0000005D E86B00                  	call get_es_ext
   184                                  
   185 00000060 06                      	push es
   186 00000061 1F                      	pop ds
   187 00000062 31DB                    	xor bx, bx		; = 0 (no prior, modify ext_command_handler)
   188 00000064 BF[2000]                reloc	mov di, command		; di -> us
   189                                  internalcoderelocation
   190 00000067 368B36[0000]            reloc	mov si, word [ss:relocateddata]
   191                                  linkdatarelocation ext_command_handler
   192                                  				; si -> first
   193 0000006C 85F6                    	test si, si		; none installed ?
   194 0000006E 7450                    	jz .error		; error -->
   195                                  
   196                                  .loop:
   197 00000070 39F7                    	cmp di, si		; found ?
   198 00000072 740D                    	je .bx			; yes, use bx -->
   199 00000074 89F3                    	mov bx, si		; bx -> prior handler
   200 00000076 AD                      	lodsw			; skip entrypoint jmp strict short
   201 00000077 AC                      	lodsb			; get first byte of chainer
   202 00000078 3CE9                    	cmp al, 0E9h		; expecting jmp near ?
   203 0000007A 7544                    	jne .error		; no, error -->
   204 0000007C AD                      	lodsw			; get rel16 displacement
   205 0000007D 01C6                    	add si, ax		; -> next handler
   206 0000007F EBEF                    	jmp .loop
   207                                  
   208                                  .bx:
   209 00000081 85DB                    	test bx, bx		; any prior ?
   210 00000083 751A                    	jnz .bxnz		; yes -->
   211 00000085 AF                      	scasw			; skip entrypoint jmp strict short
   212 00000086 803DE8                  	cmp byte [di], 0E8h	; is it a call to cmd3_not_ext ?
   213 00000089 7507                    	jne @F			; no -->
   214                                  				; yes, reset ext_command_handler to zero
   215                                  .setbx:
   216 0000008B 36891E[0000]            reloc	mov word [ss:relocateddata], bx
   217                                  linkdatarelocation ext_command_handler
   218 00000090 EB1E                    	jmp .done
   219                                  
   220                                  @@:
   221 00000092 803DE9                  	cmp byte [di], 0E9h	; validate
   222 00000095 7529                    	jne .error		; failure -->
   223 00000097 47                      	inc di			; -> rel16 displacement
   224 00000098 8B1D                    	mov bx, word [di]	; get displacement
   225 0000009A AF                      	scasw			; -> after jmp near
   226 0000009B 01FB                    	add bx, di		; -> next handler
   227 0000009D EBEC                    	jmp .setbx		; set ext_command_handler to next
   228                                  
   229                                  .bxnz:
   230 0000009F 89DE                    	mov si, bx		; -> prior handler with us as downlink
   231 000000A1 87FE                    	xchg di, si		; si -> ours, di -> prior
   232 000000A3 A7                      	cmpsw			; skip entrypoint jmp strict short
   233 000000A4 A4                      	movsb			; copy 0E8h/0E9h
   234 000000A5 AD                      	lodsw			; ax = near rel16 displacement
   235 000000A6 01F0                    	add ax, si		; add in our base (= absolute offset)
   236 000000A8 29F8                    	sub ax, di
   237 000000AA 48                      	dec ax
   238 000000AB 48                      	dec ax			; subtract new base (= relative displacement)
   239 000000AC AB                      	stosw			; store new rel16 displacement
   240 000000AD A5                      	movsw			; jmp strict short
   241 000000AE A5                      	movsw			; linkcall target
   242 000000AF A4                      	movsb			; trailer
   243                                  .done:
   244 000000B0 8026[1000]FE            reloc	clropt [code + eldiFlags], eldifResident
   245                                  internalcoderelocation -3	; mark block as free
   246 000000B5 BA[8702]                reloc	mov dx, msg.uninstall_done
   247                                  internaldatarelocation
   248                                  @@:
   249 000000B8 16                      	push ss
   250 000000B9 1F                      	pop ds
   251 000000BA E87309                  	extcallcall putsz
   252 000000BD E86009                  	extcallcall cmd3	; return
   253                                  
   254                                  .error:
   255 000000C0 B8010E                  	mov ax, 0E01h
   256 000000C3 E87209                  	extcallcall setrc
   257 000000C6 BA[9C02]                reloc	mov dx, msg.uninstall_error
   258                                  internaldatarelocation
   259 000000C9 EBED                    	jmp @B
   260                                  
   261                                  
   262                                  get_es_ext:
   263 000000CB 8E06[0000]              reloc	mov es, word [relocateddata]
   264                                  linkdatarelocation extdssel
   265 000000CF E86E09                  	extcallcall ispm
   266 000000D2 7404                    	jz @F
   267 000000D4 8E06[0000]              reloc	mov es, word [relocateddata]
   268                                  linkdatarelocation extseg
   269                                  @@:
   270 000000D8 C3                      	retn
   271                                  
   272                                  
   273                                  %if _OTHER
   274                                  get_es_ext_other:
   275                                  	getotherds
   276                                  reloc	mov es, word [relocateddata]
   277                                  otherlinkdatarelocation extdssel
   278                                  	extcallcall ispm
   279                                  	jz @F
   280                                  reloc	mov es, word [relocateddata]
   281                                  otherlinkdatarelocation extseg
   282                                  @@:
   283                                  	resetds
   284                                  	retn
   285                                  %else
   286                                   get_es_ext_other equ get_es_ext
   287                                  %endif
   288                                  
   289                                  
   290                                  run:
   291 000000D9 16                      	push ss
   292 000000DA 07                      	pop es
   293 000000DB C706[4209][3A07]        reloc2	mov word [separatormessage], msg.empty
   294                                  internaldatarelocation -4
   295                                  internaldatarelocation
   296 000000E1 AC                      	lodsb
   297 000000E2 E86309                  	extcallcall iseol?
   298 000000E5 7503                    	jne @F
   299 000000E7 BE[4201]                reloc	mov si, msg.allexceptseg + 1
   300                                  internaldatarelocation
   301                                  @@:
   302 000000EA 4E                      	dec si			; -> keyword
   303                                  
   304 000000EB 31C0                    	xor ax, ax
   305 000000ED 50                      	push ax			; on stack = 0
   306                                  
   307                                  .loopouter:			; si -> next keyword
   308 000000EE AC                      	lodsb
   309 000000EF E85609                  	extcallcall iseol?
   310 000000F2 7506                    	jne @F
   311                                  .continue:
   312 000000F4 5E                      	pop si			; get next string
   313 000000F5 85F6                    	test si, si		; any ?
   314 000000F7 75F5                    	jnz .loopouter		; yes -->
   315 000000F9 C3                      	retn			; done
   316                                  
   317                                  @@:
   318 000000FA 4E                      	dec si			; -> keyword
   319 000000FB 87F1                    	xchg si, cx
   320 000000FD BE[F600]                reloc	mov si, nountable
   321                                  internaldatarelocation
   322                                  .loop:
   323 00000100 AC                      	lodsb
   324 00000101 B400                    	mov ah, 0
   325 00000103 01F0                    	add ax, si
   326 00000105 39F0                    	cmp ax, si
   327 00000107 742A                    	je .notfound
   328 00000109 92                      	xchg dx, ax		; -> match string
   329 0000010A 87F1                    	xchg si, cx		; si -> keyword
   330 0000010C E80909                  	extcallcall isstring?
   331 0000010F 7406                    	je .got
   332 00000111 87F1                    	xchg si, cx		; si -> table
   333 00000113 AC                      	lodsb
   334 00000114 AD                      	lodsw			; skip
   335 00000115 EBE9                    	jmp .loop		; try to match next noun -->
   336                                  
   337                                  .got:
   338 00000117 E8F608                  	extcallcall skipcomma
   339 0000011A 4E                      	dec si			; -> next keyword
   340 0000011B 56                      	push si			; stack next keyword
   341 0000011C 87F1                    	xchg si, cx		; si -> table
   342 0000011E AC                      	lodsb
   343 0000011F 3C01                    	cmp al, 1
   344 00000121 AD                      	lodsw			; ax -> next string or function
   345 00000122 740C                    	je .sublist
   346                                  .function:
   347 00000124 E85700                  	call .separator
   348 00000127 FFD0                    	call ax			; call code
   349 00000129 16                      	 push ss
   350 0000012A 07                      	 pop es
   351 0000012B 16                      	 push ss
   352 0000012C 1F                      	 pop ds
   353 0000012D 5E                      	pop si			; restore -> next keyword
   354 0000012E EBBE                    	jmp .loopouter		; continue noun loop -->
   355                                  
   356                                  .sublist:
   357 00000130 96                      	xchg si, ax		; si -> sub list
   358 00000131 EBBB                    	jmp .loopouter		; handle sub list --> (stack has continue offset)
   359                                  
   360                                  .notfound:
   361 00000133 E84800                  	call .separator
   362 00000136 B8430E                  	mov ax, 0E43h
   363 00000139 E8FC08                  	extcallcall setrc
   364 0000013C BA[6B02]                reloc	mov dx, msg.notfound.1
   365                                  internaldatarelocation
   366 0000013F E8EE08                  	extcallcall putsz
   367 00000142 87F1                    	xchg si, cx		; si -> keyword
   368 00000144 89F2                    	mov dx, si		; dx -> start of keyword
   369                                  @@:
   370 00000146 AC                      	lodsb
   371 00000147 E8FE08                  	extcallcall iseol?	; EOL ?
   372 0000014A 741D                    	je @F
   373 0000014C 3C20                    	cmp al, 32		; blank ?
   374 0000014E 7419                    	je @F
   375 00000150 3C09                    	cmp al, 9
   376 00000152 7415                    	je @F
   377 00000154 3C2C                    	cmp al, ','		; comma ?
   378 00000156 75EE                    	jne @B
   379                                  		; We do not want to loop on trailing commas
   380                                  		;  indefinitely, so handle this in a special
   381                                  		;  way here. (Trailing comma after a valid
   382                                  		;  name will emit the not found message with
   383                                  		;  an empty name.)
   384 00000158 56                      	push si
   385 00000159 E8F408                  	extcallcall skipwhite
   386 0000015C E8E908                  	extcallcall iseol?	; EOL after comma ?
   387 0000015F 7507                    	jne .nottrailingcomma
   388 00000161 4E                      	dec si
   389 00000162 58                      	pop ax			; -> after keyword + 1
   390 00000163 48                      	dec ax			; -> after keyword
   391 00000164 89C1                    	mov cx, ax		; -> after keyword
   392 00000166 EB04                    	jmp @FF
   393                                  
   394                                  .nottrailingcomma:
   395 00000168 5E                      	pop si
   396                                  @@:
   397 00000169 4E                      	dec si			; -> after keyword
   398 0000016A 89F1                    	mov cx, si		; -> after keyword
   399                                  @@:
   400 0000016C 29D1                    	sub cx, dx		; cx = length of keyword
   401 0000016E E8E708                  	extcallcall puts
   402 00000171 BA[7202]                reloc	mov dx, msg.notfound.2
   403                                  internaldatarelocation
   404 00000174 E8B908                  	extcallcall putsz
   405 00000177 E89608                  	extcallcall skipcomma	; skip comma (except trailing comma)
   406 0000017A 4E                      	dec si			; -> next keyword
   407 0000017B E970FF                  	jmp .loopouter
   408                                  
   409                                  .separator:
   410 0000017E BA[3807]                reloc	mov dx, msg.linebreak
   411                                  internaldatarelocation
   412 00000181 8716[4209]              reloc	xchg dx, word [separatormessage]
   413                                  internaldatarelocation
   414 00000185 E8A808                  	extcallcall putsz
   415 00000188 C3                      	retn
   416                                  
   417                                  
   418                                  display_seg:
   419 00000189 E83B01                  	call sort_mem
   420                                  
   421 0000018C BE[4809]                reloc	mov si, table_sorted
   422                                  internaldatarelocation
   423 0000018F BF[0000]                reloc	mov di, relocateddata
   424                                  linkdatarelocation line_out
   425                                  .loop1:
   426 00000192 AD                      	lodsw
   427 00000193 85C0                    	test ax, ax
   428 00000195 7435                    	jz .done1
   429                                  
   430 00000197 56                      	push si
   431 00000198 96                      	xchg si, ax
   432 00000199 E81E00                  	call .get_name
   433 0000019C 91                      	xchg ax, cx
   434 0000019D 3C04                    	cmp al, 4
   435 0000019F 730B                    	jae @F
   436 000001A1 E8BC08                  	extcallcall copy_single_counted_string
   437 000001A4 91                      	xchg ax, cx
   438 000001A5 F7D9                    	neg cx
   439 000001A7 83C104                  	add cx, 4
   440 000001AA EB03                    	jmp @FF
   441                                  @@:
   442 000001AC E8B108                  	extcallcall copy_single_counted_string
   443                                  @@:
   444 000001AF 41                      	inc cx
   445 000001B0 B020                    	mov al, 32
   446 000001B2 F3AA                    	rep stosb
   447 000001B4 5E                      	pop si
   448 000001B5 83C608                  	add si, 8
   449 000001B8 EBD8                    	jmp .loop1
   450                                  
   451                                  .get_name:
   452 000001BA 56                      	push si
   453 000001BB 31C9                    	xor cx, cx
   454 000001BD 8A0C                    	mov cl, [si]
   455 000001BF 01CE                    	add si, cx
   456 000001C1 46                      	inc si
   457 000001C2 8A0C                    	mov cl, [si]
   458 000001C4 E302                    	jcxz @F
   459 000001C6 5A                      	pop dx
   460 000001C7 C3                      	retn
   461                                  @@:
   462 000001C8 5E                      	pop si
   463 000001C9 8A0C                    	mov cl, [si]
   464 000001CB C3                      	retn
   465                                  
   466                                  .done1:
   467 000001CC E89908                  	extcallcall trimputs
   468                                  
   469 000001CF BE[4809]                reloc	mov si, table_sorted
   470                                  internaldatarelocation
   471 000001D2 BF[0000]                reloc	mov di, relocateddata
   472                                  linkdatarelocation line_out
   473                                  .loop2:
   474 000001D5 AD                      	lodsw
   475 000001D6 85C0                    	test ax, ax
   476 000001D8 741B                    	jz .done2
   477 000001DA 56                      	push si
   478 000001DB 50                      	push ax
   479 000001DC AD                      	lodsw
   480 000001DD AD                      	lodsw
   481                                  
   482 000001DE E88F08                  	extcallcall hexword
   483 000001E1 5E                      	pop si
   484 000001E2 E8D5FF                  	call .get_name
   485 000001E5 80E903                  	sub cl, 3
   486 000001E8 7501                    	jnz @F
   487 000001EA 41                      	inc cx
   488                                  @@:
   489 000001EB B020                    	mov al, 32
   490 000001ED F3AA                    	rep stosb
   491 000001EF 5E                      	pop si
   492 000001F0 83C608                  	add si, 8
   493 000001F3 EBE0                    	jmp .loop2
   494                                  
   495                                  .done2:
   496 000001F5 E87008                  	extcallcall trimputs
   497                                  
   498 000001F8 E84508                  	extcallcall ispm
   499 000001FB 753B                    	jnz .end
   500                                  
   501 000001FD BE[4809]                reloc	mov si, table_sorted
   502                                  internaldatarelocation
   503 00000200 BF[0000]                reloc	mov di, relocateddata
   504                                  linkdatarelocation line_out
   505                                  .loop3:
   506 00000203 AD                      	lodsw
   507 00000204 85C0                    	test ax, ax
   508 00000206 742D                    	jz .done3
   509 00000208 93                      	xchg bx, ax
   510 00000209 83C606                  	add si, 6
   511 0000020C AD                      	lodsw
   512 0000020D 85C0                    	test ax, ax
   513 0000020F 750A                    	jnz @F
   514 00000211 B86E6F                  	mov ax, "no"
   515 00000214 AB                      	stosw
   516 00000215 B86E65                  	mov ax, "ne"
   517 00000218 AB                      	stosw
   518 00000219 EB07                    	jmp @FF
   519                                  @@:
   520 0000021B 93                      	xchg bx, ax
   521                                  	getotherds
   522 0000021C 8B1F                    	mov bx, [bx]
   523                                  	resetds
   524 0000021E 93                      	xchg bx, ax
   525                                  
   526 0000021F E84E08                  	extcallcall hexword
   527                                  @@:
   528 00000222 56                      	push si
   529 00000223 89DE                    	mov si, bx
   530 00000225 E892FF                  	call .get_name
   531 00000228 5E                      	pop si
   532 00000229 80E903                  	sub cl, 3
   533 0000022C 7501                    	jnz @F
   534 0000022E 41                      	inc cx
   535                                  @@:
   536 0000022F B020                    	mov al, 32
   537 00000231 F3AA                    	rep stosb
   538 00000233 EBCE                    	jmp .loop3
   539                                  
   540                                  .done3:
   541 00000235 E83008                  	extcallcall trimputs
   542                                  
   543                                  .end:
   544 00000238 E81702                  	call display_data_sel
   545 0000023B C3                      	retn
   546                                  
   547                                  
   548                                  display_patchareas.none:
   549 0000023C BA[0209]                reloc	mov dx, msg.patch_area.5
   550                                  internaldatarelocation
   551 0000023F E8EE07                  	extcallcall putsz
   552 00000242 EB72                    	jmp display_patchareas.next
   553                                  
   554                                  display_patchareas:
   555 00000244 BE[DE00]                reloc	mov si, store_table
   556                                  internaldatarelocation
   557                                  
   558                                  .loop:
   559 00000247 AD                      	lodsw
   560 00000248 97                      	xchg di, ax		; di = offset -> patch area
   561 00000249 AD                      	lodsw
   562 0000024A 93                      	xchg bx, ax		; bx -> word [segment] => patch area
   563 0000024B AD                      	lodsw
   564 0000024C 91                      	xchg cx, ax		; cx = length
   565 0000024D AD                      	lodsw			; ax -> name message
   566 0000024E 50                      	push ax			; name
   567 0000024F E3EB                    	jcxz .none		; zero length means not supported -->
   568 00000251 85DB                    	test bx, bx
   569 00000253 74E7                    	jz .none		; zero offset of segment is invalid -->
   570                                  	; test di, di		; (could be valid)
   571                                  	; jz .none
   572                                  
   573                                  	houdini
   574                                  
   575 00000255 BA[AF08]                reloc	mov dx, msg.patch_area.1
   576                                  internaldatarelocation
   577 00000258 E8D507                  	extcallcall putsz	; header
   578 0000025B 57                      	push di			; preserve -> patch area
   579 0000025C 51                      	 push cx
   580 0000025D 91                      	xchg ax, cx		; ax = length
   581 0000025E BF[0000]                reloc	mov di, relocateddata
   582                                  linkdatarelocation line_out
   583 00000261 E81408                  	extcallcall decword	; write length
   584 00000264 53                      	 push bx
   585 00000265 E81808                  	extcallcall putsline
   586 00000268 5B                      	 pop bx			; preserve segment variable offset
   587 00000269 59                      	 pop cx			; preserve length
   588 0000026A 5F                      	pop di
   589                                  	getotherds
   590 0000026B 8B17                    	mov dx, word [bx]	; => segment of patch area
   591                                  	resetds
   592 0000026D 89D5                    	mov bp, dx		; preserve segment
   593 0000026F E81608                  	extcallcall setes2dx	; es => patch area
   594 00000272 BA[CF08]                reloc	mov dx, msg.patch_area.2.notinuse
   595                                  internaldatarelocation
   596 00000275 57                      	push di
   597 00000276 B090                    	mov al, 90h		; check if all NOPs, meaning not in use
   598 00000278 F3AE                    	repe scasb		; check
   599 0000027A 7403                    	je @F			; if not in use -->
   600 0000027C BA[C308]                reloc	mov dx, msg.patch_area.2.inuse
   601                                  internaldatarelocation		; indicate in use
   602                                  @@:
   603 0000027F 16                      	 push ss
   604 00000280 07                      	 pop es
   605 00000281 E8AC07                  	extcallcall putsz
   606 00000284 BA[D908]                reloc	mov dx, msg.patch_area.3.entry
   607                                  internaldatarelocation
   608 00000287 81FB[0000]              reloc	cmp bx, strict word relocateddata
   609                                  linkdatarelocation pspdbg	; is entry segment ?
   610 0000028B 7413                    	je @F
   611 0000028D BA[DF08]                reloc	mov dx, msg.patch_area.3.code
   612                                  internaldatarelocation
   613 00000290 81FB[0000]              reloc2	cmp bx, strict word relocateddata
   614                                  linkdatarelocation code_seg, -2, optional, next
   615                                  linkdatarelocation code_movable_seg, -2, optional, last
   616                                  				; is code segment ?
   617 00000294 740A                    	je @F
   618 00000296 BA[E408]                reloc	mov dx, msg.patch_area.3.unknown
   619                                  internaldatarelocation
   620 00000299 BF[EC08]                reloc	mov di, msg.patch_area.3.unknown.s
   621                                  internaldatarelocation
   622 0000029C 95                      	xchg ax, bp		; ax = segment value
   623 0000029D E8D007                  	extcallcall hexword
   624                                  @@:
   625 000002A0 E88D07                  	extcallcall putsz
   626 000002A3 BA[F208]                reloc	mov dx, msg.patch_area.3.offset
   627                                  internaldatarelocation
   628 000002A6 BF[F308]                reloc	mov di, msg.patch_area.3.offset.o
   629                                  internaldatarelocation
   630 000002A9 58                      	pop ax
   631 000002AA E8C307                  	extcallcall hexword
   632 000002AD E88007                  	extcallcall putsz
   633 000002B0 BA[FB08]                reloc	mov dx, msg.patch_area.4
   634                                  internaldatarelocation
   635 000002B3 E87A07                  	extcallcall putsz
   636                                  .next:
   637 000002B6 5A                      	pop dx
   638 000002B7 E87607                  	extcallcall putsz
   639                                  
   640 000002BA BA[3807]                reloc	mov dx, msg.linebreak
   641                                  internaldatarelocation
   642 000002BD E87007                  	extcallcall putsz
   643                                  
   644 000002C0 81FE[F600]              reloc	cmp si, strict word store_table.end
   645                                  internaldatarelocation
   646 000002C4 7281                    	jb .loop
   647 000002C6 C3                      	retn
   648                                  
   649                                  
   650                                  sort_mem:
   651 000002C7 BE[0000]                reloc	mov si, table
   652                                  internaldatarelocation
   653 000002CA BA[4809]                reloc	mov dx, table_sorted
   654                                  internaldatarelocation
   655                                  
   656                                  loopprepare:
   657 000002CD AD                      	lodsw
   658 000002CE 85C0                    	test ax, ax
   659 000002D0 7452                    	jz .done
   660 000002D2 AD                      	lodsw
   661 000002D3 85C0                    	test ax, ax
   662 000002D5 7505                    	jnz @F
   663                                  .segzero:
   664 000002D7 83C606                  	add si, 6
   665 000002DA EB46                    	jmp .next
   666                                  
   667                                  @@:
   668 000002DC 93                      	xchg bx, ax
   669                                  	getotherds
   670 000002DD 8B07                    	mov ax, [bx]
   671                                  	resetds
   672 000002DF 85C0                    	test ax, ax
   673 000002E1 74F4                    	jz .segzero
   674 000002E3 BF[4C09]                reloc	mov di, table_sorted + 4
   675                                  internaldatarelocation
   676                                  @@:
   677 000002E6 39D7                    	cmp di, dx
   678 000002E8 7308                    	jae .insert_at_di_minus_4
   679 000002EA AF                      	scasw
   680 000002EB 7206                    	jb .insert_at_di_minus_6
   681 000002ED 83C708                  	add di, 8
   682 000002F0 EBF4                    	jmp @B
   683                                  
   684                                  .insert_at_di_minus_4:
   685 000002F2 AF                      	scasw
   686                                  .insert_at_di_minus_6:
   687 000002F3 83EF06                  	sub di, 6
   688                                  .insert_at_di:
   689 000002F6 89D1                    	mov cx, dx
   690 000002F8 29F9                    	sub cx, di
   691 000002FA 56                      	push si
   692 000002FB 57                      	push di
   693 000002FC 89D7                    	mov di, dx		; -> end
   694 000002FE 83C70A                  	add di, 10		; -> after destination
   695 00000301 89FA                    	mov dx, di		; update -> end
   696 00000303 FD                      	std			; AMD erratum 109 workaround
   697 00000304 AF                      	scasw			; -> last word destination
   698 00000305 8D75F6                  	lea si, [di - 10]	; -> last word source (dx - 2)
   699 00000308 D1E9                    	shr cx, 1		; = amount of words
   700 0000030A E308                    	jcxz @FF
   701 0000030C 83F914                  	cmp cx, 20
   702 0000030F 7703                    	ja @FF
   703                                  @@:
   704 00000311 A5                      	movsw
   705 00000312 E2FD                    	loop @B
   706                                  @@:
   707 00000314 F3A5                    	rep movsw		; move up all following entries
   708 00000316 FC                      	cld
   709 00000317 5F                      	pop di
   710 00000318 5E                      	pop si
   711 00000319 83EE04                  	sub si, 4
   712 0000031C A5                      	movsw			; copy message offset
   713 0000031D A5                      	movsw			; copy seg offset
   714 0000031E AB                      	stosw			; store seg value
   715 0000031F AD                      	lodsw			; skip this field
   716 00000320 A5                      	movsw			; copy size offset
   717 00000321 A5                      	movsw			; copy sel offset
   718                                  .next:
   719 00000322 EBA9                    	jmp loopprepare
   720                                  
   721                                  .done:
   722 00000324 87D7                    	xchg dx, di
   723 00000326 31C0                    	xor ax, ax
   724 00000328 AB                      	stosw			; terminator
   725 00000329 C3                      	retn
   726                                  
   727                                  
   728                                  display_mem:
   729 0000032A E89AFF                  	call sort_mem
   730                                  
   731 0000032D BB[0000]                reloc	mov bx, relocateddata
   732                                  otherlinkdatarelocation alloc_seg, -2, optional
   733 00000330 89DA                    	mov dx, bx
   734 00000332 85DB                    	test bx, bx
   735 00000334 7402                    	jz @F
   736                                  	getotherds
   737 00000336 8B17                    	mov dx, [bx]
   738                                  	resetds
   739                                  @@:
   740                                  
   741 00000338 BE[4809]                reloc	mov si, table_sorted
   742                                  internaldatarelocation
   743                                  loop:
   744 0000033B BF[0000]                reloc	mov di, relocateddata
   745                                  linkdatarelocation line_out
   746 0000033E AD                      	lodsw
   747 0000033F 85C0                    	test ax, ax
   748 00000341 7503E9BB00              	jz .done
   749 00000346 56                      	push si
   750 00000347 50                      	push ax
   751 00000348 AD                      	lodsw
   752 00000349 85D2                    	test dx, dx
   753 0000034B 741A                    	jz .nogap
   754 0000034D 85C0                    	test ax, ax
   755 0000034F 7416                    	jz .nogap
   756 00000351 93                      	xchg bx, ax
   757                                  	getotherds
   758 00000352 8B07                    	mov ax, [bx]
   759                                  	resetds
   760 00000354 39C2                    	cmp dx, ax
   761 00000356 740F                    	je .nogap
   762 00000358 720A                    	jb .gap
   763 0000035A 52                      	push dx
   764 0000035B BA[4004]                reloc	mov dx, msg.overlap
   765                                  internaldatarelocation
   766 0000035E E8CF06                  	extcallcall putsz
   767 00000361 5A                      	pop dx
   768 00000362 EB03                    	jmp .nogap
   769                                  .gap:
   770 00000364 E88606                  	call gap
   771                                  .nogap:
   772 00000367 5E                      	pop si
   773 00000368 E8F506                  	extcallcall copy_single_counted_string
   774 0000036B BE[7103]                reloc	mov si, msg.segment_colon
   775                                  internaldatarelocation
   776 0000036E E8EF06                  	extcallcall copy_single_counted_string
   777 00000371 5E                      	pop si
   778 00000372 AD                      	lodsw
   779 00000373 85C0                    	test ax, ax
   780 00000375 750F                    	jnz @F
   781 00000377 83C606                  	add si, 6
   782 0000037A 56                      	push si
   783 0000037B BE[7C03]                reloc	mov si, msg.none
   784                                  internaldatarelocation
   785                                  .next_string:
   786 0000037E E8DF06                  	extcallcall copy_single_counted_string
   787 00000381 31D2                    	xor dx, dx
   788 00000383 5E                      	pop si
   789 00000384 EB73                    	jmp .next
   790                                  
   791                                  @@:
   792 00000386 93                      	xchg bx, ax
   793 00000387 B9[1A00]                reloc	mov cx, relocateddata + 26
   794                                  linkdatarelocation line_out
   795 0000038A 29F9                    	sub cx, di
   796 0000038C 7604                    	jbe @F
   797 0000038E B020                    	mov al, 32
   798 00000390 F3AA                    	rep stosb
   799                                  @@:
   800                                  	getotherds
   801 00000392 8B07                    	mov ax, [bx]
   802                                  	resetds
   803 00000394 89C2                    	mov dx, ax
   804 00000396 E8D706                  	extcallcall hexword
   805 00000399 56                      	push si
   806 0000039A BE[B803]                reloc	mov si, msg.address.1
   807                                  internaldatarelocation
   808 0000039D E8C006                  	extcallcall copy_single_counted_string
   809 000003A0 5E                      	pop si
   810 000003A1 AD                      	lodsw
   811 000003A2 AD                      	lodsw
   812 000003A3 85C0                    	test ax, ax
   813 000003A5 750C                    	jnz @F
   814 000003A7 AD                      	lodsw
   815 000003A8 56                      	push si
   816 000003A9 BE[9F03]                reloc	mov si, msg.nonesize
   817                                  internaldatarelocation
   818 000003AC 31D2                    	xor dx, dx
   819 000003AE E8AF06                  	extcallcall copy_single_counted_string
   820 000003B1 EB30                    	jmp .next_sel
   821                                  
   822                                  @@:
   823 000003B3 52                      	push dx
   824 000003B4 56                      	push si
   825 000003B5 BE[BB03]                reloc	mov si, msg.size.1
   826                                  internaldatarelocation
   827 000003B8 E8A506                  	extcallcall copy_single_counted_string
   828 000003BB 93                      	xchg bx, ax
   829                                  	getotherds
   830 000003BC 8B07                    	mov ax, [bx]
   831                                  	resetds
   832 000003BE E8AF06                  	extcallcall hexword
   833 000003C1 BE[C303]                reloc	mov si, msg.size.2
   834                                  internaldatarelocation
   835 000003C4 E89906                  	extcallcall copy_single_counted_string
   836 000003C7 31D2                    	xor dx, dx
   837 000003C9 B90100                  	mov cx, 1
   838 000003CC BB0900                  	mov bx, 9
   839 000003CF E8BE06                  	extcallcall disp_dxax_times_cx_width_bx_size.store
   840 000003D2 5E                      	pop si
   841 000003D3 5A                      	pop dx
   842 000003D4 83C00F                  	add ax, 15
   843 000003D7 D1E8                    	shr ax, 1
   844 000003D9 D1E8                    	shr ax, 1
   845 000003DB D1E8                    	shr ax, 1
   846 000003DD D1E8                    	shr ax, 1
   847 000003DF 01C2                    	add dx, ax
   848 000003E1 AD                      	lodsw
   849 000003E2 56                      	push si
   850                                  .next_sel:
   851 000003E3 E85A06                  	extcallcall ispm
   852 000003E6 7510                    	jnz @F
   853 000003E8 85C0                    	test ax, ax
   854 000003EA 740C                    	jz @F
   855 000003EC 93                      	xchg bx, ax
   856                                  	getotherds
   857 000003ED 8B07                    	mov ax, [bx]
   858                                  	resetds
   859 000003EF BE[C603]                reloc	mov si, msg.sel
   860                                  internaldatarelocation
   861 000003F2 E86B06                  	extcallcall copy_single_counted_string
   862 000003F5 E87806                  	extcallcall hexword
   863                                  
   864                                  @@:
   865 000003F8 5E                      	pop si
   866                                  
   867                                  .next:
   868 000003F9 52                      	push dx
   869 000003FA E89B06                  	extcallcall putsline_crlf
   870 000003FD 5A                      	pop dx
   871 000003FE E93AFF                  	jmp loop
   872                                  
   873                                  .done:
   874                                  loop_done:
   875                                  
   876 00000401 BB[0000]                reloc	mov bx, relocateddata
   877                                  otherlinkdatarelocation alloc_seg, -2, optional
   878 00000404 85DB                    	test bx, bx
   879 00000406 7416                    	jz .nogap
   880                                  	getotherds
   881 00000408 8B07                    	mov ax, [bx]
   882 0000040A BB[0000]                reloc	mov bx, relocateddata
   883                                  otherlinkdatarelocation alloc_size, -2, optional
   884 0000040D 85DB                    	test bx, bx
   885 0000040F 740D                    	jz .nogap
   886 00000411 0307                    	add ax, [bx]
   887                                  	resetds
   888 00000413 85D2                    	test dx, dx
   889 00000415 7407                    	jz .nogap
   890 00000417 39C2                    	cmp dx, ax
   891 00000419 7303                    	jae .nogap
   892 0000041B E8CF05                  	call gap
   893                                  .nogap:
   894                                  	resetds
   895                                  
   896                                  
   897                                  display_alloc:
   898 0000041E BA[0A04]                reloc	mov dx, msg.alloc
   899                                  internaldatarelocation
   900 00000421 E80C06                  	extcallcall putsz
   901                                  
   902 00000424 BB[0000]                reloc	mov bx, relocateddata
   903                                  otherlinkdatarelocation alloc_seg, -2, optional
   904 00000427 85DB                    	test bx, bx
   905 00000429 7508                    	jnz @F
   906 0000042B BE[7C03]                reloc	mov si, msg.none
   907                                  internaldatarelocation
   908                                  .eol_string:
   909 0000042E E82F06                  	extcallcall copy_single_counted_string
   910 00000431 EB1C                    	jmp .eol
   911                                  
   912                                  @@:
   913                                  	getotherds
   914 00000433 8B07                    	mov ax, [bx]
   915                                  	resetds
   916 00000435 E83806                  	extcallcall hexword
   917 00000438 BE[B803]                reloc	mov si, msg.address.1
   918                                  internaldatarelocation
   919 0000043B E82206                  	extcallcall copy_single_counted_string
   920                                  
   921 0000043E BB[0000]                reloc	mov bx, relocateddata
   922                                  otherlinkdatarelocation alloc_size, -2, optional
   923 00000441 85DB                    	test bx, bx
   924 00000443 7505                    	jnz @F
   925 00000445 BE[9F03]                reloc	mov si, msg.nonesize
   926                                  internaldatarelocation
   927 00000448 EBE4                    	jmp .eol_string
   928                                  
   929                                  @@:
   930                                  	getotherds
   931 0000044A 8B07                    	mov ax, [bx]
   932                                  	resetds
   933 0000044C E87005                  	call parasize
   934                                  .eol:
   935 0000044F E84606                  	extcallcall putsline_crlf
   936                                  
   937                                  
   938                                  display_data_sel:
   939 00000452 E8EB05                  	extcallcall ispm
   940 00000455 7539                    	jnz .end
   941                                  
   942 00000457 BF[0000]                reloc	mov di, relocateddata
   943                                  linkdatarelocation line_out
   944 0000045A B90200                  	mov cx, 2
   945                                  @@:
   946 0000045D BB[0000]                reloc	mov bx, relocateddata
   947                                  otherlinkdatarelocation dssel, -2, optional
   948 00000460 80F902                  	cmp cl, 2
   949 00000463 7403                    	je .dssel
   950 00000465 BB[0000]                reloc	mov bx, relocateddata
   951                                  otherlinkdatarelocation extdssel, -2, optional
   952                                  .dssel:
   953 00000468 85DB                    	test bx, bx
   954 0000046A 7419                    	jz .next
   955                                  	getotherds
   956 0000046C 8B07                    	mov ax, [bx]
   957                                  	resetds
   958 0000046E BE[D303]                reloc	mov si, msg.dssel
   959                                  internaldatarelocation
   960 00000471 80F902                  	cmp cl, 2
   961 00000474 7403                    	je .msgdssel
   962 00000476 BE[E903]                reloc	mov si, msg.extdssel
   963                                  internaldatarelocation
   964                                  .msgdssel:
   965 00000479 51                      	push cx
   966 0000047A E8E305                  	extcallcall copy_single_counted_string
   967 0000047D 59                      	pop cx
   968 0000047E E8EF05                  	extcallcall hexword
   969 00000481 B82020                  	mov ax, 2020h
   970 00000484 AB                      	stosw
   971                                  .next:
   972 00000485 E2D6                    	loop @B
   973 00000487 81FF[0000]              reloc	cmp di, strict word relocateddata
   974                                  linkdatarelocation line_out
   975 0000048B 7403                    	je .end
   976 0000048D E8D805                  	extcallcall trimputs
   977                                  
   978                                  .end:
   979 00000490 C3                      	retn
   980                                  
   981                                  
   982                                  historysize:
   983                                  	lframe none
   984 00000491 5589E5                  	lenter
   985 00000494 C606[3C01]00            reloc	mov byte [history_data_entry], 0
   986                                  internaldatarelocation -3
   987 00000499 B8[0000]                reloc	mov ax, relocateddata
   988                                  otherlinkdatarelocation historyformat, -2, optional
   989 0000049C 85C0                    	test ax, ax
   990 0000049E 7509                    	jnz @F
   991 000004A0 BA[4B04]                reloc	mov dx, msg.history_none
   992                                  internaldatarelocation
   993                                  .putsz_end:
   994 000004A3 E88A05                  	extcallcall putsz
   995 000004A6 E9B400                  	jmp .end
   996                                  
   997                                  @@:
   998 000004A9 BA[6B04]                reloc	mov dx, msg.history_data_entry
   999                                  internaldatarelocation
  1000                                  	; houdini
  1001                                  @@:
  1002 000004AC 83F802                  	cmp ax, 2
  1003 000004AF 720A                    	jb .in_data_entry
  1004 000004B1 BA[8C04]                reloc	mov dx, msg.history_separate
  1005                                  internaldatarelocation
  1006 000004B4 7409                    	je .in_separate
  1007                                  
  1008                                  %if 0
  1009                                  reloc	mov di, relocateddata
  1010                                  linkdatarelocation line_out
  1011                                  	extcallcall hexword
  1012                                  	mov al, 32
  1013                                  	stosb
  1014                                  reloc	mov si, @B
  1015                                  internalcoderelocation
  1016                                  	mov cx, 16
  1017                                  @@:
  1018                                  	cs lodsb
  1019                                  	extcallcall hexbyte
  1020                                  	mov al, 32
  1021                                  	stosb
  1022                                  	loop @B
  1023                                  	extcallcall trimputs
  1024                                  %endif
  1025                                  
  1026 000004B6 BA[AD04]                reloc	mov dx, msg.history_unknown
  1027                                  internaldatarelocation
  1028 000004B9 EBE8                    	jmp .putsz_end
  1029                                  
  1030                                  .in_data_entry:
  1031 000004BB F616[3C01]              reloc	not byte [history_data_entry]
  1032                                  internaldatarelocation
  1033                                  .in_separate:
  1034 000004BF E86E05                  	extcallcall putsz
  1035 000004C2 BB[0000]                reloc	mov bx, relocateddata
  1036                                  otherlinkdatarelocation history.last, -2, optional
  1037 000004C5 BA[0000]                reloc	mov dx, relocateddata
  1038                                  otherlinkdatarelocation history.first, -2, optional
  1039 000004C8 85DB                    	test bx, bx
  1040 000004CA 7404                    	jz @F
  1041 000004CC 85D2                    	test dx, dx
  1042 000004CE 7505                    	jnz @FF
  1043                                  
  1044                                  @@:
  1045                                  .missing:
  1046                                  	resetds
  1047 000004D0 BA[C704]                reloc	mov dx, msg.history_missing
  1048                                  internaldatarelocation
  1049 000004D3 EBCE                    	jmp .putsz_end
  1050                                  
  1051                                  @@:
  1052 000004D5 BF[0000]                reloc	mov di, relocateddata
  1053                                  linkdatarelocation line_out
  1054 000004D8 BE[0005]                reloc	mov si, msg.history.1
  1055                                  internaldatarelocation
  1056 000004DB E88205                  	extcallcall copy_single_counted_string
  1057                                  	getotherds
  1058 000004DE 87D3                    	xchg dx, bx
  1059 000004E0 8B07                    	mov ax, [bx]
  1060 000004E2 87D3                    	xchg dx, bx
  1061 000004E4 2B07                    	sub ax, [bx]
  1062                                  	resetds
  1063 000004E6 D1E8                    	shr ax, 1
  1064 000004E8 E88D05                  	extcallcall decword
  1065 000004EB 50                      	push ax
  1066 000004EC BE[1205]                reloc	mov si, msg.history.2
  1067                                  internaldatarelocation
  1068 000004EF E86E05                  	extcallcall copy_single_counted_string
  1069                                  	getotherds
  1070 000004F2 8B1F                    	mov bx, [bx]
  1071                                  	resetds
  1072 000004F4 D006[3C01]              reloc	rol byte [history_data_entry], 1
  1073                                  internaldatarelocation
  1074                                  	getotherds
  1075 000004F8 720B                    	jc .not_seg
  1076 000004FA 53                      	push bx
  1077 000004FB BB[0000]                reloc	mov bx, relocateddata
  1078                                  otherlinkdatarelocation history.segorsel, -2, optional
  1079 000004FE 85DB                    	test bx, bx
  1080 00000500 74CE                    	jz .missing
  1081 00000502 8E1F                    	mov ds, word [bx]
  1082 00000504 5B                      	pop bx
  1083                                  .not_seg:
  1084 00000505 8B07                    	mov ax, [bx]
  1085 00000507 16                      	 push ss
  1086 00000508 1F                      	 pop ds
  1087 00000509 59                      	pop cx
  1088 0000050A 01C8                    	add ax, cx
  1089 0000050C 01C8                    	add ax, cx
  1090 0000050E 51                      	push cx
  1091 0000050F 40                      	inc ax
  1092 00000510 40                      	inc ax
  1093 00000511 E86405                  	extcallcall decword
  1094 00000514 50                      	push ax
  1095 00000515 BE[2405]                reloc	mov si, msg.history.3
  1096                                  internaldatarelocation
  1097 00000518 E84505                  	extcallcall copy_single_counted_string
  1098 0000051B 89D3                    	mov bx, dx
  1099                                  	getotherds
  1100 0000051D 8B07                    	mov ax, [bx]
  1101                                  	resetds
  1102 0000051F D006[3C01]              reloc	rol byte [history_data_entry], 1
  1103                                  internaldatarelocation
  1104 00000523 730B                    	jnc .not_entry
  1105 00000525 53                      	push bx
  1106 00000526 BB[0000]                reloc	mov bx, relocateddata
  1107                                  otherlinkdatarelocation historybuffer, -2, optional
  1108 00000529 85DB                    	test bx, bx
  1109 0000052B 74A3                    	jz .missing
  1110 0000052D 29D8                    	sub ax, bx
  1111 0000052F 5B                      	pop bx
  1112                                  .not_entry:
  1113 00000530 40                      	inc ax
  1114 00000531 40                      	inc ax
  1115 00000532 E84305                  	extcallcall decword
  1116 00000535 58                      	pop ax
  1117 00000536 5A                      	pop dx
  1118 00000537 85D2                    	test dx, dx
  1119 00000539 7505                    	jnz @F
  1120                                  
  1121 0000053B BE[5F05]                reloc	mov si, msg.history.average.none
  1122                                  internaldatarelocation
  1123 0000053E EB17                    	jmp .string_end
  1124                                  
  1125                                  @@:
  1126 00000540 BE[2D05]                reloc	mov si, msg.history.average.1
  1127                                  internaldatarelocation
  1128 00000543 E81A05                  	extcallcall copy_single_counted_string
  1129                                  
  1130 00000546 31C9                    	xor cx, cx
  1131 00000548 87CA                    	xchg cx, dx
  1132 0000054A F7F1                    	div cx
  1133 0000054C 85D2                    	test dx, dx
  1134 0000054E 7401                    	jz @F
  1135 00000550 40                      	inc ax
  1136                                  @@:
  1137 00000551 E82405                  	extcallcall decword
  1138 00000554 BE[5705]                reloc	mov si, msg.history.average.2
  1139                                  internaldatarelocation
  1140                                  .string_end:
  1141 00000557 E80605                  	extcallcall copy_single_counted_string
  1142 0000055A E83B05                  	extcallcall putsline_crlf
  1143                                  .end:
  1144 0000055D 89EC5D                  	lleave , forcerestoresp
  1145 00000560 C3                      	retn
  1146                                  
  1147                                  
  1148                                  stacksize:
  1149 00000561 BF[0000]                reloc	mov di, relocateddata
  1150                                  linkdatarelocation line_out
  1151 00000564 BB[0000]                reloc	mov bx, relocateddata
  1152                                  otherlinkdatarelocation stack, -2, optional
  1153 00000567 BA[0000]                reloc	mov dx, relocateddata
  1154                                  otherlinkdatarelocation stack_end, -2, optional
  1155 0000056A 85DB                    	test bx, bx
  1156 0000056C 7404                    	jz @F
  1157 0000056E 85D2                    	test dx, dx
  1158 00000570 7505                    	jnz @FF
  1159                                  @@:
  1160 00000572 BE[9505]                reloc	mov si, msg.stack.none
  1161                                  internaldatarelocation
  1162 00000575 EB31                    	jmp .string_end
  1163                                  
  1164                                  @@:
  1165 00000577 BE[AC05]                reloc	mov si, msg.stack.1
  1166                                  internaldatarelocation
  1167 0000057A E8E304                  	extcallcall copy_single_counted_string
  1168 0000057D 89D0                    	mov ax, dx
  1169 0000057F 29D8                    	sub ax, bx
  1170 00000581 E8F404                  	extcallcall decword
  1171 00000584 BE[B905]                reloc	mov si, msg.stack.2
  1172                                  internaldatarelocation
  1173 00000587 E8D604                  	extcallcall copy_single_counted_string
  1174                                  	getotherds
  1175 0000058A 8A07                    	mov al, [bx]
  1176                                  	resetds
  1177 0000058C E81105                  	extcallcall hexbyte
  1178 0000058F BE[D805]                reloc	mov si, msg.stack.3
  1179                                  internaldatarelocation
  1180 00000592 E8CB04                  	extcallcall copy_single_counted_string
  1181 00000595 87FB                    	xchg di, bx
  1182                                  	getotheres
  1183 00000597 B9FFFF                  	mov cx, -1
  1184 0000059A F3AE                    	repe scasb
  1185                                  	resetes
  1186 0000059C F7D1                    	not cx
  1187 0000059E 49                      	dec cx
  1188 0000059F 91                      	xchg ax, cx
  1189 000005A0 87FB                    	xchg di, bx
  1190 000005A2 E8D304                  	extcallcall decword
  1191 000005A5 BE[F405]                reloc	mov si, msg.stack.4
  1192                                  internaldatarelocation
  1193                                  
  1194                                  .string_end:
  1195 000005A8 E8B504                  	extcallcall copy_single_counted_string
  1196 000005AB E8D204                  	extcallcall putsline
  1197 000005AE C3                      	retn
  1198                                  
  1199                                  display_eld_use:
  1200                                  
  1201 000005AF BF[0000]                reloc	mov di, relocateddata
  1202                                  linkdatarelocation line_out
  1203 000005B2 BE[FD05]                reloc	mov si, msg.elduse.1
  1204                                  internaldatarelocation
  1205 000005B5 E8A804                  	extcallcall copy_single_counted_string
  1206                                  	getotherds
  1207 000005B8 A1[0000]                reloc	mov ax, word [relocateddata]
  1208                                  otherlinkdatarelocation extseg_used
  1209                                  	resetds
  1210 000005BB E8EA03                  	call display_ax_hex_and_size
  1211 000005BE 95                      	xchg bp, ax
  1212 000005BF BE[0806]                reloc	mov si, msg.elduse.2
  1213                                  internaldatarelocation
  1214 000005C2 E89B04                  	extcallcall copy_single_counted_string
  1215                                  	getotherds
  1216 000005C5 A1[0000]                reloc	mov ax, word [relocateddata]
  1217                                  otherlinkdatarelocation extseg_size
  1218                                  	resetds
  1219 000005C8 F7DD                    	neg bp
  1220 000005CA 01C5                    	add bp, ax
  1221 000005CC 95                      	xchg bp, ax
  1222 000005CD E8D803                  	call display_ax_hex_and_size
  1223 000005D0 95                      	xchg ax, bp
  1224 000005D1 BE[1006]                reloc	mov si, msg.elduse.2b
  1225                                  internaldatarelocation
  1226 000005D4 E88904                  	extcallcall copy_single_counted_string
  1227 000005D7 E8CE03                  	call display_ax_hex_and_size
  1228                                  
  1229 000005DA BE[1806]                reloc	mov si, msg.elduse.3
  1230                                  internaldatarelocation
  1231 000005DD E88004                  	extcallcall copy_single_counted_string
  1232                                  	getotherds
  1233 000005E0 A1[0000]                reloc	mov ax, word [relocateddata]
  1234                                  otherlinkdatarelocation extdata_used
  1235                                  	resetds
  1236 000005E3 E8C203                  	call display_ax_hex_and_size
  1237 000005E6 95                      	xchg bp, ax
  1238 000005E7 BE[0806]                reloc	mov si, msg.elduse.4
  1239                                  internaldatarelocation
  1240 000005EA E87304                  	extcallcall copy_single_counted_string
  1241                                  	getotherds
  1242 000005ED A1[0000]                reloc	mov ax, word [relocateddata]
  1243                                  otherlinkdatarelocation extdata_size
  1244                                  	resetds
  1245 000005F0 F7DD                    	neg bp
  1246 000005F2 01C5                    	add bp, ax
  1247 000005F4 95                      	xchg bp, ax
  1248 000005F5 E8B003                  	call display_ax_hex_and_size
  1249 000005F8 95                      	xchg ax, bp
  1250 000005F9 BE[1006]                reloc	mov si, msg.elduse.2b
  1251                                  internaldatarelocation
  1252 000005FC E86104                  	extcallcall copy_single_counted_string
  1253 000005FF E8A603                  	call display_ax_hex_and_size
  1254 00000602 BE[2B06]                reloc	mov si, msg.elduse.5
  1255                                  internaldatarelocation
  1256 00000605 E85804                  	extcallcall copy_single_counted_string
  1257 00000608 E88D04                  	extcallcall putsline_crlf
  1258 0000060B C3                      	retn
  1259                                  
  1260                                  
  1261                                  display_eld_memory:
  1262 0000060C BA[3206]                reloc	mov dx, msg.eld.1
  1263                                  internaldatarelocation
  1264 0000060F E81E04                  	extcallcall putsz
  1265                                  
  1266 00000612 31C0                    	xor ax, ax
  1267                                  .loop:
  1268 00000614 BF[0000]                reloc	mov di, relocateddata
  1269                                  linkdatarelocation line_out
  1270                                  	getotherds
  1271 00000617 3906[0000]              reloc	cmp word [relocateddata], ax
  1272                                  otherlinkdatarelocation extseg_used
  1273 0000061B 7719                    	ja @F
  1274                                  
  1275 0000061D 31ED                    	xor bp, bp
  1276 0000061F 8B16[0000]              reloc	mov dx, word [relocateddata]
  1277                                  otherlinkdatarelocation extseg_size
  1278 00000623 29C2                    	sub dx, ax
  1279 00000625 31DB                    	xor bx, bx
  1280 00000627 31C9                    	xor cx, cx
  1281                                  .free:
  1282 00000629 16                      	 push ss
  1283 0000062A 1F                      	 pop ds
  1284 0000062B 51                      	push cx
  1285 0000062C BE[6106]                reloc	mov si, msg.eld.free
  1286                                  internaldatarelocation
  1287 0000062F E82E04                  	extcallcall copy_single_counted_string
  1288 00000632 59                      	pop cx
  1289 00000633 E9A200                  	jmp .have
  1290                                  
  1291                                  @@:
  1292 00000636 BB[0000]                reloc	mov bx, relocateddata
  1293                                  otherlinkdatarelocation extdssel, -2, optional
  1294 00000639 E80404                  	extcallcall ispm
  1295 0000063C 7403                    	jz @F
  1296 0000063E BB[0000]                reloc	mov bx, relocateddata
  1297                                  otherlinkdatarelocation extseg, -2, optional
  1298                                  @@:
  1299 00000641 85DB                    	test bx, bx
  1300 00000643 7509                    	jnz @F
  1301                                  .error:
  1302                                  	resetds
  1303 00000645 BA[4106]                reloc	mov dx, msg.eld.error
  1304                                  internaldatarelocation
  1305 00000648 E8E503                  	extcallcall putsz
  1306 0000064B E9AD00                  	jmp .end
  1307                                  
  1308                                  @@:
  1309 0000064E 8E07                    	mov es, word [bx]
  1310 00000650 89C3                    	mov bx, ax
  1311 00000652 263907                  	cmp word [es:bx + eldiStartCode], ax
  1312 00000655 75EE                    	jne .error
  1313 00000657 89C2                    	mov dx, ax
  1314 00000659 83C220                  	add dx, ELD_INSTANCE_size
  1315 0000065C 72E7                    	jc .error
  1316 0000065E 26395702                	cmp word [es:bx + eldiEndCode], dx
  1317 00000662 72E1                    	jb .error
  1318 00000664 8B16[0000]              reloc	mov dx, word [relocateddata]
  1319                                  otherlinkdatarelocation extseg_used
  1320 00000668 26395702                	cmp word [es:bx + eldiEndCode], dx
  1321 0000066C 77D7                    	ja .error
  1322 0000066E 740B                    	je @F
  1323 00000670 83EA20                  	sub dx, ELD_INSTANCE_size
  1324 00000673 72D0                    	jc .error
  1325 00000675 26395702                	cmp word [es:bx + eldiEndCode], dx
  1326 00000679 77CA                    	ja .error
  1327                                  @@:
  1328 0000067B 268B5702                	mov dx, word [es:bx + eldiEndCode]
  1329 0000067F 89D5                    	mov bp, dx
  1330 00000681 29C2                    	sub dx, ax
  1331 00000683 72C0                    	jc .error
  1332 00000685 26FF7704                	push word [es:bx + eldiStartData]
  1333 00000689 53                      	push bx
  1334 0000068A 268B5F06                	mov bx, word [es:bx + eldiEndData]
  1335 0000068E 5E                      	pop si
  1336 0000068F 26F6441001              	testopt [es:si + eldiFlags], eldifResident
  1337 00000694 8D7408                  	lea si, [si + eldiIdentifier]
  1338 00000697 06                      	push es
  1339 00000698 1F                      	pop ds
  1340 00000699 16                      	 push ss
  1341 0000069A 07                      	 pop es
  1342 0000069B 59                      	pop cx
  1343 0000069C 7537                    	jnz .nonfree
  1344                                  
  1345 0000069E 51                      	push cx
  1346 0000069F 1E                      	push ds
  1347 000006A0 56                      	push si
  1348 000006A1 16                      	 push ss
  1349 000006A2 1F                      	 pop ds
  1350 000006A3 BE[6106]                reloc	mov si, msg.eld.free
  1351                                  internaldatarelocation
  1352 000006A6 E8B703                  	extcallcall copy_single_counted_string
  1353                                  
  1354 000006A9 BE[7106]                reloc	mov si, msg.eld.2
  1355                                  internaldatarelocation
  1356 000006AC 53                      	push bx
  1357 000006AD E8DD02                  	call display_eld_size
  1358 000006B0 5B                      	pop bx
  1359                                  
  1360 000006B1 BE[6C06]                reloc	mov si, msg.eld.free.2
  1361                                  internaldatarelocation
  1362 000006B4 E8A903                  	extcallcall copy_single_counted_string
  1363                                  
  1364 000006B7 5E                      	pop si
  1365 000006B8 1F                      	pop ds
  1366                                  
  1367 000006B9 E80900                  	call .copyname
  1368                                  
  1369 000006BC BE[6F06]                reloc	mov si, msg.eld.free.3
  1370                                  internaldatarelocation
  1371 000006BF E89E03                  	extcallcall copy_single_counted_string
  1372                                  
  1373 000006C2 59                      	pop cx
  1374                                  
  1375 000006C3 EB1B                    	jmp .havedata
  1376                                  
  1377                                  .copyname:
  1378 000006C5 51                      	push cx
  1379 000006C6 50                      	push ax
  1380 000006C7 B022                    	mov al, '"'
  1381 000006C9 AA                      	stosb
  1382 000006CA B90400                  	mov cx, 4
  1383 000006CD F3A5                    	rep movsw
  1384 000006CF AA                      	stosb
  1385 000006D0 58                      	pop ax
  1386 000006D1 16                      	 push ss
  1387 000006D2 1F                      	 pop ds
  1388 000006D3 59                      	pop cx
  1389 000006D4 C3                      	retn
  1390                                  
  1391                                  .nonfree:
  1392 000006D5 E8EDFF                  	call .copyname
  1393                                  
  1394                                  .have:
  1395 000006D8 BE[7106]                reloc	mov si, msg.eld.2
  1396                                  internaldatarelocation
  1397 000006DB 53                      	push bx
  1398 000006DC E8AE02                  	call display_eld_size
  1399 000006DF 5B                      	pop bx
  1400                                  
  1401                                  .havedata:
  1402 000006E0 89D8                    	mov ax, bx
  1403 000006E2 29C8                    	sub ax, cx
  1404 000006E4 7409                    	jz .next
  1405 000006E6 92                      	xchg dx, ax
  1406 000006E7 89C8                    	mov ax, cx
  1407 000006E9 BE[8F06]                reloc	mov si, msg.eld.5
  1408                                  internaldatarelocation
  1409 000006EC E89E02                  	call display_eld_size
  1410                                  
  1411                                  .next:
  1412 000006EF E8A603                  	extcallcall putsline_crlf
  1413 000006F2 85ED                    	test bp, bp
  1414 000006F4 89E8                    	mov ax, bp
  1415 000006F6 7403E919FF              	jnz .loop
  1416                                  .end:
  1417                                  
  1418 000006FB BF[0000]                reloc	mov di, relocateddata
  1419                                  linkdatarelocation line_out
  1420                                  	getotherds
  1421 000006FE A1[0000]                reloc	mov ax, word [relocateddata]
  1422                                  otherlinkdatarelocation extdata_used
  1423 00000701 8B16[0000]              reloc	mov dx, word [relocateddata]
  1424                                  otherlinkdatarelocation extdata_size
  1425 00000705 29C2                    	sub dx, ax
  1426 00000707 740D                    	jz @F
  1427 00000709 0306[0000]              reloc	add ax, [relocateddata]
  1428                                  otherlinkdatarelocation extdata
  1429 0000070D BE[A906]                reloc	mov si, msg.eld.6
  1430                                  internaldatarelocation
  1431                                  	resetds
  1432 00000710 E87A02                  	call display_eld_size
  1433 00000713 E88203                  	extcallcall putsline_crlf
  1434                                  @@:
  1435                                  	resetds
  1436 00000716 C3                      	retn
  1437                                  
  1438                                  
  1439                                  display_eld_variables:
  1440 00000717 BF[0000]                reloc	mov di, relocateddata
  1441                                  linkdatarelocation line_out
  1442                                  
  1443 0000071A BE[C106]                reloc	mov si, msg.var.format
  1444                                  internaldatarelocation
  1445 0000071D E84003                  	extcallcall copy_single_counted_string
  1446                                  
  1447 00000720 B8[0000]                reloc	mov ax, relocateddata
  1448                                  otherlinkdatarelocation ext_var_format
  1449 00000723 83F801                  	cmp ax, 1
  1450 00000726 740F                    	je .known
  1451                                  
  1452                                  .unknown:
  1453 00000728 BF[3307]                reloc	mov di, msg.varunknown.format
  1454                                  internaldatarelocation
  1455 0000072B E84203                  	extcallcall hexword
  1456                                  
  1457 0000072E BA[1407]                reloc	mov dx, msg.varunknown
  1458                                  internaldatarelocation
  1459 00000731 E8FC02                  	extcallcall putsz
  1460 00000734 E9B100                  	jmp .end
  1461                                  
  1462                                  .known:
  1463 00000737 E83603                  	extcallcall hexword
  1464                                  
  1465 0000073A BE[D706]                reloc	mov si, msg.var.size
  1466                                  internaldatarelocation
  1467 0000073D E82003                  	extcallcall copy_single_counted_string
  1468                                  
  1469 00000740 B8[0000]                reloc	mov ax, relocateddata
  1470                                  otherlinkdatarelocation ext_var_size
  1471                                  
  1472 00000743 E82A03                  	extcallcall hexword
  1473 00000746 92                      	xchg dx, ax
  1474                                  
  1475 00000747 BE[EA06]                reloc	mov si, msg.var.amount
  1476                                  internaldatarelocation
  1477 0000074A E81303                  	extcallcall copy_single_counted_string
  1478                                  
  1479 0000074D 31DB                    	xor bx, bx
  1480 0000074F B9[0000]                reloc	mov cx, relocateddata
  1481                                  otherlinkdatarelocation ext_var_amount
  1482 00000752 51                      	push cx
  1483 00000753 E313                    	jcxz .donecount
  1484                                  
  1485 00000755 57                      	push di
  1486 00000756 BF[0000]                reloc	mov di, relocateddata
  1487                                  otherlinkdatarelocation ext_var
  1488 00000759 BE[0000]                reloc	mov si, relocateddata
  1489                                  otherlinkdatarelocation isvariable_morebyte_nameheaders.ext
  1490                                  	getotherds
  1491                                  .loopcount:
  1492 0000075C 833D00                  	cmp word [di], 0
  1493 0000075F 7401                    	je .nextcount
  1494 00000761 43                      	inc bx
  1495                                  .nextcount:
  1496 00000762 01D7                    	add di, dx
  1497 00000764 AD                      	lodsw
  1498 00000765 E2F5                    	loop .loopcount
  1499 00000767 5F                      	pop di
  1500                                  .donecount:
  1501                                  	resetds
  1502                                  
  1503 00000768 93                      	xchg ax, bx
  1504 00000769 E80C03                  	extcallcall decword
  1505                                  
  1506 0000076C BE[0407]                reloc	mov si, msg.var.amountbetween
  1507                                  internaldatarelocation
  1508 0000076F E8EE02                  	extcallcall copy_single_counted_string
  1509                                  
  1510 00000772 58                      	pop ax
  1511 00000773 E80203                  	extcallcall decword
  1512 00000776 50                      	push ax
  1513                                  
  1514 00000777 BE[0D07]                reloc	mov si, msg.var.amountafter
  1515                                  internaldatarelocation
  1516 0000077A E8E302                  	extcallcall copy_single_counted_string
  1517 0000077D 52                      	push dx
  1518 0000077E E81703                  	extcallcall putsline_crlf
  1519 00000781 5A                      	pop dx
  1520 00000782 59                      	pop cx
  1521                                  
  1522 00000783 BB[0000]                reloc	mov bx, relocateddata
  1523                                  otherlinkdatarelocation ext_var
  1524 00000786 BE[0000]                reloc	mov si, relocateddata
  1525                                  otherlinkdatarelocation isvariable_morebyte_nameheaders.ext
  1526                                  
  1527                                  	getotherds
  1528 00000789 E35D                    	jcxz .donelist
  1529                                  .looplist:
  1530 0000078B 833F00                  	cmp word [bx], 0
  1531 0000078E 7453                    	je .nextlist
  1532 00000790 51                      	push cx
  1533 00000791 56                      	push si
  1534                                  
  1535 00000792 BF[0000]                reloc	mov di, relocateddata
  1536                                  linkdatarelocation line_out
  1537                                  
  1538                                  	resetds
  1539 00000795 BE[3B07]                reloc	mov si, msg.var.list.flags
  1540                                  internaldatarelocation
  1541 00000798 E8C502                  	extcallcall copy_single_counted_string
  1542                                  
  1543                                  	getotherds
  1544 0000079B 8B4702                  	mov ax, word [bx + ivFlags]
  1545 0000079E E8CF02                  	extcallcall hexword
  1546                                  
  1547                                  	resetds
  1548 000007A1 BE[4207]                reloc	mov si, msg.var.list.array
  1549                                  internaldatarelocation
  1550 000007A4 E8B902                  	extcallcall copy_single_counted_string
  1551                                  
  1552                                  	getotherds
  1553 000007A7 8A4708                  	mov al, byte [bx + ivArrayLast]
  1554 000007AA E8F302                  	extcallcall hexbyte
  1555                                  
  1556 000007AD 8A4709                  	mov al, byte [bx + ivArrayBetween]
  1557                                  	resetds
  1558 000007B0 84C0                    	test al, al
  1559 000007B2 7409                    	jz @F
  1560                                  
  1561 000007B4 BE[4B07]                reloc	mov si, msg.var.list.between
  1562                                  internaldatarelocation
  1563 000007B7 E8A602                  	extcallcall copy_single_counted_string
  1564                                  
  1565 000007BA E8E302                  	extcallcall hexbyte
  1566                                  @@:
  1567                                  
  1568 000007BD BE[5607]                reloc	mov si, msg.var.list.name
  1569                                  internaldatarelocation
  1570 000007C0 E89D02                  	extcallcall copy_single_counted_string
  1571                                  
  1572 000007C3 5E                      	pop si
  1573                                  	getotherds
  1574 000007C4 A5                      	movsw
  1575 000007C5 56                      	push si
  1576                                  
  1577 000007C6 8B37                    	mov si, word [bx + ivName]
  1578 000007C8 8B4F02                  	mov cx, word [bx + ivFlags]
  1579 000007CB 83E10F                  	and cx, ivfNameLengthMask
  1580 000007CE F3A4                    	rep movsb
  1581                                  
  1582 000007D0 53                      	push bx
  1583 000007D1 52                      	push dx
  1584                                  
  1585 000007D2 8B4704                  	mov ax, word [bx + ivAddress]
  1586                                  	resetds
  1587 000007D5 BE[5F07]                reloc	mov si, msg.var.list.entry
  1588                                  internaldatarelocation
  1589 000007D8 E85101                  	call display_entry_and_instance
  1590                                  
  1591 000007DB E8BA02                  	extcallcall putsline_crlf
  1592 000007DE 5A                      	pop dx
  1593 000007DF 5B                      	pop bx
  1594                                  
  1595 000007E0 5E                      	pop si
  1596 000007E1 59                      	pop cx
  1597 000007E2 A8                      	db __TEST_IMM8		; skip lodsw
  1598                                  .nextlist:
  1599 000007E3 AD                      	lodsw
  1600 000007E4 01D3                    	add bx, dx
  1601 000007E6 E2A3                    	loop .looplist
  1602                                  .donelist:
  1603                                  
  1604                                  .end:
  1605 000007E8 C3                      	retn
  1606                                  
  1607                                  
  1608                                  display_command_handler:
  1609 000007E9 BB[7000]                reloc	mov bx, handlertable.command
  1610                                  internaldatarelocation
  1611 000007EC EB12                    	jmp @F
  1612                                  
  1613                                  display_amis_handler:
  1614 000007EE BB[8600]                reloc	mov bx, handlertable.amis
  1615                                  internaldatarelocation
  1616 000007F1 EB0D                    	jmp @F
  1617                                  
  1618                                  display_asm_handler:
  1619 000007F3 BB[9200]                reloc	mov bx, handlertable.asm
  1620                                  internaldatarelocation
  1621 000007F6 EB08                    	jmp @F
  1622                                  
  1623                                  display_puts_handler:
  1624 000007F8 BB[A800]                reloc	mov bx, handlertable.puts
  1625                                  internaldatarelocation
  1626 000007FB EB03                    	jmp @F
  1627                                  
  1628                                  display_inject_handler:
  1629 000007FD BB[C800]                reloc	mov bx, handlertable.inject
  1630                                  internaldatarelocation
  1631                                  @@:
  1632                                  
  1633                                  display_handlers:
  1634                                  	houdini
  1635                                  	lframe
  1636 00000800 5589E5                  	lenter
  1637 00000803 53                      	 push bx
  1638                                  	lvar word, table
  1639 00000804 EB06                    	jmp @F
  1640                                  
  1641                                  .next_table:
  1642 00000806 BA[BB07]                reloc	mov dx, msg.handler.init.pre
  1643                                  internaldatarelocation
  1644 00000809 E82402                  	extcallcall putsz
  1645                                  @@:
  1646 0000080C 8B17                    	mov dx, word [bx + htMessage]
  1647 0000080E E81F02                  	extcallcall putsz
  1648 00000811 BA[BE07]                reloc	mov dx, msg.handler.init.post
  1649                                  internaldatarelocation
  1650 00000814 E81902                  	extcallcall putsz
  1651                                  
  1652 00000817 8B17                    	mov dx, word [bx + htMessage]
  1653 00000819 8B5F02                  	mov bx, word [bx + htHandler]
  1654 0000081C 85DB                    	test bx, bx
  1655 0000081E 7510                    	jnz @F
  1656 00000820 52                      	push dx
  1657 00000821 BA[F407]                reloc	mov dx, msg.handler.notpresent.pre
  1658                                  internaldatarelocation
  1659 00000824 E80902                  	extcallcall putsz
  1660 00000827 5A                      	pop dx
  1661 00000828 E80502                  	extcallcall putsz
  1662 0000082B BA[F907]                reloc	mov dx, msg.handler.notpresent.post
  1663                                  internaldatarelocation
  1664 0000082E EB14                    	jmp .putsz_end
  1665                                  
  1666                                  @@:
  1667                                  	getotherds
  1668 00000830 8B1F                    	mov bx, [bx]
  1669                                  	resetds
  1670 00000832 85DB                    	test bx, bx
  1671 00000834 7514                    	jnz @F
  1672 00000836 52                      	push dx
  1673 00000837 BA[CB07]                reloc	mov dx, msg.handler.none.pre
  1674                                  internaldatarelocation
  1675 0000083A E8F301                  	extcallcall putsz
  1676 0000083D 5A                      	pop dx
  1677 0000083E E8EF01                  	extcallcall putsz
  1678 00000841 BA[DE07]                reloc	mov dx, msg.handler.none.post
  1679                                  internaldatarelocation
  1680                                  .putsz_end:
  1681 00000844 E8E901                  	extcallcall putsz
  1682 00000847 E99A00                  	jmp .end
  1683                                  
  1684                                  @@:
  1685                                  .loop:
  1686 0000084A 16                      	push ss
  1687 0000084B 07                      	pop es
  1688 0000084C 53                      	push bx
  1689 0000084D BF[0000]                reloc	mov di, relocateddata
  1690                                  linkdatarelocation line_out
  1691 00000850 93                      	xchg ax, bx
  1692 00000851 BE[B307]                reloc	mov si, msg.commandhandler.entry
  1693                                  internaldatarelocation
  1694 00000854 E8D500                  	call display_entry_and_instance
  1695 00000857 E83E02                  	extcallcall putsline_crlf
  1696 0000085A 5B                      	pop bx
  1697 0000085B E86DF8                  	call get_es_ext_other
  1698                                  	houdini
  1699 0000085E 8B76FE                  	mov si, word [bp + ?table]
  1700 00000861 F6440802                	testopt [si + htFlags], htfIsInject
  1701 00000865 757D                    	jnz .end
  1702 00000867 F6440801                	testopt [si + htFlags], htfIsAMIS
  1703 0000086B 7417                    	jz .notamis
  1704 0000086D 26813FEB03              	cmp word [es:bx], 03EBh
  1705 00000872 755A                    	jne .error
  1706 00000874 26807F02E9              	cmp byte [es:bx + 2], 0E9h
  1707 00000879 7417                    	je .next
  1708 0000087B 26807F02CB              	cmp byte [es:bx + 2], 0CBh	; retf
  1709 00000880 754C                    	jne .error
  1710 00000882 EB60                    	jmp .end
  1711                                  
  1712                                  .notamis:
  1713 00000884 26813FEB08              	cmp word [es:bx], 08EBh
  1714 00000889 7543                    	jne .error
  1715 0000088B 26807F02E9              	cmp byte [es:bx + 2], 0E9h
  1716 00000890 7509                    	jne @F
  1717                                  .next:
  1718 00000892 26035F03                	add bx, word [es:bx + 2 + 1]
  1719 00000896 83C305                  	add bx, 2 + 3
  1720 00000899 EBAF                    	jmp .loop
  1721                                  
  1722                                  @@:
  1723                                  %if ! _OTHER
  1724 0000089B 8B7404                  	mov si, word [si + htTemplate]	; cs:si -> template
  1725 0000089E B90700                  	mov cx, template_size
  1726 000008A1 83EC08                  	sub sp, fromwords(words(template_size))
  1727 000008A4 0E                      	push cs
  1728 000008A5 1F                      	pop ds				; ds:si -> template
  1729 000008A6 89E7                    	mov di, sp			; ss:di -> stack
  1730 000008A8 06                      	push es
  1731 000008A9 16                      	 push ss
  1732 000008AA 07                      	 pop es				; es:di
  1733 000008AB 51                      	 push cx
  1734 000008AC F3A4                    	rep movsb
  1735 000008AE 59                      	 pop cx				; restore template length
  1736 000008AF 07                      	pop es				; => ELD instance
  1737 000008B0 16                      	push ss
  1738 000008B1 1F                      	pop ds				; reset ds
  1739 000008B2 89E6                    	mov si, sp			; ds:si -> template on stack
  1740 000008B4 8B4401                  	mov ax, [si + 1]
  1741 000008B7 8B7EFE                  	mov di, word [bp + ?table]
  1742 000008BA 034504                  	add ax, word [di + htTemplate]	; change to (biased) absolute offset
  1743 000008BD 8D7F02                  	lea di, [bx + 2]		; es:di -> downlink
  1744 000008C0 29F8                    	sub ax, di			; change to rel16 displacement
  1745 000008C2 894401                  	mov word [si + 1], ax		; enter into template
  1746 000008C5 8D4408                  	lea ax, [si + fromwords(words(template_size))]
  1747                                  					; -> prior stack
  1748 000008C8 F3A6                    	rep cmpsb			; does it match expected downlink ?
  1749 000008CA 89C4                    	mov sp, ax			; reset stack
  1750                                  %else
  1751                                  	cmp byte [es:bx + 2], 0E8h
  1752                                  	jne .error
  1753                                  	mov ax, word [si + htReturn]
  1754                                  	cmp word [es:bx + 2 + 1 + 4], ax
  1755                                  %endif
  1756 000008CC 7416                    	je .end
  1757                                  .error:
  1758 000008CE 16                      	push ss
  1759 000008CF 07                      	pop es
  1760 000008D0 8B5EFE                  	mov bx, word [bp + ?table]
  1761 000008D3 BA[1208]                reloc	mov dx, msg.handler.error.pre
  1762                                  internaldatarelocation
  1763 000008D6 E85701                  	extcallcall putsz
  1764 000008D9 8B17                    	mov dx, word [bx + htMessage]
  1765 000008DB E85201                  	extcallcall putsz
  1766 000008DE BA[1408]                reloc	mov dx, msg.handler.error.post
  1767                                  internaldatarelocation
  1768 000008E1 E960FF                  	jmp .putsz_end
  1769                                  
  1770                                  .end:
  1771 000008E4 16                      	push ss
  1772 000008E5 07                      	pop es
  1773 000008E6 8B5EFE                  	mov bx, word [bp + ?table]
  1774 000008E9 83C30A                  	add bx, HANDLERTABLE_size
  1775 000008EC 895EFE                  	mov word [bp + ?table], bx
  1776 000008EF 833F00                  	cmp word [bx], 0
  1777 000008F2 7403E90FFF              	jne .next_table
  1778                                  
  1779 000008F7 89EC5D                  	lleave
  1780                                  emptyfunction:
  1781 000008FA C3                      	retn
  1782                                  
  1783                                  
  1784                                  template_commandhandler:
  1785                                  template:
  1786 000008FB E8[0000]EB020000        	extcall cmd3_not_ext, required	; must NOT be extcallcall
  1787                                  	endarea template
  1788                                  template_preprocesshandler:
  1789 00000902 E8[0000]EB020000        	extcall cmd3_preprocessed, required	; must NOT be extcallcall
  1790                                  template_aabeforehandler:
  1791 00000909 E8[0000]EB020000        	extcall aa_before_getline, optional	; must NOT be extcallcall
  1792                                  template_aaafterhandler:
  1793 00000910 E8[0000]EB020000        	extcall aa_after_getline, optional	; must NOT be extcallcall
  1794                                  template_putshandler:
  1795 00000917 E8[0000]EB020000        	extcall puts_ext_done, required		; must NOT be extcallcall
  1796                                  template_putscohandler:
  1797 0000091E E8[0000]EB020000        	extcall puts_copyoutput_ext_done, required
  1798                                  				; must NOT be extcallcall
  1799                                  template_putsgetlinehandler:
  1800 00000925 E8[0000]EB020000        	extcall puts_getline_ext_done, required
  1801                                  				; must NOT be extcallcall
  1802                                  
  1803                                  
  1804                                  display_entry_and_instance:
  1805 0000092C E83101                  	extcallcall copy_single_counted_string
  1806 0000092F E83E01                  	extcallcall hexword
  1807                                  
  1808 00000932 92                      	xchg dx, ax
  1809                                  
  1810 00000933 E895F7                  	call get_es_ext_other
  1811 00000936 31F6                    	xor si, si
  1812 00000938 31DB                    	xor bx, bx
  1813                                  .loop:
  1814                                  	getotherds
  1815 0000093A 3B36[0000]              reloc	cmp si, word [relocateddata]
  1816                                  otherlinkdatarelocation extseg_used
  1817                                  	resetds
  1818 0000093E 7343                    	jae .notfound
  1819 00000940 263B34                  	cmp si, [es:si + eldiStartCode]
  1820 00000943 7543                    	jne .error
  1821 00000945 8D5C20                  	lea bx, [si + ELD_INSTANCE_size]
  1822 00000948 263B5C02                	cmp bx, word [es:si + eldiEndCode]
  1823 0000094C 773A                    	ja .error
  1824 0000094E 268B5C02                	mov bx, word [es:si + eldiEndCode]
  1825 00000952 39D3                    	cmp bx, dx
  1826 00000954 7432                    	je .error
  1827 00000956 7704                    	ja .found
  1828                                  .next:
  1829 00000958 89DE                    	mov si, bx
  1830 0000095A EBDE                    	jmp .loop
  1831                                  
  1832                                  .found:
  1833 0000095C 06                      	push es				; stack => ext seg
  1834 0000095D 96                      	xchg ax, si			; ax -> instance
  1835 0000095E 16                      	 push ss
  1836 0000095F 07                      	 pop es
  1837 00000960 BE[6A07]                reloc	mov si, msg.instance.1
  1838                                  internaldatarelocation
  1839 00000963 E8FA00                  	extcallcall copy_single_counted_string
  1840 00000966 E80701                  	extcallcall hexword		; write offset -> instance
  1841                                  
  1842 00000969 BE[7707]                reloc	mov si, msg.instance.2
  1843                                  internaldatarelocation
  1844 0000096C E8F100                  	extcallcall copy_single_counted_string
  1845                                  
  1846 0000096F 96                      	xchg si, ax			; si -> instance
  1847 00000970 8D7408                  	lea si, [si + eldiIdentifier]	; si -> id
  1848 00000973 1F                      	pop ds				; => ext seg
  1849 00000974 B104                    	mov cl, 4			; cx = 4
  1850 00000976 F3A5                    	rep movsw			; copy id
  1851                                  
  1852 00000978 16                      	push ss
  1853 00000979 1F                      	pop ds
  1854                                  
  1855 0000097A BE[8707]                reloc	mov si, msg.instance.3
  1856                                  internaldatarelocation
  1857                                  @@:
  1858 0000097D 16                      	push ss
  1859 0000097E 07                      	pop es
  1860 0000097F E8DE00                  	extcallcall copy_single_counted_string
  1861 00000982 C3                      	retn
  1862                                  
  1863                                  .notfound:
  1864 00000983 BE[8907]                reloc	mov si, msg.instance.notfound
  1865                                  internaldatarelocation
  1866 00000986 EBF5                    	jmp @B
  1867                                  
  1868                                  .error:
  1869 00000988 BE[A007]                reloc	mov si, msg.instance.error
  1870                                  internaldatarelocation
  1871 0000098B EBF0                    	jmp @B
  1872                                  
  1873                                  
  1874                                  		; INP:	si -> first string
  1875                                  		;	ax = start
  1876                                  		;	dx = length
  1877                                  display_eld_size:
  1878 0000098D 51                      	push cx
  1879 0000098E E8CF00                  	extcallcall copy_single_counted_string
  1880 00000991 E8DC00                  	call hexword
  1881 00000994 BE[7F06]                reloc	mov si, msg.eld.3
  1882                                  internaldatarelocation
  1883 00000997 E8C600                  	extcallcall copy_single_counted_string
  1884 0000099A 01D0                    	add ax, dx
  1885 0000099C E8D100                  	call hexword
  1886 0000099F BE[8706]                reloc	mov si, msg.eld.4
  1887                                  internaldatarelocation
  1888 000009A2 E8BB00                  	extcallcall copy_single_counted_string
  1889 000009A5 89D0                    	mov ax, dx
  1890 000009A7 A8                      	db __TEST_IMM8			; skip push
  1891                                  display_ax_hex_and_size:
  1892 000009A8 51                      	push cx
  1893 000009A9 E8C400                  	call hexword
  1894 000009AC BE[C303]                reloc	mov si, msg.size.2
  1895                                  internaldatarelocation
  1896 000009AF E8AE00                  	extcallcall copy_single_counted_string
  1897 000009B2 31D2                    	xor dx, dx
  1898 000009B4 B90100                  	mov cx, 1
  1899 000009B7 BB0900                  	mov bx, 9
  1900 000009BA E8D300                  	extcallcall disp_dxax_times_cx_width_bx_size.store
  1901 000009BD 59                      	pop cx
  1902 000009BE C3                      	retn
  1903                                  
  1904                                  
  1905                                  parasize:
  1906 000009BF BE[BB03]                reloc	mov si, msg.size.1
  1907                                  internaldatarelocation
  1908 000009C2 E89B00                  	extcallcall copy_single_counted_string
  1909 000009C5 B104                    	mov cl, 4
  1910 000009C7 50                      	push ax
  1911 000009C8 89C2                    	mov dx, ax
  1912 000009CA D3C0                    	rol ax, cl
  1913 000009CC A80F                    	test al, 15
  1914 000009CE 7404                    	jz @F
  1915 000009D0 4F                      	dec di
  1916 000009D1 E8D400                  	extcallcall hexnyb
  1917                                  @@:
  1918 000009D4 92                      	xchg ax, dx
  1919 000009D5 D3E0                    	shl ax, cl
  1920 000009D7 E89600                  	extcallcall hexword
  1921 000009DA BE[C303]                reloc	mov si, msg.size.2
  1922                                  internaldatarelocation
  1923 000009DD E88000                  	extcallcall copy_single_counted_string
  1924 000009E0 58                      	pop ax
  1925 000009E1 31D2                    	xor dx, dx
  1926 000009E3 B91000                  	mov cx, 16
  1927 000009E6 BB0900                  	mov bx, 9
  1928 000009E9 E8A400                  	extcallcall disp_dxax_times_cx_width_bx_size.store
  1929 000009EC C3                      	retn
  1930                                  
  1931                                  
  1932                                  		; INP:	dx => end of prior
  1933                                  		;	ax => start of next
  1934                                  gap:
  1935 000009ED 52                      	push dx
  1936 000009EE F7DA                    	neg dx
  1937 000009F0 01C2                    	add dx, ax
  1938 000009F2 BE[2504]                reloc	mov si, msg.gap
  1939                                  internaldatarelocation
  1940 000009F5 E86800                  	extcallcall copy_single_counted_string
  1941 000009F8 58                      	pop ax
  1942 000009F9 E87400                  	extcallcall hexword
  1943 000009FC BE[B803]                reloc	mov si, msg.address.1
  1944                                  internaldatarelocation
  1945 000009FF E85E00                  	extcallcall copy_single_counted_string
  1946 00000A02 92                      	xchg ax, dx
  1947 00000A03 E8B9FF                  	call parasize
  1948 00000A06 E88F00                  	extcallcall putsline_crlf
  1949 00000A09 BF[0000]                reloc	mov di, relocateddata
  1950                                  linkdatarelocation line_out
  1951 00000A0C C3                      	retn
  1952                                  
  1953                                  
  1954 00000A0D 90<rep 3h>E8[0000]-     	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
  1954 00000A13 EB020000C3E8[0000]-
  1954 00000A1B EB020000C3E8[0000]-
  1954 00000A23 EB020000C3E8[0000]-
  1954 00000A2B EB020000C3E8[0000]-
  1954 00000A33 EB020000C3E8[0000]-
  1954 00000A3B EB020000C3E8[0000]-
  1954 00000A43 EB020000C3E8[0000]-
  1954 00000A4B EB020000C3E8[0000]-
  1954 00000A53 EB020000C3E8[0000]-
  1954 00000A5B EB020000C3E8[0000]-
  1954 00000A63 EB020000C3E8[0000]-
  1954 00000A6B EB020000C3E8[0000]-
  1954 00000A73 EB020000C3E8[0000]-
  1954 00000A7B EB020000C3E8[0000]-
  1954 00000A83 EB020000C3E8[0000]-
  1954 00000A8B EB020000C3E8[0000]-
  1954 00000A93 EB020000C3E8[0000]-
  1954 00000A9B EB020000C3E8[0000]-
  1954 00000AA3 EB020000C3E8[0000]-
  1954 00000AAB EB020000C3         
  1955                                  
  1956                                  endinstalled equ ($ + CODEFIXUP + 15) & ~15
  1957                                  
  1958                                  
  1959                                  start:
  1960 00000AB0 8CC3                    	mov bx, es
  1961 00000AB2 16                      	 push ss
  1962 00000AB3 07                      	 pop es
  1963 00000AB4 E859FF                  	call skipcomma
  1964 00000AB7 4E                      	dec si
  1965 00000AB8 BA[0000]                reloc	mov dx, relocateddata
  1966                                  linkdatarelocation msg.install
  1967 00000ABB E85AFF                  	call isstring?
  1968 00000ABE 7440                    	je install
  1969 00000AC0 BA[5409]                reloc	mov dx, msg.keyword_help
  1970                                  internaldatarelocation
  1971 00000AC3 E852FF                  	call isstring?
  1972 00000AC6 7409                    	je help
  1973 00000AC8 E80EF6                  	call run
  1974                                  @@:
  1975 00000ACB E80F00                  	call uninstall_oneshot
  1976 00000ACE 31C0                    	xor ax, ax
  1977 00000AD0 CB                      	retf
  1978                                  
  1979                                  help:
  1980 00000AD1 AC                      	lodsb
  1981 00000AD2 E853FF                  	call chkeol
  1982 00000AD5 BA[5909]                reloc	mov dx, msg.help
  1983                                  internaldatarelocation
  1984 00000AD8 E855FF                  	call putsz
  1985 00000ADB EBEE                    	jmp @B
  1986                                  
  1987                                  
  1988                                  uninstall_oneshot:
  1989 00000ADD 36F606[0000]01          reloc	testopt [ss:relocateddata], 1
  1990                                  linkdatarelocation options7, -3
  1991 00000AE3 751A                    	jnz @F
  1992                                  
  1993 00000AE5 2EA1[0200]              reloc	mov ax, word [cs:code + eldiEndCode]
  1994                                  internalcoderelocation
  1995 00000AE9 2E2B06[0000]            reloc	sub ax, word [cs:code + eldiStartCode]
  1996                                  internalcoderelocation
  1997 00000AEE 2906[0000]              reloc	sub word [relocateddata], ax
  1998                                  linkdatarelocation extseg_used
  1999                                  
  2000 00000AF2 2EA1[0600]              reloc	mov ax, word [cs:code + eldiEndData]
  2001                                  internalcoderelocation
  2002 00000AF6 2E2B06[0400]            reloc	sub ax, word [cs:code + eldiStartData]
  2003                                  internalcoderelocation
  2004 00000AFB 2906[0000]              reloc	sub word [relocateddata], ax
  2005                                  linkdatarelocation extdata_used
  2006                                  @@:
  2007 00000AFF C3                      	retn
  2008                                  
  2009                                  
  2010                                  DATAOFFSET equ CODEOFFSET + code_size
  2011                                  	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
  2012                                  %define DATAFIXUP - datastart + 0
  2013                                  datastart:
  2014                                  PUT_ELD_DATETIME
  2015                                  
  2016                                  %rep _ELD_BUG
  2017                                  	eldstrict off
  2018                                  
  2019                                  	dw msg.ldmem			; missing internaldatarelocation
  2020                                  %endrep
  2021                                  
  2022                                  %if _OTHER
  2023                                  	align 2, db 0
  2024                                  otherds:	dw 0
  2025                                  otherseg:	dw 0
  2026                                  %endif
  2027                                  
  2028                                  	align 8, db 0
  2029                                  table:
  2030                                  .:
  2031 00000000 [B902]                  reloc	dw msg.entryseg
  2032                                  internaldatarelocation
  2033 00000002 [0000]                  reloc	dw relocateddata
  2034                                  otherlinkdatarelocation pspdbg, -2, optional
  2035 00000004 0000                    	dw 0
  2036 00000006 [0000]                  reloc	dw relocateddata
  2037                                  otherlinkdatarelocation entryseg_size, -2, optional
  2038 00000008 [0000]                  reloc	dw relocateddata
  2039                                  otherlinkdatarelocation cssel, -2, optional
  2040                                  
  2041 0000000A [C002]                  reloc	dw msg.messageseg
  2042                                  internaldatarelocation
  2043 0000000C [0000]                  reloc	dw relocateddata
  2044                                  otherlinkdatarelocation messageseg, -2, optional
  2045 0000000E 0000                    	dw 0
  2046 00000010 [0000]                  reloc	dw relocateddata
  2047                                  otherlinkdatarelocation messageseg_size, -2, optional
  2048 00000012 [0000]                  reloc	dw relocateddata
  2049                                  otherlinkdatarelocation messagesel, -2, optional
  2050                                  
  2051 00000014 [1D03]                  reloc	dw msg.auxbuffseg
  2052                                  internaldatarelocation
  2053 00000016 [0000]                  reloc	dw relocateddata
  2054                                  otherlinkdatarelocation auxbuff_segment, -2, optional
  2055 00000018 0000                    	dw 0
  2056 0000001A [0000]                  reloc	dw relocateddata
  2057                                  otherlinkdatarelocation auxbuff_current_size, -2, optional
  2058 0000001C [0000]                  reloc	dw relocateddata
  2059                                  otherlinkdatarelocation auxbuff_segorsel, -2, optional
  2060                                  
  2061 0000001E [3803]                  reloc	dw msg.auxbuffmovableseg
  2062                                  internaldatarelocation
  2063 00000020 [0000]                  reloc	dw relocateddata
  2064                                  otherlinkdatarelocation auxbuff_movable_segment, -2, optional
  2065 00000022 0000                    	dw 0
  2066 00000024 [0000]                  reloc	dw relocateddata
  2067                                  otherlinkdatarelocation auxbuff_movable_current_size, -2, optional
  2068 00000026 [0000]                  reloc	dw relocateddata
  2069                                  otherlinkdatarelocation auxbuff_movable_segorsel, -2, optional
  2070                                  
  2071 00000028 [C902]                  reloc	dw msg.codeseg
  2072                                  internaldatarelocation
  2073 0000002A [0000]                  reloc	dw relocateddata
  2074                                  otherlinkdatarelocation code_seg, -2, optional
  2075 0000002C 0000                    	dw 0
  2076 0000002E [0000]                  reloc	dw relocateddata
  2077                                  otherlinkdatarelocation code_size, -2, optional
  2078 00000030 [0000]                  reloc	dw relocateddata
  2079                                  otherlinkdatarelocation code_sel, -2, optional
  2080                                  
  2081 00000032 [DA02]                  reloc	dw msg.codemovableseg
  2082                                  internaldatarelocation
  2083 00000034 [0000]                  reloc	dw relocateddata
  2084                                  otherlinkdatarelocation code_movable_seg, -2, optional
  2085 00000036 0000                    	dw 0
  2086 00000038 [0000]                  reloc	dw relocateddata
  2087                                  otherlinkdatarelocation code_movable_size, -2, optional
  2088 0000003A [0000]                  reloc	dw relocateddata
  2089                                  otherlinkdatarelocation code_movable_sel, -2, optional
  2090                                  
  2091 0000003C [F202]                  reloc	dw msg.code2seg
  2092                                  internaldatarelocation
  2093 0000003E [0000]                  reloc	dw relocateddata
  2094                                  otherlinkdatarelocation code2_seg, -2, optional
  2095 00000040 0000                    	dw 0
  2096 00000042 [0000]                  reloc	dw relocateddata
  2097                                  otherlinkdatarelocation code2_size, -2, optional
  2098 00000044 [0000]                  reloc	dw relocateddata
  2099                                  otherlinkdatarelocation code2_sel, -2, optional
  2100                                  
  2101 00000046 [0403]                  reloc	dw msg.code2movableseg
  2102                                  internaldatarelocation
  2103 00000048 [0000]                  reloc	dw relocateddata
  2104                                  otherlinkdatarelocation code2_movable_seg, -2, optional
  2105 0000004A 0000                    	dw 0
  2106 0000004C [0000]                  reloc	dw relocateddata
  2107                                  otherlinkdatarelocation code2_movable_size, -2, optional
  2108 0000004E [0000]                  reloc	dw relocateddata
  2109                                  otherlinkdatarelocation code2_movable_sel, -2, optional
  2110                                  
  2111 00000050 [4E03]                  reloc	dw msg.historyseg
  2112                                  internaldatarelocation
  2113 00000052 [0000]                  reloc	dw relocateddata
  2114                                  otherlinkdatarelocation history_segment, -2, optional
  2115 00000054 0000                    	dw 0
  2116 00000056 [0000]                  reloc	dw relocateddata
  2117                                  otherlinkdatarelocation historyseg_size, -2, optional
  2118 00000058 [0000]                  reloc	dw relocateddata
  2119                                  otherlinkdatarelocation history.segorsel, -2, optional
  2120                                  
  2121 0000005A [5703]                  reloc	dw msg.extseg
  2122                                  internaldatarelocation
  2123 0000005C [0000]                  reloc	dw relocateddata
  2124                                  otherlinkdatarelocation extseg, -2, optional
  2125 0000005E 0000                    	dw 0
  2126 00000060 [0000]                  reloc	dw relocateddata
  2127                                  otherlinkdatarelocation extseg_size, -2, optional
  2128 00000062 [0000]                  reloc	dw relocateddata
  2129                                  otherlinkdatarelocation extcssel, -2, optional
  2130                                  
  2131 00000064 [6103]                  reloc	dw msg.envseg
  2132                                  internaldatarelocation
  2133 00000066 [0000]                  reloc	dw relocateddata
  2134                                  otherlinkdatarelocation envseg, -2, optional
  2135 00000068 0000                    	dw 0
  2136 0000006A [0000]                  reloc	dw relocateddata
  2137                                  otherlinkdatarelocation env_size, -2, optional
  2138 0000006C 0000                    	dw 0
  2139                                  .end:
  2140                                  .amount equ (.end - .) / 10
  2141                                  
  2142 0000006E 0000                    	dw 0
  2143                                  
  2144                                  	align 2, db 0
  2145                                  handlertable:
  2146                                  .command:
  2147                                  	istruc HANDLERTABLE
  2148 00000070 [2608]                  at htMessage,reloc	dw msg.commandhandler
  2149                                  internaldatarelocation
  2150 00000072 [0000]                  at htHandler,reloc	dw relocateddata
  2151                                  otherlinkdatarelocation ext_command_handler
  2152 00000074 [FB08]                  at htTemplate,reloc	dw template_commandhandler
  2153                                  internalcoderelocation
  2154 00000076 [0000]                  at htReturn,reloc	dw relocateddata
  2155                                  otherlinkdatarelocation cmd3_not_ext
  2156 00000078 00<rep 2h>              	iend
  2157                                  	istruc HANDLERTABLE
  2158 0000007A [2E08]                  at htMessage,reloc	dw msg.preprocesshandler
  2159                                  internaldatarelocation
  2160 0000007C [0000]                  at htHandler,reloc	dw relocateddata
  2161                                  otherlinkdatarelocation ext_preprocess_handler
  2162 0000007E [0209]                  at htTemplate,reloc	dw template_preprocesshandler
  2163                                  internalcoderelocation
  2164 00000080 [0000]                  at htReturn,reloc	dw relocateddata
  2165                                  otherlinkdatarelocation cmd3_preprocessed
  2166 00000082 00<rep 2h>              	iend
  2167 00000084 0000                    	dw 0
  2168                                  
  2169                                  .amis:
  2170                                  	istruc HANDLERTABLE
  2171 00000086 [3908]                  at htMessage,reloc	dw msg.amishandler
  2172                                  internaldatarelocation
  2173 00000088 [0000]                  at htHandler,reloc	dw relocateddata
  2174                                  otherlinkdatarelocation ext_amis_handler, -2, optional
  2175 0000008A 0000                    at htTemplate,		dw 0
  2176 0000008C 0000                    at htReturn,		dw 0
  2177 0000008E 0100                    at htFlags,		dw htfIsAMIS
  2178                                  	iend
  2179 00000090 0000                    	dw 0
  2180                                  
  2181                                  .asm:
  2182                                  	istruc HANDLERTABLE
  2183 00000092 [3E08]                  at htMessage,reloc	dw msg.aabeforehandler
  2184                                  internaldatarelocation
  2185 00000094 [0000]                  at htHandler,reloc	dw relocateddata
  2186                                  otherlinkdatarelocation ext_aa_before_getline_handler, -2, optional
  2187 00000096 [0909]                  at htTemplate,reloc	dw template_aabeforehandler
  2188                                  internalcoderelocation
  2189 00000098 [0000]                  at htReturn,reloc	dw relocateddata
  2190                                  otherlinkdatarelocation aa_before_getline, -2, optional
  2191 0000009A 00<rep 2h>              	iend
  2192                                  	istruc HANDLERTABLE
  2193 0000009C [4F08]                  at htMessage,reloc	dw msg.aaafterhandler
  2194                                  internaldatarelocation
  2195 0000009E [0000]                  at htHandler,reloc	dw relocateddata
  2196                                  otherlinkdatarelocation ext_aa_after_getline_handler, -2, optional
  2197 000000A0 [1009]                  at htTemplate,reloc	dw template_aaafterhandler
  2198                                  internalcoderelocation
  2199 000000A2 [0000]                  at htReturn,reloc	dw relocateddata
  2200                                  otherlinkdatarelocation aa_after_getline, -2, optional
  2201 000000A4 00<rep 2h>              	iend
  2202 000000A6 0000                    	dw 0
  2203                                  
  2204                                  .puts:
  2205                                  	istruc HANDLERTABLE
  2206 000000A8 [5F08]                  at htMessage,reloc	dw msg.putshandler
  2207                                  internaldatarelocation
  2208 000000AA [0000]                  at htHandler,reloc	dw relocateddata
  2209                                  otherlinkdatarelocation ext_puts_handler
  2210 000000AC [1709]                  at htTemplate,reloc	dw template_putshandler
  2211                                  internalcoderelocation
  2212 000000AE [0000]                  at htReturn,reloc	dw relocateddata
  2213                                  otherlinkdatarelocation puts_ext_done
  2214 000000B0 00<rep 2h>              	iend
  2215                                  	istruc HANDLERTABLE
  2216 000000B2 [7208]                  at htMessage,reloc	dw msg.putscohandler
  2217                                  internaldatarelocation
  2218 000000B4 [0000]                  at htHandler,reloc	dw relocateddata
  2219                                  otherlinkdatarelocation ext_puts_copyoutput_handler
  2220 000000B6 [1E09]                  at htTemplate,reloc	dw template_putscohandler
  2221                                  internalcoderelocation
  2222 000000B8 [0000]                  at htReturn,reloc	dw relocateddata
  2223                                  otherlinkdatarelocation puts_copyoutput_ext_done
  2224 000000BA 00<rep 2h>              	iend
  2225                                  	istruc HANDLERTABLE
  2226 000000BC [8208]                  at htMessage,reloc	dw msg.putsgetlinehandler
  2227                                  internaldatarelocation
  2228 000000BE [0000]                  at htHandler,reloc	dw relocateddata
  2229                                  otherlinkdatarelocation ext_puts_getline_handler
  2230 000000C0 [2509]                  at htTemplate,reloc	dw template_putsgetlinehandler
  2231                                  internalcoderelocation
  2232 000000C2 [0000]                  at htReturn,reloc	dw relocateddata
  2233                                  otherlinkdatarelocation puts_getline_ext_done
  2234 000000C4 00<rep 2h>              	iend
  2235 000000C6 0000                    	dw 0
  2236                                  
  2237                                  .inject:
  2238                                  	istruc HANDLERTABLE
  2239 000000C8 [8F08]                  at htMessage,reloc	dw msg.commandinjecthandler
  2240                                  internaldatarelocation
  2241 000000CA [0000]                  at htHandler,reloc	dw relocateddata
  2242                                  otherlinkdatarelocation ext_inject_handler
  2243 000000CC 0000                    at htTemplate,		dw 0
  2244 000000CE 0000                    at htReturn,		dw 0
  2245 000000D0 0200                    at htFlags,		dw htfIsInject
  2246                                  	iend
  2247                                  	istruc HANDLERTABLE
  2248 000000D2 [9E08]                  at htMessage,reloc	dw msg.aainjecthandler
  2249                                  internaldatarelocation
  2250 000000D4 [0000]                  at htHandler,reloc	dw relocateddata
  2251                                  otherlinkdatarelocation ext_aa_inject_handler, -2, optional
  2252 000000D6 0000                    at htTemplate,		dw 0
  2253 000000D8 0000                    at htReturn,		dw 0
  2254 000000DA 0200                    at htFlags,		dw htfIsInject
  2255                                  	iend
  2256 000000DC 0000                    	dw 0
  2257                                  
  2258                                  	align 2, db 0
  2259                                  store_table:
  2260 000000DE [0000]                  reloc	dw relocateddata
  2261                                  otherlinkdatarelocation patcharea_run, -2, optional
  2262 000000E0 [0000]                  reloc	dw relocateddata
  2263                                  otherlinkdatarelocation patcharea_run.segment, -2, optional
  2264 000000E2 [0000]                  reloc	dw relocateddata
  2265                                  otherlinkdatarelocation patcharea_run.size, -2, optional
  2266 000000E4 [1B09]                  reloc	dw msg.patch_area_run
  2267                                  internaldatarelocation
  2268                                  
  2269 000000E6 [0000]                  reloc	dw relocateddata
  2270                                  otherlinkdatarelocation patcharea_intrtn, -2, optional
  2271 000000E8 [0000]                  reloc	dw relocateddata
  2272                                  otherlinkdatarelocation patcharea_intrtn.segment, -2, optional
  2273 000000EA [0000]                  reloc	dw relocateddata
  2274                                  otherlinkdatarelocation patcharea_intrtn.size, -2, optional
  2275 000000EC [1F09]                  reloc	dw msg.patch_area_intrtn
  2276                                  internaldatarelocation
  2277                                  
  2278 000000EE [0000]                  reloc	dw relocateddata
  2279                                  otherlinkdatarelocation patcharea_pm_exc, -2, optional
  2280 000000F0 [0000]                  reloc	dw relocateddata
  2281                                  otherlinkdatarelocation patcharea_pm_exc.segment, -2, optional
  2282 000000F2 [0000]                  reloc	dw relocateddata
  2283                                  otherlinkdatarelocation patcharea_pm_exc.size, -2, optional
  2284 000000F4 [2E09]                  reloc	dw msg.patch_area_pm_exc
  2285                                  internaldatarelocation
  2286                                  
  2287                                  .end:
  2288                                  
  2289                                  	struc STORETABLEENTRY
  2290 00000000 ????                    steAreaOffset:		resw 1
  2291 00000002 ????                    steAreaSegmentVariable:	resw 1
  2292 00000004 ????                    steAreaLength:		resw 1
  2293 00000006 ????                    steName:		resw 1
  2294                                  	endstruc
  2295                                  
  2296                                  
  2297                                  	align 2, db 0
  2298                                  nountable:
  2299 000000F6 46                      	db msg.all - $ - 1
  2300 000000F7 01                      	db 1
  2301 000000F8 [CB01]                  reloc	dw msg.all_replace
  2302                                  internaldatarelocation
  2303 000000FA 46                      	db msg.allexceptseg - $ - 1
  2304 000000FB 01                      	db 1
  2305 000000FC [EE01]                  reloc	dw msg.allnoseg_replace
  2306                                  internaldatarelocation
  2307 000000FE 67                      	db msg.eldall - $ - 1
  2308 000000FF 01                      	db 1
  2309 00000100 [0D02]                  reloc	dw msg.eldall_replace
  2310                                  internaldatarelocation
  2311 00000102 7C                      	db msg.eldhandlers - $ - 1
  2312 00000103 01                      	db 1
  2313 00000104 [2B02]                  reloc	dw msg.eldhandlers_replace
  2314                                  internaldatarelocation
  2315 00000106 4D                      	db msg.mem - $ - 1
  2316 00000107 00                      	db 0
  2317 00000108 [2A03]                  reloc	dw display_mem
  2318                                  internalcoderelocation
  2319 0000010A 4D                      	db msg.history - $ - 1
  2320 0000010B 00                      	db 0
  2321 0000010C [9104]                  reloc	dw historysize
  2322                                  internalcoderelocation
  2323 0000010E 51                      	db msg.stack - $ - 1
  2324 0000010F 00                      	db 0
  2325 00000110 [6105]                  reloc	dw stacksize
  2326                                  internalcoderelocation
  2327 00000112 5A                      	db msg.eld - $ - 1
  2328 00000113 00                      	db 0
  2329 00000114 [0C06]                  reloc	dw display_eld_memory
  2330                                  internalcoderelocation
  2331 00000116 5A                      	db msg.elduse - $ - 1
  2332 00000117 00                      	db 0
  2333 00000118 [AF05]                  reloc	dw display_eld_use
  2334                                  internalcoderelocation
  2335 0000011A 5D                      	db msg.eldvar - $ - 1
  2336 0000011B 00                      	db 0
  2337 0000011C [1707]                  reloc	dw display_eld_variables
  2338                                  internalcoderelocation
  2339 0000011E 6C                      	db msg.commandhandler_noun - $ - 1
  2340 0000011F 00                      	db 0
  2341 00000120 [E907]                  reloc	dw display_command_handler
  2342                                  internalcoderelocation
  2343 00000122 77                      	db msg.amishandler_noun - $ - 1
  2344 00000123 00                      	db 0
  2345 00000124 [EE07]                  reloc	dw display_amis_handler
  2346                                  internalcoderelocation
  2347 00000126 7F                      	db msg.asmhandler - $ - 1
  2348 00000127 00                      	db 0
  2349 00000128 [F307]                  reloc	dw display_asm_handler
  2350                                  internalcoderelocation
  2351 0000012A 86                      	db msg.putshandler_noun - $ - 1
  2352 0000012B 00                      	db 0
  2353 0000012C [F807]                  reloc	dw display_puts_handler
  2354                                  internalcoderelocation
  2355 0000012E 8E                      	db msg.injecthandler_noun - $ - 1
  2356 0000012F 00                      	db 0
  2357 00000130 [FD07]                  reloc	dw display_inject_handler
  2358                                  internalcoderelocation
  2359 00000132 17                      	db msg.seg - $ - 1
  2360 00000133 00                      	db 0
  2361 00000134 [8901]                  reloc	dw display_seg
  2362                                  internalcoderelocation
  2363 00000136 17                      	db msg.patch - $ - 1
  2364 00000137 00                      	db 0
  2365 00000138 [4402]                  reloc	dw display_patchareas
  2366                                  internalcoderelocation
  2367 0000013A 0000                    	dw 0
  2368                                  
  2369                                  history_data_entry:
  2370 0000013C 00                      	db 0
  2371                                  
  2372                                  msg:
  2373 0000013D 414C4C00                .all:		asciz "ALL"
  2374 00000141 414C4C4E4F53454700      .allexceptseg:	asciz "ALLNOSEG"
  2375 0000014A 53454700                .seg:		asciz "SEG"
  2376 0000014E 504154434800            .patch:		asciz "PATCH"
  2377 00000154 4D454D00                .mem:		asciz "MEM"
  2378 00000158 484953544F525900        .history:	asciz "HISTORY"
  2379 00000160 535441434B00            .stack:		asciz "STACK"
  2380 00000166 454C44414C4C00          .eldall:	asciz "ELDALL"
  2381 0000016D 454C4400                .eld:		asciz "ELD"
  2382 00000171 454C4455534500          .elduse:	asciz "ELDUSE"
  2383 00000178 454C4456415200          .eldvar:	asciz "ELDVAR"
  2384 0000017F 454C4448414E444C45-     .eldhandlers:	asciz "ELDHANDLERS"
  2384 00000188 525300             
  2385 0000018B 434F4D4D414E444841-     .commandhandler_noun:	asciz "COMMANDHANDLER"
  2385 00000194 4E444C455200       
  2386 0000019A 414D495348414E444C-     .amishandler_noun:	asciz "AMISHANDLER"
  2386 000001A3 455200             
  2387 000001A6 41534D48414E444C45-     .asmhandler:		asciz "ASMHANDLER"
  2387 000001AF 5200               
  2388 000001B1 5055545348414E444C-     .putshandler_noun:	asciz "PUTSHANDLER"
  2388 000001BA 455200             
  2389 000001BD 494E4A45435448414E-     .injecthandler_noun:	asciz "INJECTHANDLER"
  2389 000001C6 444C455200         
  2390 000001CB 4D454D205345472048-     .all_replace:		asciz "MEM SEG HISTORY STACK ELDALL PATCH"
  2390 000001D4 4953544F5259205354-
  2390 000001DD 41434B20454C44414C-
  2390 000001E6 4C20504154434800   
  2391 000001EE 4D454D20484953544F-     .allnoseg_replace:	asciz "MEM HISTORY STACK ELDALL PATCH"
  2391 000001F7 525920535441434B20-
  2391 00000200 454C44414C4C205041-
  2391 00000209 54434800           
  2392 0000020D 454C4420454C445553-     .eldall_replace:	asciz "ELD ELDUSE ELDVAR ELDHANDLERS"
  2392 00000216 4520454C4456415220-
  2392 0000021F 454C4448414E444C45-
  2392 00000228 525300             
  2393 0000022B 434F4D4D414E444841-     .eldhandlers_replace:	asciz "COMMANDHANDLER AMISHANDLER ASMHANDLER PUTSHANDLER INJECTHANDLER"
  2393 00000234 4E444C455220414D49-
  2393 0000023D 5348414E444C455220-
  2393 00000246 41534D48414E444C45-
  2393 0000024F 52205055545348414E-
  2393 00000258 444C455220494E4A45-
  2393 00000261 435448414E444C4552-
  2393 0000026A 00                 
  2394 0000026B 4E6F756E202200          .notfound.1:		asciz 'Noun "'
  2395 00000272 22206E6F7420666F75-     .notfound.2:		asciz '" not found!',13,10
  2395 0000027B 6E64210D0A00       
  2396 00000281 4C444D454D00            .ldmem:			asciz "LDMEM",OTH_STRING
  2397 00000287 4C444D454D20756E69-     .uninstall_done:	db "LDMEM",OTH_STRING," uninstalled."
  2397 00000290 6E7374616C6C65642E 
  2398                                  %if _ELD_RECLAIM_HINT
  2399                                  			db " (Don't forget to use reclaim.eld)"
  2400                                  %endif
  2401 00000299 0D0A00                  			asciz 13,10
  2402 0000029C 4C444D454D20756E61-     .uninstall_error:	asciz "LDMEM",OTH_STRING," unable to uninstall!",13,10
  2402 000002A5 626C6520746F20756E-
  2402 000002AE 696E7374616C6C210D-
  2402 000002B7 0A00               
  2403 000002B9 05456E747279            .entryseg:	counted "Entry"
  2404 000002BF 00                      		counted
  2405 000002C0 074D657373616765        .messageseg:	counted "Message"
  2406 000002C8 00                      		counted
  2407 000002C9 0A466972737420636F-     .codeseg:	counted "First code"
  2407 000002D2 6465               
  2408 000002D4 05436F646531            		counted "Code1"
  2409 000002DA 0E466972737420636F-     .codemovableseg:counted "First code (M)"
  2409 000002E3 646520284D29       
  2410 000002E9 08436F646531284D29      		counted "Code1(M)"
  2411 000002F2 0B5365636F6E642063-     .code2seg:	counted "Second code"
  2411 000002FB 6F6465             
  2412 000002FE 05436F646532            		counted "Code2"
  2413                                  .code2movableseg:
  2414 00000304 0F5365636F6E642063-     		counted "Second code (M)"
  2414 0000030D 6F646520284D29     
  2415 00000314 08436F646532284D29      		counted "Code2(M)"
  2416 0000031D 10417578696C696172-     .auxbuffseg:	counted "Auxiliary buffer"
  2416 00000326 7920627566666572   
  2417 0000032E 09417578696C696172-     		counted "Auxiliary"
  2417 00000337 79                 
  2418                                  .auxbuffmovableseg:
  2419 00000338 0E41757820284D2920-     		counted "Aux (M) buffer"
  2419 00000341 627566666572       
  2420 00000347 06417578284D29          		counted "Aux(M)"
  2421 0000034E 07486973746F7279        .historyseg:	counted "History"
  2422 00000356 00                      		counted
  2423 00000357 08454C4420636F6465      .extseg:	counted "ELD code"
  2424 00000360 00                      		counted
  2425 00000361 0B456E7669726F6E6D-     .envseg:	counted "Environment"
  2425 0000036A 656E74             
  2426 0000036D 03456E76                		counted "Env"
  2427 00000371 0A207365676D656E74-     .segment_colon:	counted " segment: "
  2427 0000037A 3A20               
  2428 0000037C 224E6F6E6520285365-     .none:		counted "None (Segment data not available.)"
  2428 00000385 676D656E7420646174-
  2428 0000038E 61206E6F7420617661-
  2428 00000397 696C61626C652E29   
  2429 0000039F 1853697A6520646174-     .nonesize:	counted "Size data not available."
  2429 000003A8 61206E6F7420617661-
  2429 000003B1 696C61626C652E     
  2430 000003B8 022020                  .address.1:	counted "  "
  2431 000003BB 0753697A653A2020        .size.1:	counted "Size:  "
  2432 000003C3 022020                  .size.2:	counted "  "
  2433 000003C6 0C202073656C656374-     .sel:		counted "  selector: "
  2433 000003CF 6F723A20           
  2434 000003D3 15456E7472792F6461-     .dssel:		counted "Entry/data selector: "
  2434 000003DC 74612073656C656374-
  2434 000003E5 6F723A20           
  2435 000003E9 20454C4420636F6465-     .extdssel:	counted "ELD code segment data selector: "
  2435 000003F2 207365676D656E7420-
  2435 000003FB 646174612073656C65-
  2435 00000404 63746F723A20       
  2436 0000040A 546F74616C20616C6C-     .alloc:		fill 26, 32, db "Total allocation: "
  2436 00000413 6F636174696F6E3A20-
  2436 0000041C 20<rep 8h>         
  2437 00000424 00                      		asciz
  2438 00000425 1A                      .gap:		db .gap.end - ($ + 1)
  2439 00000426 4761703A2020-           		fill 26, 32, db "Gap: "
  2439 00000426 <rep 15h>          
  2440                                  .gap.end:
  2441 00000440 4F7665726C6170210D-     .overlap:		asciz "Overlap!",13,10
  2441 00000449 0A00               
  2442 0000044B 4E6F20686973746F72-     .history_none:		asciz "No history format link found.",13,10
  2442 00000454 7920666F726D617420-
  2442 0000045D 6C696E6B20666F756E-
  2442 00000466 642E0D0A00         
  2443 0000046B 486973746F72792069-     .history_data_entry:	asciz "History in data entry section.",13,10
  2443 00000474 6E206461746120656E-
  2443 0000047D 747279207365637469-
  2443 00000486 6F6E2E0D0A00       
  2444 0000048C 486973746F72792069-     .history_separate:	asciz "History in a separate segment.",13,10
  2444 00000495 6E2061207365706172-
  2444 0000049E 617465207365676D65-
  2444 000004A7 6E742E0D0A00       
  2445 000004AD 556E6B6E6F776E2068-     .history_unknown:	asciz "Unknown history format.",13,10
  2445 000004B6 6973746F727920666F-
  2445 000004BF 726D61742E0D0A00   
  2446 000004C7 486973746F7279206C-     .history_missing:	asciz "History last or first displacement or segment missing.",13,10
  2446 000004D0 617374206F72206669-
  2446 000004D9 72737420646973706C-
  2446 000004E2 6163656D656E74206F-
  2446 000004EB 72207365676D656E74-
  2446 000004F4 206D697373696E672E-
  2446 000004FD 0D0A00             
  2447 00000500 11486973746F727920-     .history.1:		counted "History entries: "
  2447 00000509 656E74726965733A20 
  2448 00000512 110D0A486973746F72-     .history.2:		counted 13,10,"History bytes: "
  2448 0000051B 792062797465733A20 
  2449 00000524 082075736564202F20      .history.3:		counted " used / "
  2450 0000052D 2920746F74616C0D0A-     .history.average.1:	counted " total",13,10,"Average history entry size is <= "
  2450 00000536 417665726167652068-
  2450 0000053F 6973746F727920656E-
  2450 00000548 7472792073697A6520-
  2450 00000551 6973203C3D20       
  2451 00000557 072062797465732E        .history.average.2:	counted " bytes."
  2452 0000055F 3520746F74616C0D0A-     .history.average.none:	counted " total",13,10,"Cannot calculate average, no history entries."
  2452 00000568 43616E6E6F74206361-
  2452 00000571 6C63756C6174652061-
  2452 0000057A 7665726167652C206E-
  2452 00000583 6F20686973746F7279-
  2452 0000058C 20656E74726965732E 
  2453 00000595 164E6F20737461636B-     .stack.none:		counted "No stack link found.",13,10
  2453 0000059E 206C696E6B20666F75-
  2453 000005A7 6E642E0D0A         
  2454 000005AC 0C537461636B207369-     .stack.1:		counted "Stack size: "
  2454 000005B5 7A653A20           
  2455 000005B9 1E2062797465730D0A-     .stack.2:		counted " bytes",13,10,"Heuristic match byte: "
  2455 000005C2 486575726973746963-
  2455 000005CB 206D61746368206279-
  2455 000005D4 74653A20           
  2456 000005D8 1B680D0A4865757269-     .stack.3:		counted "h",13,10,"Heuristic unused stack: "
  2456 000005E1 7374696320756E7573-
  2456 000005EA 656420737461636B3A-
  2456 000005F3 20                 
  2457 000005F4 082062797465730D0A      .stack.4:		counted " bytes",13,10
  2458 000005FD 0A454C4420636F6465-     .elduse.1:		counted "ELD code: "
  2458 00000606 3A20               
  2459                                  .elduse.4:
  2460 00000608 0720757365642C20        .elduse.2:		counted " used, "
  2461 00000610 0720667265652C20        .elduse.2b:		counted " free, "
  2462 00000618 1220746F74616C0D0A-     .elduse.3:		counted " total",13,10,"ELD data: "
  2462 00000621 454C4420646174613A-
  2462 0000062A 20                 
  2463 0000062B 0620746F74616C          .elduse.5:		counted " total"
  2464 00000632 4C6F6164656420454C-     .eld.1:			asciz "Loaded ELDs:",13,10
  2464 0000063B 44733A0D0A00       
  2465 00000641 4572726F7220647572-     .eld.error:		asciz "Error during ELD enumeration.",13,10
  2465 0000064A 696E6720454C442065-
  2465 00000653 6E756D65726174696F-
  2465 0000065C 6E2E0D0A00         
  2466 00000661 0A4672656520737061-     .eld.free:		counted "Free space"
  2466 0000066A 6365               
  2467 0000066C 022028                  .eld.free.2:		counted " ("
  2468 0000066F 0129                    .eld.free.3:		counted ")"
  2469 00000671 0D2C20636F64652073-     .eld.2:			counted ", code start "
  2469 0000067A 7461727420         
  2470 0000067F 072C2073746F7020        .eld.3:			counted ", stop "
  2471 00000687 072C2073697A6520        .eld.4:			counted ", size "
  2472 0000068F 19                      .eld.5:			db .eld.5.end - ($ + 1)
  2473 00000690 0D0A                    			db 13,10
  2474 00000692 20<rep Ch>              			times 8 + 2 + 2 db 32
  2475 0000069E 446174612073746172-     			db "Data start "
  2475 000006A7 7420               
  2476                                  .eld.5.end:
  2477 000006A9 174672656520737061-     .eld.6:			counted "Free space, data start "
  2477 000006B2 63652C206461746120-
  2477 000006BB 737461727420       
  2478 000006C1 154578742076617269-     .var.format:		counted "Ext variables format="
  2478 000006CA 61626C657320666F72-
  2478 000006D3 6D61743D           
  2479 000006D7 12682C207374727563-     .var.size:		counted "h, structure size="
  2479 000006E0 747572652073697A65-
  2479 000006E9 3D                 
  2480 000006EA 19680D0A416D6F756E-     .var.amount:		counted "h",13,10,"Amount ext variables: "
  2480 000006F3 742065787420766172-
  2480 000006FC 6961626C65733A20   
  2481 00000704 082075736564202F20      .var.amountbetween:	counted " used / "
  2482 0000070D 0620746F74616C          .var.amountafter:	counted " total"
  2483 00000714 0D0A556E6B6E6F776E-     .varunknown:		db 13,10,"Unknown ext variables format="
  2483 0000071D 206578742076617269-
  2483 00000726 61626C657320666F72-
  2483 0000072F 6D61743D           
  2484 00000733 2D2D2D2D68              .varunknown.format:	db "----h"
  2485 00000738 0D0A                    .linebreak:		db 13,10
  2486 0000073A 00                      .empty:			asciz
  2487 0000073B 06466C6167733D          .var.list.flags:	counted "Flags="
  2488 00000742 08682061727261793D      .var.list.array:	counted "h array="
  2489 0000074B 0A6820626574776565-     .var.list.between:	counted "h between="
  2489 00000754 6E3D               
  2490 00000756 0868206E616D653D22      .var.list.name:		counted "h name=",'"'
  2491 0000075F 0A220D0A20456E7472-     .var.list.entry:	counted '"',13,10," Entry="
  2491 00000768 793D               
  2492 0000076A 0C682C20696E737461-     .instance.1:		counted "h, instance="
  2492 00000773 6E63653D           
  2493 00000777 0F682C206964656E74-     .instance.2:		counted "h, identifier=",'"'
  2493 00000780 69666965723D22     
  2494 00000787 0122                    .instance.3:		counted '"'
  2495 00000789 16682E20496E737461-     .instance.notfound:	counted "h. Instance not found!"
  2495 00000792 6E6365206E6F742066-
  2495 0000079B 6F756E6421         
  2496 000007A0 12682E20496E737461-     .instance.error:	counted "h. Instance error!"
  2496 000007A9 6E6365206572726F72-
  2496 000007B2 21                 
  2497 000007B3 0720456E7472793D        .commandhandler.entry:	counted " Entry="
  2498 000007BB 0D0A00                  .handler.init.pre:	asciz 13,10
  2499 000007BE 2068616E646C657273-     .handler.init.post:	asciz " handlers:",13,10
  2499 000007C7 3A0D0A00           
  2500 000007CB 20456E7472793D3030-     .handler.none.pre:	asciz " Entry=0000h - No "
  2500 000007D4 303068202D204E6F20-
  2500 000007DD 00                 
  2501 000007DE 2068616E646C657220-     .handler.none.post:	asciz " handler installed.",13,10
  2501 000007E7 696E7374616C6C6564-
  2501 000007F0 2E0D0A00           
  2502 000007F4 204E6F2000              .handler.notpresent.pre:	asciz " No "
  2503 000007F9 2068616E646C657220-     .handler.notpresent.post:	asciz " handler hook present.",13,10
  2503 00000802 686F6F6B2070726573-
  2503 0000080B 656E742E0D0A00     
  2504 00000812 2000                    .handler.error.pre:	asciz " "
  2505 00000814 2068616E646C657220-     .handler.error.post:	asciz " handler error!",13,10
  2505 0000081D 6572726F72210D0A00 
  2506 00000826 436F6D6D616E6400        .commandhandler:	asciz "Command"
  2507 0000082E 50726570726F636573-     .preprocesshandler:	asciz "Preprocess"
  2507 00000837 7300               
  2508 00000839 414D495300              .amishandler:		asciz "AMIS"
  2509 0000083E 417373656D626C6572-     .aabeforehandler:	asciz "Assembler before"
  2509 00000847 206265666F726500   
  2510 0000084F 417373656D626C6572-     .aaafterhandler:	asciz "Assembler after"
  2510 00000858 20616674657200     
  2511 0000085F 4D756C74692D707572-     .putshandler:		asciz "Multi-purpose puts"
  2511 00000868 706F73652070757473-
  2511 00000871 00                 
  2512 00000872 434F50594F55545055-     .putscohandler:		asciz "COPYOUTPUT puts"
  2512 0000087B 54207075747300     
  2513 00000882 4745544C494E452070-     .putsgetlinehandler:	asciz "GETLINE puts"
  2513 0000088B 75747300           
  2514 0000088F 436F6D6D616E642069-     .commandinjecthandler:	asciz "Command inject"
  2514 00000898 6E6A65637400       
  2515 0000089E 417373656D626C6572-     .aainjecthandler:	asciz "Assembler inject"
  2515 000008A7 20696E6A65637400   
  2516 000008AF 506174636820617265-     .patch_area.1:		asciz "Patch area, length "
  2516 000008B8 612C206C656E677468-
  2516 000008C1 2000               
  2517 000008C3 2028696E2075736529-     .patch_area.2.inuse:	asciz " (in use), "
  2517 000008CC 2C2000             
  2518 000008CF 202866726565292C20-     .patch_area.2.notinuse:	asciz " (free), "
  2518 000008D8 00                 
  2519 000008D9 656E74727900            .patch_area.3.entry:	asciz "entry"
  2520 000008DF 636F646500              .patch_area.3.code:	asciz "code"
  2521 000008E4 756E6B6E6F776E3D        .patch_area.3.unknown:	db "unknown="
  2522 000008EC 2D2D2D2D6800            .patch_area.3.unknown.s:asciz "----h"
  2523 000008F2 3A                      .patch_area.3.offset:	db ":"
  2524 000008F3 2D2D2D2D682C2000        .patch_area.3.offset.o:	asciz "----h, "
  2525 000008FB 6E616D653A2000          .patch_area.4:		asciz "name: "
  2526 00000902 506174636820617265-     .patch_area.5:		asciz "Patch area not present: "
  2526 0000090B 61206E6F7420707265-
  2526 00000914 73656E743A2000     
  2527 0000091B 52756E00                .patch_area_run:	asciz "Run"
  2528 0000091F 3836204D6F64652069-     .patch_area_intrtn:	asciz "86 Mode intrtn"
  2528 00000928 6E7472746E00       
  2529 0000092E 50726F746563746564-     .patch_area_pm_exc:	asciz "Protected Mode exc"
  2529 00000937 204D6F646520657863-
  2529 00000940 00                 
  2530                                  
  2531                                  uinit_data: equ $
  2532 00000941 4C444D454D20696E73-     .installed:		asciz "LDMEM",OTH_STRING," installed.",13,10
  2532 0000094A 74616C6C65642E0D0A-
  2532 00000953 00                 
  2533 00000954 48454C5000              .keyword_help:		asciz "HELP"
  2534 00000959 5468697320454C4420-     .help:		db "This ELD can be installed residently or used transiently.",13,10
  2534 00000962 63616E20626520696E-
  2534 0000096B 7374616C6C65642072-
  2534 00000974 65736964656E746C79-
  2534 0000097D 206F72207573656420-
  2534 00000986 7472616E7369656E74-
  2534 0000098F 6C792E0D0A         
  2535 00000994 0D0A                    		db 13,10
  2536 00000996 416E79206E756D6265-     		db "Any number of keywords can be passed to this ELD to choose output:",13,10
  2536 0000099F 72206F66206B657977-
  2536 000009A8 6F7264732063616E20-
  2536 000009B1 626520706173736564-
  2536 000009BA 20746F207468697320-
  2536 000009C3 454C4420746F206368-
  2536 000009CC 6F6F7365206F757470-
  2536 000009D5 75743A0D0A         
  2537 000009DA 09286E6F6E65290909-     		db 9,"(none)",9,9,"Alias to ALLNOSEG",13,10
  2537 000009E3 416C69617320746F20-
  2537 000009EC 414C4C4E4F5345470D-
  2537 000009F5 0A                 
  2538 000009F6 09414C4C0909446973-     		db 9,"ALL",9,9,"Display all output",13,10
  2538 000009FF 706C617920616C6C20-
  2538 00000A08 6F75747075740D0A   
  2539 00000A10 09414C4C4E4F534547-     		db 9,"ALLNOSEG",9,"Display all output except SEG",13,10
  2539 00000A19 09446973706C617920-
  2539 00000A22 616C6C206F75747075-
  2539 00000A2B 742065786365707420-
  2539 00000A34 5345470D0A         
  2540 00000A39 09454C44414C4C0909-     		db 9,"ELDALL",9,9,"Display all ELD output",13,10
  2540 00000A42 446973706C61792061-
  2540 00000A4B 6C6C20454C44206F75-
  2540 00000A54 747075740D0A       
  2541 00000A5A 09454C4448414E444C-     		db 9,"ELDHANDLERS",9,"Display all ELD handlers",13,10
  2541 00000A63 45525309446973706C-
  2541 00000A6C 617920616C6C20454C-
  2541 00000A75 442068616E646C6572-
  2541 00000A7E 730D0A             
  2542 00000A81 094D454D0909446973-     		db 9,"MEM",9,9,"Display memory areas with segments/selectors",13,10
  2542 00000A8A 706C6179206D656D6F-
  2542 00000A93 727920617265617320-
  2542 00000A9C 77697468207365676D-
  2542 00000AA5 656E74732F73656C65-
  2542 00000AAE 63746F72730D0A     
  2543 00000AB5 095345470909446973-     		db 9,"SEG",9,9,"Display segments/selectors mostly on one line",13,10
  2543 00000ABE 706C6179207365676D-
  2543 00000AC7 656E74732F73656C65-
  2543 00000AD0 63746F7273206D6F73-
  2543 00000AD9 746C79206F6E206F6E-
  2543 00000AE2 65206C696E650D0A   
  2544 00000AEA 09484953544F525909-     		db 9,"HISTORY",9,9,"Display history utilisation",13,10
  2544 00000AF3 09446973706C617920-
  2544 00000AFC 686973746F72792075-
  2544 00000B05 74696C69736174696F-
  2544 00000B0E 6E0D0A             
  2545 00000B11 09535441434B090944-     		db 9,"STACK",9,9,"Display stack utilisation",13,10
  2545 00000B1A 6973706C6179207374-
  2545 00000B23 61636B207574696C69-
  2545 00000B2C 736174696F6E0D0A   
  2546 00000B34 09454C440909446973-     		db 9,"ELD",9,9,"Display ELD code instances and data blocks use",13,10
  2546 00000B3D 706C617920454C4420-
  2546 00000B46 636F646520696E7374-
  2546 00000B4F 616E63657320616E64-
  2546 00000B58 206461746120626C6F-
  2546 00000B61 636B73207573650D0A 
  2547 00000B6A 09454C445553450909-     		db 9,"ELDUSE",9,9,"Display ELD memory space use lines",13,10
  2547 00000B73 446973706C61792045-
  2547 00000B7C 4C44206D656D6F7279-
  2547 00000B85 207370616365207573-
  2547 00000B8E 65206C696E65730D0A 
  2548 00000B97 09454C445641520909-     		db 9,"ELDVAR",9,9,"Display ELD variables",13,10
  2548 00000BA0 446973706C61792045-
  2548 00000BA9 4C4420766172696162-
  2548 00000BB2 6C65730D0A         
  2549 00000BB7 09434F4D4D414E4448-     		db 9,"COMMANDHANDLER",9,"Display ELD command and preprocess handlers",13,10
  2549 00000BC0 414E444C4552094469-
  2549 00000BC9 73706C617920454C44-
  2549 00000BD2 20636F6D6D616E6420-
  2549 00000BDB 616E64207072657072-
  2549 00000BE4 6F636573732068616E-
  2549 00000BED 646C6572730D0A     
  2550 00000BF4 09414D495348414E44-     		db 9,"AMISHANDLER",9,"Display ELD AMIS handlers",13,10
  2550 00000BFD 4C455209446973706C-
  2550 00000C06 617920454C4420414D-
  2550 00000C0F 49532068616E646C65-
  2550 00000C18 72730D0A           
  2551 00000C1C 0941534D48414E444C-     		db 9,"ASMHANDLER",9,"Display ELD assembly handlers",13,10
  2551 00000C25 455209446973706C61-
  2551 00000C2E 7920454C4420617373-
  2551 00000C37 656D626C792068616E-
  2551 00000C40 646C6572730D0A     
  2552 00000C47 095055545348414E44-     		db 9,"PUTSHANDLER",9,"Display ELD puts-related handlers",13,10
  2552 00000C50 4C455209446973706C-
  2552 00000C59 617920454C44207075-
  2552 00000C62 74732D72656C617465-
  2552 00000C6B 642068616E646C6572-
  2552 00000C74 730D0A             
  2553 00000C77 09494E4A4543544841-     		db 9,"INJECTHANDLER",9,"Display ELD inject handlers",13,10
  2553 00000C80 4E444C455209446973-
  2553 00000C89 706C617920454C4420-
  2553 00000C92 696E6A656374206861-
  2553 00000C9B 6E646C6572730D0A   
  2554 00000CA3 095041544348090944-     		db 9,"PATCH",9,9,"Display patch areas",13,10
  2554 00000CAC 6973706C6179207061-
  2554 00000CB5 746368206172656173-
  2554 00000CBE 0D0A               
  2555 00000CC0 00                      		asciz
  2556                                  
  2557 00000CC1 00<rep Fh>              	align 16, db 0
  2558                                  init_data_end:
  2559                                  data_size equ $ - datastart
  2560                                  transient_data_size equ data_size
  2561                                  
  2562                                  	absolute uinit_data
  2563 00000941 ??                      	alignb 2
  2564                                  separatormessage:
  2565 00000942 ????                    	resw 1
  2566                                  
  2567 00000944 ????????                	alignb 8
  2568                                  table_sorted:
  2569 00000948 <res 70h>               	resb 10 * table.amount + 2
  2570                                  
  2571 000009B8 ????????????????        	alignb 16
  2572                                  uinit_data_end:
  2573                                  resident_data_end:
  2574                                  resident_data_size equ resident_data_end - datastart
  2575                                  
  2576                                  %if uinit_data_end >= init_data_end
  2577                                   total_data_size equ $ - datastart
  2578                                  %else
  2579                                   total_data_size equ init_data_end - datastart
  2580                                  %endif
  2581                                  %assign _DATA_SIZE total_data_size
  2582                                  
  2583                                  
  2584                                  	usesection CODE
  2585                                  
  2586                                  install:
  2587 00000B00 AC                      	lodsb
  2588 00000B01 E8[0000]EB020000        	extcall chkeol
  2589                                  
  2590                                  	houdini
  2591 00000B08 8EC3                    	mov es, bx		; => ext seg (writable)
  2592                                  
  2593 00000B0A B8B000                  	mov ax, endresident - endinstalled
  2594 00000B0D 262906[0200]            reloc	sub word [es:code + eldiEndCode], ax
  2595                                  internalcoderelocation		; adjust size
  2596 00000B12 2906[0000]              reloc	sub word [relocateddata], ax
  2597                                  linkdatarelocation extseg_used	; adjust size
  2598                                  
  2599                                  %if (transient_data_size - resident_data_size) > 0
  2600 00000B16 B81003                  	mov ax, transient_data_size - resident_data_size
  2601 00000B19 262906[0600]            reloc	sub word [es:code + eldiEndData], ax
  2602                                  internalcoderelocation		; adjust size
  2603 00000B1E 2906[0000]              reloc	sub word [relocateddata], ax
  2604                                  linkdatarelocation extdata_used	; adjust size
  2605                                  %endif
  2606                                  
  2607 00000B22 8B1E[0000]              reloc	mov bx, word [relocateddata]
  2608                                  linkdatarelocation ext_command_handler
  2609                                  				; -> prior
  2610 00000B26 BF[2000]                reloc	mov di, command		; -> our handler
  2611                                  internalcoderelocation
  2612 00000B29 85DB                    	test bx, bx		; installing as first ?
  2613 00000B2B 740A                    	jz .only_first		; yes, simple --> (leave as extcall cmd3_not_ext)
  2614 00000B2D AF                      	scasw			; skip entrypoint jmp strict short
  2615 00000B2E B0E9                    	mov al, 0E9h		; = jmp near opcode
  2616 00000B30 AA                      	stosb			; store
  2617 00000B31 93                      	xchg ax, bx		; ax -> next handler
  2618 00000B32 29F8                    	sub ax, di
  2619 00000B34 48                      	dec ax
  2620 00000B35 48                      	dec ax			; ax = ax - (di + 2)
  2621 00000B36 AB                      	stosw			; store our downlink as rel16 displacement
  2622                                  
  2623                                  .only_first:
  2624 00000B37 26800E[1000]01          reloc	setopt [es:code + eldiFlags], eldifResident
  2625                                  internalcoderelocation -3	; mark block as resident
  2626 00000B3D C706[0000][2000]        reloc2	mov word [relocateddata], command
  2627                                  linkdatarelocation ext_command_handler, -4
  2628                                  internalcoderelocation		; -> our entrypoint
  2629                                  
  2630 00000B43 F606[0000]04            reloc	testopt [relocateddata], 4
  2631                                  linkdatarelocation options7, -3
  2632 00000B48 7506                    	jnz @F
  2633 00000B4A BA[4109]                reloc	mov dx, msg.installed
  2634                                  internaldatarelocation
  2635 00000B4D E8E0FE                  	call putsz
  2636                                  @@:
  2637 00000B50 31C0                    	xor ax, ax
  2638 00000B52 CB                      	retf
  2639                                  
  2640                                  
  2641                                  %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                              <1> 	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
    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 00000B53 5589E5              <1> 	lenter
    93                              <1> 	lvar dword, instance
    94 00000B56 06                  <1> 	 push es
    95 00000B57 52                  <1> 	 push dx		; -> start of where we're loaded in ELD cs
    96                              <1> 	lvar word, targetsection_low_optional_high
    97 00000B58 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 00000B59 1E                  <1> 	 push ds
   102 00000B5A 57                  <1> 	 push di		; -> link info (in debugger ss or message seg)
   103                              <1> 	lvar dword, nextreloc
   104 00000B5B 06                  <1> 	 push es		; => ELD cs
   105 00000B5C 52                  <1> 	 push dx		; placeholder
   106                              <1> 	lvar dword, entry
   107 00000B5D 06                  <1> 	 push es		; => ELD cs
   108 00000B5E 50                  <1> 	 push ax		; placeholder
   109 00000B5F 31C0                <1> 	xor ax, ax
   110 00000B61 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 00000B65 7403                <1> 	je @F
   115                              <1> .error_j1:
   116 00000B67 E97A03              <1> 	jmp .error		; signature mismatch -->
   117                              <1> @@:
   118 00000B6A 837D0601            <1> 	cmp word [di + eldlUseLinkHash], 1
   119 00000B6E 77F7                <1> 	ja .error_j1		; unknown use link hash number -->
   120 00000B70 7202                <1> 	jb @F
   121                              <1> %if _ELDDATA_NEXT || _ELDCALL_NEXT
   122 00000B72 FEC8                <1> 	dec al			; = -1 if hash used
   123                              <1> %else
   124                              <1> 	dec ax
   125                              <1> %endif
   126                              <1> @@:
   127                              <1> 	lvar word, use_hash_low_skip_last_high
   128 00000B74 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 00000B75 31C0                <1> 	xor ax, ax
   138                              <1>  %if _ELD_LINKER_PASSES
   139                              <1> 	lvar word, pass
   140 00000B77 50                  <1> 	 push ax		; = 0 for linker itself, = 2 for application
   141                              <1> 	lvar word, amounterrors
   142 00000B78 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 00000B79 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 00000B7A 50                  <1> 	 push ax
   155                              <1>  %endif
   156                              <1> %endif
   157 00000B7B 56                  <1> 	push si			; -> command line tail
   158 00000B7C 53                  <1> 	push bx			; -> data block in ELD data area (segment ss)
   159                              <1> 
   160                              <1> 			; simple: add instance base (dx) to code
   161 00000B7D 06                  <1> 	push es
   162 00000B7E 1F                  <1> 	pop ds			; ds = es => ELD cs
   163                              <1> %if _ELD_LINKER_PASSES
   164                              <1> .pass:
   165 00000B7F 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   166 00000B82 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 00000B84 8BB70C10            <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 00000B88 01D6                <1> 	add si, dx		; relocate the table pointer itself
   177                              <1> @@:
   178 00000B8A AD                  <1> 	lodsw
   179 00000B8B 85C0                <1> 	test ax, ax		; was last ?
   180 00000B8D 740B                <1> 	jz @F			; yes -->
   181 00000B8F 93                  <1> 	xchg bx, ax		; bx = entry
   182 00000B90 01D3                <1> 	add bx, dx		; relocate the entry itself
   183                              <1> %if _ELD_CODE_VSTART
   184 00000B92 812F[0000]          <1> 	sub word [bx], code	; undo adjustment
   185                              <1> %endif
   186 00000B96 0117                <1> 	add word [bx], dx	; relocate word referenced by entry
   187 00000B98 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 00000B9A 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   193 00000B9D 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 00000B9F 8BB71010            <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 00000BA3 01D6                <1> 	add si, dx		; relocate the table pointer itself
   204                              <1> @@:
   205 00000BA5 AD                  <1> 	lodsw
   206 00000BA6 85C0                <1> 	test ax, ax		; was last ?
   207 00000BA8 740C                <1> 	jz @F			; yes -->
   208 00000BAA 93                  <1> 	xchg bx, ax		; bx = entry
   209 00000BAB 01D3                <1> 	add bx, dx		; relocate the entry itself
   210                              <1> 		; ! access the offset of the data area block, topmost on stack
   211 00000BAD 58                  <1> 	pop ax			; ax -> heap data
   212 00000BAE 50                  <1> 	push ax
   213                              <1> %if _ELD_DATA_VSTART
   214 00000BAF 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   215                              <1> %endif
   216 00000BB2 0107                <1> 	add word [bx], ax	; relocate word referenced by entry
   217 00000BB4 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 00000BB6 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   224 00000BB9 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 00000BBB 8BB71410            <1> 	mov si, word [linktable - code + ltDataToCode + bx]
   230                              <1>  %endif
   231                              <1> %else
   232                              <1> 	mov si, internaldatatocoderelocations - code
   233                              <1> %endif
   234 00000BBF 01D6                <1> 	add si, dx
   235                              <1> @@:
   236 00000BC1 AD                  <1> 	lodsw
   237 00000BC2 83F8FF              <1> 	cmp ax, -1		; was last ?
   238 00000BC5 740F                <1> 	je @F			; yes -->
   239 00000BC7 93                  <1> 	xchg bx, ax		; bx = entry
   240                              <1> 		; ! access the offset of the data area block, topmost on stack
   241 00000BC8 58                  <1> 	pop ax
   242 00000BC9 50                  <1> 	push ax
   243 00000BCA 01C3                <1> 	add bx, ax		; relocate the entry itself
   244                              <1> %if _ELD_CODE_VSTART
   245 00000BCC 36812F[0000]        <1> 	sub word [ss:bx], code	; undo adjustment
   246                              <1> %endif
   247 00000BD1 360117              <1> 	add word [ss:bx], dx	; relocate word referenced by entry
   248 00000BD4 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 00000BD6 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   254 00000BD9 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 00000BDB 8BB71810            <1> 	mov si, word [linktable - code + ltDataToData + bx]
   260                              <1>  %endif
   261                              <1> %else
   262                              <1> 	mov si, internaldatatodatarelocations - code
   263                              <1> %endif
   264 00000BDF 01D6                <1> 	add si, dx
   265                              <1> @@:
   266 00000BE1 AD                  <1> 	lodsw
   267 00000BE2 83F8FF              <1> 	cmp ax, -1		; was last ?
   268 00000BE5 740D                <1> 	je @F			; yes -->
   269 00000BE7 93                  <1> 	xchg bx, ax		; bx = entry
   270                              <1> 		; ! access the offset of the data area block, topmost on stack
   271 00000BE8 58                  <1> 	pop ax			; ax -> heap data
   272 00000BE9 50                  <1> 	push ax
   273 00000BEA 01C3                <1> 	add bx, ax		; relocate the entry itself
   274                              <1> %if _ELD_DATA_VSTART
   275 00000BEC 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   276                              <1> %endif
   277 00000BEF 360107              <1> 	add word [ss:bx], ax	; relocate word referenced by entry
   278 00000BF2 EBED                <1> 	jmp @B
   279                              <1> 
   280                              <1> @@:
   281 00000BF4 8B56FC              <1> 	mov dx, word [bp + ?instance]
   282                              <1> 				; reset (why??) -> ELD instance in ELD cs
   283                              <1> %if _ELD_LINKER_PASSES
   284 00000BF7 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   285 00000BFA 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 00000BFC 03971C10            <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 00000C00 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 00000C03 C576F2              <1> 	lds si, [bp + ?nextreloc]
   301 00000C06 AD                  <1> 	lodsw			; ax = section indicator
   302 00000C07 85C0                <1> 	test ax, ax		; end of table ?
   303 00000C09 7503E9B301          <1> 	jz .donedatareloc
   304 00000C0E 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 00000C0F 5B                  <1> 	pop bx
   307 00000C10 53                  <1> 	push bx			; bx -> ELD data block
   308 00000C11 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   309 00000C14 84C0                <1> 	test al, al		; data ?
   310 00000C16 AD                  <1> 	lodsw
   311 00000C17 7504                <1> 	jnz @F			; yes -->
   312 00000C19 0346FC              <1> 	add ax, word [bp + ?instance]
   313                              <1> 				; relocate entry into code
   314 00000C1C A9                  <1> 	db __TEST_IMM16		; (skip add)
   315                              <1> @@:
   316 00000C1D 01D8                <1> 	add ax, bx		; relocate entry into data
   317 00000C1F 8946EE              <1> 	mov word [bp + ?entry], ax
   318                              <1> 				; save away -> where to patch
   319 00000C22 AD                  <1> 	lodsw			; get unrelocated -> name
   320 00000C23 8976F2              <1> 	mov word [bp + ?nextreloc], si
   321                              <1> 				; update -> behind relocation table entry
   322                              <1> %if _ELDDATA_NEXT
   323 00000C26 D046ED              <1> 	rol byte [bp + ?skip_last], 1	; skipping ?
   324 00000C29 730B                <1> 	jnc @F				; no -->
   325 00000C2B F646FB08            <1> 	test byte [bp + ?optional], 8	; is it a last relocation ?
   326 00000C2F 74D2                <1> 	jz .datarelocloop		; no, leave skip_last set -->
   327 00000C31 F656ED              <1> 	not byte [bp + ?skip_last]	; disable skip_last
   328 00000C34 EBCD                <1> 	jmp .datarelocloop
   329                              <1> @@:
   330                              <1> %endif
   331 00000C36 E84D01              <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 00000C39 73C8                <1> 	jnc .datarelocloop	; if duplicate of a not found symbol -->
   337                              <1> %endif
   338 00000C3B 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 00000C3E 268B4F08            <1> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   346 00000C42 268B7F0A            <1> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   347                              <1> .datarelocfind:
   348 00000C46 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   349 00000C49 F2AF                <1> 	repne scasw			; scan initial
   350                              <1> %if _ELDDATA_OPTIONAL
   351 00000C4B 754F                <1> 	jne .datanotfound_may_be_optional
   352                              <1> %else
   353                              <1> 	jne .datanotfound
   354                              <1> %endif
   355 00000C4D 57                  <1> 	push di
   356 00000C4E 51                  <1> 	push cx
   357 00000C4F 56                  <1> 	push si
   358 00000C50 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   359 00000C54 4F                  <1> 	dec di
   360 00000C55 4F                  <1> 	dec di				; 0-based
   361 00000C56 26037F0C            <1> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   362 00000C5A 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   363 00000C5D B500                <1> 	mov ch, 0
   364 00000C5F 8A0C                <1> 	mov cl, byte [si]		; cx = length
   365 00000C61 41                  <1> 	inc cx
   366                              <1> 	; cmp al, al			; ZR if length is zero
   367 00000C62 F3A6                <1> 	repe cmpsb			; match ?
   368 00000C64 5E                  <1> 	pop si
   369 00000C65 59                  <1> 	pop cx
   370 00000C66 5F                  <1> 	pop di
   371 00000C67 75DD                <1> 	jne .datarelocfind		; if not found this time,
   372                              <1> 					;  scan for next initial -->
   373 00000C69 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   374 00000C6B 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   375 00000C6F 4F                  <1> 	dec di
   376 00000C70 4F                  <1> 	dec di				; 0-based
   377 00000C71 26037F0E            <1> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   378 00000C75 268B05              <1> 	mov ax, word [es:di]		; get link data from the table
   379 00000C78 E81500              <1> 	call .address_data_reloc
   380                              <1> %if _ELD_RELOC_VSTART
   381 00000C7B 2D[0000]            <1> 	sub ax, relocateddata		; *not* a relocation
   382                              <1> %endif
   383 00000C7E 0104                <1> 	add word [si], ax		; relocate
   384                              <1> %if _ELDDATA_NEXT
   385 00000C80 F646FB04            <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   386 00000C84 7503E97AFF          <1> 	jz .datarelocloop
   387 00000C89 C646EDFF            <1> 	mov byte [bp + ?skip_last], -1	; skip subsequent next/last relocs
   388                              <1> %endif
   389 00000C8D E973FF              <1> 	jmp .datarelocloop
   390                              <1> 
   391                              <1> .address_data_reloc:
   392 00000C90 C576EE              <1> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   393 00000C93 807EFA00            <1> 	cmp byte [bp + ?targetsection], 0
   394                              <1> 					; relocation in code ?
   395 00000C97 7402                <1> 	je @F				; yes -->
   396 00000C99 16                  <1> 	push ss
   397 00000C9A 1F                  <1> 	pop ds				; => our ELD data block
   398                              <1> @@:
   399 00000C9B C3                  <1> 	retn
   400                              <1> 
   401                              <1> %if _ELDDATA_OPTIONAL
   402                              <1> .datanotfound_may_be_optional:
   403 00000C9C 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   404                              <1> %if _ELDDATA_NEXT
   405 00000C9E F646FB03            <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 00000CA2 7472                <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 00000CA4 D046E4              <1> 	rol byte [bp + ?optionalmissing], 1
   444 00000CA7 730B                <1> 	jnc .optionaldatamissingmsg
   445 00000CA9 8B76E6              <1> 	mov si, [bp + ?name]
   446 00000CAC 800C80              <1> 	or byte [si], 80h
   447 00000CAF F656E4              <1> 	not byte [bp + ?optionalmissing]
   448 00000CB2 EB15                <1> 	jmp @F
   449                              <1> .optionaldatamissingmsg:
   450                              <1> %endif
   451 00000CB4 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   452                              <1> linkdatarelocation options7, -3
   453 00000CBA 740D                <1> 	jz @F				; no -->
   454                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   455 00000CBC C646E5FF            <1> 	mov byte [bp + ?optionalmissing + 1], -1
   456                              <1> %endif
   457 00000CC0 BE[F91C]            <1> 	mov si, lmsg.warning_data_optional
   458                              <1> internalcoderelocation
   459 00000CC3 E86F00              <1> 	call .notfound			; display a warning
   460                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   461 00000CC6 F656E5              <1> 	not byte [bp + ?optionalmissing + 1]
   462                              <1> %endif
   463                              <1> @@:
   464                              <1> %endif
   465                              <1> %if _ELDDATA_NEXT
   466 00000CC9 F646FB04            <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   467 00000CCD 7403E931FF          <1> 	jnz .datarelocloop
   468                              <1> %endif
   469 00000CD2 E8BBFF              <1> 	call .address_data_reloc
   470 00000CD5 832400              <1> 	and word [si], 0		; indicate optional data link failed
   471 00000CD8 E928FF              <1> 	jmp .datarelocloop
   472                              <1> %endif
   473                              <1> 
   474                              <1> 
   475                              <1> %if _ELDCALL_OPTIONAL
   476                              <1> .codenotfound_may_be_optional:
   477 00000CDB 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 00000CDD 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 00000CE1 7444                <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                              <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                              <1> 	test si, si			; is it a PM build ?
   515                              <1> 	jz @F				; no --> (treat PM required as optional)
   516                              <1> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   517                              <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 00000CE3 D046E4              <1> 	rol byte [bp + ?optionalmissing], 1
   524 00000CE6 730B                <1> 	jnc .optionalcodemissingmsg
   525 00000CE8 8B76E6              <1> 	mov si, [bp + ?name]
   526 00000CEB 800C80              <1> 	or byte [si], 80h
   527 00000CEE F656E4              <1> 	not byte [bp + ?optionalmissing]
   528 00000CF1 EB15                <1> 	jmp @F
   529                              <1> .optionalcodemissingmsg:
   530                              <1> %endif
   531 00000CF3 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   532                              <1> linkdatarelocation options7, -3
   533 00000CF9 740D                <1> 	jz @F				; no -->
   534                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   535 00000CFB C646E5FF            <1> 	mov byte [bp + ?optionalmissing + 1], -1
   536                              <1> %endif
   537 00000CFF BE[D71C]            <1> 	mov si, lmsg.warning_code_optional
   538                              <1> internalcoderelocation
   539 00000D02 E83000              <1> 	call .notfound			; display a warning
   540                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   541 00000D05 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 00000D08 C576EE              <1> 	lds si, [bp + ?entry]		; -> code site (must be in ELD cs)
   550 00000D0B C7049090            <1> 	mov word [si], 9090h
   551 00000D0F C6440290            <1> 	mov byte [si + 2], 90h		; indicate optional code link failed
   552                              <1> 					;  (NOP out the 3-byte call near imm)
   553 00000D13 E9BA00              <1> 	jmp .coderelocloop
   554                              <1> %endif
   555                              <1> 
   556                              <1> 
   557                              <1> %if _ELD_LINKER_PASSES
   558                              <1> .datanotfound:
   559 00000D16 BE[1B1D]            <1> 	mov si, lmsg.error_data
   560                              <1> internalcoderelocation
   561 00000D19 E81900              <1> 	call .notfound			; display error
   562 00000D1C 7306                <1> 	jnc .error_j3			; NC if in pass 0, error out now -->
   563 00000D1E FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   564 00000D21 E9DFFE              <1> 	jmp .datarelocloop		; go to next relocation entry -->
   565                              <1> 
   566                              <1> .error_j3:
   567 00000D24 E9BD01              <1> 	jmp .error
   568                              <1> 
   569                              <1> .codenotfound:
   570 00000D27 BE[341D]            <1> 	mov si, lmsg.error_code
   571                              <1> internalcoderelocation
   572 00000D2A E80800              <1> 	call .notfound			; display error
   573 00000D2D 73F5                <1> 	jnc .error_j3			; NC if in pass 0 -->
   574 00000D2F FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   575 00000D32 E99B00              <1> 	jmp .coderelocloop		; go to next -->
   576                              <1> 
   577                              <1> .notfound:
   578 00000D35 807EEA00            <1> 	cmp byte [bp + ?pass], 0	; pass 0 ?
   579 00000D39 7442                <1> 	je .notfound.retn		; yes, do not try displaying --> (NC)
   580 00000D3B 16                  <1> 	 push ss
   581 00000D3C 07                  <1> 	 pop es
   582 00000D3D BF[0000]            <1> 	mov di, relocateddata
   583                              <1> linkdatarelocation line_out		; es:di -> line_out buffer
   584 00000D40 E83B00              <1> 	call .copy			; copy prefix message
   585 00000D43 8B76E6              <1> 	mov si, word [bp + ?name]
   586 00000D46 AD                  <1> 	lodsw				; = hash
   587 00000D47 E8[0000]EB020000    <1> 	extcall hexword			; display the hash in hex
   588 00000D4E 56                  <1> 	push si
   589 00000D4F BE[4D1D]            <1> 	mov si, lmsg.error.2
   590                              <1> internalcoderelocation
   591 00000D52 E82900              <1> 	call .copy			; display message fragment
   592 00000D55 5E                  <1> 	pop si
   593                              <1> %if _ELD_LINKER_PASSES
   594 00000D56 56                  <1> 	push si
   595 00000D57 E82400              <1> 	call .copy			; copy over the full name
   596 00000D5A 5E                  <1> 	pop si
   597                              <1>  %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   598 00000D5B 800C80              <1> 	or byte [si], 80h		; mark as failed optional link
   599 00000D5E D046E5              <1> 	rol byte [bp + ?optionalmissing + 1], 1
   600                              <1> 					; was it optional ?
   601 00000D61 7203                <1> 	jc @F				; yes -->
   602                              <1>  %endif
   603 00000D63 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 00000D66 B022                <1> 	mov al, '"'
   609 00000D68 AA                  <1> 	stosb				; end message with a closing quote mark
   610 00000D69 16                  <1> 	 push ss
   611 00000D6A 1F                  <1> 	 pop ds
   612 00000D6B E8[0000]EB020000    <1> 	extcall putsline_crlf		; display diagnostic line
   613 00000D72 B8350E              <1> 	mov ax, 0E35h
   614 00000D75 E8[0000]EB020000    <1> 	extcall setrc
   615 00000D7C F9                  <1> 	stc				; CY, diagnostic displayed
   616                              <1> .notfound.retn:
   617 00000D7D C3                  <1> 	retn
   618                              <1> 
   619                              <1> .copy:		; (cannot use extcallcall here)
   620 00000D7E E8[0000]EB020000    <1> 	extcall copy_single_counted_string
   621 00000D85 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 00000D86 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 00000D8A 2D[0000]            <1> 	sub ax, code			; revert adjustment (= displacement)
   638                              <1> %endif
   639 00000D8D 0346FC              <1> 	add ax, word [bp + ?instance]	; make displacement into -> name string
   640 00000D90 96                  <1> 	xchg si, ax			; si -> hash word, counted name string
   641                              <1> %if _ELD_LINKER_PASSES || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   642 00000D91 8976E6              <1> 	mov word [bp + ?name], si	; save away for diagnostics
   643                              <1> %endif
   644 00000D94 AD                  <1> 	lodsw			; = hash, si -> counted string
   645 00000D95 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   646                              <1> %if _ELD_LINKER_PASSES
   647 00000D97 84D2                <1> 	test dl, dl		; marked as already failed ?
   648                              <1> 				;  (80h = optional, 0 = required)
   649 00000D99 750A                <1> 	jnz @F			; no -->
   650 00000D9B 837EE800            <1> 	cmp word [bp + ?amounterrors], 0
   651                              <1> 				; validate error status
   652 00000D9F 7503E9B300          <1> 	je .error_j		; no error known ?! cancel quickly -->
   653 00000DA4 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 00000DA5 7909                <1> 	jns @F
   661 00000DA7 80E27F              <1> 	and dl, 7Fh
   662 00000DAA 8814                <1> 	mov byte [si], dl
   663 00000DAC 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 00000DB0 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 00000DB3 720A                <1> 	jc @F			; if to use hash, return now -->
   679 00000DB5 AC                  <1> 	lodsb			; al = length
   680 00000DB6 91                  <1> 	xchg cx, ax		; cl = length
   681 00000DB7 AD                  <1> 	lodsw			; ax = prefix
   682 00000DB8 49                  <1> 	dec cx
   683 00000DB9 49                  <1> 	dec cx			; cl = adjusted length
   684 00000DBA 4E                  <1> 	dec si			; -> second byte of prefix
   685 00000DBB 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   686 00000DBD 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 00000DBF F9                  <1> 	stc			; CY
   695                              <1> %endif
   696 00000DC0 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 00000DC1 8B56FC              <1> 	mov dx, word [bp + ?instance]
   707                              <1> %if _ELD_LINKER_PASSES
   708 00000DC4 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   709 00000DC7 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 00000DC9 03972010            <1> 	add dx, word [linktable - code + ltLinkCode + bx]
   715                              <1>  %endif
   716                              <1> %else
   717                              <1> 	add dx, linkercoderelocations - code
   718                              <1> %endif
   719 00000DCD 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   720                              <1> 
   721                              <1> .coderelocloop:
   722 00000DD0 C576F2              <1> 	lds si, [bp + ?nextreloc]
   723 00000DD3 AD                  <1> 	lodsw
   724                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
   725 00000DD4 48                  <1> 	dec ax				; optional word is 1-based, get 0-based
   726 00000DD5 7903E98F00          <1> 	js .donecodereloc
   727 00000DDA 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   728 00000DDD AD                  <1> 	lodsw
   729                              <1> %endif
   730 00000DDE 0346FC              <1> 	add ax, word [bp + ?instance]
   731 00000DE1 8946EE              <1> 	mov word [bp + ?entry], ax
   732 00000DE4 AD                  <1> 	lodsw
   733 00000DE5 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 00000DE8 E89BFF              <1> 	call .build_match
   748                              <1> %if _ELD_LINKER_PASSES
   749 00000DEB 73E3                <1> 	jnc .coderelocloop
   750                              <1> %endif
   751 00000DED C45EF6              <1> 	les bx, [bp + ?linkinfo]
   752 00000DF0 268B4F10            <1> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   753 00000DF4 268B7F12            <1> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   754                              <1> .coderelocfind:
   755 00000DF8 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   756 00000DFB F2AF                <1> 	repne scasw			; scan initial
   757                              <1> %if _ELDCALL_OPTIONAL
   758 00000DFD 7403E9D9FE          <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 00000E02 57                  <1> 	push di
   770 00000E03 51                  <1> 	push cx
   771 00000E04 56                  <1> 	push si
   772 00000E05 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   773 00000E09 4F                  <1> 	dec di
   774 00000E0A 4F                  <1> 	dec di				; 0-based
   775 00000E0B 26037F14            <1> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   776 00000E0F 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   777 00000E12 B500                <1> 	mov ch, 0
   778 00000E14 8A0C                <1> 	mov cl, byte [si]		; cx = length
   779 00000E16 41                  <1> 	inc cx
   780                              <1> 	; cmp al, al			; ZR if length is zero
   781 00000E17 F3A6                <1> 	repe cmpsb			; match ?
   782 00000E19 5E                  <1> 	pop si
   783 00000E1A 59                  <1> 	pop cx
   784 00000E1B 5F                  <1> 	pop di
   785 00000E1C 75DA                <1> 	jne .coderelocfind
   786 00000E1E 8814                <1> 	mov byte [si], dl
   787 00000E20 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   788 00000E24 4F                  <1> 	dec di
   789 00000E25 4F                  <1> 	dec di				; 0-based
   790 00000E26 01FF                <1> 	add di, di			; quadruple index
   791 00000E28 26037F16            <1> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   792 00000E2C 26FF35              <1> 	push word [es:di]
   793 00000E2F C576EE              <1> 	lds si, [bp + ?entry]
   794 00000E32 8F4405              <1> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   795                              <1> 					;  patch the destination address
   796 00000E35 803CE8              <1> 	cmp byte [si], 0E8h		; is it as expected ?
   797 00000E38 751D                <1> 	jne .error_j
   798 00000E3A 268B7D02            <1> 	mov di, word [es:di + 2]
   799 00000E3E BB[0000]            <1> 	mov bx, relocateddata
   800                              <1> linkdatarelocation linkcall_table	; ss:bx -> link call table
   801 00000E41 36833F01            <1> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   802 00000E45 7510                <1> 	jne .error_j			; no -->
   803 00000E47 368B4F02            <1> 	mov cx, word [ss:bx + 2]	; get amount of segments
   804 00000E4B E30A                <1> 	jcxz .error_j			; none -->
   805                              <1> @@:
   806 00000E4D 83C304              <1> 	add bx, 4			; -> next segment
   807 00000E50 36393F              <1> 	cmp word [ss:bx], di		; value matches ?
   808 00000E53 7405                <1> 	je @F				; yes, found -->
   809 00000E55 E2F6                <1> 	loop @B				; try remaining segments
   810                              <1> .error_j:
   811 00000E57 E98A00              <1> 	jmp .error
   812                              <1> 
   813                              <1> @@:
   814 00000E5A 368B5F02            <1> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   815                              <1> 		; si + 3 + delta = bx
   816                              <1> 		; delta = bx - si - 3
   817 00000E5E 29F3                <1> 	sub bx, si
   818 00000E60 83EB03              <1> 	sub bx, 3
   819 00000E63 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 00000E66 E967FF              <1> 	jmp .coderelocloop
   826                              <1> 
   827                              <1> .donecodereloc:
   828                              <1> %if _ELD_LINKER_PASSES
   829 00000E69 8B46E8              <1> 	mov ax, word [bp + ?amounterrors]
   830 00000E6C 85C0                <1> 	test ax, ax
   831 00000E6E 75E7                <1> 	jnz .error_j
   832 00000E70 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   833 00000E73 85DB                <1> 	test bx, bx
   834 00000E75 750B                <1> 	jnz @F
   835 00000E77 43                  <1> 	inc bx
   836 00000E78 43                  <1> 	inc bx
   837 00000E79 895EEA              <1> 	mov word [bp + ?pass], bx
   838 00000E7C 8B56FC              <1> 	mov dx, word [bp + ?instance]
   839 00000E7F E9FDFC              <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 00000E82 16                  <1> 	push ss
   848 00000E83 1F                  <1> 	pop ds
   849 00000E84 B02D                <1> 	mov al, 2Dh
   850 00000E86 E8[0000]EB020000    <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   851                              <1> 					; CHG: ax, dx, bx
   852 00000E8D 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 00000E8F 8A26[0000]          <1> 	mov ah, byte [relocateddata]
   860                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   861 00000E93 E85500              <1> 	call plex_check
   862 00000E96 7305                <1> 	jnc @F
   863                              <1> 
   864 00000E98 B4FF                <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   865                              <1> .loop_hint:
   866 00000E9A E84E00              <1> 	call plex_check
   867                              <1> @@:
   868 00000E9D 7307                <1> 	jnc .end_hint		; if found --> (NC)
   869 00000E9F 80EC01              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   870 00000EA2 73F6                <1> 	jnc .loop_hint		; try next if we didn't check all yet -->
   871 00000EA4 EB20                <1> 	jmp .no_hint
   872                              <1> 
   873                              <1> .end_hint:
   874 00000EA6 50                  <1> 	push ax
   875 00000EA7 C446FC              <1> 	les ax, [bp + ?instance]
   876 00000EAA BF[1F15]            <1> 	mov di, listmsg.hint.offset
   877                              <1> internalcoderelocation
   878 00000EAD E8[0000]EB020000    <1> 	extcall hexword
   879 00000EB4 BB[0015]            <1> 	mov bx, listmsg.hint
   880                              <1> internalcoderelocation
   881 00000EB7 368B16[0000]        <1> 	mov dx, [ss:relocateddata]
   882                              <1> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   883 00000EBC 58                  <1> 	pop ax
   884 00000EBD B040                <1> 	mov al, 40h		; AMIS message display service
   885 00000EBF 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 00000EC6 5B                  <1> 	pop bx				; -> our heap data
  1005 00000EC7 5E                  <1> 	pop si				; -> our command line tail
  1006 00000EC8 16                  <1> 	 push ss
  1007 00000EC9 1F                  <1> 	 pop ds
  1008 00000ECA C47EFC              <1> 	les di, [bp + ?instance]
  1009 00000ECD 268B4502            <1> 	mov ax, word [es:di + eldiEndCode]
  1010                              <1> houdini
  1011 00000ED1 2D[600B]            <1> 	sub ax, strict word endresident + code
  1012                              <1> internalcoderelocation
  1013 00000ED4 26C74502[600B]      <1> 	mov word [es:di + eldiEndCode], endresident + code
  1014                              <1> internalcoderelocation
  1015 00000EDA 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 00000EDE 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 00000EE1 E9CCFB              <1> 	jmp start
  1029                              <1> 
  1030                              <1> .error:
  1031 00000EE4 89EC5D              <1> 	lleave
  1032 00000EE7 B8FFFF              <1> 	mov ax, -1
  1033 00000EEA 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 00000EEB 16                  <1> 	push ss
  1055 00000EEC 1F                  <1> 	pop ds
  1056 00000EED F606[0000]08        <1> 	testopt [relocateddata], 8
  1057                              <1> linkdatarelocation internalflags4, -3
  1058 00000EF2 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 00000EF4 BE[0000]            <1> 	mov si, relocateddata
  1068                              <1> linkdatarelocation amis_multiplex_number, -2, optional
  1069 00000EF7 85F6                <1> 	test si, si
  1070 00000EF9 7404                <1> 	jz @F
  1071 00000EFB 3A24                <1> 	cmp ah, byte [si]
  1072 00000EFD 7420                <1> 	je .notfound		; do not use our own multiplexer -->
  1073                              <1> %endif
  1074                              <1> @@:
  1075 00000EFF B000                <1> 	mov al, 00h		; AMIS installation check
  1076 00000F01 E8[0000]EB020000    <1> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
  1077 00000F08 3CFF                <1> 	cmp al, 0FFh
  1078 00000F0A 7513                <1> 	jne .notfound
  1079 00000F0C 0E                  <1> 	push cs
  1080 00000F0D 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 00000F0E BE[F014]            <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
  1089                              <1> internalcoderelocation
  1090 00000F11 E8[0000]EB020000    <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
  1091 00000F18 B90800              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
  1092 00000F1B F3A7                <1> 	repe cmpsw
  1093                              <1> %endif
  1094 00000F1D 7401                <1> 	je .checkret		; ZR, NC = match -->
  1095                              <1> .notfound:
  1096 00000F1F F9                  <1> 	stc			; CY no match
  1097                              <1> .checkret:
  1098 00000F20 C3                  <1> 	retn
  1099                              <1> %endif
  1100                              <1> 
  1101                              <1> 
  1102 00000F21 00<rep 3h>          <1> 	align 4, db 0
  1103                              <1> linkercoderelocations:
  1104                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
  1105 00000F24 01002200[2715]0100- <1> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
  1105 00000F2C FB08[2715]01000209- <1>
  1105 00000F34 [3615]01010909-     <1>
  1105 00000F3A [4A15]01011009-     <1>
  1105 00000F40 [5E15]01001709-     <1>
  1105 00000F46 [7115]01001E09-     <1>
  1105 00000F4C [8115]01002509-     <1>
  1105 00000F52 [9C15]0100100A-     <1>
  1105 00000F58 [B415]0100180A-     <1>
  1105 00000F5E [C015]0100200A-     <1>
  1105 00000F64 [CC15]0100280A-     <1>
  1105 00000F6A [D315]0100300A-     <1>
  1105 00000F70 [DC15]0100380A-     <1>
  1105 00000F76 [E415]0100400A-     <1>
  1105 00000F7C [EC15]0100480A-     <1>
  1105 00000F82 [F315]0100500A-     <1>
  1105 00000F88 [FC15]0100580A-     <1>
  1105 00000F8E [0816]0100600A-     <1>
  1105 00000F94 [0F16]0100680A-     <1>
  1105 00000F9A [2C16]0100700A-     <1>
  1105 00000FA0 [3716]0100780A-     <1>
  1105 00000FA6 [4116]0100800A-     <1>
  1105 00000FAC [4B16]0100880A-     <1>
  1105 00000FB2 [5616]0100900A-     <1>
  1105 00000FB8 [6116]0100980A-     <1>
  1105 00000FBE [8A16]0100A00A-     <1>
  1105 00000FC4 [9A16]0100A80A-     <1>
  1105 00000FCA [A416]0100010B-     <1>
  1105 00000FD0 [D315]0100860E-     <1>
  1105 00000FD6 [AD16]0100AD0E-     <1>
  1105 00000FDC [3716]0100BF0E-     <1>
  1105 00000FE2 [B616]0100010F-     <1>
  1105 00000FE8 [B616]0100110F-     <1>
  1105 00000FEE [5616]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 00000FF2 0100470D[3716]0100- <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
  1113 00000FFA 6B0D[8A16]0100750D- <1>
  1113 00001002 [E415]01007E0D-     <1>
  1113 00001008 [0F16]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 0000100C DE14                <1> 	dw internallinkercodetocoderelocations - code
  1123 0000100E 4413                <1> 	dw internalcodetocoderelocations - code
  1124                              <1> at ltCodeToData
  1125 00001010 EA14                <1> 	dw internallinkercodetodatarelocations - code
  1126 00001012 6613                <1> 	dw internalcodetodatarelocations - code
  1127                              <1> at ltDataToCode
  1128 00001014 EC14                <1> 	dw internallinkerdatatocoderelocations - code
  1129 00001016 6014                <1> 	dw internaldatatocoderelocations - code
  1130                              <1> at ltDataToData
  1131 00001018 EE14                <1> 	dw internallinkerdatatodatarelocations - code
  1132 0000101A 8A14                <1> 	dw internaldatatodatarelocations - code
  1133                              <1> at ltLinkData
  1134 0000101C C414                <1> 	dw linkerlinkerdatarelocations - code
  1135 0000101E 2410                <1> 	dw linkerdatarelocations - code
  1136                              <1> at ltLinkCode
  1137 00001020 F20F                <1> 	dw linkerlinkercoderelocations - code
  1138 00001022 240F                <1> 	dw linkercoderelocations - code
  1139                              <1> 	iend
  1140                              <1> %endif
  1141                              <1> 
  1142                              <1> 	align 2, db 0
  1143                              <1> linkerdatarelocations:
  1144 00001024 01004700[C316]0100- <1> 	dw LINK_DATA_RELOCATIONS, 0
  1144 0000102C 4900[CD16]01004C00- <1>
  1144 00001034 [D616]01006A00-     <1>
  1144 0000103A [E616]01008E00-     <1>
  1144 00001040 [E616]0100CD00-     <1>
  1144 00001046 [FC16]0100D600-     <1>
  1144 0000104C [0717]01009001-     <1>
  1144 00001052 [1017]0100D301-     <1>
  1144 00001058 [1017]01000102-     <1>
  1144 0000105E [1017]01005F02-     <1>
  1144 00001064 [1017]01008902-     <1>
  1144 0000106A [1B17]01059202-     <1>
  1144 00001070 [2417]01099202-     <1>
  1144 00001076 [2F17]01012E03-     <1>
  1144 0000107C [4217]01003C03-     <1>
  1144 00001082 [1017]01008803-     <1>
  1144 00001088 [1017]01010204-     <1>
  1144 0000108E [4217]01010B04-     <1>
  1144 00001094 [4E17]01012504-     <1>
  1144 0000109A [4217]01013F04-     <1>
  1144 000010A0 [4E17]01005804-     <1>
  1144 000010A6 [1017]01015E04-     <1>
  1144 000010AC [5B17]01016604-     <1>
  1144 000010B2 [FC16]01008904-     <1>
  1144 000010B8 [1017]01019A04-     <1>
  1144 000010BE [6317]0101C304-     <1>
  1144 000010C4 [7317]0101C604-     <1>
  1144 000010CA [8217]0100D604-     <1>
  1144 000010D0 [1017]0101FC04-     <1>
  1144 000010D6 [9217]01012705-     <1>
  1144 000010DC [A517]01006205-     <1>
  1144 000010E2 [1017]01016505-     <1>
  1144 000010E8 [B517]01016805-     <1>
  1144 000010EE [BD17]0100B005-     <1>
  1144 000010F4 [1017]0100B905-     <1>
  1144 000010FA [C917]0100C605-     <1>
  1144 00001100 [D717]0100E105-     <1>
  1144 00001106 [E517]0100EE05-     <1>
  1144 0000110C [F417]01001506-     <1>
  1144 00001112 [1017]01001906-     <1>
  1144 00001118 [C917]01002106-     <1>
  1144 0000111E [D717]01013706-     <1>
  1144 00001124 [FC16]01013F06-     <1>
  1144 0000112A [0717]01006606-     <1>
  1144 00001130 [C917]0100FC06-     <1>
  1144 00001136 [1017]0100FF06-     <1>
  1144 0000113C [E517]01000307-     <1>
  1144 00001142 [F417]01000B07-     <1>
  1144 00001148 [0318]01001807-     <1>
  1144 0000114E [1017]01002107-     <1>
  1144 00001154 [0D18]01004107-     <1>
  1144 0000115A [1E18]01005007-     <1>
  1144 00001160 [2D18]01005707-     <1>
  1144 00001166 [3E18]01005A07-     <1>
  1144 0000116C [4818]01008407-     <1>
  1144 00001172 [3E18]01008707-     <1>
  1144 00001178 [4818]01009307-     <1>
  1144 0000117E [1017]01004E08-     <1>
  1144 00001184 [1017]01003C09-     <1>
  1144 0000118A [C917]01000A0A-     <1>
  1144 00001190 [1017]0100B90A-     <1>
  1144 00001196 [6E18]0100E00A-     <1>
  1144 0000119C [7C18]0100F00A-     <1>
  1144 000011A2 [C917]0100FD0A-     <1>
  1144 000011A8 [E517]02010200-     <1>
  1144 000011AE [1B17]02010600-     <1>
  1144 000011B4 [8718]02010800-     <1>
  1144 000011BA [9718]02010C00-     <1>
  1144 000011C0 [9F18]02011000-     <1>
  1144 000011C6 [AC18]02011200-     <1>
  1144 000011CC [BE18]02011600-     <1>
  1144 000011D2 [CB18]02011A00-     <1>
  1144 000011D8 [DD18]02011C00-     <1>
  1144 000011DE [F418]02012000-     <1>
  1144 000011E4 [0719]02012400-     <1>
  1144 000011EA [2119]02012600-     <1>
  1144 000011F0 [4019]02012A00-     <1>
  1144 000011F6 [2417]02012E00-     <1>
  1144 000011FC [5B19]02013000-     <1>
  1144 00001202 [6719]02013400-     <1>
  1144 00001208 [2F17]02013800-     <1>
  1144 0000120E [7219]02013A00-     <1>
  1144 00001214 [8619]02013E00-     <1>
  1144 0000121A [9919]02014200-     <1>
  1144 00001220 [A519]02014400-     <1>
  1144 00001226 [B219]02014800-     <1>
  1144 0000122C [BE19]02014C00-     <1>
  1144 00001232 [D219]02014E00-     <1>
  1144 00001238 [E719]02015200-     <1>
  1144 0000123E [FB19]02015600-     <1>
  1144 00001244 [0D1A]02015800-     <1>
  1144 0000124A [9217]02015C00-     <1>
  1144 00001250 [0717]02016000-     <1>
  1144 00001256 [D717]02016200-     <1>
  1144 0000125C [1F1A]02016600-     <1>
  1144 00001262 [2A1A]02016A00-     <1>
  1144 00001268 [331A]02007200-     <1>
  1144 0000126E [E616]02007600-     <1>
  1144 00001274 [3E1A]02007C00-     <1>
  1144 0000127A [4D1A]02008000-     <1>
  1144 00001280 [661A]02018800-     <1>
  1144 00001286 [7A1A]02019400-     <1>
  1144 0000128C [8D1A]02019800-     <1>
  1144 00001292 [AD1A]02019E00-     <1>
  1144 00001298 [C11A]0201A200-     <1>
  1144 0000129E [E01A]0200AA00-     <1>
  1144 000012A4 [F31A]0200AE00-     <1>
  1144 000012AA [061B]0200B400-     <1>
  1144 000012B0 [161B]0200B800-     <1>
  1144 000012B6 [341B]0200BE00-     <1>
  1144 000012BC [4F1B]0200C200-     <1>
  1144 000012C2 [6A1B]0200CA00-     <1>
  1144 000012C8 [821B]0201D400-     <1>
  1144 000012CE [971B]0201DE00-     <1>
  1144 000012D4 [AF1B]0201E000-     <1>
  1144 000012DA [BF1B]0201E200-     <1>
  1144 000012E0 [D71B]0201E600-     <1>
  1144 000012E6 [EC1B]0201E800-     <1>
  1144 000012EC [FF1B]0201EA00-     <1>
  1144 000012F2 [1A1C]0201EE00-     <1>
  1144 000012F8 [321C]0201F000-     <1>
  1144 000012FE [451C]0201F200-     <1>
  1144 00001304 [601C]0100140B-     <1>
  1144 0000130A [C917]0100200B-     <1>
  1144 00001310 [E517]0100240B-     <1>
  1144 00001316 [E616]01003F0B-     <1>
  1144 0000131C [E616]0100450B-     <1>
  1144 00001322 [7C18]0100910E-     <1>
  1144 00001328 [891C]0100BA0E-     <1>
  1144 0000132E [0717]0100DC0E-     <1>
  1144 00001334 [C917]0100EF0E-     <1>
  1144 0000133A [AE1C]0101F50E-     <1>
  1144 00001340 [BF1C]0000          <1>
  1145                              <1> 
  1146                              <1> 	align 2, db 0
  1147                              <1> internalcodetocoderelocations:
  1148 00001344 6500B200E70AEC0AF4- <1> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
  1148 0000134D 0AF90A100B1C0B270B- <1>
  1148 00001356 3A0B410BAB0EB50ED2- <1>
  1148 0000135F 0ED80E0F0F0000      <1>
  1149                              <1> 
  1150                              <1> 	align 2, db 0
  1151                              <1> internalcodetodatarelocations:
  1152 00001366 3400B600C700DD00DF- <1> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
  1152 0000136F 00E800FE003D017201- <1>
  1152 00001378 7F0183018D01D001FE- <1>
  1152 00001381 013D02450256027302- <1>
  1152 0000138A 7D0285028E0297029A- <1>
  1152 00001393 02A402A702B102BB02- <1>
  1152 0000139C C202C802CB02E40239- <1>
  1152 000013A5 035C036C037C039B03- <1>
  1152 000013AE AA03B603C203F0031F- <1>
  1152 000013B7 042C04390446046F04- <1>
  1152 000013C0 77049604A104AA04B2- <1>
  1152 000013C9 04B704BD04D104D904- <1>
  1152 000013D2 ED04F604160521053C- <1>
  1152 000013DB 054105550573057805- <1>
  1152 000013E4 85059005A605B305C0- <1>
  1152 000013ED 05D205DB05E805FA05- <1>
  1152 000013F6 03060D062D064606A4- <1>
  1152 000013FF 06AA06B206BD06D906- <1>
  1152 00001408 EA060E071B0729072F- <1>
  1152 00001411 073B0748076D077807- <1>
  1152 0000141A 9607A207B507BE07D6- <1>
  1152 00001423 07EA07EF07F407F907- <1>
  1152 0000142C FE070708120822082C- <1>
  1152 00001435 08380842085208D408- <1>
  1152 0000143E DF0861096A097B0984- <1>
  1152 00001447 0989099509A009AD09- <1>
  1152 00001450 C009DB09F309FD09C1- <1>
  1152 00001459 0AD60A4B0B0000      <1>
  1153                              <1> 
  1154                              <1> 	align 2, db 0
  1155                              <1> internaldatatocoderelocations:
  1156 00001460 74007E009600A000AC- <1> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
  1156 00001469 00B600C00008010C01- <1>
  1156 00001472 1001140118011C0120- <1>
  1156 0000147B 01240128012C013001- <1>
  1156 00001484 34013801FFFF        <1>
  1157                              <1> 
  1158                              <1> 	align 2, db 0
  1159                              <1> internaldatatodatarelocations:
  1160 0000148A 00000A0014001E0028- <1> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
  1160 00001493 0032003C0046005000- <1>
  1160 0000149C 5A00640070007A0086- <1>
  1160 000014A5 0092009C00A800B200- <1>
  1160 000014AE BC00C800D200E400EC- <1>
  1160 000014B7 00F400F800FC000001- <1>
  1160 000014C0 0401FFFF            <1>
  1161                              <1> 
  1162                              <1> %if _ELD_LINKER_PASSES
  1163                              <1> 	align 2, db 0
  1164                              <1> linkerlinkerdatarelocations:
  1165 000014C4 0100B70C[7C18]0100- <1> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
  1165 000014CC F60C[7C18]01003E0D- <1>
  1165 000014D4 [1017]01003F0E-     <1>
  1165 000014DA [781C]0000          <1>
  1166                              <1> 
  1167                              <1> 	align 2, db 0
  1168                              <1> internallinkercodetocoderelocations:
  1169 000014DE C10C000D170D280D50- <1> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
  1169 000014E7 0D0000              <1>
  1170                              <1> 
  1171                              <1> 	align 2, db 0
  1172                              <1> internallinkercodetodatarelocations:
  1173 000014EA 0000                <1> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
  1174                              <1> 
  1175                              <1> 	align 2, db 0
  1176                              <1> internallinkerdatatocoderelocations:
  1177 000014EC FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
  1178                              <1> 
  1179                              <1> 	align 2, db 0
  1180                              <1> internallinkerdatatodatarelocations:
  1181 000014EE 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 000014F0 65636D20<rep 5h>    <1> 		fill 8, 32, db "ecm"
  1198 000014F8 6C446562756720-     <1> 		fill 8, 32, db "lDebug"
  1198 000014F8 <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 00001500 547261634C6973742D- <1> .hint:		db "TracList-add-offset=",_LISTING,"::"
  1210 00001509 6164642D6F66667365- <1>
  1210 00001512 743D6C646D656D2E6C- <1>
  1210 0000151B 73743A3A            <1>
  1211 0000151F 2D2D2D2D680D0A00    <1> .hint.offset:	asciz "----h",13,10
  1212                              <1> %endif
  1213                              <1> 
  1214 00001527 30CD0C636D64335F6E- <1> 	eldcall_dump_names ELDCALL_CODE_NAMES
  1214 00001530 6F745F657874702A11- <1>
  1214 00001539 636D64335F70726570- <1>
  1214 00001542 726F636573736564A8- <1>
  1214 0000154B 1B1161615F6265666F- <1>
  1214 00001554 72655F6765746C696E- <1>
  1214 0000155D 6509B91061615F6166- <1>
  1214 00001566 7465725F6765746C69- <1>
  1214 0000156F 6E651AB70D70757473- <1>
  1214 00001578 5F6578745F646F6E65- <1>
  1214 00001581 CF3F18707574735F63- <1>
  1214 0000158A 6F70796F7574707574- <1>
  1214 00001593 5F6578745F646F6E65- <1>
  1214 0000159C 6F9D15707574735F67- <1>
  1214 000015A5 65746C696E655F6578- <1>
  1214 000015AE 745F646F6E65D55509- <1>
  1214 000015B7 736B6970636F6D6D61- <1>
  1214 000015C0 03C309697373747269- <1>
  1214 000015C9 6E673FBABD04636D64- <1>
  1214 000015D2 33DDB90663686B656F- <1>
  1214 000015DB 6C551205707574737A- <1>
  1214 000015E4 B21205736574726328- <1>
  1214 000015ED 90046973706DE83A06- <1>
  1214 000015F6 6973656F6C3F29EF09- <1>
  1214 000015FF 736B69707768697465- <1>
  1214 00001608 C5C60470757473D0BB- <1>
  1214 00001611 1A636F70795F73696E- <1>
  1214 0000161A 676C655F636F756E74- <1>
  1214 00001623 65645F737472696E67- <1>
  1214 0000162C 67B1087472696D7075- <1>
  1214 00001635 747384810768657877- <1>
  1214 0000163E 6F7264EBA607646563- <1>
  1214 00001647 776F7264398C087075- <1>
  1214 00001650 74736C696E65B77408- <1>
  1214 00001659 7365746573326478AB- <1>
  1214 00001662 FF26646973705F6478- <1>
  1214 0000166B 61785F74696D65735F- <1>
  1214 00001674 63785F77696474685F- <1>
  1214 0000167D 62785F73697A652E73- <1>
  1214 00001686 746F72656FA20D7075- <1>
  1214 0000168F 74736C696E655F6372- <1>
  1214 00001698 6C66821B0768657862- <1>
  1214 000016A1 7974653DBA06686578- <1>
  1214 000016AA 6E7962986906696E74- <1>
  1214 000016B3 63686B21300A63616C- <1>
  1214 000016BC 6C5F696E743244      <1>
  1215 000016C3 C30B076C617374636D- <1> 	link_data_dump_names LINK_DATA_NAMES
  1215 000016CC 646B5D06646D79636D- <1>
  1215 000016D5 6454400D6D73672E75- <1>
  1215 000016DE 6E696E7374616C6C97- <1>
  1215 000016E7 B6136578745F636F6D- <1>
  1215 000016F0 6D616E645F68616E64- <1>
  1215 000016F9 6C6572EB4208657874- <1>
  1215 00001702 647373656CD52D0665- <1>
  1215 0000170B 787473656784E3086C- <1>
  1215 00001714 696E655F6F7574FDFC- <1>
  1215 0000171D 06707370646267044A- <1>
  1215 00001726 08636F64655F736567- <1>
  1215 0000172F B30510636F64655F6D- <1>
  1215 00001738 6F7661626C655F7365- <1>
  1215 00001741 676A5D09616C6C6F63- <1>
  1215 0000174A 5F7365678C610A616C- <1>
  1215 00001753 6C6F635F73697A650A- <1>
  1215 0000175C 0A05647373656C2AE7- <1>
  1215 00001765 0D686973746F727966- <1>
  1215 0000176E 6F726D617431AA0C68- <1>
  1215 00001777 6973746F72792E6C61- <1>
  1215 00001780 737475AE0D68697374- <1>
  1215 00001789 6F72792E6669727374- <1>
  1215 00001792 7D4210686973746F72- <1>
  1215 0000179B 792E7365676F727365- <1>
  1215 000017A4 6C73830D686973746F- <1>
  1215 000017AD 727962756666657227- <1>
  1215 000017B6 9B05737461636BC367- <1>
  1215 000017BF 09737461636B5F656E- <1>
  1215 000017C8 64E7D30B6578747365- <1>
  1215 000017D1 675F757365642BC80B- <1>
  1215 000017DA 6578747365675F7369- <1>
  1215 000017E3 7A65B2400C65787464- <1>
  1215 000017EC 6174615F75736564F6- <1>
  1215 000017F5 340C65787464617461- <1>
  1215 000017FE 5F73697A652AAE0765- <1>
  1215 00001807 7874646174612E6B0E- <1>
  1215 00001810 6578745F7661725F66- <1>
  1215 00001819 6F726D6174F8B40C65- <1>
  1215 00001822 78745F7661725F7369- <1>
  1215 0000182B 7A658FC30E6578745F- <1>
  1215 00001834 7661725F616D6F756E- <1>
  1215 0000183D 74E8B4076578745F76- <1>
  1215 00001846 6172C4E22369737661- <1>
  1215 0000184F 726961626C655F6D6F- <1>
  1215 00001858 7265627974655F6E61- <1>
  1215 00001861 6D6568656164657273- <1>
  1215 0000186A 2E6578748D710B6D73- <1>
  1215 00001873 672E696E7374616C6C- <1>
  1215 0000187C 5ABC086F7074696F6E- <1>
  1215 00001885 7337BC890D656E7472- <1>
  1215 0000188E 797365675F73697A65- <1>
  1215 00001897 89F205637373656CAF- <1>
  1215 000018A0 9D0A6D657373616765- <1>
  1215 000018A9 73656791300F6D6573- <1>
  1215 000018B2 736167657365675F73- <1>
  1215 000018BB 697A65B49D0A6D6573- <1>
  1215 000018C4 7361676573656CEAE5- <1>
  1215 000018CD 0F617578627566665F- <1>
  1215 000018D6 7365676D656E74B0B2- <1>
  1215 000018DF 14617578627566665F- <1>
  1215 000018E8 63757272656E745F73- <1>
  1215 000018F1 697A658B0010617578- <1>
  1215 000018FA 627566665F7365676F- <1>
  1215 00001903 7273656C192A176175- <1>
  1215 0000190C 78627566665F6D6F76- <1>
  1215 00001915 61626C655F7365676D- <1>
  1215 0000191E 656E74E1B31C617578- <1>
  1215 00001927 627566665F6D6F7661- <1>
  1215 00001930 626C655F6375727265- <1>
  1215 00001939 6E745F73697A653C42- <1>
  1215 00001942 18617578627566665F- <1>
  1215 0000194B 6D6F7661626C655F73- <1>
  1215 00001954 65676F7273656C3208- <1>
  1215 0000195D 09636F64655F73697A- <1>
  1215 00001966 65094A08636F64655F- <1>
  1215 0000196F 73656C63C211636F64- <1>
  1215 00001978 655F6D6F7661626C65- <1>
  1215 00001981 5F73697A65B8051063- <1>
  1215 0000198A 6F64655F6D6F766162- <1>
  1215 00001993 6C655F73656C1AF209- <1>
  1215 0000199C 636F6465325F736567- <1>
  1215 000019A5 DC620A636F6465325F- <1>
  1215 000019AE 73697A651FF209636F- <1>
  1215 000019B7 6465325F73656CC937- <1>
  1215 000019C0 11636F6465325F6D6F- <1>
  1215 000019C9 7661626C655F736567- <1>
  1215 000019D2 0DD312636F6465325F- <1>
  1215 000019DB 6D6F7661626C655F73- <1>
  1215 000019E4 697A65CE3711636F64- <1>
  1215 000019ED 65325F6D6F7661626C- <1>
  1215 000019F6 655F73656C67340F68- <1>
  1215 000019FF 6973746F72795F7365- <1>
  1215 00001A08 676D656E741E380F68- <1>
  1215 00001A11 6973746F7279736567- <1>
  1215 00001A1A 5F73697A656A2B0865- <1>
  1215 00001A23 7874637373656C892B- <1>
  1215 00001A2C 06656E76736567140B- <1>
  1215 00001A35 08656E765F73697A65- <1>
  1215 00001A3E 30CD0C636D64335F6E- <1>
  1215 00001A47 6F745F657874964816- <1>
  1215 00001A50 6578745F7072657072- <1>
  1215 00001A59 6F636573735F68616E- <1>
  1215 00001A62 646C6572702A11636D- <1>
  1215 00001A6B 64335F70726570726F- <1>
  1215 00001A74 636573736564C00110- <1>
  1215 00001A7D 6578745F616D69735F- <1>
  1215 00001A86 68616E646C65729555- <1>
  1215 00001A8F 1D6578745F61615F62- <1>
  1215 00001A98 65666F72655F676574- <1>
  1215 00001AA1 6C696E655F68616E64- <1>
  1215 00001AAA 6C6572A81B1161615F- <1>
  1215 00001AB3 6265666F72655F6765- <1>
  1215 00001ABC 746C696E65F2351C65- <1>
  1215 00001AC5 78745F61615F616674- <1>
  1215 00001ACE 65725F6765746C696E- <1>
  1215 00001AD7 655F68616E646C6572- <1>
  1215 00001AE0 09B91061615F616674- <1>
  1215 00001AE9 65725F6765746C696E- <1>
  1215 00001AF2 65AE24106578745F70- <1>
  1215 00001AFB 7574735F68616E646C- <1>
  1215 00001B04 65721AB70D70757473- <1>
  1215 00001B0D 5F6578745F646F6E65- <1>
  1215 00001B16 DD301B6578745F7075- <1>
  1215 00001B1F 74735F636F70796F75- <1>
  1215 00001B28 747075745F68616E64- <1>
  1215 00001B31 6C6572CF3F18707574- <1>
  1215 00001B3A 735F636F70796F7574- <1>
  1215 00001B43 7075745F6578745F64- <1>
  1215 00001B4C 6F6E65B9E118657874- <1>
  1215 00001B55 5F707574735F676574- <1>
  1215 00001B5E 6C696E655F68616E64- <1>
  1215 00001B67 6C65726F9D15707574- <1>
  1215 00001B70 735F6765746C696E65- <1>
  1215 00001B79 5F6578745F646F6E65- <1>
  1215 00001B82 3B26126578745F696E- <1>
  1215 00001B8B 6A6563745F68616E64- <1>
  1215 00001B94 6C65729C6C15657874- <1>
  1215 00001B9D 5F61615F696E6A6563- <1>
  1215 00001BA6 745F68616E646C6572- <1>
  1215 00001BAF C0CD0D706174636861- <1>
  1215 00001BB8 7265615F72756E05BD- <1>
  1215 00001BC1 157061746368617265- <1>
  1215 00001BCA 615F72756E2E736567- <1>
  1215 00001BD3 6D656E746FE3127061- <1>
  1215 00001BDC 746368617265615F72- <1>
  1215 00001BE5 756E2E73697A65C88C- <1>
  1215 00001BEE 107061746368617265- <1>
  1215 00001BF7 615F696E7472746E0D- <1>
  1215 00001C00 F41870617463686172- <1>
  1215 00001C09 65615F696E7472746E- <1>
  1215 00001C12 2E7365676D656E7467- <1>
  1215 00001C1B 491570617463686172- <1>
  1215 00001C24 65615F696E7472746E- <1>
  1215 00001C2D 2E73697A6579A51070- <1>
  1215 00001C36 61746368617265615F- <1>
  1215 00001C3F 706D5F657863BECB18- <1>
  1215 00001C48 706174636861726561- <1>
  1215 00001C51 5F706D5F6578632E73- <1>
  1215 00001C5A 65676D656E7456F715- <1>
  1215 00001C63 706174636861726561- <1>
  1215 00001C6C 5F706D5F6578632E73- <1>
  1215 00001C75 697A6568440E6C696E- <1>
  1215 00001C7E 6B63616C6C5F746162- <1>
  1215 00001C87 6C65F09E227472795F- <1>
  1215 00001C90 64656275676765725F- <1>
  1215 00001C99 616D69735F6D756C74- <1>
  1215 00001CA2 69706C65785F6E756D- <1>
  1215 00001CAB 626572CB510E696E74- <1>
  1215 00001CB4 65726E616C666C6167- <1>
  1215 00001CBD 7334688C15616D6973- <1>
  1215 00001CC6 5F6D756C7469706C65- <1>
  1215 00001CCF 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 00001CD7 214F7074696F6E616C- <1> .warning_code_optional:		counted "Optional code link missing, hash="
  1223 00001CE0 20636F6465206C696E- <1>
  1223 00001CE9 6B206D697373696E67- <1>
  1223 00001CF2 2C20686173683D      <1>
  1224                              <1> %endif
  1225                              <1> %if _ELDDATA_OPTIONAL
  1226 00001CF9 214F7074696F6E616C- <1> .warning_data_optional:		counted "Optional data link missing, hash="
  1226 00001D02 2064617461206C696E- <1>
  1226 00001D0B 6B206D697373696E67- <1>
  1226 00001D14 2C20686173683D      <1>
  1227                              <1> %endif
  1228 00001D1B 1844617461206C696E- <1> .error_data:			counted "Data link missing, hash="
  1228 00001D24 6B206D697373696E67- <1>
  1228 00001D2D 2C20686173683D      <1>
  1229 00001D34 18436F6465206C696E- <1> .error_code:			counted "Code link missing, hash="
  1229 00001D3D 6B206D697373696E67- <1>
  1229 00001D46 2C20686173683D      <1>
  1230 00001D4D 0A682C206C6162656C- <1> .error.2:			counted "h, label ",'"'
  1230 00001D56 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 00001D58 00<rep 8h>          <1> 	align 16, db 0
  2642                                  
  2643                                  	align 16
  2644                                  code_size equ $ - code
