     1                                  
     2                                  ; Public Domain
     3                                  
     4                                  ; test run command: ; .; .
     5                                  
     6                                  %include "lmacros3.mac"
     1                              <1> [list -]
    14                              <2> [list -]
    14                              <1> [list -]
     7                                  %include "eld.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2025 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELD_MAC
    16                              <1> %define ELD_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    19                              <1> 
    20                              <1> 		; ELD executable header
    21                              <1> 	struc ELD_HEADER
    22 00000000 ????????            <1> eldhSignature:		resb 4	; "ELD1"
    23 00000004 ??????              <1> 			resb 3	; reserved
    24 00000007 ??                  <1> 			resb 1	; 26 (Ctrl-Z)
    25 00000008 ????????            <1> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26 0000000C ????                <1> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27 0000000E ????                <1> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28 00000010 ????????            <1> eldhDataOffset:		resd 1
    29 00000014 ????                <1> eldhDataImageLength:	resw 1	; (zero allowed)
    30 00000016 ????                <1> eldhDataAllocLength:	resw 1	; (zero allowed)
    31 00000018 ????                <1> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32 0000001A ????????            <1> eldhReserved:		resb 4	; reserved
    33 0000001E ????                <1> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <1> 	endstruc
    35                              <1> 	endarea ELD_HEADER, 1
    36                              <1> 
    37                              <1> 	struc ELD_HEADERX
    38 00000000 <res 20h>           <1> eldhxHeader:		resb ELD_HEADER_size
    39 00000020 ????????            <1> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40 00000024 ????????            <1> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41 00000028 ????????            <1> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42 0000002C ????????            <1> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <1> 	alignb 16
    44                              <1> 	endstruc
    45                              <1> 
    46                              <1> 	struc ELD_TRAILER_HEADER
    47 00000000 ????????????????    <1> eldthSignature:		resb 8	; "ELD1TAIL"
    48 00000008 ????????            <1> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <1> 				;  add this dword to the seek offset
    50 0000000C ????                <1> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51 0000000E ????                <1> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <1> 	endstruc
    53                              <1> 	endarea ELD_TRAILER_HEADER, 1
    54                              <1> 
    55                              <1> 	struc ELD_LIBTABLE
    56 00000000 ????                <1> eldltFormat:		resw 1
    57                              <1> 	; 0 = uncompressed
    58                              <1> 	; 2 = heatshrink compressed
    59                              <1> 	; 3 = lzexedat -4 compressed
    60                              <1> 	; 4 = lzexedat -4 -l compressed
    61 00000002 ????                <1> eldltAmount:		resw 1
    62 00000004 ????????            <1> eldltOffset:		resd 1	; from eldhxHeader
    63                              <1> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <1> 	endstruc
    65                              <1> 	endarea ELD_LIBTABLE, 1
    66                              <1> 
    67                              <1> 		; ELD instance header
    68                              <1> 	struc ELD_INSTANCE
    69 00000000 ????                <1> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70 00000002 ????                <1> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71 00000004 ????                <1> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72 00000006 ????                <1> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73 00000008 ????????????????    <1> eldiIdentifier:		resb 8	; blank-filled text
    74 00000010 ????                <1> eldiFlags:		resw 1	; flags
    75                              <1> eldiListing_size equ 14
    76 00000012 <res Eh>            <1> eldiListing:		resb eldiListing_size
    77                              <1> 				; ASCIZ listing file name
    78                              <1> 	endstruc
    79                              <1> 		; flags for eldiFlags:
    80                              <1> eldifResident:		equ 1
    81                              <1> 
    82                              <1> 		; ELD link info header
    83                              <1> 	struc ELD_LINKINFO
    84 00000000 ????                <1> eldlSignature:		resw 1	; 0E1D1h
    85 00000002 ????????            <1> eldlReserved:		resw 2
    86 00000006 ????                <1> eldlUseLinkHash:	resw 1
    87 00000008 ????                <1> eldlDataAmount:		resw 1
    88 0000000A ????                <1> eldlDataPrefixes:	resw 1
    89 0000000C ????                <1> eldlDataEntries:	resw 1
    90 0000000E ????                <1> eldlDataAddresses:	resw 1
    91 00000010 ????                <1> eldlCodeAmount:		resw 1
    92 00000012 ????                <1> eldlCodePrefixes:	resw 1
    93 00000014 ????                <1> eldlCodeEntries:	resw 1
    94 00000016 ????                <1> eldlCodeAddresses:	resw 1
    95                              <1> 	endstruc
    96                              <1> 
    97                              <1> 	numdef ELD_CODE_VSTART, 9001h
    98                              <1> 	numdef ELD_DATA_VSTART, 8000h
    99                              <1> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <1> 
   101                              <1> 	numdef ELD_RECLAIM_HINT, 0
   102                              <1> 	strdef ELD_LISTING, ""
   103                              <1> 	numdef ELD_DATETIME, 0
   104                              <1> 
   105                              <1> %if _ELD_DATETIME
   106                              <1>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <1>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <1> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <1> 		asciz		; for future extension
   110                              <1>  %endmacro
   111                              <1> %else
   112                              <1>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <1>  %define PUT_ELD_DATETIME
   114                              <1> %endif
   115                              <1> 
   116                              <1> %endif
     8                                  %include "eldcall.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug call macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2024 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELDCALL_MAC
    16                              <1> %define ELDCALL_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    19                              <1> %include "nasmhash.mac"
     1                              <2> 
     2                              <2> %if 0
     3                              <2> 
     4                              <2> Hashing macros
     5                              <2>  by E. C. Masloch, 2019
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef __NASMHASH_MAC__
    16                              <2> %assign __NASMHASH_MAC__ 1
    17                              <2> 
    18                              <2> 
    19                              <2> 	%macro hashdef 2+.nolist
    20                              <2> %ifempty %2
    21                              <2>  %assign _%1 1
    22                              <2> %else
    23                              <2> %ifstr %2
    24                              <2>  %define %%string %2
    25                              <2> %elifid %2
    26                              <2>  %defstr %%string %2
    27                              <2> %elifnum %2
    28                              <2>  %defstr %%string %2
    29                              <2> %eliftok %2
    30                              <2>  %defstr %%string %2
    31                              <2> %else
    32                              <2>  %error Unknown input
    33                              <2> %endif
    34                              <2> %strlen %%length %%string
    35                              <2> %assign %%hash 1
    36                              <2> %assign %%index 1
    37                              <2> %rep %%length
    38                              <2>  %substr %%char %%string %%index
    39                              <2>  %assign %%hash (%%hash * 31 + %%char) & 0FFFFh
    40                              <2>  %assign %%index %%index + 1
    41                              <2> %endrep
    42                              <2> %assign _%1 %%hash
    43                              <2> %endif
    44                              <2> 	%endmacro
    45                              <2> 
    46                              <2> 
    47                              <2> %endif
    20                              <1> %include "elddata.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug data relocation macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2024 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef ELDDATA_MAC
    16                              <2> %define ELDDATA_MAC 1
    17                              <2> 
    18                              <2> %include "lmacros3.mac"
     1                              <3> [list -]
    19                              <2> %include "nasmhash.mac"
     1                              <3> 
     2                              <3> %if 0
     3                              <3> 
     4                              <3> Hashing macros
     5                              <3>  by E. C. Masloch, 2019
     6                              <3> 
     7                              <3> Usage of the works is permitted provided that this
     8                              <3> instrument is retained with the works, so that any entity
     9                              <3> that uses the works is notified of this instrument.
    10                              <3> 
    11                              <3> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <3> 
    13                              <3> %endif
    14                              <3> 
    15                              <3> %ifndef __NASMHASH_MAC__
    16                              <3> %assign __NASMHASH_MAC__ 1
    17                              <3> 
    18                              <3> 
    19                              <3> 	%macro hashdef 2+.nolist
    20                              <3> %ifempty %2
    21                              <3>  %assign _%1 1
    22                              <3> %else
    23                              <3> %ifstr %2
    24                              <3>  %define %%string %2
    25                              <3> %elifid %2
    26                              <3>  %defstr %%string %2
    27                              <3> %elifnum %2
    28                              <3>  %defstr %%string %2
    29                              <3> %eliftok %2
    30                              <3>  %defstr %%string %2
    31                              <3> %else
    32                              <3>  %error Unknown input
    33                              <3> %endif
    34                              <3> %strlen %%length %%string
    35                              <3> %assign %%hash 1
    36                              <3> %assign %%index 1
    37                              <3> %rep %%length
    38                              <3>  %substr %%char %%string %%index
    39                              <3>  %assign %%hash (%%hash * 31 + %%char) & 0FFFFh
    40                              <3>  %assign %%index %%index + 1
    41                              <3> %endrep
    42                              <3> %assign _%1 %%hash
    43                              <3> %endif
    44                              <3> 	%endmacro
    45                              <3> 
    46                              <3> 
    47                              <3> %endif
    20                              <2> %include "eldcheck.mac"
     1                              <3> %if 0
     2                              <3> 
     3                              <3> Extensions for lDebug relocation check macros
     4                              <3> 
     5                              <3> Copyright (C) 2008-2023 E. C. Masloch
     6                              <3> 
     7                              <3> Usage of the works is permitted provided that this
     8                              <3> instrument is retained with the works, so that any entity
     9                              <3> that uses the works is notified of this instrument.
    10                              <3> 
    11                              <3> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <3> 
    13                              <3> %endif
    14                              <3> 
    15                              <3> %ifndef ELDCHECK_MAC
    16                              <3> %define ELDCHECK_MAC 1
    17                              <3> 
    18                              <3> %assign ELDSTRICT 0
    19                              <3> %assign ELDSTRICTCOUNTER 0
    20                              <3> 
    21                              <3> 	%imacro eldstrict 1.nolist
    22                              <3> %ifidni %1, on
    23                              <3>  %assign ELDSTRICT 1
    24                              <3>  [warning +error=reloc-abs]
    25                              <3>  [warning +reloc-abs]
    26                              <3> %elifidni %1, off
    27                              <3>  %assign ELDSTRICT 0
    28                              <3>  [warning -reloc-abs]
    29                              <3> %else
    30                              <3>  %error Unknown keyword
    31                              <3> %endif
    32                              <3> 	%endmacro
    33                              <3> 
    34                              <3> 	%imacro reloc 1+.nolist
    35                              <3> %if ELDSTRICT
    36                              <3>  %if ELDSTRICTCOUNTER
    37                              <3>   %error Missing relocation
    38                              <3>  %endif
    39                              <3>  [warning -reloc-abs]
    40                              <3>  %assign ELDSTRICTCOUNTER 1
    41                              <3> %endif
    42                              <3> %1
    43                              <3> 	%endmacro
    44                              <3> 
    45                              <3> 	%imacro reloc2 1+.nolist
    46                              <3> %if ELDSTRICT
    47                              <3>  %if ELDSTRICTCOUNTER
    48                              <3>   %error Missing relocation
    49                              <3>  %endif
    50                              <3>  [warning -reloc-abs]
    51                              <3>  %assign ELDSTRICTCOUNTER 2
    52                              <3> %endif
    53                              <3> %1
    54                              <3> 	%endmacro
    55                              <3> 
    56                              <3> 	%imacro eldstrictcheck 0.nolist
    57                              <3> %if ELDSTRICT
    58                              <3>  %ifn ELDSTRICTCOUNTER
    59                              <3>   %error Unexpected relocation
    60                              <3>  %else
    61                              <3>   %assign ELDSTRICTCOUNTER ELDSTRICTCOUNTER - 1
    62                              <3>   %ifn ELDSTRICTCOUNTER
    63                              <3>    [warning +reloc-abs]
    64                              <3>   %endif
    65                              <3>  %endif
    66                              <3> %endif
    67                              <3> 	%endmacro
    68                              <3> 
    69                              <3> %endif
    70                              <3> 
    21                              <2> 
    22                              <2> 
    23                              <2> %assign ELDLINKER 0
    24                              <2> 
    25                              <2> %define INTERNAL_CODE_TO_CODE_RELOCATIONS ""
    26                              <2> %define INTERNAL_CODE_TO_DATA_RELOCATIONS ""
    27                              <2> %define INTERNAL_DATA_TO_CODE_RELOCATIONS ""
    28                              <2> %define INTERNAL_DATA_TO_DATA_RELOCATIONS ""
    29                              <2> %define INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS ""
    30                              <2> %define INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS ""
    31                              <2> %define INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS ""
    32                              <2> %define INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS ""
    33                              <2> %assign ELDDATA_OPTIONAL_STATUS 0		; not any seen yet
    34                              <2> %assign ELDDATA_PMREQUIRED_STATUS 0		; not any seen yet
    35                              <2> 
    36                              <2> 	%imacro internalcoderelocation 0-1.nolist -2
    37                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    38                              <2> %if ELDLINKER
    39                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    40                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    41                              <2>  %else
    42                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    43                              <2>  %endif
    44                              <2> %else
    45                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    46                              <2>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    47                              <2>  %else
    48                              <2>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    49                              <2>  %endif
    50                              <2> %endif
    51                              <2> 	eldstrictcheck
    52                              <2> 	%endmacro
    53                              <2> 
    54                              <2> 	%imacro internaldatarelocation 0-1.nolist -2
    55                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    56                              <2> %if ELDLINKER
    57                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    58                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    59                              <2>  %else
    60                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    61                              <2>  %endif
    62                              <2> %else
    63                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    64                              <2>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    65                              <2>  %else
    66                              <2>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    67                              <2>  %endif
    68                              <2> %endif
    69                              <2> 	eldstrictcheck
    70                              <2> 	%endmacro
    71                              <2> 
    72                              <2> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    73                              <2> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    74                              <2> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    75                              <2> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    76                              <2> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    77                              <2> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    78                              <2> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    79                              <2> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    80                              <2> 
    81                              <2> 
    82                              <2> %define LINK_DATA_RELOCATIONS ""
    83                              <2> %define LINK_LINKER_DATA_RELOCATIONS ""
    84                              <2> %define LINK_DATA_NAMES db ""
    85                              <2> %define LINK_DATA_DETECTION none, none
    86                              <2> 
    87                              <2> %define LINK_OTHER_DATA_RELOCATIONS ""
    88                              <2> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    89                              <2> %define LINK_OTHER_DATA_NAMES db ""
    90                              <2> %define LINK_OTHER_DATA_DETECTION none, none
    91                              <2> 
    92                              <2> %ifndef ELDOTHER
    93                              <2>  %assign ELDOTHER 0
    94                              <2> %endif
    95                              <2> %assign ELDOTHERLINK 0
    96                              <2> 
    97                              <2> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
    98                              <2> %if ELDOTHER
    99                              <2>  %assign ELDOTHERLINK 1
   100                              <2> %endif
   101                              <2> 	linkdatarelocation %1, %2, %3
   102                              <2> %assign ELDOTHERLINK 0
   103                              <2> 	%endmacro
   104                              <2> 
   105                              <2> 	%imacro linkdatarelocation 1-3.nolist -2, required
   106                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   107                              <2> %ifidni %3, required
   108                              <2>  %assign %%optional 0
   109                              <2> %elifidni %3, optional
   110                              <2>  %assign %%optional 100h
   111                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   112                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   113                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   114                              <2>  %else
   115                              <2>   %error Optional data link not allowed here
   116                              <2>  %endif
   117                              <2> %elifidni %3, PM required
   118                              <2>  %assign %%optional 300h
   119                              <2>  %assign ELDDATA_PMREQUIRED_STATUS 1
   120                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   121                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   122                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   123                              <2>  %else
   124                              <2>   %error Optional data link not allowed here
   125                              <2>  %endif
   126                              <2> %else
   127                              <2>  %fatal Unknown optional keyword
   128                              <2> %endif
   129                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
   130                              <2>  %assign %%DATASECTION 1
   131                              <2> %else
   132                              <2>  %assign %%DATASECTION 0
   133                              <2> %endif
   134                              <2> 	%if ELDOTHERLINK
   135                              <2> %if ELDLINKER
   136                              <2>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   137                              <2> %else
   138                              <2>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   139                              <2> %endif
   140                              <2> 	%else
   141                              <2> %if ELDLINKER
   142                              <2>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   143                              <2> %else
   144                              <2>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   145                              <2> %endif
   146                              <2> 	%endif
   147                              <2> %defstr %%string %1
   148                              <2> %strlen %%length %%string
   149                              <2> %if %%length > 64
   150                              <2>  %error Too long link name: %1
   151                              <2> %endif
   152                              <2> %define LINK_DATA_CHECK %1
   153                              <2> 	%if ELDOTHERLINK
   154                              <2> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   155                              <2> %if LINK_DATA_NEW
   156                              <2>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   157                              <2> 	hashdef HASH, %%string
   158                              <2>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   160                              <2> %else
   161                              <2>  %%name equ LINK_DATA_DUPLICATE
   162                              <2> %endif
   163                              <2> 	%else
   164                              <2> 	linkdata_detect LINK_DATA_DETECTION
   165                              <2> %if LINK_DATA_NEW
   166                              <2>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   167                              <2> 	hashdef HASH, %%string
   168                              <2>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   170                              <2> %else
   171                              <2>  %%name equ LINK_DATA_DUPLICATE
   172                              <2> %endif
   173                              <2> 	%endif
   174                              <2> 	eldstrictcheck
   175                              <2> 	%endmacro
   176                              <2> 
   177                              <2> 	%imacro linkdata_detect 2-*.nolist
   178                              <2> %assign LINK_DATA_NEW 1
   179                              <2> %rep (%0 - 2) / 2
   180                              <2>  %rotate 2
   181                              <2>  %ifidni %1, LINK_DATA_CHECK
   182                              <2>   %assign LINK_DATA_NEW 0
   183                              <2>   %xdefine LINK_DATA_DUPLICATE %2
   184                              <2>   %exitrep
   185                              <2>  %endif
   186                              <2> %endrep
   187                              <2> 	%endmacro
   188                              <2> 
   189                              <2> 	%imacro link_data_dump_names 1-*.nolist
   190                              <2> %rep %0
   191                              <2> 	%1
   192                              <2>  %rotate 1
   193                              <2> %endrep
   194                              <2> 	%endmacro
   195                              <2> 
   196                              <2> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   197                              <2> ; dw LINK_DATA_RELOCATIONS, 0, 0
   198                              <2> ; link_data_dump_names ELDCALL_CODE_NAMES
   199                              <2> 
   200                              <2> %endif
    21                              <1> 
    22                              <1> %assign ELDLINKER 0
    23                              <1> 
    24                              <1> [section relocatedzero nobits vstart=0]
    25                              <1> relocatedzero:
    26                              <1> __SECT__
    27                              <1> 
    28                              <1> 	numdef HOUDINI, 1
    29                              <1> 	numdef HOUDINI_CONDITIONAL, 1
    30                              <1> 
    31                              <1> %imacro houdini 0.nolist
    32                              <1> %if _HOUDINI
    33                              <1>  %if _HOUDINI_CONDITIONAL
    34                              <1> reloc	testopt [ss:relocateddata], 100h
    35                              <1> linkdatarelocation options7, -3
    36                              <1> 	jz %%skip
    37                              <1>  %endif
    38                              <1> reloc	testopt [ss:relocateddata], 100h
    39                              <1> linkdatarelocation internalflags6, -3
    40                              <1> 	jz %%skip
    41                              <1> 	int3
    42                              <1> %%skip:
    43                              <1> %endif
    44                              <1> %endmacro
    45                              <1> 
    46                              <1> %define ELDCALL_CODE_RELOCATIONS ""
    47                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS ""
    48                              <1> %define ELDCALL_CODE_RELOCATIONS_OPTIONAL ""
    49                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ""
    50                              <1> %define ELDCALL_CODE_NAMES db ""
    51                              <1> %define ELDCALL_CODE_DETECTION none, none
    52                              <1> %assign ELDCALL_OPTIONAL_STATUS 0		; not any seen yet
    53                              <1> %assign ELDCALL_PMREQUIRED_STATUS 0		; not any seen yet
    54                              <1> 
    55                              <1> 	%imacro extcall 1-2.nolist required
    56                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
    57                              <1>  %error "ELD call cannot be used in ELD data block"
    58                              <1> %endif
    59                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP
    60                              <1> %ifidni %2, required
    61                              <1>  %assign %%optional 0
    62                              <1> %elifidni %2, optional
    63                              <1>  %assign %%optional 100h
    64                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    65                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    66                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    67                              <1>  %else
    68                              <1>   %error Optional code link not allowed here
    69                              <1>  %endif
    70                              <1> %elifidni %2, PM required
    71                              <1>  %assign %%optional 300h
    72                              <1>  %assign ELDCALL_PMREQUIRED_STATUS 1
    73                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    74                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    75                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    76                              <1>  %else
    77                              <1>   %error Optional code link not allowed here
    78                              <1>  %endif
    79                              <1> %else
    80                              <1>  %fatal Unknown optional keyword
    81                              <1> %endif
    82                              <1> %if 0
    83                              <1> [warning -reloc-rel-word]
    84                              <1> 	call near relocatedzero
    85                              <1> [warning +reloc-rel-word]
    86                              <1> %else
    87                              <1> 	db 0E8h
    88                              <1> reloc	dw relocatedzero
    89                              <1> 	eldstrictcheck
    90                              <1> %endif
    91                              <1> 	jmp strict short %%skipparameter
    92                              <1> 	dw 0
    93                              <1> %%skipparameter:
    94                              <1> %if ELDLINKER
    95                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS ELDCALL_LINKER_CODE_RELOCATIONS, %%entry, %%name
    96                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
    97                              <1> %else
    98                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS ELDCALL_CODE_RELOCATIONS, %%entry, %%name
    99                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS_OPTIONAL ELDCALL_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional, %%entry, %%name
   100                              <1> %endif
   101                              <1> %defstr %%string %1
   102                              <1> %strlen %%length %%string
   103                              <1> %if %%length > 64
   104                              <1>  %error Too long link name: %1
   105                              <1> %endif
   106                              <1> %define ELDCALL_CODE_CHECK %1
   107                              <1> 	linkcode_detect ELDCALL_CODE_DETECTION
   108                              <1> %if ELDCALL_CODE_NEW
   109                              <1>  %xdefine ELDCALL_CODE_DETECTION ELDCALL_CODE_DETECTION, %1, %%name
   110                              <1> 	hashdef HASH, %%string
   111                              <1> %xdefine ELDCALL_CODE_NAMES 	ELDCALL_CODE_NAMES, %%name:, dw _HASH, {counted %%string}
   113                              <1> %else
   114                              <1>  %%name equ ELDCALL_CODE_DUPLICATE
   115                              <1> %endif
   116                              <1> 	%endmacro
   117                              <1> 
   118                              <1> 	%imacro linkcode_detect 2-*.nolist
   119                              <1> %assign ELDCALL_CODE_NEW 1
   120                              <1> %rep (%0 - 2) / 2
   121                              <1>  %rotate 2
   122                              <1>  %ifidni %1, ELDCALL_CODE_CHECK
   123                              <1>   %assign ELDCALL_CODE_NEW 0
   124                              <1>   %xdefine ELDCALL_CODE_DUPLICATE %2
   125                              <1>   %exitrep
   126                              <1>  %endif
   127                              <1> %endrep
   128                              <1> 	%endmacro
   129                              <1> 
   130                              <1> 
   131                              <1> %define ELDCALL_CALLCALL_LIST none
   132                              <1> 
   133                              <1> 	%imacro extcallcall 1.nolist
   134                              <1> 	call %1
   135                              <1> %xdefine ELDCALL_CALLCALL_LIST ELDCALL_CALLCALL_LIST, %1
   136                              <1> 	%endmacro
   137                              <1> 
   138                              <1> %assign ELDCALLCALL_DUMPED 0
   139                              <1> 
   140                              <1> 	%imacro eldcall_dump_callcall 1-*.nolist
   141                              <1> %define ELDCALL_CALLCALL_PROCESSED none
   142                              <1>  %rep %0 - 1
   143                              <1>   %rotate 1
   144                              <1>   %define ELDCALL_CHECK %1
   145                              <1> 	eldcall_callcall_detect ELDCALL_CALLCALL_PROCESSED
   146                              <1>   %if ELDCALL_NEW
   147                              <1>    %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED, %1
   148                              <1> 	align 8, nop
   149                              <1> %1:
   150                              <1> 	extcall %1
   151                              <1> 	retn
   152                              <1>   %endif
   153                              <1>  %endrep
   154                              <1> %unimacro extcallcall 1.nolist
   155                              <1> %assign ELDCALLCALL_DUMPED 1
   156                              <1> %define ELDCALL_CALLCALL_LIST none
   157                              <1> 	%endmacro
   158                              <1> 
   159                              <1> 	%imacro eldcall_callcall_detect 1-*.nolist
   160                              <1> %assign ELDCALL_NEW 1
   161                              <1> %rep %0 - 1
   162                              <1>  %rotate 1
   163                              <1>  %ifidni %1, ELDCALL_CHECK
   164                              <1>   %assign ELDCALL_NEW 0
   165                              <1>   %exitrep
   166                              <1>  %endif
   167                              <1> %endrep
   168                              <1> 	%endmacro
   169                              <1> 
   170                              <1> 	%imacro eldcall_dump_names 1-*.nolist
   171                              <1> %rep %0
   172                              <1> 	%1
   173                              <1>  %rotate 1
   174                              <1> %endrep
   175                              <1> 	%endmacro
   176                              <1> 
   177                              <1> ; eldcall_dump_callcall ELDCALL_CALLCALL_LIST
   178                              <1> ; if using optional code links:
   179                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   180                              <1> ;  dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   181                              <1> ; if not using optional code links:
   182                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   183                              <1> ;  dw ELDCALL_CODE_RELOCATIONS, 0, 0
   184                              <1> ; eldcall_dump_names ELDCALL_CODE_NAMES
   185                              <1> 
   186                              <1> %endif
     9                                  %include "elddata.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug data relocation macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2024 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %ifndef ELDDATA_MAC
    16                              <1> %define ELDDATA_MAC 1
    17                              <1> 
    18                              <1> %include "lmacros3.mac"
    19                              <1> %include "nasmhash.mac"
    20                              <1> %include "eldcheck.mac"
    21                              <1> 
    22                              <1> 
    23                              <1> %assign ELDLINKER 0
    24                              <1> 
    25                              <1> %define INTERNAL_CODE_TO_CODE_RELOCATIONS ""
    26                              <1> %define INTERNAL_CODE_TO_DATA_RELOCATIONS ""
    27                              <1> %define INTERNAL_DATA_TO_CODE_RELOCATIONS ""
    28                              <1> %define INTERNAL_DATA_TO_DATA_RELOCATIONS ""
    29                              <1> %define INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS ""
    30                              <1> %define INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS ""
    31                              <1> %define INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS ""
    32                              <1> %define INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS ""
    33                              <1> %assign ELDDATA_OPTIONAL_STATUS 0		; not any seen yet
    34                              <1> %assign ELDDATA_PMREQUIRED_STATUS 0		; not any seen yet
    35                              <1> 
    36                              <1> 	%imacro internalcoderelocation 0-1.nolist -2
    37                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    38                              <1> %if ELDLINKER
    39                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    40                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    41                              <1>  %else
    42                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    43                              <1>  %endif
    44                              <1> %else
    45                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    46                              <1>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    47                              <1>  %else
    48                              <1>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    49                              <1>  %endif
    50                              <1> %endif
    51                              <1> 	eldstrictcheck
    52                              <1> 	%endmacro
    53                              <1> 
    54                              <1> 	%imacro internaldatarelocation 0-1.nolist -2
    55                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    56                              <1> %if ELDLINKER
    57                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    58                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    59                              <1>  %else
    60                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    61                              <1>  %endif
    62                              <1> %else
    63                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    64                              <1>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    65                              <1>  %else
    66                              <1>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    67                              <1>  %endif
    68                              <1> %endif
    69                              <1> 	eldstrictcheck
    70                              <1> 	%endmacro
    71                              <1> 
    72                              <1> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    73                              <1> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    74                              <1> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    75                              <1> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    76                              <1> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    77                              <1> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    78                              <1> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    79                              <1> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    80                              <1> 
    81                              <1> 
    82                              <1> %define LINK_DATA_RELOCATIONS ""
    83                              <1> %define LINK_LINKER_DATA_RELOCATIONS ""
    84                              <1> %define LINK_DATA_NAMES db ""
    85                              <1> %define LINK_DATA_DETECTION none, none
    86                              <1> 
    87                              <1> %define LINK_OTHER_DATA_RELOCATIONS ""
    88                              <1> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    89                              <1> %define LINK_OTHER_DATA_NAMES db ""
    90                              <1> %define LINK_OTHER_DATA_DETECTION none, none
    91                              <1> 
    92                              <1> %ifndef ELDOTHER
    93                              <1>  %assign ELDOTHER 0
    94                              <1> %endif
    95                              <1> %assign ELDOTHERLINK 0
    96                              <1> 
    97                              <1> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
    98                              <1> %if ELDOTHER
    99                              <1>  %assign ELDOTHERLINK 1
   100                              <1> %endif
   101                              <1> 	linkdatarelocation %1, %2, %3
   102                              <1> %assign ELDOTHERLINK 0
   103                              <1> 	%endmacro
   104                              <1> 
   105                              <1> 	%imacro linkdatarelocation 1-3.nolist -2, required
   106                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   107                              <1> %ifidni %3, required
   108                              <1>  %assign %%optional 0
   109                              <1> %elifidni %3, optional
   110                              <1>  %assign %%optional 100h
   111                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   112                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   113                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   114                              <1>  %else
   115                              <1>   %error Optional data link not allowed here
   116                              <1>  %endif
   117                              <1> %elifidni %3, PM required
   118                              <1>  %assign %%optional 300h
   119                              <1>  %assign ELDDATA_PMREQUIRED_STATUS 1
   120                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   121                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   122                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   123                              <1>  %else
   124                              <1>   %error Optional data link not allowed here
   125                              <1>  %endif
   126                              <1> %else
   127                              <1>  %fatal Unknown optional keyword
   128                              <1> %endif
   129                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
   130                              <1>  %assign %%DATASECTION 1
   131                              <1> %else
   132                              <1>  %assign %%DATASECTION 0
   133                              <1> %endif
   134                              <1> 	%if ELDOTHERLINK
   135                              <1> %if ELDLINKER
   136                              <1>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   137                              <1> %else
   138                              <1>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   139                              <1> %endif
   140                              <1> 	%else
   141                              <1> %if ELDLINKER
   142                              <1>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   143                              <1> %else
   144                              <1>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional, %%entry, %%name
   145                              <1> %endif
   146                              <1> 	%endif
   147                              <1> %defstr %%string %1
   148                              <1> %strlen %%length %%string
   149                              <1> %if %%length > 64
   150                              <1>  %error Too long link name: %1
   151                              <1> %endif
   152                              <1> %define LINK_DATA_CHECK %1
   153                              <1> 	%if ELDOTHERLINK
   154                              <1> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   155                              <1> %if LINK_DATA_NEW
   156                              <1>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   157                              <1> 	hashdef HASH, %%string
   158                              <1>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   160                              <1> %else
   161                              <1>  %%name equ LINK_DATA_DUPLICATE
   162                              <1> %endif
   163                              <1> 	%else
   164                              <1> 	linkdata_detect LINK_DATA_DETECTION
   165                              <1> %if LINK_DATA_NEW
   166                              <1>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   167                              <1> 	hashdef HASH, %%string
   168                              <1>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   170                              <1> %else
   171                              <1>  %%name equ LINK_DATA_DUPLICATE
   172                              <1> %endif
   173                              <1> 	%endif
   174                              <1> 	eldstrictcheck
   175                              <1> 	%endmacro
   176                              <1> 
   177                              <1> 	%imacro linkdata_detect 2-*.nolist
   178                              <1> %assign LINK_DATA_NEW 1
   179                              <1> %rep (%0 - 2) / 2
   180                              <1>  %rotate 2
   181                              <1>  %ifidni %1, LINK_DATA_CHECK
   182                              <1>   %assign LINK_DATA_NEW 0
   183                              <1>   %xdefine LINK_DATA_DUPLICATE %2
   184                              <1>   %exitrep
   185                              <1>  %endif
   186                              <1> %endrep
   187                              <1> 	%endmacro
   188                              <1> 
   189                              <1> 	%imacro link_data_dump_names 1-*.nolist
   190                              <1> %rep %0
   191                              <1> 	%1
   192                              <1>  %rotate 1
   193                              <1> %endrep
   194                              <1> 	%endmacro
   195                              <1> 
   196                              <1> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   197                              <1> ; dw LINK_DATA_RELOCATIONS, 0, 0
   198                              <1> ; link_data_dump_names ELDCALL_CODE_NAMES
   199                              <1> 
   200                              <1> %endif
    10                                  
    11                                  	numdef COMPRESSED, 0
    12                                  	numdef COMPRESSLIB, 0
    13                                  %assign _ELDCOMPRESSED _COMPRESSED
    14                                  	numdef ALIGNPAGE, 1
    15                                  	excdef !_COMPRESSED, ALIGNPAGE
    16                                  	numdef DATABUFFER, 1
    17                                  	numdef ELD_TEST_LIB, 0
    18                                   	numdef ELD_ZERO_OFFSETS, 1
    19                                  
    20                                  %assign _DEBUG 1
    21                                  %assign _CATCHINT0C 0
    22                                  %assign _CATCHINT0D 0
    23                                  %assign _CATCHINTFAULTCOND 0
    24                                  %assign _DEBUG_COND 1
    25                                  %assign _DELAY_BEFORE_BP 0
    26                                  %assign _DHIGHLIGHT 0
    27                                  %assign _GETLINEHIGHLIGHT 0
    28                                  %assign _IMMASM 0
    29                                  %assign _INPUT_FILE_BOOT 0
    30                                  %assign _INPUT_FILE_HANDLES 0
    31                                  %assign _MS_0RANGE_COMPAT 0
    32                                  %assign _PM 0
    33                                  %assign _RH 0
    34                                  %assign _SYMBOLIC 0
    35                                  %assign _VXCHG 0
    36                                  %include "options.mac"
     1                              <1> 
     2                              <1> %if 0
     3                              <1> 
     4                              <1> lDebug options and internal flags
     5                              <1> 
     6                              <1> Copyright (C) 2008-2023 E. C. Masloch
     7                              <1> 
     8                              <1> Usage of the works is permitted provided that this
     9                              <1> instrument is retained with the works, so that any entity
    10                              <1> that uses the works is notified of this instrument.
    11                              <1> 
    12                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    13                              <1> 
    14                              <1> %endif
    15                              <1> 
    16                              <1> 
    17                              <1> dispregs32	equ	  1	; RX: 32-bit register display (R, T/P/G)
    18                              <1> traceints	equ	  2	; TM: trace into interrupts (T)
    19                              <1> cpdepchars	equ	  4	; allow dumping of CP-dependent characters (D, DX)
    20                              <1> fakeindos	equ	  8	; always assume InDOS flag non-zero (all)
    21                              <1> nonpagingdevice	equ	 10h	; disallow paged output with [more] prompt (all exc. P, T)
    22                              <1> 	; This option was never used anywhere:
    23                              <1> ; pagingdevice	equ	 20h	; allow paged output with [more] prompt (all exc. P, T)
    24                              <1> 				; paged output is by default on if the output device is StdOut, else off
    25                              <1> hexrn		equ	 40h	; display raw hexadecimal content of FPU registers (RN)
    26                              <1> ;novdd		equ	 80h	; don't use a registered NTVDM VDD (L, W)
    27                              <1> nondospaging	equ	100h	; paging: don't use DOS for input when waiting for a key
    28                              <1> opt1_86mnohlt	equ	200h	; (86 Mode:) HLT doesn't work, don't use it
    29                              <1> biosidles	equ	400h	; don't idle with HLT or Int2F.1680, only call BIOS Int16.00
    30                              <1> opt_usegetinput	equ	800h	; use getinput for int 21h interactive input
    31                              <1> use_si_units	equ    1000h	; in disp_*_size use SI units (kB = 1000, etc)
    32                              <1> use_jedec_units	equ    2000h	; in disp_*_size use JEDEC units (kB = 1024)
    33                              <1> enable_serial	equ    4000h	; enable serial I/O (preferred over DOS or BIOS terminal)
    34                              <1> int8_disable_serial equ	   8000h	; disable serial I/O when breaking due to intr8
    35                              <1> gg_do_not_skip_bp equ	 1_0000h	; gg: do not skip a breakpoint (bb or gg)
    36                              <1> gg_no_autorepeat equ	 2_0000h	; gg: do not auto-repeat
    37                              <1> tp_do_not_skip_bp equ	 4_0000h	; T/TP/P: do not skip a (bb) breakpoint
    38                              <1> gg_bb_hit_no_repeat equ	 8_0000h	; gg: do not auto-repeat after bb hit
    39                              <1> tp_bb_hit_no_repeat equ	10_0000h	; T/TP/P: do not auto-repeat after bb hit
    40                              <1> gg_unexpected_no_repeat equ 20_0000h	; gg: do not auto-repeat after unexpectedinterrupt
    41                              <1> tp_unexpected_no_repeat equ 40_0000h	; T/TP/P
    42                              <1> ss_no_dump:		equ 80_0000h
    43                              <1> %if _SYMBOLIC
    44                              <1> dd_no_blanks_sym:	equ 100_0000h
    45                              <1> zz_no_pm_xms:		equ 200_0000h
    46                              <1> %endif
    47                              <1> rr_disasm_no_rept:	equ 1000_0000h
    48                              <1> rr_disasm_no_show:	equ 2000_0000h
    49                              <1> opt_cmdline_quiet_input:equ 4000_0000h
    50                              <1> opt_cmdline_quiet_output:equ 8000_0000h
    51                              <1> %if _SYMBOLIC
    52                              <1> DEFAULTOPTIONS	equ zz_no_pm_xms
    53                              <1> %else
    54                              <1> DEFAULTOPTIONS	equ 0
    55                              <1> %endif
    56                              <1> 
    57                              <1> 
    58                              <1> opt2_db_header:		equ 1
    59                              <1> opt2_db_trailer:	equ 2
    60                              <1> opt2_dw_header:		equ 10h
    61                              <1> opt2_dw_trailer:	equ 20h
    62                              <1> opt2_dd_header:		equ 100h
    63                              <1> opt2_dd_trailer:	equ 200h
    64                              <1> opt2_getinput_dpmi:	equ 800h
    65                              <1> opt2_hh_compat:		equ 1000h
    66                              <1> opt2_getc_idle:		equ 2000h
    67                              <1> opt2_getc_idle_dpmi:	equ 4000h
    68                              <1> opt2_re_cancel_tpg:	equ 8000h
    69                              <1> opt2_nn_compat:		equ 1_0000h
    70                              <1> opt2_nn_capitalise:	equ 2_0000h
    71                              <1> %if _MS_0RANGE_COMPAT
    72                              <1> opt2_0range_compat:	equ 4_0000h
    73                              <1> %endif
    74                              <1> opt2_rr16_compat:	equ 8_0000h
    75                              <1> opt2_r_prompt_compat:	equ 10_0000h
    76                              <1> opt2_r_separate:	equ 20_0000h
    77                              <1> opt2_r_linebreak_always:equ 40_0000h
    78                              <1> opt2_dpminohlt:		equ 8000_0000h	; DPMI doesn't like hlt
    79                              <1> DEFAULTOPTIONS2	equ opt2_dw_header | opt2_dd_header | opt2_getc_idle_dpmi | opt2_dpminohlt
    80                              <1> 
    81                              <1> 
    82                              <1> opt3_tt_no_paging:	equ 1
    83                              <1> opt3_tp_no_paging:	equ 2
    84                              <1> opt3_pp_no_paging:	equ 4
    85                              <1> opt3_gg_no_paging:	equ 8
    86                              <1> opt3_silence_paging_set:equ 100h
    87                              <1> opt3_silence_paging_on:	equ 200h
    88                              <1> opt3_paging_rc:		equ 1000h
    89                              <1> opt3_paging_yy:		equ 2000h
    90                              <1> opt3_paging_re:		equ 4000h
    91                              <1> opt3_r_highlight_diff:	equ 10000h
    92                              <1> opt3_r_highlight_dumb:	equ 20000h
    93                              <1> opt3_r_highlight_full:	equ 40000h
    94                              <1> opt3_r_highlight_eip:	equ 80000h
    95                              <1> %if _PM
    96                              <1> opt3_ss_b_bit_set:	equ   10_0000h
    97                              <1>  %if _BREAK_INSTALLDPMI
    98                              <1> opt3_break_installdpmi:	equ   20_0000h
    99                              <1>  %endif
   100                              <1> %endif
   101                              <1> %if _DHIGHLIGHT
   102                              <1> opt3_d_highlight:	equ   80_0000h
   103                              <1> %endif
   104                              <1> %if _GETLINEHIGHLIGHT
   105                              <1> opt3_getline_highlight:	equ  100_0000h
   106                              <1> %endif
   107                              <1> opt3_no_idle_2F:	equ  200_0000h
   108                              <1> %if _DELAY_BEFORE_BP
   109                              <1> opt3_delay_before_bp:	equ  400_0000h
   110                              <1> %endif
   111                              <1> opt3_no_call_amis:	equ  800_0000h
   112                              <1> opt3_disable_autorepeat:equ 1000_0000h
   113                              <1> opt3_check_ctrlc_keyb:	equ 2000_0000h
   114                              <1> opt3_check_ctrlc_0bh:	equ 4000_0000h
   115                              <1> opt3_tsr_quit_leave_tf:	equ 8000_0000h
   116                              <1> DEFAULTOPTIONS3	equ opt3_tt_no_paging | opt3_tp_no_paging 		| opt3_pp_no_paging | opt3_gg_no_paging 		| opt3_check_ctrlc_keyb | opt3_check_ctrlc_0bh
   119                              <1> 
   120                              <1> 
   121                              <1> opt4_int_2F_hook:	equ 2
   122                              <1> opt4_int_08_hook:	equ 4
   123                              <1> opt4_int_2D_hook:	equ 8
   124                              <1> %if _CATCHINTFAULTCOND
   125                              <1> opt4_int_fault_hook:	equ 10h
   126                              <1> %endif
   127                              <1> opt4_int_serial_force:	equ 1_0000h
   128                              <1> opt4_int_2F_force:	equ 2_0000h
   129                              <1> opt4_int_08_force:	equ 4_0000h
   130                              <1> opt4_int_2D_force:	equ 8_0000h
   131                              <1> %if _CATCHINT0D
   132                              <1> opt4_int_0D_force:	equ   10_0000h
   133                              <1> %endif
   134                              <1> %if _CATCHINT0C
   135                              <1> opt4_int_0C_force:	equ   20_0000h
   136                              <1> %endif
   137                              <1> opt4_int_00_force:	equ  100_0000h
   138                              <1> opt4_int_01_force:	equ  200_0000h
   139                              <1> opt4_int_03_force:	equ  400_0000h
   140                              <1> opt4_int_06_force:	equ  800_0000h
   141                              <1> opt4_int_18_force:	equ 1000_0000h
   142                              <1> opt4_int_19_force:	equ 2000_0000h
   143                              <1> opt4_int_09_force:	equ 4000_0000h	; not used at the same time as 15h
   144                              <1> opt4_int_15_force:	equ 4000_0000h	; not used at the same time as 09h
   145                              <1> opt4_int_07_force:	equ 8000_0000h
   146                              <1> DEFAULTOPTIONS4 equ opt4_int_2F_hook
   147                              <1> 
   148                              <1> 
   149                              <1> %if _VXCHG
   150                              <1> opt6_vv_mode:		equ 1
   151                              <1> opt6_vv_keep:		equ 2
   152                              <1> opt6_vv_int16:		equ 10h
   153                              <1>  %if _VXCHG_DEFAULT_ON
   154                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq | opt6_vv_mode
   155                              <1>  %else
   156                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   157                              <1>  %endif
   158                              <1> %else
   159                              <1> DEFAULTOPTIONS6 equ opt6_share_serial_irq
   160                              <1> %endif
   161                              <1> %if _DEBUG
   162                              <1> opt6_debug_exception_late:	equ  20h
   163                              <1> opt6_debug_exception_early:	equ  40h
   164                              <1>  %if _DEBUG_COND
   165                              <1> opt6_debug_exception:	equ  80h
   166                              <1> opt6_debug_mode:	equ 100h
   167                              <1>  %endif
   168                              <1> %endif
   169                              <1> opt6_bios_output:	equ 200h
   170                              <1> opt6_flat_binary:	equ 400h
   171                              <1> opt6_big_stack:		equ 800h
   172                              <1> opt6_40_columns:	equ 1000h
   173                              <1> opt6_40_indent_odd:	equ 2000h
   174                              <1> opt6_40_dash:		equ 4000h
   175                              <1> opt6_share_serial_irq:	equ 1_0000h
   176                              <1> opt6_serial_EOI_call:	equ 2_0000h
   177                              <1> %if _RH
   178                              <1> opt6_rh_mode:		equ 10_0000h
   179                              <1> %endif
   180                              <1> %if _DEBUG
   181                              <1> opt6_debug_putrunint_early:	equ  40_0000h
   182                              <1>  %if _DEBUG_COND
   183                              <1> opt6_debug_putrunint:		equ  80_0000h
   184                              <1>  %endif
   185                              <1> %endif
   186                              <1> opt6_bios_io:		equ 100_0000h
   187                              <1> opt6_immasm_display_uu:	equ 200_0000h
   188                              <1> opt6_immasm_debug:	equ 400_0000h
   189                              <1> opt6_immasm_flag:	equ 800_0000h
   190                              <1> opt6_immasm_nobranch:	equ 1000_0000h
   191                              <1> opt6_r_flags_style2:	equ 2000_0000h
   192                              <1> opt6_r_flags_style3:	equ 4000_0000h
   193                              <1> opt6_r_linebreak_conditional:	equ 8000_0000h
   194                              <1> 
   195                              <1> 
   196                              <1> DEFAULTOPTIONS7 equ opt7_no_tsr_ll
   197                              <1> opt7_no_free_oneshot_eld:	equ 1
   198                              <1> opt7_debug_optional_link:	equ 2
   199                              <1> opt7_quiet_install:		equ 4
   200                              <1> opt7_quick_run:			equ 8
   201                              <1> opt7_houdini:			equ 100h
   202                              <1> opt7_no_ensure:			equ 1000h
   203                              <1> opt7_no_tsr_ll:			equ 2000h
   204                              <1> 
   205                              <1> 
   206                              <1> oldpacket	equ	  1	; Int25/Int26 packet method available (L, W)
   207                              <1> newpacket	equ	  2	; Int21.7305 packet method available (L, W)
   208                              <1> ntpacket	equ	  4	; VDD registered and usable (L, W)
   209                              <1> pagedcommand	equ	  8	; allows paging in puts
   210                              <1> notstdinput	equ	 10h	; DEBUG's StdIn isn't a device with StdIn bit (is file or other device)
   211                              <1> inputfile	equ	 20h	; DEBUG's StdIn is a file, notstdinput also set
   212                              <1> notstdoutput	equ	 40h	; DEBUG's StdOut isn't a device with StdOut bit (is file or other device)
   213                              <1> outputfile	equ	  80h	; DEBUG's StdOut is a file, notstdoutput also set
   214                              <1> hooked2F	equ	 100h	; Int2F hooked
   215                              <1> nohook2F	equ	 200h	; don't hook Int2F.1687 (required for Win9x, DosEmu?)
   216                              <1> unused_dif1_dpminohlt equ 400h	; DPMI doesn't like hlt
   217                              <1> protectedmode	equ	 800h	; in (DPMI) protected mode
   218                              <1> debuggeeA20	equ	1000h	; state of debuggee's A20
   219                              <1> debuggerA20	equ	2000h	; state of debugger's A20 (will be on if possible)
   220                              <1> nodosloaded	equ	4000h	; No DOS loaded currently (Boot loader mode)
   221                              <1> has386		equ	8000h	; CPU is a 386
   222                              <1> usecharcounter	equ    1_0000h	; don't reset charcounter between calls to puts
   223                              <1> runningnt	equ    2_0000h	; running in NTVDM
   224                              <1> canswitchmode	equ    4_0000h	; can switch modes (auxbuff large enough, DPMI mode switch set up)
   225                              <1> modeswitched	equ    8_0000h	; switched mode (now in the mode that we weren't entered in)
   226                              <1> promptwaiting	equ   10_0000h	; puts: any more output needs to display a prompt first
   227                              <1> switchbuffer	equ   20_0000h	; mode switch needs a buffer (auxbuff)
   228                              <1> tsrmode		equ   40_0000h	; in TSR mode; DPI and DPP not valid
   229                              <1> attachedterm	equ   80_0000h	; the attached process terminated
   230                              <1> runningdosemu	equ  100_0000h	; running in dosemu
   231                              <1> ; load_is_ldp	equ  200_0000h	; boot load: partition specified as "ldp"
   232                              <1> tt_while:	equ  400_0000h	; tt: while condition specified
   233                              <1> tt_p:		equ  800_0000h	; tt: proceed past repeated string instructions
   234                              <1> tt_silent_mode:	equ 1000_0000h	; tt: run should be silent (dump at end)
   235                              <1> tt_silence:	equ 2000_0000h	; tt: silent writing (write to auxbuff instead)
   236                              <1> tt_no_bb:	equ 4000_0000h	; tt: do not use bb breakpoints
   237                              <1> tt_no_bb_first:	equ 8000_0000h	; tt: do not use bb breakpoints at first
   238                              <1> 
   239                              <1> 
   240                              <1> dif2_gg_is_first:	equ   1
   241                              <1> dif2_gg_skip_non_cseip:	equ   2
   242                              <1> dif2_gg_skip_cseip:	equ   4
   243                              <1> dif2_gg_is_gg:		equ   8
   244                              <1> dif2_gg_first_detected:	equ  10h
   245                              <1> dif2_gg_again:		equ  20h
   246                              <1> dif2_tpg_proceed_bp_set:equ  40h
   247                              <1> dif2_tpg_keep_proceed_bp: equ 80h
   248                              <1> dif2_tpg_have_bp:	equ 100h
   249                              <1> dif2_tpg_adjusted_cseip:equ 200h
   250                              <1> dif2_tpg_do_not_adjust:	equ 400h
   251                              <1> dif2_bp_failure:	equ 800h
   252                              <1> dif2_is_pp:		equ 1000h
   253                              <1> %if _SYMBOLIC
   254                              <1> dif2_createdprocess:	equ 800_0000h	; created empty debuggee process
   255                              <1> dif2_sym_req_xms:	equ 2000h
   256                              <1> dif2_sym_req_86mm:	equ 4000h
   257                              <1> dif2_sym_req_mask equ dif2_sym_req_86mm | dif2_sym_req_xms
   258                              <1> dif2_no_pm_xms:		equ 1_0000h
   259                              <1> dif2_xms_detection_done:equ 2_0000h
   260                              <1> %endif
   261                              <1> %if _INPUT_FILE_HANDLES
   262                              <1> dif2_input_file:	equ 10_0000h
   263                              <1> dif2_closed_input_file:	equ 20_0000h
   264                              <1> %endif
   265                              <1> dif2_did_getline_file:	equ 40_0000h
   266                              <1> %if _SYMBOLIC
   267                              <1> dif2_poison:		equ 80_0000h
   268                              <1> %endif
   269                              <1> dif2_boot_loaded_kernel:equ 100_0000h
   270                              <1> %if _INPUT_FILE_BOOT
   271                              <1> dif2_input_file_boot:	equ 200_0000h
   272                              <1> dif2_closed_input_file_boot:	equ 400_0000h
   273                              <1> %endif
   274                              <1> dif2_in_silence_dump:	equ 1000_0000h
   275                              <1> dif2_int31_segment:	equ 2000_0000h
   276                              <1> dif2_nn_compat:		equ 4000_0000h
   277                              <1> dif2_nn_capitalise:	equ 8000_0000h
   278                              <1> 
   279                              <1> 
   280                              <1> dif3_load_is_ldp:	equ 1	; boot load: partition specified as "ldp"
   281                              <1> dif3_load_is_sdp:	equ 2	; boot load: partition specified as "sdp"
   282                              <1> dif3_load_is_ydp:	equ 4	; boot load: partition specified as "ydp"
   283                              <1> dif3_load_is_dp:	equ dif3_load_is_ldp 				| dif3_load_is_sdp 				| dif3_load_is_ydp
   286                              <1> dif3_load_dir_dir:	equ 8
   287                              <1> dif3_input_terminal_override:	equ 10h
   288                              <1> dif3_input_serial_override:	equ 20h
   289                              <1> dif3_if_not:		equ 40h
   290                              <1> dif3_partition_changed:	equ 80h
   291                              <1> ;
   292                              <1> dif3_input_cmdline:	equ 100h; input reading from cmdline_buffer
   293                              <1> dif3_input_cmdline_closed: equ 200h
   294                              <1> dif3_at_line_end:	equ 400h
   295                              <1> dif3_quiet_input_single:equ 800h
   296                              <1> dif3_quiet_output:	equ 1000h
   297                              <1> dif3_unquiet_error:	equ 2000h
   298                              <1> dif3_unquiet_prompt:	equ 4000h
   299                              <1> dif3_unquiet:		equ dif3_unquiet_error | dif3_unquiet_prompt
   300                              <1> dif3_return_eof:	equ 8000h
   301                              <1> dif3_highlighting:	equ 1_0000h
   302                              <1> dif3_do_not_highlight:	equ 2_0000h
   303                              <1> dif3_int10_highlight:	equ 2_0000h
   304                              <1> dif3_nosymbols_1:	equ 4_0000h
   305                              <1> dif3_nosymbols_2:	equ 8_0000h
   306                              <1> %if _PM
   307                              <1> dif3_ss_b_bit_set:	equ  10_0000h
   308                              <1> %endif
   309                              <1> dif3_gotint19:		equ  20_0000h
   310                              <1> dif3_prior_pm:		equ  40_0000h
   311                              <1> %if _DELAY_BEFORE_BP
   312                              <1> dif3_delayed		equ  80_0000h
   313                              <1> %endif
   314                              <1> dif3_input_re:		equ 100_0000h	; input reading from re_buffer
   315                              <1> dif3_input_re_closed:	equ 200_0000h
   316                              <1> dif3_accept_getrange_0:	equ 400_0000h
   317                              <1> %if _INPUT_FILE_HANDLES || _INPUT_FILE_BOOT
   318                              <1> dif3_in_if:		equ 800_0000h
   319                              <1> %endif
   320                              <1> dif3_auxbuff_guarded_1:	equ 1000_0000h
   321                              <1> dif3_auxbuff_guarded_2:	equ 2000_0000h
   322                              <1> dif3_auxbuff_guarded_3:	equ 4000_0000h
   323                              <1> dif3_sss_is_reverse:	equ 8000_0000h
   324                              <1> 
   325                              <1> 
   326                              <1> dif4_int_serial_hooked:	equ 1
   327                              <1> dif4_int_2F_hooked:	equ 2
   328                              <1> dif4_int_08_hooked:	equ 4
   329                              <1> dif4_int_2D_hooked:	equ 8
   330                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0D
   331                              <1> dif4_int_0D_hooked:	equ 10h
   332                              <1> %endif
   333                              <1> %if _CATCHINTFAULTCOND && _CATCHINT0C
   334                              <1> dif4_int_0C_hooked:	equ 20h
   335                              <1> %endif
   336                              <1> 
   337                              <1> 
   338                              <1> %if _VXCHG
   339                              <1> dif6_vv_mode:		equ 1
   340                              <1> %endif
   341                              <1> dif6_in_hook2F:		equ 2
   342                              <1> dif6_in_amis_hook2F:	equ 4
   343                              <1> dif6_debug_mode:	equ 100h
   344                              <1> dif6_locked:		equ 200h
   345                              <1> %if _RH
   346                              <1> dif6_rh_mode_was:	equ  8_0000h
   347                              <1> dif6_rh_mode:		equ 10_0000h
   348                              <1> dif6_rh_mode_2:		equ 20_0000h
   349                              <1> %endif
   350                              <1> dif6_device_mode:	equ 40_0000h
   351                              <1> dif6_cpdepchars:	equ 80_0000h
   352                              <1> %if _IMMASM
   353                              <1> dif6_immasm_no_output:	equ 100_0000h
   354                              <1> dif6_immasm:		equ 200_0000h
   355                              <1> dif6_immasm_rel8:	equ 400_0000h
   356                              <1> %endif
   357                              <1> 
   358                              <1> 
   359                              <1> disasm_lowercase	equ 1
   360                              <1> disasm_commablank	equ 2
   361                              <1> disasm_nasm		equ 4
   362                              <1> disasm_lowercase_refmem:equ 8
   363                              <1> disasm_show_short:	equ 10h
   364                              <1> disasm_show_near:	equ 20h
   365                              <1> disasm_show_far:	equ 40h
   366                              <1> disasm_nec:		equ 80h
   367                              <1> disasm_40_columns:	equ 100h
   368                              <1> disasm_no_indent:	equ 200h
   369                              <1> disasm_msdebug_mnemonofs: equ 400h
   370                              <1> disasm_a16_memref:	equ 1000h
   371                              <1> disasm_a32_memref:	equ 2000h
   372                              <1> disasm_a16_string:	equ 4000h
   373                              <1> disasm_a32_string:	equ 8000h
   374                              <1> disasm_hide_modrm:	equ 10000h
   375                              <1> disasm_asize_loop_nasm:	equ 20000h
   376                              <1> disasm_modrm_always:	equ 40000h
   377                              <1> DEFAULTASMOPTIONS equ disasm_lowercase|disasm_commablank|disasm_nasm 	| disasm_a16_memref | disasm_a32_memref 	| disasm_a16_string | disasm_a32_string
    37                                  
    38                                  %include "iniload.mac"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> lDebug iniload/boot interfacing structs and macros
     4                              <1> 
     5                              <1> Copyright (C) 2008-2023 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> 
    16                              <1> 	struc BS
    17 00000000 ??????              <1> bsJump:	resb 3
    18 00000003 ????????????????    <1> bsOEM:	resb 8
    19                              <1> bsBPB:
    20                              <1> 	endstruc
    21                              <1> 
    22                              <1> 	struc EBPB		;        BPB sec
    23 00000000 ????                <1> bpbBytesPerSector:	resw 1	; offset 00h 0Bh
    24 00000002 ??                  <1> bpbSectorsPerCluster:	resb 1	; offset 02h 0Dh
    25 00000003 ????                <1> bpbReservedSectors:	resw 1	; offset 03h 0Eh
    26 00000005 ??                  <1> bpbNumFATs:		resb 1	; offset 05h 10h
    27 00000006 ????                <1> bpbNumRootDirEnts:	resw 1	; offset 06h 11h -- 0 for FAT32
    28 00000008 ????                <1> bpbTotalSectors:	resw 1	; offset 08h 13h
    29 0000000A ??                  <1> bpbMediaID:		resb 1	; offset 0Ah 15h
    30 0000000B ????                <1> bpbSectorsPerFAT:	resw 1	; offset 0Bh 16h -- 0 for FAT32
    31 0000000D ????                <1> bpbCHSSectors:		resw 1	; offset 0Dh 18h
    32 0000000F ????                <1> bpbCHSHeads:		resw 1	; offset 0Fh 1Ah
    33 00000011 ????????            <1> bpbHiddenSectors:	resd 1	; offset 11h 1Ch
    34 00000015 ????????            <1> bpbTotalSectorsLarge:	resd 1	; offset 15h 20h
    35                              <1> bpbNew:				; offset 19h 24h
    36                              <1> 
    37 00000019 ????????            <1> ebpbSectorsPerFATLarge:	resd 1	; offset 19h 24h
    38 0000001D ????                <1> ebpbFSFlags:		resw 1	; offset 1Dh 28h
    39 0000001F ????                <1> ebpbFSVersion:		resw 1	; offset 1Fh 2Ah
    40 00000021 ????????            <1> ebpbRootCluster:	resd 1	; offset 21h 2Ch
    41 00000025 ????                <1> ebpbFSINFOSector:	resw 1	; offset 25h 30h
    42 00000027 ????                <1> ebpbBackupSector:	resw 1	; offset 27h 32h
    43 00000029 <res Ch>            <1> ebpbReserved:		resb 12	; offset 29h 34h
    44                              <1> ebpbNew:			; offset 35h 40h
    45                              <1> 	endstruc
    46                              <1> 
    47                              <1> 	struc BPBN		; ofs B16 S16 B32 S32
    48 00000000 ??                  <1> bpbnBootUnit:		resb 1	; 00h 19h 24h 35h 40h
    49 00000001 ??                  <1> 			resb 1	; 01h 1Ah 25h 36h 41h
    50 00000002 ??                  <1> bpbnExtBPBSignature:	resb 1	; 02h 1Bh 26h 37h 42h -- 29h for valid BPBN
    51 00000003 ????????            <1> bpbnSerialNumber:	resd 1	; 03h 1Ch 27h 38h 43h
    52 00000007 <res Bh>            <1> bpbnVolumeLabel:	resb 11	; 07h 20h 2Bh 3Ch 47h
    53 00000012 ????????????????    <1> bpbnFilesystemID:	resb 8	; 12h 2Bh 36h 47h 52h
    54                              <1> 	endstruc		; 1Ah 33h 3Eh 4Fh 5Ah
    55                              <1> 
    56                              <1> 	struc DIRENTRY
    57 00000000 ????????????????    <1> deName:		resb 8
    58 00000008 ??????              <1> deExt:		resb 3
    59 0000000B ??                  <1> deAttrib:	resb 1
    60 0000000C ??                  <1> dePlusSize:	resb 1
    61 0000000D ??????????????      <1> 		resb 7
    62 00000014 ????                <1> deClusterHigh:	resw 1
    63 00000016 ????                <1> deTime:		resw 1
    64 00000018 ????                <1> deDate:		resw 1
    65 0000001A ????                <1> deClusterLow:	resw 1
    66 0000001C ????????            <1> deSize:		resd 1
    67                              <1> 	endstruc
    68                              <1> 
    69                              <1> ATTR_READONLY	equ 1
    70                              <1> ATTR_HIDDEN	equ 2
    71                              <1> ATTR_SYSTEM	equ 4
    72                              <1> ATTR_VOLLABEL	equ 8
    73                              <1> ATTR_DIRECTORY	equ 10h
    74                              <1> ATTR_ARCHIVE	equ 20h
    75                              <1> 
    76                              <1> lsvclSignature		equ "CL"
    77                              <1> lsvclBufferLength	equ 256
    78                              <1> 
    79                              <1> 	struc LOADSTACKVARS, -10h
    80 FFFFFFF0 ????????            <1> lsvFirstCluster:	resd 1
    81 FFFFFFF4 ????????            <1> lsvFATSector:		resd 1
    82 FFFFFFF8 ????                <1> lsvFATSeg:		resw 1
    83 FFFFFFFA ????                <1> lsvLoadSeg:		resw 1
    84 FFFFFFFC ????????            <1> lsvDataStart:		resd 1
    85                              <1> 	endstruc
    86                              <1> 
    87                              <1> 	struc LOADDATA, LOADSTACKVARS - 10h
    88 FFFFFFE0 ????                <1> ldMemoryTop:	resw 1
    89 FFFFFFE2 ????                <1> ldLoadTop:	resw 1
    90 FFFFFFE4 ????                <1> ldSectorSeg:	resw 1
    91 FFFFFFE6 ??                  <1> ldFATType:	resb 1
    92                              <1> ldFlags:
    93 FFFFFFE7 ??                  <1> ldHasLBA:	resb 1
    94 FFFFFFE8 ????                <1> ldClusterSize:	resw 1
    95 FFFFFFEA ????                <1> ldParaPerSector:resw 1
    96                              <1> ldDirCluster:			; dword
    97                              <1> ldLoadingSeg:		; word
    98                              <1> ldQueryPatchValue:	; word
    99                              <1> lsvCommandLine:		; word
   100                              <1> .start:		equ $ - lsvclBufferLength
   101 FFFFFFEC ????                <1> .signature:	resw 1
   102                              <1> ldLoadUntilSeg:		; word
   103                              <1> lsvExtra:		; word
   104 FFFFFFEE ??                  <1> .partition:	resb 1	; byte
   105 FFFFFFEF ??                  <1> .flags:		resb 1	; byte
   106                              <1> 	endstruc
   107                              <1> 
   108                              <1> lsvefNoDataStart	equ 1
   109                              <1> lsvefPartitionNumber	equ 2
   110                              <1> 
   111                              <1> 	struc LOADCMDLINE, LOADDATA - lsvclBufferLength
   112                              <1> ldCommandLine:
   113 FFFFFEE0 <res 100h>          <1> .start:		resb lsvclBufferLength
   114                              <1> 	endstruc
   115                              <1> 
   116                              <1> ldfHasLBA:	equ 1
   117                              <1> ldfFATInvalid:	equ 2
   118                              <1> ldfFATBuffered:	equ 4
   119                              <1> ldfDataBuffered: equ 8
   120                              <1> 
   121                              <1> 	struc LOADDATA2, LOADDATA - 10h
   122 FFFFFFD0 ????????            <1> ldRootSector:		resd 1
   123 FFFFFFD4 ????                <1> ldEntriesPerSector:	resw 1
   124                              <1> ldDataSegment:		; word
   125 FFFFFFD6 ????                <1> ldLastAvailableSector:	resw 1
   126                              <1> ldDataSector:		; dword
   127 FFFFFFD8 ????                <1> ldParasLeft:		resw 1
   128 FFFFFFDA ????                <1> ldParasDone:		resw 1
   129                              <1> 	endstruc
   130                              <1> 
   131                              <1> 	struc LOADDATA3, LOADDATA2 - 10h
   132 FFFFFFC0 ????????            <1> ldMaxCluster:		resd 1
   133 FFFFFFC4 ????????            <1> ldFileSize:		resd 1
   134 FFFFFFC8 ????????            <1> ldCurrentCluster:	resd 1
   135 FFFFFFCC ????????            <1> ldCurrentSeek:		resd 1
   136                              <1> 	endstruc
   137                              <1> 
   138                              <1> 	struc LBAPACKET
   139 00000000 ????                <1> lpSize:		resw 1
   140 00000002 ????                <1> lpCount:	resw 1
   141 00000004 ????????            <1> lpBuffer:	resd 1
   142 00000008 ????????????????    <1> lpSector:	resq 1
   143                              <1> 	endstruc
   144                              <1> 
   145                              <1> 	struc PARTINFO
   146 00000000 ??                  <1> piBoot:		resb 1
   147 00000001 ??????              <1> piStartCHS:	resb 3
   148 00000004 ??                  <1> piType:		resb 1
   149 00000005 ??????              <1> piEndCHS:	resb 3
   150 00000008 ????????            <1> piStart:	resd 1
   151 0000000C ????????            <1> piLength:	resd 1
   152                              <1> 	endstruc
   153                              <1> 
   154                              <1> ptEmpty:		equ 0
   155                              <1> ptFAT12:		equ 1
   156                              <1> ptFAT16_16BIT_CHS:	equ 4
   157                              <1> ptExtendedCHS:		equ 5
   158                              <1> ptFAT16_CHS:		equ 6
   159                              <1> ptFAT32_CHS:		equ 0Bh
   160                              <1> ptFAT32:		equ 0Ch
   161                              <1> ptFAT16:		equ 0Eh
   162                              <1> ptExtended:		equ 0Fh
   163                              <1> ptLinux:		equ 83h
   164                              <1> ptExtendedLinux:	equ 85h
   165                              <1> 
   166                              <1> 
   167                              <1> 		; Flags of load_unit_flags
   168                              <1> lufForceCHS:		equ 1
   169                              <1> lufForceLBA:		equ 2
   170                              <1> lufForceGeometry:	equ 4
   171                              <1> luf_mask_writable equ lufForceCHS | lufForceLBA | lufForceGeometry
    39                                  
    40                                  	numdef XLD
    41                                  
    42                                  %ifn _COMPRESSLIB
    43                                  	cpu 8086
    44                                  
    45                                  	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
    46                                  relocateddata:
    47                                  
    48                                  	addsection HEADER, start=0
    49                                  
    50                                  	istruc ELD_HEADERX
    51                                  at eldhxHeader
    52                                  		; ELD executable header
    53                                  	istruc ELD_HEADER
    54 00000000 454C4431                at eldhSignature,	db "ELD1"
    55 00000004 000000                  			db 0,0,0
    56 00000007 1A                      			db 26
    57 00000008 50000000                at eldhCodeOffset,	dd CODEOFFSET
    58 0000000C 600F                    at eldhCodeImageLength,	dw code_size
    59 0000000E 0000                    at eldhCodeAllocLength,	dw 0
    60 00000010 B00F0000                at eldhDataOffset,	dd DATAOFFSET
    61 00000014 5005                    at eldhDataImageLength,	dw data_size
    62 00000016 1002                    at eldhDataAllocLength,	dw total_data_size - data_size
    63 00000018 A806                    at eldhCodeEntrypoint,	dw linker - code
    64                                  at eldhReserved
    65 0000001A 00<rep 4h>2C00          at eldhExtensionSize,	dw header_extension_end - $$
    66                                  	iend
    67 00000020 [30000000]              at eldhxDescriptionOffset,	dd description
    68 00000024 02140000                at eldhxHelpOffset,		dd DATAOFFSET + msg.help - datastart
    69 00000028 B00F0000                at eldhxLibTable,		dd DATAOFFSET + libtable - datastart
    70                                  PUT_ELDHX_DATETIME_OFFSET
    71                                  header_extension_end:
    72 0000002C 00<rep 4h>              	iend
    73                                  
    74 00000030 455854204C49423A20-     description:		asciz "EXT LIB: library of ELDs."
    74 00000039 6C696272617279206F-
    74 00000042 6620454C44732E00   
    75                                  
    76                                  
    77 0000004A 00<rep 6h>              	align 16, db 0
    78                                  
    79                                  CODEOFFSET equ $ - $$
    80                                  	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
    81                                  %define CODEFIXUP - code + 0
    82                                  code:
    83                                  		; ELD instance header
    84                                  	istruc ELD_INSTANCE
    85                                  at eldiStartCode
    86 00000000 00<rep 2h>              at eldiEndCode
    87 00000002 00<rep 2h>              at eldiStartData
    88 00000004 00<rep 2h>              at eldiEndData
    89 00000006 00<rep 2h>4558544C-     at eldiIdentifier,	fill 8, 32, db "EXTLIB"
    89 0000000C 494220<rep 2h>     
    90 00000010 00<rep 2h>6578746C-     at eldiListing,		asciz _ELD_LISTING
    90 00000016 69622E6C737400     
    91 0000001D 00<rep 3h>              	iend
    92                                  
    93                                  start:
    94 00000020 16                      	push ss
    95 00000021 07                      	pop es
    96                                  %if _DATABUFFER
    97 00000022 F606[0100]40            reloc	testopt [relocateddata], nodosloaded
    98                                  linkdatarelocation internalflags, -3
    99 00000027 7420                    	jz .skipdatabuffer
   100 00000029 B104                    	mov cl, 4
   101 0000002B 8CD0                    	mov ax, ss
   102 0000002D BB[6005]                reloc	mov bx, databuffer
   103                                  internaldatarelocation
   104 00000030 F6C30F                  	test bl, 15
   105 00000033 7514                    	jnz .skipdatabuffer
   106 00000035 D3EB                    	shr bx, cl
   107 00000037 01D8                    	add ax, bx
   108 00000039 A3[0600]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSegment], ax
   109                                  linkdatarelocation load_data
   110 0000003C 31C0                    	xor ax, ax
   111 0000003E A3[0A00]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSector + 2], ax
   112                                  linkdatarelocation load_data
   113 00000041 A3[0800]                reloc	mov word [relocateddata - LOADDATA2 + ldDataSector], ax
   114                                  linkdatarelocation load_data
   115 00000044 800E[1700]08            reloc	setopt [relocateddata - LOADDATA2 + ldFlags], ldfDataBuffered
   116                                  linkdatarelocation load_data, -3
   117                                  .skipdatabuffer:
   118                                  %endif
   119 00000049 E8E405                  	extcallcall skipcomma
   120 0000004C 4E                      	dec si
   121 0000004D 89F3                    	mov bx, si
   122 0000004F AC                      	lodsb
   123 00000050 E8E505                  	extcallcall iseol?
   124 00000053 8D74FF                  	lea si, [si - 1]
   125 00000056 740C                    	je help
   126 00000058 BA[3504]                	mov dx, msg.help_keyword
   127                                  internaldatarelocation
   128 0000005B E8E205                  	extcallcall isstring?
   129 0000005E 7404                    	je help
   130                                  %if _COMPRESSED && _ELD_TEST_LIB
   131                                  	mov dx, msg.test_keyword
   132                                  internaldatarelocation
   133                                  	extcallcall isstring?
   134                                  	je test
   135                                  %endif
   136 00000060 AC                      	lodsb
   137 00000061 E94C01                  	jmp getname
   138                                  
   139                                  %if _COMPRESSED && _ELD_TEST_LIB
   140                                  test:
   141                                  	xor cx, cx
   142                                  	xor dx, dx
   143                                  	call get_dxax_seek_lib_plus_cxdx
   144                                  	jc .io_error
   145                                  	mov word [libseek], ax
   146                                  internaldatarelocation
   147                                  	mov word [libseek + 2], dx
   148                                  internaldatarelocation
   149                                  
   150                                  	mov cx, ELD_HEADERX_size
   151                                  	sub sp, cx
   152                                  
   153                                  	xor ax, ax
   154                                  	mov word [depackskip], ax
   155                                  internaldatarelocation
   156                                  	mov word [depackskip + 2], ax
   157                                  internaldatarelocation
   158                                  
   159                                  	mov dx, sp
   160                                  	call read_and_depack
   161                                  	houdini
   162                                  
   163                                  	mov ax, (library_end_skip - library_start_skip - 16) & 0FFFFh
   164                                  	mov dx, (library_end_skip - library_start_skip - 16) >> 16
   165                                  
   166                                  	mov word [depackskip], ax
   167                                  internaldatarelocation
   168                                  	mov word [depackskip + 2], dx
   169                                  internaldatarelocation
   170                                  
   171                                  	mov cx, ELD_HEADERX_size
   172                                  	mov dx, sp
   173                                  	call read_and_depack
   174                                  	houdini
   175                                  	jc .io_error
   176                                  	cmp cx, ax
   177                                  	jne .io_error
   178                                  .io_error:
   179                                  	mov word [depackskip], 30h
   180                                  internaldatarelocation -4
   181                                  	mov word [depackskip + 2], 0
   182                                  internaldatarelocation -4
   183                                  
   184                                  	mov cx, 32
   185                                  	mov dx, sp
   186                                  	call read_and_depack
   187                                  	houdini
   188                                  
   189                                  	extcallcall cmd3
   190                                  %endif
   191                                  
   192                                  help:
   193 00000064 B90200                  	mov cx, 2
   194 00000067 E8C605                  	extcallcall skipcomma
   195 0000006A E8CB05                  	extcallcall iseol?
   196 0000006D 7422                    	je .dispatch_eol
   197 0000006F 4E                      	dec si
   198 00000070 49                      	dec cx
   199 00000071 BA[3A04]                	mov dx, msg.describe_keyword
   200                                  internaldatarelocation
   201 00000074 E8C905                  	extcallcall isstring?
   202 00000077 7414                    	je .dispatch
   203                                  %if _COMPRESSED
   204                                  	not byte [partialdepack]
   205                                  internaldatarelocation
   206                                  %endif
   207 00000079 BA[4304]                	mov dx, msg.describex_keyword
   208                                  internaldatarelocation
   209 0000007C E8C105                  	extcallcall isstring?
   210 0000007F 740C                    	je .dispatch
   211 00000081 49                      	dec cx
   212 00000082 BA[4D04]                	mov dx, msg.wide_keyword
   213                                  internaldatarelocation
   214 00000085 E8B805                  	extcallcall isstring?
   215 00000088 7403                    	je .dispatch
   216 0000008A E91306                  	jmp error
   217                                  
   218                                  .dispatch:
   219 0000008D AC                      	lodsb
   220 0000008E E8B705                  	extcallcall chkeol
   221                                  .dispatch_eol:
   222 00000091 BA[5204]                	mov dx, msg.help
   223                                  internaldatarelocation
   224 00000094 E8B905                  	extcallcall putsz
   225                                  
   226 00000097 80F901                  	cmp cl, 1
   227 0000009A 7606                    	jbe @F
   228 0000009C E8FE00                  	call zerooffsets
   229 0000009F E8B605                  	extcallcall cmd3
   230                                  
   231                                  @@:
   232 000000A2 7431                    	je describe
   233                                  
   234                                  wide:
   235 000000A4 BA[2D05]                	mov dx, msg.list
   236                                  internaldatarelocation
   237 000000A7 E8A605                  	extcallcall putsz
   238                                  
   239 000000AA BE[0800]                	mov si, lib
   240                                  internaldatarelocation
   241 000000AD EB09                    	jmp @F
   242                                  .loop:
   243 000000AF 81FF[4800]              	cmp di, relocateddata + 9 * 8
   244                                  linkdatarelocation line_out
   245 000000B3 7206                    	jb @FF
   246 000000B5 E8A805                  	extcallcall trimputs
   247                                  @@:
   248 000000B8 BF[0000]                reloc	mov di, relocateddata
   249                                  linkdatarelocation line_out
   250                                  @@:
   251 000000BB 8D7404                  	lea si, [si + 4]
   252 000000BE B90800                  	mov cx, 8
   253 000000C1 F3A4                    	rep movsb
   254 000000C3 B020                    	mov al, 32
   255 000000C5 AA                      	stosb
   256                                  
   257 000000C6 81FE[F002]              	cmp si, strict word lib_end
   258                                  internaldatarelocation
   259 000000CA 72E3                    	jb .loop
   260 000000CC E89105                  	extcallcall trimputs
   261 000000CF E8CB00                  	call zerooffsets
   262 000000D2 E88305                  	extcallcall cmd3
   263                                  
   264                                  
   265                                  describe:
   266 000000D5 BA[2D05]                	mov dx, msg.list
   267                                  internaldatarelocation
   268 000000D8 E87505                  	extcallcall putsz
   269                                  
   270 000000DB 31C9                    	xor cx, cx
   271 000000DD 31D2                    	xor dx, dx
   272 000000DF E87B04                  	call get_dxax_seek_lib_plus_cxdx
   273 000000E2 7303E95504              	jc .io_error
   274 000000E7 A3[5205]                	mov word [libseek], ax
   275                                  internaldatarelocation
   276 000000EA 8916[5405]              	mov word [libseek + 2], dx
   277                                  internaldatarelocation
   278                                  
   279 000000EE BE[0800]                	mov si, lib
   280                                  internaldatarelocation
   281                                  .loop:
   282 000000F1 8D5404                  	lea dx, [si + 4]
   283 000000F4 B90800                  	mov cx, 8
   284 000000F7 53                      	push bx
   285 000000F8 E86D05                  	extcallcall puts
   286 000000FB 5B                      	pop bx
   287 000000FC BA[E003]                	mov dx, msg.between
   288                                  internaldatarelocation
   289 000000FF E84E05                  	extcallcall putsz
   290                                  
   291                                  %if _COMPRESSED
   292                                  	mov ax, word [si]
   293                                  	mov dx, word [si + 2]
   294                                  
   295                                  	mov word [eldheader], ax
   296                                  internaldatarelocation
   297                                  	mov word [eldheader + 2], dx
   298                                  internaldatarelocation
   299                                  
   300                                  	mov word [depackskip], ax
   301                                  internaldatarelocation
   302                                  	mov word [depackskip + 2], dx
   303                                  internaldatarelocation
   304                                  %else
   305 00000102 8B16[5205]              	mov dx, word [libseek]
   306                                  internaldatarelocation
   307 00000106 8B0E[5405]              	mov cx, word [libseek + 2]
   308                                  internaldatarelocation
   309                                  
   310 0000010A 0314                    	add dx, word [si]
   311 0000010C 134C02                  	adc cx, word [si + 2]
   312                                  
   313 0000010F B80042                  	mov ax, 4200h
   314 00000112 E86A04                  	call dos_or_boot_io
   315 00000115 7303E92204              	jc .io_error
   316 0000011A A3[5605]                	mov word [eldheader], ax
   317                                  internaldatarelocation
   318 0000011D 8916[5805]              	mov word [eldheader + 2], dx
   319                                  internaldatarelocation
   320                                  %endif
   321                                  
   322 00000121 B93000                  	mov cx, ELD_HEADERX_size
   323 00000124 29CC                    	sub sp, cx
   324 00000126 89E2                    	mov dx, sp
   325                                  %if _COMPRESSED
   326                                  	call read_and_depack
   327                                  %else
   328 00000128 B8003F                  	mov ax, 3F00h
   329 0000012B E85104                  	call dos_or_boot_io
   330                                  %endif
   331 0000012E 7303E90904              	jc .io_error
   332 00000133 39C1                    	cmp cx, ax
   333 00000135 7403E90204              	jne .io_error
   334                                  
   335 0000013A 89E7                    	mov di, sp
   336 0000013C 837D1E24                	cmp word [di + eldhExtensionSize], eldhxDescriptionOffset + 4
   337 00000140 7240                    	jb .nodesc
   338 00000142 8B4D22                  	mov cx, word [di + eldhxDescriptionOffset + 2]
   339 00000145 8B5520                  	mov dx, word [di + eldhxDescriptionOffset]
   340 00000148 89C8                    	mov ax, cx
   341 0000014A 09D0                    	or ax, dx
   342 0000014C 7434                    	jz .nodesc
   343                                  
   344 0000014E B80042                  	mov ax, 4200h
   345 00000151 0316[5605]              	add dx, word [eldheader]
   346                                  internaldatarelocation
   347 00000155 130E[5805]              	adc cx, word [eldheader + 2]
   348                                  internaldatarelocation
   349                                  %if _COMPRESSED
   350                                  	mov word [depackskip], dx
   351                                  internaldatarelocation
   352                                  	mov word [depackskip + 2], cx
   353                                  internaldatarelocation
   354                                  %else
   355 00000159 E82304                  	call dos_or_boot_io
   356 0000015C 7303E9DB03              	jc .io_error
   357                                  %endif
   358                                  
   359 00000161 BF[0000]                	mov di, relocateddata
   360                                  linkdatarelocation line_out
   361 00000164 89FA                    	mov dx, di
   362 00000166 31C0                    	xor ax, ax
   363 00000168 B94000                  	mov cx, words(128)
   364 0000016B F3AB                    	rep stosw
   365 0000016D B17F                    	mov cl, 127
   366                                  %if _COMPRESSED
   367                                  	call read_and_depack
   368                                  %else
   369 0000016F B8003F                  	mov ax, 3F00h
   370 00000172 E80A04                  	call dos_or_boot_io
   371                                  %endif
   372 00000175 7303E9C203              	jc .io_error
   373                                  	; cmp cx, ax
   374                                  	; jne .io_error
   375                                  
   376 0000017A E8D304                  	extcallcall putsz
   377 0000017D BA[F203]                	mov dx, msg.linebreak
   378                                  internaldatarelocation
   379 00000180 EB03                    	jmp @F
   380                                  .nodesc:
   381 00000182 BA[E303]                	mov dx, msg.nodesc
   382                                  internaldatarelocation
   383                                  @@:
   384 00000185 E8C804                  	extcallcall putsz
   385 00000188 83C430                  	add sp, ELD_HEADERX_size
   386 0000018B 83C60C                  	add si, 4 + 8
   387 0000018E 81FE[F002]              	cmp si, strict word lib_end
   388                                  internaldatarelocation
   389 00000192 7303E95AFF              	jb .loop
   390                                  
   391                                  .io_error equ found.io_error
   392 00000197 E80300                  	call zerooffsets
   393 0000019A E8BB04                  	extcallcall cmd3
   394                                  
   395                                  
   396                                  zerooffsets:
   397                                  %if _ELD_ZERO_OFFSETS
   398                                  		; for debugging with eldcomp, zero the offsets
   399 0000019D 31C0                    	xor ax, ax
   400 0000019F BF[0400]                	mov di, ..@eldltOffset
   401                                  internaldatarelocation
   402 000001A2 AB                      	stosw
   403 000001A3 AB                      	stosw			; clear eldltOffset
   404                                   %if _COMPRESSED
   405                                  	stosw
   406                                  	stosw			; clear libtab_compressed_length
   407                                   %endif
   408                                  .loop:
   409 000001A4 AB                      	stosw
   410 000001A5 AB                      	stosw
   411 000001A6 83C708                  	add di, 8
   412 000001A9 81FF[F002]              	cmp di, strict word lib_end
   413                                  internaldatarelocation
   414 000001AD 72F5                    	jb .loop
   415                                  %endif
   416 000001AF C3                      	retn
   417                                  
   418                                  
   419                                  getname:
   420 000001B0 3C22                    	cmp al, '"'
   421 000001B2 7419                    	je quoted
   422 000001B4 3C27                    	cmp al, "'"
   423 000001B6 7415                    	je quoted
   424                                  unquoted:
   425 000001B8 4E                      	dec si
   426                                  .loop:
   427 000001B9 AC                      	lodsb
   428 000001BA 3C20                    	cmp al, 32
   429 000001BC 7431                    	je end
   430 000001BE 3C09                    	cmp al, 9
   431 000001C0 742D                    	je end
   432 000001C2 3C2C                    	cmp al, ','
   433 000001C4 7429                    	je end
   434 000001C6 E8A704                  	extcallcall iseol?.notsemicolon
   435 000001C9 75EE                    	jne .loop
   436 000001CB EB22                    	jmp end
   437                                  
   438                                  quoted:
   439 000001CD 43                      	inc bx
   440 000001CE 88C4                    	mov ah, al
   441                                  .loop:
   442 000001D0 AC                      	lodsb
   443 000001D1 38E0                    	cmp al, ah
   444 000001D3 7414                    	je end_quoted
   445 000001D5 E89804                  	extcallcall iseol?.notsemicolon
   446 000001D8 75F6                    	jne .loop
   447                                  unexpected_eol:
   448 000001DA B8360E                  	mov ax, 0E36h
   449 000001DD E89804                  	extcallcall setrc
   450 000001E0 BA[F503]                	mov dx, msg.unexpected_eol
   451                                  internaldatarelocation
   452                                  putsz_cmd3:
   453 000001E3 E86A04                  	extcallcall putsz
   454                                  cmd3_j:
   455 000001E6 E86F04                  	extcallcall cmd3
   456                                  
   457                                  end_quoted:
   458 000001E9 8D4CFF                  	lea cx, [si - 1]
   459 000001EC AC                      	lodsb
   460 000001ED EB03                    	jmp @F
   461                                  
   462                                  end:
   463 000001EF 8D4CFF                  	lea cx, [si - 1]
   464                                  @@:
   465 000001F2 E88B04                  	extcallcall skipcomm0
   466 000001F5 4E                      	dec si
   467                                  
   468 000001F6 56                      	push si
   469 000001F7 29D9                    	sub cx, bx
   470 000001F9 7503E95301              	jz notfound_invalid
   471                                  
   472 000001FE 83F904                  	cmp cx, 4
   473 00000201 722A                    	jb .notext
   474 00000203 8D77FC                  	lea si, [bx - 4]
   475 00000206 01CE                    	add si, cx
   476 00000208 803C2E                  	cmp byte [si], '.'
   477 0000020B 7520                    	jne .notext
   478 0000020D 8B4402                  	mov ax, word [si + 2]
   479 00000210 25DFDF                  	and ax, ~2020h
   480 00000213 3D4C44                  	cmp ax, "LD"
   481 00000216 7515                    	jne .notext
   482 00000218 8A4401                  	mov al, byte [si + 1]
   483 0000021B 24DF                    	and al, ~20h
   484 0000021D 3C45                    	cmp al, 'E'
   485 0000021F 7404                    	je .ext
   486 00000221 3C58                    	cmp al, 'X'
   487 00000223 7508                    	jne .notext
   488                                  .ext:
   489 00000225 83E904                  	sub cx, 4
   490 00000228 7503E92401              	jz notfound_invalid
   491                                  .notext:
   492                                  
   493 0000022D 83F908                  	cmp cx, 8
   494 00000230 7603E91C01              	ja notfound_invalid
   495 00000235 89DE                    	mov si, bx
   496 00000237 BF[4A05]                	mov di, namebuffer
   497                                  internaldatarelocation
   498 0000023A 89CA                    	mov dx, cx
   499                                  @@:
   500 0000023C AC                      	lodsb
   501 0000023D E84804                  	extcallcall uppercase
   502 00000240 AA                      	stosb
   503 00000241 E2F9                    	loop @B
   504 00000243 F7DA                    	neg dx
   505 00000245 83C208                  	add dx, 8
   506 00000248 87CA                    	xchg cx, dx
   507 0000024A B020                    	mov al, 32
   508 0000024C F3AA                    	rep stosb
   509 0000024E BF[4A05]                	mov di, namebuffer
   510                                  internaldatarelocation
   511                                  
   512                                  search_filename:
   513 00000251 BE[0C00]                	mov si, lib + 4
   514                                  internaldatarelocation
   515                                  .loop:
   516 00000254 57                      	push di
   517 00000255 56                      	push si
   518 00000256 B90800                  	mov cx, 8
   519                                  @@:
   520 00000259 AC                      	lodsb
   521 0000025A E82B04                  	extcallcall uppercase
   522 0000025D AE                      	scasb
   523 0000025E 7502                    	jne @F
   524 00000260 E2F7                    	loop @B
   525                                  @@:
   526 00000262 5E                      	pop si
   527 00000263 5F                      	pop di
   528 00000264 7503E9F700              	je found
   529 00000269 83C60C                  	add si, 8 + 4
   530 0000026C 81FE[F002]              	cmp si, strict word lib_end
   531                                  internaldatarelocation
   532 00000270 72E2                    	jb .loop
   533                                  
   534                                  search_instancename:
   535 00000272 31C9                    	xor cx, cx
   536 00000274 31D2                    	xor dx, dx
   537 00000276 E8E402                  	call get_dxax_seek_lib_plus_cxdx
   538 00000279 7303E9BE02              	jc .io_error
   539 0000027E A3[5205]                	mov word [libseek], ax
   540                                  internaldatarelocation
   541 00000281 8916[5405]              	mov word [libseek + 2], dx
   542                                  internaldatarelocation
   543                                  
   544 00000285 BE[0C00]                	mov si, lib + 4
   545                                  internaldatarelocation
   546                                  
   547                                  .loop:
   548                                  %if _COMPRESSED
   549                                  	mov ax, word [si - 4]
   550                                  	mov dx, word [si - 4 + 2]
   551                                  
   552                                  	mov word [depackskip], ax
   553                                  internaldatarelocation
   554                                  	mov word [depackskip + 2], dx
   555                                  internaldatarelocation
   556                                  %else
   557 00000288 8B4CFE                  	mov cx, word [si - 4 + 2]
   558 0000028B 8B54FC                  	mov dx, word [si - 4]		; cx:dx = offset within lib section
   559 0000028E 0316[5205]              	add dx, word [libseek]
   560                                  internaldatarelocation
   561 00000292 130E[5405]              	adc cx, word [libseek + 2]
   562                                  internaldatarelocation
   563 00000296 B80042                  	mov ax, 4200h
   564 00000299 E8E302                  	call dos_or_boot_io
   565 0000029C 7303E99B02              	jc .io_error
   566                                  %endif
   567                                  
   568 000002A1 A3[5605]                	mov word [eldheader], ax
   569                                  internaldatarelocation
   570 000002A4 8916[5805]              	mov word [eldheader + 2], dx
   571                                  internaldatarelocation
   572                                  
   573 000002A8 B92000                  	mov cx, ELD_HEADER_size
   574 000002AB 29CC                    	sub sp, cx
   575 000002AD 89E2                    	mov dx, sp
   576                                  %if _COMPRESSED
   577                                  	call read_and_depack
   578                                  %else
   579 000002AF B8003F                  	mov ax, 3F00h
   580 000002B2 E8CA02                  	call dos_or_boot_io
   581                                  %endif
   582 000002B5 7303E98202              	jc .io_error
   583 000002BA 39C1                    	cmp cx, ax
   584 000002BC 7403E97B02              	jne .io_error
   585                                  
   586 000002C1 89E7                    	mov di, sp
   587 000002C3 8B4D0A                  	mov cx, word [di + eldhCodeOffset + 2]
   588 000002C6 8B5508                  	mov dx, word [di + eldhCodeOffset] ; cx:dx = offset within ELD
   589 000002C9 0316[5605]              	add dx, word [eldheader]
   590                                  internaldatarelocation
   591 000002CD 130E[5805]              	adc cx, word [eldheader + 2]
   592                                  internaldatarelocation
   593                                  %if _COMPRESSED
   594                                  	mov word [depackskip], dx
   595                                  internaldatarelocation
   596                                  	mov word [depackskip + 2], cx
   597                                  internaldatarelocation
   598                                  %else
   599 000002D1 B80042                  	mov ax, 4200h
   600 000002D4 E8A802                  	call dos_or_boot_io
   601 000002D7 7303E96002              	jc .io_error
   602                                  %endif
   603                                  
   604 000002DC 89E2                    	mov dx, sp
   605 000002DE B91000                  	mov cx, eldiIdentifier + 8
   606                                  %if (eldiIdentifier + 8) > ELD_HEADER_size
   607                                   %error Expected shorter instance header
   608                                  %endif
   609                                  %if _COMPRESSED
   610                                  	call read_and_depack
   611                                  %else
   612 000002E1 B8003F                  	mov ax, 3F00h
   613 000002E4 E89802                  	call dos_or_boot_io
   614                                  %endif
   615 000002E7 7303E95002              	jc .io_error
   616 000002EC 39C1                    	cmp cx, ax
   617 000002EE 7403E94902              	jne .io_error
   618                                  
   619 000002F3 56                      	push si
   620 000002F4 8D7508                  	lea si, [di + eldiIdentifier]
   621 000002F7 BF[4A05]                	mov di, namebuffer
   622                                  internaldatarelocation
   623                                  
   624 000002FA 57                      	push di
   625 000002FB B90800                  	mov cx, 8
   626                                  @@:
   627 000002FE AC                      	lodsb
   628 000002FF E88603                  	extcallcall uppercase
   629 00000302 AE                      	scasb
   630 00000303 7502                    	jne @F
   631 00000305 E2F7                    	loop @B
   632                                  @@:
   633 00000307 5F                      	pop di
   634 00000308 5E                      	pop si
   635 00000309 7411                    	je .found
   636 0000030B 83C420                  	add sp, ELD_HEADER_size
   637                                  
   638 0000030E 83C60C                  	add si, 8 + 4
   639 00000311 81FE[F002]              	cmp si, strict word lib_end
   640                                  internaldatarelocation
   641 00000315 7303E96EFF              	jb .loop
   642 0000031A EB18                    	jmp notfound
   643                                  
   644                                  .found:
   645 0000031C 83C420                  	add sp, ELD_HEADER_size
   646                                  
   647                                  %ifn _COMPRESSED
   648 0000031F 8B16[5605]              	mov dx, word [eldheader]
   649                                  internaldatarelocation
   650 00000323 8B0E[5805]              	mov cx, word [eldheader + 2]
   651                                  internaldatarelocation
   652 00000327 B80042                  	mov ax, 4200h
   653 0000032A E85202                  	call dos_or_boot_io
   654 0000032D 7303E90A02              	jc .io_error
   655                                  %endif
   656 00000332 EB41                    	jmp found.header_variable
   657                                  
   658                                  .io_error equ found.io_error
   659                                  
   660                                  
   661                                  notfound:
   662 00000334 B8370E                  	mov ax, 0E37h
   663 00000337 E83E03                  	extcallcall setrc
   664 0000033A BA[9003]                	mov dx, msg.notfound.1
   665                                  internaldatarelocation
   666 0000033D E81003                  	extcallcall putsz
   667 00000340 89FA                    	mov dx, di
   668 00000342 B90800                  	mov cx, 8
   669 00000345 E82003                  	extcallcall puts
   670 00000348 BA[B403]                	mov dx, msg.notfound.2
   671                                  internaldatarelocation
   672 0000034B E84FFE                  	call zerooffsets
   673 0000034E E992FE                  	jmp putsz_cmd3
   674                                  
   675                                  notfound_invalid:
   676 00000351 B8380E                  	mov ax, 0E38h
   677 00000354 E82103                  	extcallcall setrc
   678 00000357 BA[B903]                	mov dx, msg.notfound.invalid
   679                                  internaldatarelocation
   680 0000035A E840FE                  	call zerooffsets
   681 0000035D E983FE                  	jmp putsz_cmd3
   682                                  
   683                                  found:
   684                                  %if 0
   685                                  	xor ax, ax
   686                                  	retf
   687                                  %endif
   688                                  
   689                                  %if _COMPRESSED
   690                                  	xor cx, cx
   691                                  	xor dx, dx
   692                                  	call get_dxax_seek_lib_plus_cxdx
   693                                  	jc .io_error
   694                                  	mov word [libseek], ax
   695                                  internaldatarelocation
   696                                  	mov word [libseek + 2], dx
   697                                  internaldatarelocation
   698                                  
   699                                  	mov dx, word [si - 4 + 2]
   700                                  	mov ax, word [si - 4]		; dx:ax = offset within lib section
   701                                  %else
   702 00000360 8B4CFE                  	mov cx, word [si - 4 + 2]
   703 00000363 8B54FC                  	mov dx, word [si - 4]		; cx:dx = offset within lib section
   704                                  
   705 00000366 E8F401                  	call get_dxax_seek_lib_plus_cxdx
   706 00000369 7303E9CE01              	jc .io_error
   707                                  %endif
   708 0000036E A3[5605]                	mov word [eldheader], ax
   709                                  internaldatarelocation
   710 00000371 8916[5805]              	mov word [eldheader + 2], dx
   711                                  internaldatarelocation
   712                                  .header_variable:
   713                                  
   714                                  %assign _BOOTLDR 1
   715                                  %assign _APPLICATION 1
   716                                  %assign _DEVICE 1
   717                                  %assign _PM 1
   718                                  %define relocated(address) relocateddata
   719                                  %define doscall extcallcall _doscall
   720                                  %assign ELD 1
   721                                  %assign _DOSORBOOTIO 1
   722                                  
   723                                  %include "loadeld.asm"
     1                              <1> 
     2                              <1> %if 0
     3                              <1> 
     4                              <1> lDebug load Extensions for lDebug
     5                              <1> 
     6                              <1> Copyright (C) 2008-2024 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> %if ELD
    17                              <1> %assign _ELDTRAILER 0
    18                              <1> 		numdef DOSORBOOTIO, 0
    19                              <1> 		numdef ELDCOMPRESSED, 0
    20                              <1> %else
    21                              <1> %assign _DOSORBOOTIO 0
    22                              <1> %assign _ELDCOMPRESSED 0
    23                              <1> 	push bp
    24                              <1> %endif
    25                              <1> 
    26                              <1> %if _ELDTRAILER
    27                              <1> 	xor ax, ax
    28                              <1> 	mov word [eldheader], ax
    29                              <1> internaldatarelocation
    30                              <1> 	mov word [eldheader + 2], ax
    31                              <1> internaldatarelocation
    32                              <1> 
    33                              <1> 	xchg cx, ax
    34                              <1> 	mov ax, 4202h
    35                              <1> 	xor dx, dx
    36                              <1> %if _BOOTLDR
    37                              <1>  %if _APPLICATION || _DEVICE
    38                              <1> 	testopt [relocated(internalflags)], nodosloaded
    39                              <1> linkdatarelocation internalflags, -3
    40                              <1> 	jz @F
    41                              <1>  %endif
    42                              <1> 	extcallcall yy_boot_seek_start.bx
    43                              <1> 	mov cx, word [load_data - LOADDATA2 + ldFileSize + 2]
    44                              <1> internaldatarelocation
    45                              <1> 	mov dx, word [load_data - LOADDATA2 + ldFileSize]
    46                              <1> internaldatarelocation
    47                              <1> 	extcallcall yy_boot_seek_current.bx
    48                              <1> 	mov dx, word [load_data - LOADDATA2 + ldCurrentSeek + 2]
    49                              <1> internaldatarelocation
    50                              <1> 	mov ax, word [load_data - LOADDATA2 + ldCurrentSeek]
    51                              <1> internaldatarelocation
    52                              <1>  %if _APPLICATION || _DEVICE
    53                              <1> 	jmp @FF
    54                              <1>  %endif
    55                              <1> %endif
    56                              <1> 
    57                              <1> @@:
    58                              <1> %if _APPLICATION || _DEVICE
    59                              <1> 	doscall
    60                              <1> %endif
    61                              <1> @@:
    62                              <1> 	jc .io_error
    63                              <1> 
    64                              <1> 	test dx, dx
    65                              <1> 	jnz @F
    66                              <1> 	cmp ax, ELD_HEADER_size + ELD_TRAILER_HEADER_size
    67                              <1> 	jb .no_trailer
    68                              <1> @@:
    69                              <1> 
    70                              <1> 	mov ax, 4201h
    71                              <1> 	mov cx, -1
    72                              <1> 	mov dx, - ELD_TRAILER_HEADER_size
    73                              <1> %if _BOOTLDR
    74                              <1>  %if _APPLICATION || _DEVICE
    75                              <1> 	testopt [relocated(internalflags)], nodosloaded
    76                              <1> linkdatarelocation internalflags, -3
    77                              <1> 	jz @F
    78                              <1>  %endif
    79                              <1> 	extcallcall yy_boot_seek_current.bx
    80                              <1> 	mov dx, word [load_data - LOADDATA2 + ldCurrentSeek + 2]
    81                              <1> internaldatarelocation
    82                              <1> 	mov ax, word [load_data - LOADDATA2 + ldCurrentSeek]
    83                              <1> internaldatarelocation
    84                              <1>  %if _APPLICATION || _DEVICE
    85                              <1> 	jmp @FF
    86                              <1>  %endif
    87                              <1> %endif
    88                              <1> 
    89                              <1> @@:
    90                              <1> %if _APPLICATION || _DEVICE
    91                              <1> 	doscall
    92                              <1> %endif
    93                              <1> @@:
    94                              <1> 	jc .io_error
    95                              <1> 
    96                              <1> 	push dx
    97                              <1> 	push ax
    98                              <1> 
    99                              <1> 	mov cx, fromwords(ELD_TRAILER_HEADER_size_w)
   100                              <1> 	sub sp, cx
   101                              <1> 	mov dx, sp
   102                              <1> 
   103                              <1> 	mov ah, 3Fh
   104                              <1> %if _BOOTLDR
   105                              <1>  %if _APPLICATION || _DEVICE
   106                              <1> 	testopt [relocated(internalflags)], nodosloaded
   107                              <1> linkdatarelocation internalflags, -3
   108                              <1> 	jz @F
   109                              <1>  %endif
   110                              <1> 	extcallcall yy_boot_read.bx
   111                              <1>  %if _APPLICATION || _DEVICE
   112                              <1> 	jmp @FF
   113                              <1>  %endif
   114                              <1> %endif
   115                              <1> 
   116                              <1> @@:
   117                              <1> %if _APPLICATION || _DEVICE
   118                              <1> 	doscall
   119                              <1> %endif
   120                              <1> @@:
   121                              <1> 	jc .io_error
   122                              <1> 	mov di, sp
   123                              <1> 	mov si, sp
   124                              <1> 
   125                              <1> 	cmp ax, cx
   126                              <1> 	jne .no_trailer_pop
   127                              <1> 
   128                              <1> 	xor dx, dx
   129                              <1> 	shr cx, 1
   130                              <1> @@:
   131                              <1> 	lodsw
   132                              <1> 	add dx, ax
   133                              <1> 	loop @B
   134                              <1> 	jnz .no_trailer_pop
   135                              <1> 
   136                              <1> 	pop ax
   137                              <1> 	cmp ax, "EL"
   138                              <1> 	jne .no_trailer_pop
   139                              <1> 	pop ax
   140                              <1> 	cmp ax, "D1"
   141                              <1> 	jne .no_trailer_pop
   142                              <1> 	pop ax
   143                              <1> 	cmp ax, "TA"
   144                              <1> 	jne .no_trailer_pop
   145                              <1> 	pop ax
   146                              <1> 	cmp ax, "IL"
   147                              <1> 	jne .no_trailer_pop
   148                              <1> 
   149                              <1> 	pop si
   150                              <1> 	pop cx			; cx:si = displacement to subtract
   151                              <1> 	pop ax			; reserved
   152                              <1> 	pop ax			; checksum
   153                              <1> 
   154                              <1> 	pop ax
   155                              <1> 	pop dx			; dx:ax = offset of trailer header
   156                              <1> 	add ax, si
   157                              <1> 	adc dx, cx		; dx:ax = offset of header
   158                              <1> 	jnc .io_error
   159                              <1> 
   160                              <1> 	mov word [eldheader], ax
   161                              <1> internaldatarelocation
   162                              <1> 	mov word [eldheader + 2], dx
   163                              <1> internaldatarelocation
   164                              <1> 
   165                              <1> .no_trailer_pop:
   166                              <1> 	lea sp, [di + fromwords(ELD_TRAILER_HEADER_size_w) + 4]
   167                              <1> 
   168                              <1> .no_trailer:
   169                              <1> 	mov ax, 4200h
   170                              <1> 	mov dx, word [eldheader]
   171                              <1> internaldatarelocation
   172                              <1> 	mov cx, word [eldheader + 2]
   173                              <1> internaldatarelocation
   174                              <1> 
   175                              <1> %if _BOOTLDR
   176                              <1>  %if _APPLICATION || _DEVICE
   177                              <1> 	testopt [relocated(internalflags)], nodosloaded
   178                              <1> linkdatarelocation internalflags, -3
   179                              <1> 	jz @F
   180                              <1>  %endif
   181                              <1> 	extcallcall yy_boot_seek_start.bx
   182                              <1> 	extcallcall yy_boot_seek_current.bx
   183                              <1>  %if _APPLICATION || _DEVICE
   184                              <1> 	jmp @FF
   185                              <1>  %endif
   186                              <1> %endif
   187                              <1> 
   188                              <1> @@:
   189                              <1> %if _APPLICATION || _DEVICE
   190                              <1> 	doscall
   191                              <1> %endif
   192                              <1> @@:
   193                              <1> 	jc .io_error
   194                              <1> %endif
   195                              <1> 
   196 00000375 B92000              <1> 	mov cx, fromwords(ELD_HEADER_size_w)
   197 00000378 29CC                <1> 	sub sp, cx
   198 0000037A 89E2                <1> 	mov dx, sp		; es:dx and ds:dx
   199                              <1> %if _ELDCOMPRESSED
   200                              <1> 	push word [eldheader + 2]
   201                              <1> internaldatarelocation
   202                              <1> 	push word [eldheader]
   203                              <1> internaldatarelocation
   204                              <1> 	pop word [depackskip]
   205                              <1> internaldatarelocation
   206                              <1> 	pop word [depackskip + 2]
   207                              <1> internaldatarelocation
   208                              <1> 
   209                              <1> 	call read_and_depack
   210                              <1> %elif _DOSORBOOTIO
   211 0000037C B8003F              <1> 	mov ax, 3F00h
   212 0000037F E8FD01              <1> 	call dos_or_boot_io
   213                              <1> %else
   214                              <1> 	mov ah, 3Fh
   215                              <1> %if _BOOTLDR
   216                              <1>  %if _APPLICATION || _DEVICE
   217                              <1> 	testopt [relocated(internalflags)], nodosloaded
   218                              <1> linkdatarelocation internalflags, -3
   219                              <1> 	jz @F
   220                              <1>  %endif
   221                              <1> 	extcallcall yy_boot_read.bx
   222                              <1>  %if _APPLICATION || _DEVICE
   223                              <1> 	jmp @FF
   224                              <1>  %endif
   225                              <1> %endif
   226                              <1> 
   227                              <1> @@:
   228                              <1> %if _APPLICATION || _DEVICE
   229                              <1> 	doscall
   230                              <1> %endif
   231                              <1> @@:
   232                              <1> %endif
   233 00000382 7303E9B501          <1> 	jc .io_error
   234 00000387 39C8                <1> 	cmp ax, cx
   235 00000389 7403E9B601          <1> 	jne .invalid
   236                              <1> 
   237 0000038E 89E7                <1> 	mov di, sp
   238                              <1> 
   239 00000390 58                  <1> 	pop ax
   240 00000391 3D454C              <1> 	cmp ax, "EL"
   241 00000394 7403E9AB01          <1> 	jne .invalid
   242 00000399 58                  <1> 	pop ax
   243 0000039A 3D4431              <1> 	cmp ax, "D1"
   244 0000039D 7403E9A201          <1> 	jne .invalid
   245 000003A2 58                  <1> 	pop ax
   246 000003A3 58                  <1> 	pop ax
   247 000003A4 80FC1A              <1> 	cmp ah, 26
   248 000003A7 7403E99801          <1> 	jne .invalid
   249                              <1> 
   250 000003AC A1[0000]            <1> 	mov ax, word [relocated(extseg_size)]
   251                              <1> linkdatarelocation extseg_size
   252 000003AF 2B06[0000]          <1> 	sub ax, word [relocated(extseg_used)]
   253                              <1> linkdatarelocation extseg_used
   254 000003B3 7303E97C01          <1> 	jc .error_internal
   255                              <1> %if ELD
   256 000003B8 83E840              <1> 	sub ax, relocator_size
   257 000003BB 7303E97401          <1> 	jc .error_internal
   258                              <1> %endif
   259                              <1> 
   260 000003C0 8B4D0C              <1> 	mov cx, word [di + eldhCodeImageLength]
   261                              <1> %if ELD
   262 000003C3 39C8                <1> 	cmp ax, cx
   263 000003C5 7303E98201          <1> 	jb .oom
   264                              <1> %endif
   265 000003CA 034D0E              <1> 	add cx, word [di + eldhCodeAllocLength]
   266 000003CD 7238                <1> 	jc .invalid_CY
   267 000003CF 83C10F              <1> 	add cx, 15
   268 000003D2 7233                <1> 	jc .invalid_CY
   269 000003D4 80E1F0              <1> 	and cl, ~ 15
   270                              <1> 
   271                              <1> %if ELD
   272 000003D7 2E0306[0200]        <1> 	add ax, word [cs:code + eldiEndCode]
   273                              <1> internalcoderelocation
   274 000003DC 2E2B06[0000]        <1> 	sub ax, word [cs:code + eldiStartCode]
   275                              <1> internalcoderelocation
   276                              <1> %endif
   277 000003E1 39C8                <1> 	cmp ax, cx
   278 000003E3 7303E96401          <1> 	jb .oom
   279                              <1> 
   280 000003E8 8B16[0000]          <1> 	mov dx, word [relocated(extdata_size)]
   281                              <1> linkdatarelocation extdata_size
   282 000003EC 2B16[0000]          <1> 	sub dx, word [relocated(extdata_used)]
   283                              <1> linkdatarelocation extdata_used
   284 000003F0 7303E93F01          <1> 	jc .error_internal
   285                              <1> 
   286 000003F5 8B7514              <1> 	mov si, word [di + eldhDataImageLength]
   287                              <1> %if ELD
   288 000003F8 39F2                <1> 	cmp dx, si
   289 000003FA 7303E94D01          <1> 	jb .oom
   290                              <1> %endif
   291 000003FF 037516              <1> 	add si, word [di + eldhDataAllocLength]
   292 00000402 7203                <1> 	jc .invalid_CY
   293 00000404 83C60F              <1> 	add si, 15
   294                              <1> .invalid_CY:
   295 00000407 7303E93801          <1> 	jc .invalid
   296 0000040C 83E6F0              <1> 	and si, ~ 15
   297                              <1> 
   298                              <1> %if ELD
   299 0000040F 2E0316[0600]        <1> 	add dx, word [cs:code + eldiEndData]
   300                              <1> internalcoderelocation
   301 00000414 2E2B16[0400]        <1> 	sub dx, word [cs:code + eldiStartData]
   302                              <1> internalcoderelocation
   303                              <1> %endif
   304 00000419 39F2                <1> 	cmp dx, si
   305 0000041B 7303E92C01          <1> 	jb .oom
   306                              <1> 
   307 00000420 56                  <1> 	push si
   308 00000421 51                  <1> 	push cx
   309                              <1> 
   310 00000422 B80042              <1> 	mov ax, 4200h
   311 00000425 8B4D0A              <1> 	mov cx, word [di + eldhCodeOffset + 2]
   312 00000428 8B5508              <1> 	mov dx, word [di + eldhCodeOffset]
   313                              <1> %if ELD || _ELDTRAILER
   314 0000042B 0316[5605]          <1> 	add dx, word [eldheader]
   315                              <1> internaldatarelocation
   316 0000042F 130E[5805]          <1> 	adc cx, word [eldheader + 2]
   317                              <1> internaldatarelocation
   318                              <1> %else
   319                              <1> 		; ELD header is at seek 0
   320                              <1> %endif
   321                              <1> %if _ELDCOMPRESSED
   322                              <1> 	mov word [depackskip], dx
   323                              <1> internaldatarelocation
   324                              <1> 	mov word [depackskip + 2], cx
   325                              <1> internaldatarelocation
   326                              <1> %elif _DOSORBOOTIO
   327 00000433 E84901              <1> 	call dos_or_boot_io
   328                              <1> %else
   329                              <1> %if _BOOTLDR
   330                              <1>  %if _APPLICATION || _DEVICE
   331                              <1> 	testopt [relocated(internalflags)], nodosloaded
   332                              <1> linkdatarelocation internalflags, -3
   333                              <1> 	jz @F
   334                              <1>  %endif
   335                              <1> 	extcallcall yy_boot_seek_start.bx
   336                              <1> 	extcallcall yy_boot_seek_current.bx
   337                              <1>  %if _APPLICATION || _DEVICE
   338                              <1> 	jmp @FF
   339                              <1>  %endif
   340                              <1> %endif
   341                              <1> 
   342                              <1> @@:
   343                              <1> %if _APPLICATION || _DEVICE
   344                              <1> 	doscall
   345                              <1> %endif
   346                              <1> @@:
   347                              <1> %endif
   348 00000436 7303E90101          <1> 	jc .io_error
   349                              <1> 
   350 0000043B 8B16[0000]          <1> 	mov dx, word [relocated(extseg_used)]
   351                              <1> linkdatarelocation extseg_used
   352                              <1> %if _PM
   353 0000043F E84E02              <1> 	extcallcall ispm
   354 00000442 7506                <1> 	jnz @F
   355 00000444 8E1E[0000]          <1> 	mov ds, word [relocated(extdssel)]
   356                              <1> linkdatarelocation extdssel
   357 00000448 EB04                <1> 	jmp @FF
   358                              <1> 
   359                              <1> @@:
   360                              <1> %endif
   361 0000044A 8E1E[0000]          <1> 	mov ds, word [relocated(extseg)]
   362                              <1> linkdatarelocation extseg
   363                              <1> @@:
   364 0000044E 368B4D0C            <1> 	mov cx, word [ss:di + eldhCodeImageLength]
   365                              <1> %if _ELDCOMPRESSED
   366                              <1> 	push ds
   367                              <1> 	pop es
   368                              <1> 	push ss
   369                              <1> 	pop ds
   370                              <1> 	call read_and_depack
   371                              <1> 	push ss
   372                              <1> 	pop es
   373                              <1> %elif _DOSORBOOTIO
   374 00000452 B8FF3F              <1> 	mov ax, 3FFFh
   375 00000455 E82701              <1> 	call dos_or_boot_io
   376                              <1> %else
   377                              <1> 	mov ah, 3Fh
   378                              <1> %if _BOOTLDR
   379                              <1>  %if _APPLICATION || _DEVICE
   380                              <1> 	testopt [ss:relocated(internalflags)], nodosloaded
   381                              <1> linkdatarelocation internalflags, -3
   382                              <1> 	jz @F
   383                              <1>  %endif
   384                              <1> 	push ds
   385                              <1> 	pop es
   386                              <1> 	push ss
   387                              <1> 	pop ds
   388                              <1> 	extcallcall yy_boot_read.bx
   389                              <1> 	push ss
   390                              <1> 	pop es
   391                              <1>  %if _APPLICATION || _DEVICE
   392                              <1> 	jmp @FF
   393                              <1>  %endif
   394                              <1> %endif
   395                              <1> 
   396                              <1> @@:
   397                              <1> %if _APPLICATION || _DEVICE
   398                              <1> %if _PM
   399                              <1> 	extcallcall doscall_extseg
   400                              <1> %else
   401                              <1> 	doscall
   402                              <1> %endif
   403                              <1> %endif
   404                              <1> @@:
   405                              <1> %endif
   406 00000458 16                  <1> 	 push ss
   407 00000459 1F                  <1> 	 pop ds
   408 0000045A 7303E9DD00          <1> 	jc .io_error
   409 0000045F 39C1                <1> 	cmp cx, ax
   410 00000461 7403E9D600          <1> 	jne .io_error
   411                              <1> 
   412 00000466 B80042              <1> 	mov ax, 4200h
   413 00000469 8B4D12              <1> 	mov cx, word [di + eldhDataOffset + 2]
   414 0000046C 8B5510              <1> 	mov dx, word [di + eldhDataOffset]
   415                              <1> %if ELD || _ELDTRAILER
   416 0000046F 0316[5605]          <1> 	add dx, word [eldheader]
   417                              <1> internaldatarelocation
   418 00000473 130E[5805]          <1> 	adc cx, word [eldheader + 2]
   419                              <1> internaldatarelocation
   420                              <1> %else
   421                              <1> 		; ELD header is at seek 0
   422                              <1> %endif
   423                              <1> 
   424                              <1> %if _ELDCOMPRESSED
   425                              <1> 	mov word [depackskip], dx
   426                              <1> internaldatarelocation
   427                              <1> 	mov word [depackskip + 2], cx
   428                              <1> internaldatarelocation
   429                              <1> %elif _DOSORBOOTIO
   430 00000477 E80501              <1> 	call dos_or_boot_io
   431                              <1> %else
   432                              <1> %if _BOOTLDR
   433                              <1>  %if _APPLICATION || _DEVICE
   434                              <1> 	testopt [relocated(internalflags)], nodosloaded
   435                              <1> linkdatarelocation internalflags, -3
   436                              <1> 	jz @F
   437                              <1>  %endif
   438                              <1> 	extcallcall yy_boot_seek_start.bx
   439                              <1> 	extcallcall yy_boot_seek_current.bx
   440                              <1>  %if _APPLICATION || _DEVICE
   441                              <1> 	jmp @FF
   442                              <1>  %endif
   443                              <1> %endif
   444                              <1> 
   445                              <1> @@:
   446                              <1> %if _APPLICATION || _DEVICE
   447                              <1> 	doscall
   448                              <1> %endif
   449                              <1> @@:
   450                              <1> %endif
   451 0000047A 7303E9BD00          <1> 	jc .io_error
   452                              <1> 
   453                              <1> %if ELD
   454 0000047F 8B16[0000]          <1> 	mov dx, word [relocateddata]
   455                              <1> linkdatarelocation extdata
   456                              <1> %else
   457                              <1> 	mov dx, ext_data_area
   458                              <1> %endif
   459 00000483 0316[0000]          <1> 	add dx, word [relocated(extdata_used)]
   460                              <1> linkdatarelocation extdata_used
   461 00000487 8B4D14              <1> 	mov cx, word [di + eldhDataImageLength]
   462                              <1> %if _ELDCOMPRESSED
   463                              <1> 	call read_and_depack
   464                              <1> %elif _DOSORBOOTIO
   465 0000048A B8003F              <1> 	mov ax, 3F00h
   466 0000048D E8EF00              <1> 	call dos_or_boot_io
   467                              <1> %else
   468                              <1> 	mov ah, 3Fh
   469                              <1> %if _BOOTLDR
   470                              <1>  %if _APPLICATION || _DEVICE
   471                              <1> 	testopt [relocated(internalflags)], nodosloaded
   472                              <1> linkdatarelocation internalflags, -3
   473                              <1> 	jz @F
   474                              <1>  %endif
   475                              <1> 	extcallcall yy_boot_read.bx
   476                              <1>  %if _APPLICATION || _DEVICE
   477                              <1> 	jmp @FF
   478                              <1>  %endif
   479                              <1> %endif
   480                              <1> 
   481                              <1> @@:
   482                              <1> %if _APPLICATION || _DEVICE
   483                              <1> 	doscall
   484                              <1> %endif
   485                              <1> @@:
   486                              <1> %endif
   487 00000490 7303E9A700          <1> 	jc .io_error
   488 00000495 39C1                <1> 	cmp cx, ax
   489 00000497 7403E9A000          <1> 	jne .io_error
   490                              <1> 
   491                              <1> %if _PM
   492 0000049C E83801              <1> 	call get_es_ext
   493                              <1> %else
   494                              <1> 	mov es, word [extseg]
   495                              <1> %endif
   496                              <1> 
   497                              <1> %if ELD
   498 0000049F 8B1E[0000]          <1> 	mov bx, word [relocateddata]
   499                              <1> linkdatarelocation extseg_used		; es:bx -> where we loaded code
   500                              <1> 
   501 000004A3 8B4518              <1> 	mov ax, [di + eldhCodeEntrypoint]
   502 000004A6 05[0000]            <1> 	add ax, strict word code	; -> entry destination
   503                              <1> internalcoderelocation
   504 000004A9 26A3[1E06]          <1> 	mov word [es:relocator.entry], ax
   505                              <1> internalcoderelocation
   506                              <1> 
   507 000004AD 8B450C              <1> 	mov ax, word [di + eldhCodeImageLength]
   508 000004B0 26A3[F705]          <1> 	mov word [es:relocator.codelength], ax
   509                              <1> internalcoderelocation
   510                              <1> 
   511 000004B4 8B4514              <1> 	mov ax, word [di + eldhDataImageLength]
   512 000004B7 26A3[0606]          <1> 	mov word [es:relocator.datalength], ax
   513                              <1> internalcoderelocation
   514                              <1> 
   515 000004BB 58                  <1> 	pop ax
   516                              <1> 
   517 000004BC 26C707[0000]        <1> 	mov word [es:bx + eldiStartCode], code
   518                              <1> internalcoderelocation			; fix its start
   519                              <1> 
   520 000004C1 89C7                <1> 	mov di, ax
   521 000004C3 033E[0000]          <1> 	add di, word [relocateddata]
   522                              <1> linkdatarelocation extseg_used		; di -> relocator destination
   523 000004C7 50                  <1> 	push ax
   524 000004C8 83C040              <1> 	add ax, relocator_size
   525 000004CB 260106[0200]        <1> 	add word [es:code + eldiEndCode], ax
   526                              <1> internalcoderelocation			; grow our allocation
   527 000004D0 0106[0000]          <1> 	add word [relocateddata], ax
   528                              <1> linkdatarelocation extseg_used		; ditto
   529 000004D4 58                  <1> 	pop ax
   530                              <1> 
   531 000004D5 26891E[FA05]        <1> 	mov word [es:relocator.codesource], bx
   532                              <1> internalcoderelocation			; -> start
   533 000004DA 05[0000]            <1> 	add ax, strict word code
   534                              <1> internalcoderelocation
   535 000004DD 26894702            <1> 	mov word [es:bx + eldiEndCode], ax
   536                              <1> 					; -> past destination
   537 000004E1 26A3[1506]          <1> 	mov word [es:relocator.extseg_used], ax
   538                              <1> internalcoderelocation			; new extseg_used
   539                              <1> 
   540 000004E5 58                  <1> 	pop ax
   541                              <1> 
   542 000004E6 8B16[0000]          <1> 	mov dx, word [relocateddata]
   543                              <1> linkdatarelocation extdata_used
   544 000004EA 0316[0000]          <1> 	add dx, word [relocateddata]
   545                              <1> linkdatarelocation extdata
   546                              <1> 
   547 000004EE 268916[0906]        <1> 	mov word [es:relocator.datasource], dx
   548                              <1> internalcoderelocation
   549                              <1> 
   550                              <1> 	houdini
   551 000004F3 BA[0000]            <1> 	mov dx, datastart
   552                              <1> internaldatarelocation
   553 000004F6 26895704            <1> 	mov word [es:bx + eldiStartData], dx
   554 000004FA 01D0                <1> 	add ax, dx
   555 000004FC 26894706            <1> 	mov word [es:bx + eldiEndData], ax
   556                              <1> 
   557 00000500 2B06[0000]          <1> 	sub ax, word [relocateddata]
   558                              <1> linkdatarelocation extdata
   559 00000504 26A3[1B06]          <1> 	mov word [es:relocator.extdata_used], ax
   560                              <1> internalcoderelocation			; new extdata_used
   561                              <1> 
   562 00000508 BA[0000]            <1> 	mov dx, code
   563                              <1> internalcoderelocation			; es:dx -> ELD code instance (dest)
   564 0000050B BB[0000]            <1> 	mov bx, datastart
   565                              <1> internaldatarelocation
   566                              <1> 
   567 0000050E BE[F005]            <1> 	mov si, relocator
   568                              <1> internalcoderelocation
   569 00000511 B92000              <1> 	mov cx, words(relocator_size)
   570 00000514 06                  <1> 	 push es
   571 00000515 1F                  <1> 	 pop ds
   572 00000516 57                  <1> 	push di
   573 00000517 F3A5                <1> 	rep movsw
   574 00000519 59                  <1> 	pop cx				; -> relocator entry
   575 0000051A 16                  <1> 	push ss
   576 0000051B 1F                  <1> 	pop ds
   577                              <1> %else
   578                              <1> 	pop ax				; allocated code size
   579                              <1> 	mov dx, word [extseg_used]
   580                              <1> 	mov bp, dx
   581                              <1> 	mov word [es:bp+eldiStartCode], dx
   582                              <1> 					; -> loaded code
   583                              <1> 	add ax, word [extseg_used]
   584                              <1> 	mov word [extseg_used], ax	; -> behind
   585                              <1> 	mov word [es:bp+eldiEndCode], ax; -> behind
   586                              <1> 
   587                              <1> 	pop ax				; allocated data size
   588                              <1> 	mov bx, word [extdata_used]
   589                              <1> 	add bx, ext_data_area		; -> loaded data
   590                              <1> 	mov word [es:bp+eldiStartData], bx
   591                              <1> 	add word [extdata_used], ax	; = amount new used
   592                              <1> 	add ax, bx			; -> behind
   593                              <1> 	mov word [es:bp+eldiEndData], ax
   594                              <1> 
   595                              <1> 	mov cx, [di + eldhCodeEntrypoint]
   596                              <1> 	add cx, dx
   597                              <1> %endif
   598 0000051C 83C418              <1> 	add sp, ELD_HEADER_size - 8
   599                              <1> 
   600                              <1> %if ELD
   601 0000051F 5E                  <1> 	pop si
   602 00000520 A1[0000]            <1> 	mov ax, word [relocateddata]
   603                              <1> linkdatarelocation linksel
   604 00000523 E86A01              <1> 	extcallcall ispm
   605 00000526 7403                <1> 	jz @F
   606 00000528 A1[0000]            <1> 	mov ax, word [relocateddata]
   607                              <1> linkdatarelocation linkseg
   608                              <1> @@:
   609                              <1> 
   610 0000052B BF[0000]            <1> 	mov di, relocateddata
   611                              <1> linkdatarelocation linkinfoaddress
   612 0000052E 8B3D                <1> 	mov di, [di]
   613 00000530 8ED8                <1> 	mov ds, ax
   614                              <1> 
   615 00000532 FFE1                <1> 	jmp cx
   616                              <1> 		; INP:	es:dx -> loaded initial ELD image
   617                              <1> 		;	 ELD instance structure filled
   618                              <1> 		;	es => ELD code area
   619                              <1> 		;	ds:di -> link info
   620                              <1> 		;	ss:bx -> loaded initial data
   621                              <1> 		;	ss:si -> command line tail
   622                              <1> 		;	cs:ip -> entrypoint
   623                              <1> 		;	ss:sp -> far return address for current mode
   624                              <1> 		; STT:	UP, EI
   625                              <1> %else
   626                              <1> ext_finish.bp_is_set equ $
   627                              <1> 	pop bp
   628                              <1> 
   629                              <1> 	mov si, word [ext_cmdline]
   630                              <1> 
   631                              <1> %if _MESSAGESEGMENT
   632                              <1>  %if _PM
   633                              <1> 	call get_messagesegsel
   634                              <1>  %else
   635                              <1>  	mov ds, word [ss:messageseg]
   636                              <1>  %endif
   637                              <1> %endif
   638                              <1> 	mov di, linkinfo
   639                              <1> 
   640                              <1> 	push cs
   641                              <1> 	call .transfer
   642                              <1> 		; INP:	es:dx -> loaded initial ELD image
   643                              <1> 		;	 ELD instance structure filled
   644                              <1> 		;	es => ELD code area
   645                              <1> 		;	ds:di -> link info
   646                              <1> 		;	ss:bx -> loaded initial data
   647                              <1> 		;	ss:si -> command line tail
   648                              <1> 		;	cs:ip -> entrypoint
   649                              <1> 		;	ss:sp -> far return address for current mode
   650                              <1> 		; STT:	UP, EI
   651                              <1> %endif
   724                                  
   725                                  .error_internal:
   726 00000534 BA[F002]                	mov dx, msg.ext_error_internal
   727                                  internaldatarelocation
   728 00000537 B8390E                  	mov ax, 0E39h
   729 0000053A EB16                    	jmp @F
   730                                  
   731                                  .io_error:
   732 0000053C BA[1503]                	mov dx, msg.ext_error_io
   733                                  internaldatarelocation
   734 0000053F B83A0E                  	mov ax, 0E3Ah
   735 00000542 EB0E                    	jmp @F
   736                                  
   737                                  .invalid:
   738 00000544 BA[3603]                	mov dx, msg.ext_error_invalid
   739                                  internaldatarelocation
   740 00000547 B83B0E                  	mov ax, 0E3Bh
   741 0000054A EB06                    	jmp @F
   742                                  
   743                                  .oom:
   744 0000054C BA[6C03]                	mov dx, msg.ext_error_oom
   745                                  internaldatarelocation
   746 0000054F B83C0E                  	mov ax, 0E3Ch
   747                                  
   748                                  @@:
   749 00000552 E82301                  	extcallcall setrc
   750 00000555 16                      	push ss
   751 00000556 1F                      	pop ds
   752 00000557 E8F600                  	extcallcall putsz
   753 0000055A E8FB00                  	extcallcall cmd3
   754                                  
   755                                  
   756                                  get_dxax_seek_lib_plus_cxdx:
   757 0000055D BB[0000]                	mov bx, relocateddata
   758                                  linkdatarelocation load_data_lowest	; make yy_boot_get and yy_boot_update no-ops
   759 00000560 F606[0100]40            	testopt [relocateddata], nodosloaded
   760                                  linkdatarelocation internalflags, -3
   761 00000565 750C                    	jnz @F
   762 00000567 8B1E[0000]              	mov bx, [relocateddata]
   763                                  linkdatarelocation ext_handle
   764 0000056B E82A01                  	extcallcall InDOS
   765 0000056E 7403                    	jz @F
   766 00000570 E82D01                  	extcallcall error
   767                                  @@:
   768 00000573 B8[0000]                	mov ax, relocateddata
   769                                  linkdatarelocation ext_finish.bp_is_set
   770                                  
   771 00000576 B80142                  	mov ax, 4201h
   772                                  lib_displacement equ LIBOFFSET - DATAOFFSET - data_size
   773 00000579 83C200                  	add dx, lib_displacement & 0FFFFh
   774 0000057C 83D100                  	adc cx, (lib_displacement >> 16) & 0FFFFh
   775                                  	; jmp dos_or_boot_io
   776                                  
   777                                  
   778                                  dos_or_boot_io:
   779                                  %if _BOOTLDR
   780 0000057F 36F606[0100]40          reloc	testopt [ss:relocateddata], nodosloaded
   781                                  linkdatarelocation internalflags, -3
   782 00000585 7515                    	jnz .boot
   783                                  %endif
   784                                  .dos:
   785 00000587 3DFF3F                  	cmp ax, 3FFFh
   786 0000058A 7408                    	je @F
   787 0000058C E8[0000]EB020000        	extcall _doscall
   788 00000593 C3                      	retn
   789                                  
   790                                  @@:
   791 00000594 E8[0000]EB020000        	extcall doscall_extseg
   792 0000059B C3                      	retn
   793                                  
   794                                  %if _BOOTLDR
   795                                  .boot:
   796 0000059C 80FC3F                  	cmp ah, 3Fh
   797 0000059F 7512                    	jne @F
   798 000005A1 3CFF                    	cmp al, 0FFh
   799 000005A3 7504                    	jne .bootread
   800                                  .bootread_ext:
   801 000005A5 1E                      	push ds
   802 000005A6 07                      	pop es
   803 000005A7 16                      	push ss
   804 000005A8 1F                      	pop ds
   805                                  .bootread:
   806 000005A9 E8[0000]EB020000        	extcall yy_boot_read.bx
   807 000005B0 16                      	push ss
   808 000005B1 07                      	pop es
   809 000005B2 C3                      	retn
   810                                  
   811                                  @@:
   812 000005B3 3D0042                  	cmp ax, 4200h
   813 000005B6 7517                    	jne @F
   814 000005B8 2B16[FCFF]              	sub dx, word [relocateddata - LOADDATA2 + ldCurrentSeek]
   815                                  linkdatarelocation load_data
   816 000005BC 1B0E[FEFF]              	sbb cx, word [relocateddata - LOADDATA2 + ldCurrentSeek + 2]
   817                                  linkdatarelocation load_data
   818                                  
   819                                  .boot_seek_current:
   820 000005C0 E8[0000]EB020000        	extcall yy_boot_seek_current.bx
   821 000005C7 A1[FCFF]                	mov ax, word [relocateddata - LOADDATA2 + ldCurrentSeek]
   822                                  linkdatarelocation load_data
   823 000005CA 8B16[FEFF]              	mov dx, word [relocateddata - LOADDATA2 + ldCurrentSeek + 2]
   824                                  linkdatarelocation load_data
   825 000005CE C3                      	retn
   826                                  
   827                                  @@:
   828 000005CF 3D0142                  	cmp ax, 4201h
   829 000005D2 74EC                    	je .boot_seek_current
   830 000005D4 E8C900                  	extcallcall error
   831                                  %endif
   832                                  
   833                                  
   834                                  %if _COMPRESSED
   835                                  %assign _STANDALONE 0
   836                                   %include "depack.asm"
   837                                  %endif
   838                                  
   839                                  
   840                                  get_es_ext:
   841 000005D7 8E06[0000]              reloc	mov es, word [relocateddata]
   842                                  linkdatarelocation extdssel
   843 000005DB E8B200                  	extcallcall ispm
   844 000005DE 7404                    	jz @F
   845 000005E0 8E06[0000]              reloc	mov es, word [relocateddata]
   846                                  linkdatarelocation extseg
   847                                  @@:
   848 000005E4 C3                      	retn
   849                                  
   850                                  
   851 000005E5 90<rep Bh>              	align 16
   852                                  relocator:
   853 000005F0 56                      	push si
   854 000005F1 57                      	push di
   855 000005F2 1E                      	push ds
   856 000005F3 06                      	push es
   857                                  
   858 000005F4 06                      	 push es
   859 000005F5 1F                      	 pop ds
   860 000005F6 B90000                  	mov cx, 0
   861                                  .codelength equ $ - 2
   862 000005F9 BE0000                  	mov si, 0
   863                                  .codesource equ $ - 2
   864 000005FC BF[0000]                	mov di, code
   865                                  .codedestination equ $ - 2
   866                                  internalcoderelocation
   867 000005FF F3A4                    	rep movsb
   868                                  
   869 00000601 16                      	 push ss
   870 00000602 07                      	 pop es
   871 00000603 16                      	 push ss
   872 00000604 1F                      	 pop ds
   873 00000605 B90000                  	mov cx, 0
   874                                  .datalength equ $ - 2
   875 00000608 BE0000                  	mov si, 0
   876                                  .datasource equ $ - 2
   877 0000060B BF[0000]                	mov di, datastart
   878                                  .datadestination equ $ - 2
   879                                  internaldatarelocation
   880 0000060E F3A4                    	rep movsb
   881                                  
   882 00000610 07                      	pop es
   883 00000611 C706[0000]0000          	mov word [relocateddata], 0
   884                                  linkdatarelocation extseg_used, -4
   885                                  .extseg_used equ $ - 2
   886 00000617 C706[0000]0000          	mov word [relocateddata], 0
   887                                  linkdatarelocation extdata_used, -4
   888                                  .extdata_used equ $ - 2
   889                                  
   890 0000061D B90000                  	mov cx, 0
   891                                  .entry equ $ - 2
   892 00000620 1F                      	pop ds
   893 00000621 5F                      	pop di
   894 00000622 5E                      	pop si
   895 00000623 FFE1                    	jmp cx
   896                                  
   897 00000625 90<rep Bh>              	align 16
   898                                  	endarea relocator
   899                                  
   900                                  
   901                                  DATAOFFSET equ CODEOFFSET + code_size
   902                                  	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
   903                                  datastart:
   904                                  PUT_ELD_DATETIME
   905                                  
   906                                  %define INCBINLIST db ""
   907                                  
   908                                  	%imacro libeld 1-2.nolist
   909                                  %strcat %%label "lib_", %1
   910                                  %deftok %%token %%label
   911                                  %if _XLD
   912                                   %strcat %%filename %1,".xld"
   913                                  %else
   914                                   %strcat %%filename %1,".eld"
   915                                  %endif
   916                                  %xdefine INCBINLIST INCBINLIST, {align 16, db 0}, %%token:, incbin %%filename
   917                                  	dd %%token
   918                                  	fill 8, 32, db %1
   919                                  	%endmacro
   920                                  
   921                                  	%imacro dump_incbin 1-*.nolist
   922                                  %rep %0
   923                                  	%1
   924                                   %rotate 1
   925                                  %endrep
   926                                  	%endmacro
   927                                  
   928                                  %ifn _COMPRESSED
   929                                  	overridedef LZEXEDAT, 0
   930                                  %endif
   931                                  %ifn _LZEXEDAT
   932                                  	overridedef LONGLITERAL, 0
   933                                  %endif
   934                                  
   935                                  	align 4, db 0
   936                                  libtable:
   937                                   istruc ELD_LIBTABLE
   938 00000000 0000                    at eldltFormat,		dw 2 * !!_COMPRESSED + !!_LZEXEDAT + !!_LONGLITERAL
   939                                  	; 0 = uncompressed
   940                                  	; 1 = legacy heatshrink format (no libtab compressed length)
   941                                  	; 2 = heatshrink format (prepended with -w and -l bytes)
   942                                  	; 3 = lzexedat -4 format (current revision starts with a 1 bit)
   943                                  	; 4 = lzexedat -4 -l format (current revision starts with a 1 bit)
   944 00000002 3E00                    at eldltAmount,		dw (lib_end - lib) / 12
   945                                  at eldltOffset
   946 00000004 00150000                ..@eldltOffset:		dd LIBOFFSET
   947                                   iend
   948                                   %if _COMPRESSED
   949                                  libtab_compressed_length:
   950                                  			dd (lib_compressed_end - lib_start)
   951                                   %endif
   952                                  %else
   953                                  		; Collect the binaries and compress them solidly.
   954                                  	%imacro libeld 1-2.nolist
   955                                  %strcat %%label "lib_", %1
   956                                  %deftok %%token %%label
   957                                  %if _XLD
   958                                   %strcat %%filename %1,".xld"
   959                                  %else
   960                                   %strcat %%filename %1,".eld"
   961                                  %endif
   962                                  	align 16, db 0
   963                                  %%token:
   964                                  	incbin %%filename
   965                                  	%endmacro
   966                                  %endif
   967                                  
   968                                  	numdef ELD_DEBUG_LIB, 0
   969                                  lib:
   970                                  %if _ELD_DEBUG_LIB
   971                                  libeld "eldteste"
   972                                  libeld "eldtestf"
   973                                  %else
   974 00000008 [00000000]61666F72-     libeld "aformat"
   974 00000010 6D617420           
   975 00000014 [F00C0000]616C6961-     libeld "alias"
   975 0000001C 7320<rep 3h>       
   976 00000020 [401D0000]616D6973-     libeld "amiscmd"
   976 00000028 636D6420           
   977 0000002C [D0290000]616D6973-     libeld "amismsg"
   977 00000034 6D736720           
   978 00000038 [10360000]616D6973-     libeld "amisoth"
   978 00000040 6F746820           
   979 00000044 [10410000]616D6974-     libeld "amitsrs"
   979 0000004C 73727320           
   980 00000050 [F0590000]616D6F75-     libeld "amount"
   980 00000058 6E7420<rep 2h>     
   981 0000005C [80650000]62617365-     libeld "bases"
   981 00000064 7320<rep 3h>       
   982 00000068 [C0720000]626F6F74-     libeld "bootdir"
   982 00000070 64697220           
   983 00000074 [308A0000]63686563-     libeld "checksum"
   983 0000007C 6B73756D           
   984 00000080 [B0960000]63687374-     libeld "chstool"
   984 00000088 6F6F6C20           
   985 0000008C [40B10000]636F20-       libeld "co"
   985 0000008C <rep 6h>           
   986 00000098 [50C30000]636F6E66-     libeld "config"
   986 000000A0 696720<rep 2h>     
   987 000000A4 [60CD0000]64626974-     libeld "dbitmap"
   987 000000AC 6D617020           
   988 000000B0 [B0E00000]64657669-     libeld "devices"
   988 000000B8 63657320           
   989 000000BC [C0EE0000]64686D20-     libeld "dhm"
   989 000000BC <rep 5h>           
   990 000000C8 [D0FC0000]646920-       libeld "di"
   990 000000C8 <rep 6h>           
   991 000000D4 [90100100]646D20-       libeld "dm"
   991 000000D4 <rep 6h>           
   992 000000E0 [F0210100]646F7363-     libeld "doscd"
   992 000000E8 6420<rep 3h>       
   993 000000EC [302A0100]646F7364-     libeld "dosdir"
   993 000000F4 697220<rep 2h>     
   994 000000F8 [20410100]646F7364-     libeld "dosdrive"
   994 00000100 72697665           
   995 00000104 [60490100]646F7370-     libeld "dospwd"
   995 0000010C 776420<rep 2h>     
   996 00000110 [50510100]646F7373-     libeld "dosseek"
   996 00000118 65656B20           
   997 0000011C [805D0100]646F7373-     libeld "dosspace"
   997 00000124 70616365           
   998 00000128 [00700100]646F7373-     libeld "dosstrat"
   998 00000130 74726174           
   999 00000134 [E07A0100]64706220-     libeld "dpb"
   999 00000134 <rep 5h>           
  1000 00000140 [90910100]64746164-     libeld "dtadisp"
  1000 00000148 69737020           
  1001 0000014C [10990100]647820-       libeld "dx"
  1001 0000014C <rep 6h>           
  1002 00000158 [A0A70100]65727266-     libeld "errfix"
  1002 00000160 697820<rep 2h>     
  1003 00000164 [C0B50100]6578746E-     libeld "extname"
  1003 0000016C 616D6520           
  1004 00000170 [10C70100]68696E74-     libeld "hint"
  1004 00000178 20<rep 4h>         
  1005 0000017C [D0D30100]68696E74-     libeld "hintoth"
  1005 00000184 6F746820           
  1006 00000188 [80E00100]68697374-     libeld "history"
  1006 00000190 6F727920           
  1007 00000194 [50EC0100]69666578-     libeld "ifext"
  1007 0000019C 7420<rep 3h>       
  1008 000001A0 [90F90100]696E6A65-     libeld "inject"
  1008 000001A8 637420<rep 2h>     
  1009 000001AC [50050200]696E7374-     libeld "instnoth"
  1009 000001B4 6E6F7468           
  1010 000001B8 [50130200]696E7374-     libeld "instnoun"
  1010 000001C0 6E6F756E           
  1011 000001C4 [A01F0200]6B636D64-     libeld "kcmdline"
  1011 000001CC 6C696E65           
  1012 000001D0 [C02B0200]6B646973-     libeld "kdisplay"
  1012 000001D8 706C6179           
  1013 000001DC [00350200]6C646D65-     libeld "ldmem"
  1013 000001E4 6D20<rep 3h>       
  1014 000001E8 [C05B0200]6C646D65-     libeld "ldmemoth"
  1014 000001F0 6D6F7468           
  1015 000001F4 [50850200]6C696E66-     libeld "linfo"
  1015 000001FC 6F20<rep 3h>       
  1016 00000200 [40960200]6C697374-     libeld "list"
  1016 00000208 20<rep 4h>         
  1017 0000020C [00BA0200]70617468-     libeld "path"
  1017 00000214 20<rep 4h>         
  1018 00000218 [D0CB0200]7072696E-     libeld "printf"
  1018 00000220 746620<rep 2h>     
  1019 00000224 [A0DF0200]71756965-     libeld "quiet"
  1019 0000022C 7420<rep 3h>       
  1020 00000230 [00EB0200]71756974-     libeld "quit"
  1020 00000238 20<rep 4h>         
  1021 0000023C [10F70200]72636578-     libeld "rcexec"
  1021 00000244 656320<rep 2h>     
  1022 00000248 [40020300]7264756D-     libeld "rdumpidx"
  1022 00000250 70696478           
  1023 00000254 [500E0300]7264756D-     libeld "rdumpstr"
  1023 0000025C 70737472           
  1024 00000260 [301A0300]7265636C-     libeld "reclaim"
  1024 00000268 61696D20           
  1025 0000026C [70210300]72657365-     libeld "reserve"
  1025 00000274 72766520           
  1026 00000278 [80370300]726D20-       libeld "rm"
  1026 00000278 <rep 6h>           
  1027 00000284 [D0410300]726E20-       libeld "rn"
  1027 00000284 <rep 6h>           
  1028 00000290 [20510300]7320-         libeld "s"
  1028 00000290 <rep 7h>           
  1029 0000029C [D0660300]73627261-     libeld "sbranch"
  1029 000002A4 6E636820           
  1030 000002A8 [10730300]73657420-     libeld "set"
  1030 000002A8 <rep 5h>           
  1031 000002B4 [E0850300]74736320-     libeld "tsc"
  1031 000002B4 <rep 5h>           
  1032 000002C0 [60950300]75736570-     libeld "useparat"
  1032 000002C8 61726174           
  1033 000002CC [50A40300]76617269-     libeld "variable"
  1033 000002D4 61626C65           
  1034 000002D8 [D0B30300]77697468-     libeld "withhdr"
  1034 000002E0 68647220           
  1035 000002E4 [30C00300]7820-         libeld "x"
  1035 000002E4 <rep 7h>           
  1036                                  %endif
  1037                                  lib_end:
  1038                                  
  1039                                  %ifn _COMPRESSLIB
  1040                                  %if _COMPRESSED
  1041                                  	align 2, db 0
  1042                                  depack_saved_sp:	dw 0FFFFh
  1043                                  partialdepack:		db 0FFh
  1044                                  %endif
  1045                                  
  1046                                  msg:
  1047 000002F0 496E7465726E616C20-     .ext_error_internal:	asciz "Internal error in EXT LIB command.",13,10
  1047 000002F9 6572726F7220696E20-
  1047 00000302 455854204C49422063-
  1047 0000030B 6F6D6D616E642E0D0A-
  1047 00000314 00                 
  1048 00000315 455854204C49422063-     .ext_error_io:		asciz "EXT LIB command got I/O error.",13,10
  1048 0000031E 6F6D6D616E6420676F-
  1048 00000327 7420492F4F20657272-
  1048 00000330 6F722E0D0A00       
  1049 00000336 455854204C49423A20-     .ext_error_invalid:	asciz "EXT LIB: No or invalid Extension for lDebug header.",13,10
  1049 0000033F 4E6F206F7220696E76-
  1049 00000348 616C69642045787465-
  1049 00000351 6E73696F6E20666F72-
  1049 0000035A 206C44656275672068-
  1049 00000363 65616465722E0D0A00 
  1050 0000036C 4F7574206F66206D65-     .ext_error_oom:		asciz "Out of memory in EXT LIB command.",13,10
  1050 00000375 6D6F727920696E2045-
  1050 0000037E 5854204C494220636F-
  1050 00000387 6D6D616E642E0D0A00 
  1051 00000390 455854204C49423A20-     .notfound.1:		asciz 'EXT LIB: No ELD found by the name "'
  1051 00000399 4E6F20454C4420666F-
  1051 000003A2 756E64206279207468-
  1051 000003AB 65206E616D65202200 
  1052 000003B4 22210D0A00              .notfound.2:		asciz '"!',13,10
  1053 000003B9 455854204C49423A20-     .notfound.invalid:	asciz "EXT LIB: No ELD found, invalid name!",13,10
  1053 000003C2 4E6F20454C4420666F-
  1053 000003CB 756E642C20696E7661-
  1053 000003D4 6C6964206E616D6521-
  1053 000003DD 0D0A00             
  1054 000003E0 202000                  .between:		asciz "  "
  1055 000003E3 4E6F20646573637269-     .nodesc:		db "No description."
  1055 000003EC 7074696F6E2E       
  1056 000003F2 0D0A00                  .linebreak:		asciz 13,10
  1057                                  
  1058                                  depack_stack: equ $
  1059                                  
  1060 000003F5 455854204C49423A20-     .unexpected_eol:	asciz "EXT LIB: Unexpected End Of Line, expected closing quote mark!",13,10
  1060 000003FE 556E65787065637465-
  1060 00000407 6420456E64204F6620-
  1060 00000410 4C696E652C20657870-
  1060 00000419 656374656420636C6F-
  1060 00000422 73696E672071756F74-
  1060 0000042B 65206D61726B210D0A-
  1060 00000434 00                 
  1061 00000435 48454C5000              .help_keyword:		asciz "HELP"
  1062 0000043A 444553435249424500      .describe_keyword:	asciz "DESCRIBE"
  1063 00000443 444553435249424558-     .describex_keyword:	asciz "DESCRIBEX"
  1063 0000044C 00                 
  1064                                  %if _COMPRESSED && _ELD_TEST_LIB
  1065                                  .test_keyword:		asciz "TEST"
  1066                                  %endif
  1067 0000044D 5749444500              .wide_keyword:		asciz "WIDE"
  1068 00000452 455854204C49422063-     .help:			db "EXT LIB command. This ELD is a library of other ELDs.",13,10
  1068 0000045B 6F6D6D616E642E2054-
  1068 00000464 68697320454C442069-
  1068 0000046D 732061206C69627261-
  1068 00000476 7279206F66206F7468-
  1068 0000047F 657220454C44732E0D-
  1068 00000488 0A                 
  1069 00000489 52756E207769746820-     			db "Run with an ELD instance name to run another ELD.",13,10
  1069 00000492 616E20454C4420696E-
  1069 0000049B 7374616E6365206E61-
  1069 000004A4 6D6520746F2072756E-
  1069 000004AD 20616E6F7468657220-
  1069 000004B6 454C442E0D0A       
  1070 000004BC 52756E207769746820-     			db "Run with HELP DESCRIBE to dump descriptions (slow)",13,10
  1070 000004C5 48454C502044455343-
  1070 000004CE 5249424520746F2064-
  1070 000004D7 756D70206465736372-
  1070 000004E0 697074696F6E732028-
  1070 000004E9 736C6F77290D0A     
  1071 000004F0 206F72207769746820-     			db " or with HELP WIDE to display only known ELD names (fast).",13,10
  1071 000004F9 48454C502057494445-
  1071 00000502 20746F20646973706C-
  1071 0000050B 6179206F6E6C79206B-
  1071 00000514 6E6F776E20454C4420-
  1071 0000051D 6E616D657320286661-
  1071 00000526 7374292E0D0A       
  1072 0000052C 00                      			asciz
  1073 0000052D 0D0A                    .list:			db 13,10
  1074 0000052F 4C697374206F662063-     			asciz "List of contained ELDs:",13,10
  1074 00000538 6F6E7461696E656420-
  1074 00000541 454C44733A0D0A00   
  1075                                  
  1076                                  uinit_data: equ $
  1077                                  
  1078 00000549 00<rep 7h>              	align 16, db 0
  1079                                  init_data_end:
  1080                                  data_size equ $ - datastart
  1081                                  transient_data_size equ data_size
  1082                                  
  1083                                  %if _COMPRESSED
  1084                                  	absolute depack_stack
  1085                                  	alignb 2
  1086                                  		resb 256
  1087                                  depack_stack.top:
  1088                                  
  1089                                   %if uinit_data > depack_stack.top
  1090                                  	absolute uinit_data
  1091                                   %endif
  1092                                  %else
  1093                                  	absolute uinit_data
  1094                                  %endif
  1095                                  
  1096 00000549 ??                      	alignb 2
  1097 0000054A ????????????????        namebuffer:	resb 8
  1098 00000552 ????????                libseek:	resd 1
  1099 00000556 ????????                eldheader:	resd 1
  1100                                  
  1101                                  %if _COMPRESSED
  1102                                  depackskip:	resd 1
  1103                                  depackseek:	resd 1
  1104                                  depacked_buffer:resd 1
  1105                                  depack_left_length:	resw 1
  1106                                  depack_left_address:	resw 1
  1107                                  depacked_length:resw 1
  1108                                  depack_prior_sp:resw 1
  1109                                  	alignb 2
  1110                                  filebuffer:
  1111                                  %if _ALIGNPAGE
  1112                                  	resb 512
  1113                                  %else
  1114                                  	resb 256
  1115                                  %endif
  1116                                  .end:
  1117                                  	alignb 2
  1118                                  .next:		resw 1
  1119                                  .tail:		resw 1
  1120                                  handle:		resw 1
  1121                                  
  1122                                  	alignb 16
  1123                                  resultbuffer:
  1124                                  .size equ 4096
  1125                                  		resb .size
  1126                                  .end:
  1127                                  %endif
  1128                                  
  1129                                  %if _DATABUFFER
  1130 0000055A ????????????            	alignb 16
  1131                                  databuffer:
  1132 00000560 <res 200h>              	resb 512
  1133                                  %endif
  1134                                  
  1135                                  	alignb 16
  1136                                  uinit_data_end:
  1137                                  
  1138                                  %if uinit_data_end >= init_data_end
  1139                                   total_data_size equ $ - datastart
  1140                                  %else
  1141                                   total_data_size equ init_data_end - datastart
  1142                                  %endif
  1143                                  %assign _DATA_SIZE total_data_size
  1144                                  
  1145                                  	usesection CODE
  1146                                  
  1147                                  %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 00000630 E8[0000]EB020000C3- <1> 	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
    28 00000638 E8[0000]EB020000C3- <1>
    28 00000640 E8[0000]EB020000C3- <1>
    28 00000648 E8[0000]EB020000C3- <1>
    28 00000650 E8[0000]EB020000C3- <1>
    28 00000658 E8[0000]EB020000C3- <1>
    28 00000660 E8[0000]EB020000C3- <1>
    28 00000668 E8[0000]EB020000C3- <1>
    28 00000670 E8[0000]EB020000C3- <1>
    28 00000678 E8[0000]EB020000C3- <1>
    28 00000680 E8[0000]EB020000C3- <1>
    28 00000688 E8[0000]EB020000C3- <1>
    28 00000690 E8[0000]EB020000C3- <1>
    28 00000698 E8[0000]EB020000C3- <1>
    28 000006A0 E8[0000]EB020000C3  <1>
    29                              <1> %endif
    30                              <1> 
    31                              <1> 	numdef ELD_IDENTICALISE, 0
    32                              <1> 	numdef ELD_DEBUG, 0
    33                              <1> 	numdef ELD_LINKER_PASSES, 1
    34                              <1> 	strdef LISTING, _ELD_LISTING
    35                              <1> 	numdef ELDCALL_OPTIONAL, ELDCALL_OPTIONAL_STATUS
    36                              <1> 	numdef ELDDATA_OPTIONAL, ELDDATA_OPTIONAL_STATUS
    37                              <1> %if _ELD_IDENTICALISE
    38                              <1>  ;%assign _ELDCALL_OPTIONAL 1
    39                              <1> %endif
    40                              <1> %ifn _ELDCALL_OPTIONAL
    41                              <1> %assign ELDCALL_OPTIONAL_STATUS 2		; not allowed
    42                              <1> %endif
    43                              <1> ;%ifn _ELDDATA_OPTIONAL
    44                              <1> ;%assign ELDDATA_OPTIONAL_STATUS 2		; not allowed
    45                              <1> ;%endif
    46                              <1> 	gendef MAP, ""
    47                              <1> 
    48                              <1> %ifnidni _MAP, ""
    49                              <1>  [map all _MAP]
    50                              <1> %endif
    51                              <1> 
    52                              <1> 
    53                              <1> endresident: equ ($ + _CURRENT_SECTION %+ FIXUP + 15) & ~15
    54                              <1> 
    55                              <1> %if _ELD_LINKER_PASSES
    56                              <1> %assign ELDLINKER 1
    57                              <1> 
    58                              <1> 	struc LINKTABLE
    59 00000000 ????????            <1> ltCodeToCode:	resw 2
    60 00000004 ????????            <1> ltCodeToData:	resw 2
    61 00000008 ????????            <1> ltDataToCode:	resw 2
    62 0000000C ????????            <1> ltDataToData:	resw 2
    63 00000010 ????????            <1> ltLinkData:	resw 2
    64 00000014 ????????            <1> ltLinkCode:	resw 2
    65                              <1> 	endstruc
    66                              <1> %endif
    67                              <1> 
    68                              <1> 
    69                              <1> linker:
    70                              <1> 		; The first 15 Bytes of the linker should be
    71                              <1> 		;  the same regardless of the linker options
    72                              <1> 		;  used (debug, passes, vstart). This allows
    73                              <1> 		;  the eldcomp ELD to match even if up to 15
    74                              <1> 		;  Bytes of the linker are trailing in the
    75                              <1> 		;  resident part of the ELD.
    76                              <1> 	lframe
    77                              <1>  %if ELDOTHER
    78                              <1> 	lvar dword, linkinfo_other
    79                              <1> 	lvar word, use_hash_other
    80                              <1>  %endif
    81 000006A8 5589E5              <1> 	lenter
    82                              <1> 	lvar dword, instance
    83 000006AB 06                  <1> 	 push es
    84 000006AC 52                  <1> 	 push dx
    85                              <1> 	lvar word, targetsection_low_optional_high
    86 000006AD 50                  <1> 	 push ax
    87                              <1> 	lequ ?targetsection_low_optional_high, targetsection
    88                              <1> 	lequ ?targetsection_low_optional_high + 1, optional
    89                              <1> 	lvar dword, linkinfo
    90 000006AE 1E                  <1> 	 push ds
    91 000006AF 57                  <1> 	 push di
    92                              <1> 	lvar dword, nextreloc
    93 000006B0 06                  <1> 	 push es
    94 000006B1 52                  <1> 	 push dx
    95                              <1> 	lvar dword, entry
    96 000006B2 06                  <1> 	 push es
    97 000006B3 50                  <1> 	 push ax		; placeholder
    98 000006B4 31C0                <1> 	xor ax, ax
    99 000006B6 813DD1E1            <1> 	cmp word [di + eldlSignature], 0E1D1h
   100                              <1> %if ($ - linker) < 16
   101                              <1>  %error Expected invariant first paragraph of linker
   102                              <1> %endif
   103 000006BA 7403E95502          <1> 	jne .error_j
   104 000006BF 837D0601            <1> 	cmp word [di + eldlUseLinkHash], 1
   105 000006C3 7603E94C02          <1> 	ja .error_j
   106 000006C8 7201                <1> 	jb @F
   107 000006CA 48                  <1> 	dec ax
   108                              <1> @@:
   109                              <1> 	lvar word, use_hash
   110 000006CB 50                  <1> 	 push ax
   111                              <1> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   112                              <1> 	mov ax, linktable - code
   113                              <1> 	lvar word, lt
   114                              <1> 	 push ax
   115                              <1> %endif
   116                              <1> %if _ELD_LINKER_PASSES || ELDOTHER
   117 000006CC 31C0                <1> 	xor ax, ax
   118                              <1>  %if _ELD_LINKER_PASSES
   119                              <1> 	lvar word, pass
   120 000006CE 50                  <1> 	 push ax
   121                              <1> 	lvar word, amounterrors
   122 000006CF 50                  <1> 	 push ax
   123                              <1> 	lvar word, name
   124 000006D0 50                  <1> 	 push ax
   125                              <1>  %endif
   126                              <1>  %if ELDOTHER
   127                              <1> 	lvar word, other
   128                              <1> 	 push ax
   129                              <1>  %endif
   130                              <1> %endif
   131 000006D1 56                  <1> 	push si
   132 000006D2 53                  <1> 	push bx
   133                              <1> 
   134                              <1> 			; simple: add instance base (dx) to code
   135 000006D3 06                  <1> 	push es
   136 000006D4 1F                  <1> 	pop ds
   137                              <1> %if _ELD_LINKER_PASSES
   138                              <1> .pass:
   139 000006D5 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   140 000006D8 01D3                <1> 	add bx, dx
   141                              <1>  %if _ELD_IDENTICALISE
   142                              <1> 	add bx, word [bp + ?lt]
   143                              <1> 	mov si, word [ltCodeToCode + bx]
   144                              <1>  %else
   145 000006DA 8BB7580A            <1> 	mov si, word [linktable - code + ltCodeToCode + bx]
   146                              <1>  %endif
   147                              <1> %else
   148                              <1> 	mov si, internalcodetocoderelocations - code
   149                              <1> %endif
   150 000006DE 01D6                <1> 	add si, dx
   151                              <1> @@:
   152 000006E0 AD                  <1> 	lodsw
   153 000006E1 85C0                <1> 	test ax, ax		; was last ?
   154 000006E3 740B                <1> 	jz @F			; yes -->
   155 000006E5 93                  <1> 	xchg bx, ax		; bx = entry
   156 000006E6 01D3                <1> 	add bx, dx		; relocate the entry itself
   157                              <1> %if _ELD_CODE_VSTART
   158 000006E8 812F[0000]          <1> 	sub word [bx], code	; undo adjustment
   159                              <1> %endif
   160 000006EC 0117                <1> 	add word [bx], dx	; relocate word referenced by entry
   161 000006EE EBF0                <1> 	jmp @B
   162                              <1> 
   163                              <1> @@:
   164                              <1> 			; next, add heap data base (on stack) to code
   165                              <1> %if _ELD_LINKER_PASSES
   166 000006F0 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   167 000006F3 01D3                <1> 	add bx, dx
   168                              <1>  %if _ELD_IDENTICALISE
   169                              <1> 	add bx, word [bp + ?lt]
   170                              <1> 	mov si, word [ltCodeToData + bx]
   171                              <1>  %else
   172 000006F5 8BB75C0A            <1> 	mov si, word [linktable - code + ltCodeToData + bx]
   173                              <1>  %endif
   174                              <1> %else
   175                              <1> 	mov si, internalcodetodatarelocations - code
   176                              <1> %endif
   177 000006F9 01D6                <1> 	add si, dx
   178                              <1> @@:
   179 000006FB AD                  <1> 	lodsw
   180 000006FC 85C0                <1> 	test ax, ax		; was last ?
   181 000006FE 740C                <1> 	jz @F			; yes -->
   182 00000700 93                  <1> 	xchg bx, ax		; bx = entry
   183 00000701 01D3                <1> 	add bx, dx		; relocate the entry itself
   184 00000703 58                  <1> 	pop ax			; ax -> heap data
   185 00000704 50                  <1> 	push ax
   186                              <1> %if _ELD_DATA_VSTART
   187 00000705 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   188                              <1> %endif
   189 00000708 0107                <1> 	add word [bx], ax	; relocate word referenced by entry
   190 0000070A EBEF                <1> 	jmp @B
   191                              <1> 
   192                              <1> @@:
   193                              <1> 
   194                              <1> 			; add instance base (dx) to data
   195                              <1> %if _ELD_LINKER_PASSES
   196 0000070C 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   197 0000070F 01D3                <1> 	add bx, dx
   198                              <1>  %if _ELD_IDENTICALISE
   199                              <1> 	add bx, word [bp + ?lt]
   200                              <1> 	mov si, word [ltDataToCode + bx]
   201                              <1>  %else
   202 00000711 8BB7600A            <1> 	mov si, word [linktable - code + ltDataToCode + bx]
   203                              <1>  %endif
   204                              <1> %else
   205                              <1> 	mov si, internaldatatocoderelocations - code
   206                              <1> %endif
   207 00000715 01D6                <1> 	add si, dx
   208                              <1> @@:
   209 00000717 AD                  <1> 	lodsw
   210 00000718 83F8FF              <1> 	cmp ax, -1		; was last ?
   211 0000071B 740F                <1> 	je @F			; yes -->
   212 0000071D 93                  <1> 	xchg bx, ax		; bx = entry
   213 0000071E 58                  <1> 	pop ax
   214 0000071F 50                  <1> 	push ax
   215 00000720 01C3                <1> 	add bx, ax		; relocate the entry itself
   216                              <1> %if _ELD_CODE_VSTART
   217 00000722 36812F[0000]        <1> 	sub word [ss:bx], code	; undo adjustment
   218                              <1> %endif
   219 00000727 360117              <1> 	add word [ss:bx], dx	; relocate word referenced by entry
   220 0000072A EBEB                <1> 	jmp @B
   221                              <1> 
   222                              <1> @@:
   223                              <1> 			; next, add heap data base (on stack) to data
   224                              <1> %if _ELD_LINKER_PASSES
   225 0000072C 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   226 0000072F 01D3                <1> 	add bx, dx
   227                              <1>  %if _ELD_IDENTICALISE
   228                              <1> 	add bx, word [bp + ?lt]
   229                              <1> 	mov si, word [ltDataToData + bx]
   230                              <1>  %else
   231 00000731 8BB7640A            <1> 	mov si, word [linktable - code + ltDataToData + bx]
   232                              <1>  %endif
   233                              <1> %else
   234                              <1> 	mov si, internaldatatodatarelocations - code
   235                              <1> %endif
   236 00000735 01D6                <1> 	add si, dx
   237                              <1> @@:
   238 00000737 AD                  <1> 	lodsw
   239 00000738 83F8FF              <1> 	cmp ax, -1		; was last ?
   240 0000073B 740D                <1> 	je @F			; yes -->
   241 0000073D 93                  <1> 	xchg bx, ax		; bx = entry
   242 0000073E 58                  <1> 	pop ax			; ax -> heap data
   243 0000073F 50                  <1> 	push ax
   244 00000740 01C3                <1> 	add bx, ax		; relocate the entry itself
   245                              <1> %if _ELD_DATA_VSTART
   246 00000742 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   247                              <1> %endif
   248 00000745 360107              <1> 	add word [ss:bx], ax	; relocate word referenced by entry
   249 00000748 EBED                <1> 	jmp @B
   250                              <1> 
   251                              <1> @@:
   252 0000074A 8B56FC              <1> 	mov dx, word [bp + ?instance]
   253                              <1> %if _ELD_LINKER_PASSES
   254 0000074D 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   255 00000750 01D3                <1> 	add bx, dx
   256                              <1>  %if _ELD_IDENTICALISE
   257                              <1> 	add bx, word [bp + ?lt]
   258                              <1> 	add dx, word [ltLinkData + bx]
   259                              <1>  %else
   260 00000752 0397680A            <1> 	add dx, word [linktable - code + ltLinkData + bx]
   261                              <1>  %endif
   262                              <1> %else
   263                              <1> 	add dx, linkerdatarelocations - code
   264                              <1> %endif
   265                              <1> .otherloop:
   266 00000756 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   267                              <1> 
   268                              <1> .datarelocloop:		; must be done before further relocs
   269 00000759 C576F2              <1> 	lds si, [bp + ?nextreloc]
   270 0000075C AD                  <1> 	lodsw			; ax = section indicator
   271 0000075D 85C0                <1> 	test ax, ax		; end of table ?
   272 0000075F 7503E92301          <1> 	jz .donedatareloc
   273 00000764 48                  <1> 	dec ax			; al = 1 if data, 0 if code
   274 00000765 5B                  <1> 	pop bx
   275 00000766 53                  <1> 	push bx			; bx -> ELD data block
   276 00000767 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   277 0000076A 84C0                <1> 	test al, al		; data ?
   278 0000076C AD                  <1> 	lodsw
   279 0000076D 7504                <1> 	jnz @F			; yes -->
   280 0000076F 0346FC              <1> 	add ax, word [bp + ?instance]
   281                              <1> 				; relocate entry into code
   282 00000772 A9                  <1> 	db __TEST_IMM16		; (skip add)
   283                              <1> @@:
   284 00000773 01D8                <1> 	add ax, bx		; relocate entry into data
   285 00000775 8946EE              <1> 	mov word [bp + ?entry], ax
   286 00000778 AD                  <1> 	lodsw
   287 00000779 8976F2              <1> 	mov word [bp + ?nextreloc], si
   288 0000077C E8DC00              <1> 	call .build_match
   289                              <1> %if _ELD_LINKER_PASSES
   290 0000077F 73D8                <1> 	jnc .datarelocloop
   291                              <1> %endif
   292 00000781 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   293                              <1> %if ELDOTHER
   294                              <1> 	rol byte [bp + ?other], 1
   295                              <1> 	jnc @F
   296                              <1> 	les bx, [bp + ?linkinfo_other]
   297                              <1> @@:
   298                              <1> %endif
   299 00000784 268B4F08            <1> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   300 00000788 268B7F0A            <1> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   301                              <1> .datarelocfind:
   302 0000078C F2AF                <1> 	repne scasw			; scan initial
   303 0000078E 7541                <1> 	jne .datarelocnotfound
   304 00000790 57                  <1> 	push di
   305 00000791 51                  <1> 	push cx
   306 00000792 56                  <1> 	push si
   307 00000793 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   308 00000797 4F                  <1> 	dec di
   309 00000798 4F                  <1> 	dec di				; 0-based
   310 00000799 26037F0C            <1> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   311 0000079D 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   312 000007A0 B500                <1> 	mov ch, 0
   313 000007A2 8A0C                <1> 	mov cl, byte [si]		; cx = length
   314 000007A4 41                  <1> 	inc cx
   315                              <1> 	; cmp al, al			; ZR if length is zero
   316 000007A5 F3A6                <1> 	repe cmpsb			; match ?
   317 000007A7 5E                  <1> 	pop si
   318 000007A8 59                  <1> 	pop cx
   319 000007A9 5F                  <1> 	pop di
   320 000007AA 75E0                <1> 	jne .datarelocfind
   321 000007AC 8814                <1> 	mov byte [si], dl
   322 000007AE 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   323 000007B2 4F                  <1> 	dec di
   324 000007B3 4F                  <1> 	dec di				; 0-based
   325 000007B4 26037F0E            <1> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   326 000007B8 268B05              <1> 	mov ax, word [es:di]
   327 000007BB E80700              <1> 	call .address_data_reloc
   328                              <1> %if _ELD_RELOC_VSTART
   329 000007BE 2D[0000]            <1> 	sub ax, relocateddata		; *not* a relocation
   330                              <1> %endif
   331 000007C1 0104                <1> 	add word [si], ax		; relocate
   332 000007C3 EB94                <1> 	jmp .datarelocloop
   333                              <1> 
   334                              <1> .address_data_reloc:
   335 000007C5 C576EE              <1> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   336 000007C8 807EFA00            <1> 	cmp byte [bp + ?targetsection], 0
   337                              <1> 					; relocation in code ?
   338 000007CC 7402                <1> 	je @F				; yes -->
   339 000007CE 16                  <1> 	push ss
   340 000007CF 1F                  <1> 	pop ds				; => our ELD data block
   341                              <1> @@:
   342 000007D0 C3                  <1> 	retn
   343                              <1> 
   344                              <1> .datarelocnotfound:
   345 000007D1 8814                <1> 	mov byte [si], dl
   346 000007D3 807EFB00            <1> 	cmp byte [bp + ?optional], 0
   347                              <1> %if _ELD_DEBUG
   348                              <1> 	jne @F
   349                              <1>  %ifn _ELD_LINKER_PASSES
   350                              <1> 	mov si, 0			; (invalid link)
   351                              <1> linkdatarelocation internalflags6
   352                              <1> 	test si, si
   353                              <1> 	jz .datanotfound
   354                              <1> 	mov si, 0			; (invalid link)
   355                              <1> linkdatarelocation options7
   356                              <1> 	test si, si
   357                              <1> 	jz .datanotfound
   358                              <1>  %else
   359                              <1> 	cmp byte [bp + ?pass], 0
   360                              <1> 	je .datanotfound
   361                              <1>  %endif
   362                              <1> 	houdini
   363                              <1> 	jmp .datanotfound
   364                              <1> @@:
   365                              <1> %else
   366 000007D7 7417                <1> 	je .datanotfound
   367                              <1> %endif
   368                              <1> 
   369                              <1> %if ELDDATA_PMREQUIRED_STATUS
   370                              <1> 	mov si, relocateddata
   371                              <1> linkdatarelocation build_option_PM
   372                              <1> 	test si, si
   373                              <1> 	jz @F
   374                              <1> 	test byte [bp + ?optional], 2
   375                              <1> 	jnz .datanotfound
   376                              <1> @@:
   377                              <1> %endif
   378                              <1> 
   379                              <1> %if _ELD_LINKER_PASSES
   380 000007D9 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2
   381                              <1> linkdatarelocation options7, -3
   382 000007DF 7406                <1> 	jz @F
   383 000007E1 BE[000F]            <1> 	mov si, lmsg.warning_data_optional
   384                              <1> internalcoderelocation
   385 000007E4 E82B00              <1> 	call .notfound
   386                              <1> @@:
   387                              <1> %endif
   388 000007E7 E8DBFF              <1> 	call .address_data_reloc
   389 000007EA 832400              <1> 	and word [si], 0		; indicate optional data link failed
   390 000007ED E969FF              <1> 	jmp .datarelocloop
   391                              <1> 
   392                              <1> 
   393                              <1> %if _ELDCALL_OPTIONAL
   394                              <1> .coderelocnotfound:
   395                              <1> 	mov byte [si], dl
   396                              <1> 	cmp byte [bp + ?optional], 0
   397                              <1> %if _ELD_DEBUG
   398                              <1> 	jne @F
   399                              <1>  %ifn _ELD_LINKER_PASSES
   400                              <1> 	mov si, 0			; (invalid link)
   401                              <1> linkdatarelocation internalflags6
   402                              <1> 	test si, si
   403                              <1> 	jz .codenotfound
   404                              <1> 	mov si, 0			; (invalid link)
   405                              <1> linkdatarelocation options7
   406                              <1> 	test si, si
   407                              <1> 	jz .codenotfound
   408                              <1>  %else
   409                              <1> 	cmp byte [bp + ?pass], 0
   410                              <1> 	je .codenotfound
   411                              <1>  %endif
   412                              <1> 	houdini
   413                              <1> 	jmp .codenotfound
   414                              <1> @@:
   415                              <1> %else
   416                              <1> 	je .codenotfound
   417                              <1> %endif
   418                              <1> 
   419                              <1> %if ELDCALL_PMREQUIRED_STATUS
   420                              <1>  %if _ELD_LINKER_PASSES
   421                              <1>   %assign ELDLINKER 0
   422                              <1>  %endif
   423                              <1> 	mov si, relocateddata
   424                              <1> linkdatarelocation build_option_PM
   425                              <1>  %if _ELD_LINKER_PASSES
   426                              <1>   %assign ELDLINKER 1
   427                              <1>  %endif
   428                              <1> 	test si, si
   429                              <1> 	jz @F
   430                              <1> 	test byte [bp + ?optional], 2
   431                              <1> 	jnz .codenotfound
   432                              <1> @@:
   433                              <1> %endif
   434                              <1> 
   435                              <1> %if _ELD_LINKER_PASSES
   436                              <1> 	testopt [ss:relocateddata], 2
   437                              <1> linkdatarelocation options7, -3
   438                              <1> 	jz @F
   439                              <1> 	mov si, lmsg.warning_code_optional
   440                              <1> internalcoderelocation
   441                              <1> 	call .notfound
   442                              <1> @@:
   443                              <1> %endif
   444                              <1> 	lds si, [bp + ?entry]
   445                              <1> 	mov word [si], 9090h
   446                              <1> 	mov byte [si + 2], 90h		; indicate optional code link failed
   447                              <1> 	jmp .coderelocloop
   448                              <1> %endif
   449                              <1> 
   450                              <1> 
   451                              <1> %if _ELD_LINKER_PASSES
   452                              <1> .datanotfound:
   453 000007F0 BE[220F]            <1> 	mov si, lmsg.error_data
   454                              <1> internalcoderelocation
   455 000007F3 E81C00              <1> 	call .notfound
   456 000007F6 7203E91901          <1> 	jnc .error_j
   457 000007FB FF46E8              <1> 	inc word [bp + ?amounterrors]
   458 000007FE E958FF              <1> 	jmp .datarelocloop
   459                              <1> 
   460                              <1> .codenotfound:
   461 00000801 BE[3B0F]            <1> 	mov si, lmsg.error_code
   462                              <1> internalcoderelocation
   463 00000804 E80B00              <1> 	call .notfound
   464 00000807 7203E90801          <1> 	jnc .error_j
   465 0000080C FF46E8              <1> 	inc word [bp + ?amounterrors]
   466 0000080F E98400              <1> 	jmp .coderelocloop
   467                              <1> 
   468                              <1> .notfound:
   469 00000812 807EEA00            <1> 	cmp byte [bp + ?pass], 0
   470 00000816 743A                <1> 	je @F				; --> (NC)
   471 00000818 16                  <1> 	 push ss
   472 00000819 07                  <1> 	 pop es
   473 0000081A BF[0000]            <1> 	mov di, relocateddata
   474                              <1> linkdatarelocation line_out
   475 0000081D E83300              <1> 	call .copy
   476 00000820 8B76E6              <1> 	mov si, word [bp + ?name]
   477 00000823 AD                  <1> 	lodsw
   478 00000824 E8[0000]EB020000    <1> 	extcall hexword
   479 0000082B 56                  <1> 	push si
   480 0000082C BE[540F]            <1> 	mov si, lmsg.error.2
   481                              <1> internalcoderelocation
   482 0000082F E82100              <1> 	call .copy
   483 00000832 5E                  <1> 	pop si
   484                              <1> %if _ELD_LINKER_PASSES
   485 00000833 56                  <1> 	push si
   486 00000834 E81C00              <1> 	call .copy
   487 00000837 5E                  <1> 	pop si
   488 00000838 C60400              <1> 	mov byte [si], 0		; mark as failed
   489                              <1> %else
   490                              <1> 	call .copy
   491                              <1> %endif
   492 0000083B B022                <1> 	mov al, '"'
   493 0000083D AA                  <1> 	stosb
   494 0000083E 16                  <1> 	 push ss
   495 0000083F 1F                  <1> 	 pop ds
   496 00000840 E8[0000]EB020000    <1> 	extcall putsline_crlf
   497 00000847 B8350E              <1> 	mov ax, 0E35h
   498 0000084A E8[0000]EB020000    <1> 	extcall setrc
   499 00000851 F9                  <1> 	stc				; CY, diagnostic displayed
   500                              <1> @@:
   501 00000852 C3                  <1> 	retn
   502                              <1> 
   503                              <1> .copy:
   504 00000853 E8[0000]EB020000    <1> 	extcall copy_single_counted_string
   505 0000085A C3                  <1> 	retn
   506                              <1> %else
   507                              <1> .datanotfound: equ .error_j
   508                              <1> .codenotfound: equ .error_j
   509                              <1> %endif
   510                              <1> 
   511                              <1> .build_match:
   512                              <1> %if _ELD_CODE_VSTART
   513 0000085B 2D[0000]            <1> 	sub ax, code
   514                              <1> %endif
   515 0000085E 0346FC              <1> 	add ax, word [bp + ?instance]
   516 00000861 96                  <1> 	xchg si, ax
   517                              <1> %if _ELD_LINKER_PASSES
   518 00000862 8976E6              <1> 	mov word [bp + ?name], si
   519                              <1> %endif
   520 00000865 AD                  <1> 	lodsw			; = hash, si -> counted string
   521 00000866 8A14                <1> 	mov dl, byte [si]
   522                              <1> %if _ELD_LINKER_PASSES
   523 00000868 84D2                <1> 	test dl, dl		; marked as already failed ?
   524 0000086A 750A                <1> 	jnz @F
   525 0000086C 837EE800            <1> 	cmp word [bp + ?amounterrors], 0
   526 00000870 7503E99F00          <1> 	je .error_j
   527 00000875 C3                  <1> 	retn			; (NC)
   528                              <1> 
   529                              <1> @@:
   530                              <1> %endif
   531                              <1> %if ELDOTHER
   532                              <1> 	rol byte [bp + ?other], 1
   533                              <1> 	jnc @F
   534                              <1> 	rol byte [bp + ?use_hash_other], 1
   535                              <1> 	jmp @FF
   536                              <1> 
   537                              <1> @@:
   538                              <1> %endif
   539 00000876 D046EC              <1> 	rol byte [bp + ?use_hash], 1
   540                              <1> @@:
   541 00000879 720A                <1> 	jc @F
   542 0000087B AC                  <1> 	lodsb
   543 0000087C 91                  <1> 	xchg cx, ax		; cl = length
   544 0000087D AD                  <1> 	lodsw			; ax = prefix
   545 0000087E 49                  <1> 	dec cx
   546 0000087F 49                  <1> 	dec cx
   547 00000880 4E                  <1> 	dec si
   548 00000881 8A14                <1> 	mov dl, byte [si]
   549 00000883 880C                <1> 	mov byte [si], cl	; si -> counted string suffix
   550                              <1> @@:
   551                              <1> %if _ELD_LINKER_PASSES
   552 00000885 F9                  <1> 	stc			; CY
   553                              <1> %endif
   554 00000886 C3                  <1> 	retn
   555                              <1> 
   556                              <1> 
   557                              <1> .donedatareloc:
   558                              <1> %if ELDOTHER
   559                              <1> 	rol byte [bp + ?other], 1
   560                              <1> 	jc .otherdone
   561                              <1> %endif
   562                              <1> 
   563 00000887 8B56FC              <1> 	mov dx, word [bp + ?instance]
   564                              <1> %if _ELD_LINKER_PASSES
   565 0000088A 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   566 0000088D 01D3                <1> 	add bx, dx
   567                              <1>  %if _ELD_IDENTICALISE
   568                              <1> 	add bx, word [bp + ?lt]
   569                              <1> 	add dx, word [ltLinkCode + bx]
   570                              <1>  %else
   571 0000088F 03976C0A            <1> 	add dx, word [linktable - code + ltLinkCode + bx]
   572                              <1>  %endif
   573                              <1> %else
   574                              <1> 	add dx, linkercoderelocations - code
   575                              <1> %endif
   576 00000893 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   577                              <1> 
   578                              <1> .coderelocloop:
   579 00000896 C576F2              <1> 	lds si, [bp + ?nextreloc]
   580 00000899 AD                  <1> 	lodsw
   581                              <1> %if _ELDCALL_OPTIONAL
   582                              <1> 	dec ax
   583                              <1> 	js .donecodereloc
   584                              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   585                              <1> 	lodsw
   586                              <1> %endif
   587 0000089A 0346FC              <1> 	add ax, word [bp + ?instance]
   588 0000089D 8946EE              <1> 	mov word [bp + ?entry], ax
   589 000008A0 AD                  <1> 	lodsw
   590 000008A1 8976F2              <1> 	mov word [bp + ?nextreloc], si
   591                              <1> %ifn _ELDCALL_OPTIONAL
   592 000008A4 85C0                <1> 	test ax, ax
   593 000008A6 747E                <1> 	jz .donecodereloc
   594                              <1> %endif
   595 000008A8 E8B0FF              <1> 	call .build_match
   596                              <1> %if _ELD_LINKER_PASSES
   597 000008AB 73E9                <1> 	jnc .coderelocloop
   598                              <1> %endif
   599 000008AD C45EF6              <1> 	les bx, [bp + ?linkinfo]
   600 000008B0 268B4F10            <1> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   601 000008B4 268B7F12            <1> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   602                              <1> .coderelocfind:
   603 000008B8 F2AF                <1> 	repne scasw			; scan initial
   604                              <1> %if _ELDCALL_OPTIONAL
   605                              <1> 	jne .coderelocnotfound
   606                              <1> %else
   607                              <1>  %if _ELD_DEBUG
   608                              <1> 	je @F
   609                              <1> 	houdini
   610                              <1> 	jmp .codenotfound
   611                              <1> @@:
   612                              <1>  %else
   613 000008BA 7403E942FF          <1> 	jne .codenotfound
   614                              <1>  %endif
   615                              <1> %endif
   616 000008BF 57                  <1> 	push di
   617 000008C0 51                  <1> 	push cx
   618 000008C1 56                  <1> 	push si
   619 000008C2 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   620 000008C6 4F                  <1> 	dec di
   621 000008C7 4F                  <1> 	dec di				; 0-based
   622 000008C8 26037F14            <1> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   623 000008CC 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   624 000008CF B500                <1> 	mov ch, 0
   625 000008D1 8A0C                <1> 	mov cl, byte [si]		; cx = length
   626 000008D3 41                  <1> 	inc cx
   627                              <1> 	; cmp al, al			; ZR if length is zero
   628 000008D4 F3A6                <1> 	repe cmpsb			; match ?
   629 000008D6 5E                  <1> 	pop si
   630 000008D7 59                  <1> 	pop cx
   631 000008D8 5F                  <1> 	pop di
   632 000008D9 75DD                <1> 	jne .coderelocfind
   633 000008DB 8814                <1> 	mov byte [si], dl
   634 000008DD 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   635 000008E1 4F                  <1> 	dec di
   636 000008E2 4F                  <1> 	dec di				; 0-based
   637 000008E3 01FF                <1> 	add di, di			; quadruple index
   638 000008E5 26037F16            <1> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   639 000008E9 26FF35              <1> 	push word [es:di]
   640 000008EC C576EE              <1> 	lds si, [bp + ?entry]
   641 000008EF 8F4405              <1> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   642                              <1> 					;  patch the destination address
   643 000008F2 803CE8              <1> 	cmp byte [si], 0E8h		; is it as expected ?
   644 000008F5 751D                <1> 	jne .error_j
   645 000008F7 268B7D02            <1> 	mov di, word [es:di + 2]
   646 000008FB BB[0000]            <1> 	mov bx, relocateddata
   647                              <1> linkdatarelocation linkcall_table	; ss:bx -> link call table
   648 000008FE 36833F01            <1> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   649 00000902 7510                <1> 	jne .error_j			; no -->
   650 00000904 368B4F02            <1> 	mov cx, word [ss:bx + 2]	; get amount of segments
   651 00000908 E30A                <1> 	jcxz .error_j			; none -->
   652                              <1> @@:
   653 0000090A 83C304              <1> 	add bx, 4			; -> next segment
   654 0000090D 36393F              <1> 	cmp word [ss:bx], di		; value matches ?
   655 00000910 7405                <1> 	je @F				; yes, found -->
   656 00000912 E2F6                <1> 	loop @B				; try remaining segments
   657                              <1> .error_j:
   658 00000914 E98A00              <1> 	jmp .error
   659                              <1> 
   660                              <1> @@:
   661 00000917 368B5F02            <1> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   662                              <1> 		; si + 3 + delta = bx
   663                              <1> 		; delta = bx - si - 3
   664 0000091B 29F3                <1> 	sub bx, si
   665 0000091D 83EB03              <1> 	sub bx, 3
   666 00000920 895C01              <1> 	mov word [si + 1], bx		; patch the call instruction
   667 00000923 E970FF              <1> 	jmp .coderelocloop
   668                              <1> 
   669                              <1> .donecodereloc:
   670                              <1> %if _ELD_LINKER_PASSES
   671 00000926 8B46E8              <1> 	mov ax, word [bp + ?amounterrors]
   672 00000929 85C0                <1> 	test ax, ax
   673 0000092B 75E7                <1> 	jnz .error_j
   674 0000092D 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   675 00000930 85DB                <1> 	test bx, bx
   676 00000932 750B                <1> 	jnz @F
   677 00000934 43                  <1> 	inc bx
   678 00000935 43                  <1> 	inc bx
   679 00000936 895EEA              <1> 	mov word [bp + ?pass], bx
   680 00000939 8B56FC              <1> 	mov dx, word [bp + ?instance]
   681 0000093C E996FD              <1> 	jmp .pass
   682                              <1> 
   683                              <1> @@:
   684                              <1> %endif
   685                              <1> 
   686                              <1> %ifnidni _LISTING, ""
   687                              <1> %assign ELDLINKER 0
   688                              <1> .hint:
   689 0000093F 16                  <1> 	push ss
   690 00000940 1F                  <1> 	pop ds
   691 00000941 B02D                <1> 	mov al, 2Dh
   692 00000943 E8[0000]EB020000    <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   693                              <1> 					; CHG: ax, dx, bx
   694 0000094A 7437                <1> 	jz .no_hint
   695                              <1> 
   696 0000094C 8A26[0000]          <1> 	mov ah, byte [relocateddata]
   697                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   698 00000950 E85500              <1> 	call plex_check
   699 00000953 7305                <1> 	jnc @F
   700                              <1> 
   701 00000955 B4FF                <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   702                              <1> .loop_hint:
   703 00000957 E84E00              <1> 	call plex_check
   704                              <1> @@:
   705 0000095A 7307                <1> 	jnc .end_hint		; if found --> (NC)
   706 0000095C 80EC01              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   707 0000095F 73F6                <1> 	jnc .loop_hint		; try next if we didn't check all yet -->
   708 00000961 EB20                <1> 	jmp .no_hint
   709                              <1> 
   710                              <1> .end_hint:
   711 00000963 50                  <1> 	push ax
   712 00000964 C446FC              <1> 	les ax, [bp + ?instance]
   713 00000967 BF[7A0C]            <1> 	mov di, listmsg.hint.offset
   714                              <1> internalcoderelocation
   715 0000096A E8[0000]EB020000    <1> 	extcall hexword
   716 00000971 BB[5A0C]            <1> 	mov bx, listmsg.hint
   717                              <1> internalcoderelocation
   718 00000974 368B16[0000]        <1> 	mov dx, [ss:relocateddata]
   719                              <1> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   720 00000979 58                  <1> 	pop ax
   721 0000097A B040                <1> 	mov al, 40h		; AMIS message display service
   722 0000097C E8[0000]EB020000    <1> 	extcall call_int2D
   723                              <1> .no_hint:
   724                              <1> %endif
   725                              <1> 
   726                              <1> %if ELDOTHER
   727                              <1> %assign ELDLINKER 0
   728                              <1> 	not byte [bp + ?other]
   729                              <1> 
   730                              <1> 	push ss
   731                              <1> 	pop ds
   732                              <1> 	mov al, 2Dh
   733                              <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   734                              <1> 					; CHG: ax, dx, bx
   735                              <1> 	jz .no_other
   736                              <1> 
   737                              <1> 	mov ah, byte [relocateddata]
   738                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   739                              <1> 	call plex_check
   740                              <1> 	jnc @F
   741                              <1> 
   742                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   743                              <1> .loop_other:
   744                              <1> 	call plex_check
   745                              <1> @@:
   746                              <1> 	jnc .end_other		; if found --> (NC)
   747                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   748                              <1> 	jnc .loop_other		; try next if we didn't check all yet -->
   749                              <1> 	jmp .no_other
   750                              <1> 
   751                              <1> .end_other:
   752                              <1> 	mov al, 42h		; AMIS get other link info service
   753                              <1> 	extcall call_int2D
   754                              <1> 	cmp al, 0FFh
   755                              <1> 	jne .no_other
   756                              <1> 
   757                              <1> 	mov ax, si		; selector => PSP
   758                              <1> 	extcall ispm
   759                              <1> 	jz @F
   760                              <1> 	mov ax, dx		; segment => PSP
   761                              <1> @@:
   762                              <1> 	 push ss
   763                              <1> 	 pop ds
   764                              <1> 	mov word [otherds], ax
   765                              <1> internaldatarelocation		; current mode sel/seg
   766                              <1> 	mov word [otherseg], dx
   767                              <1> internaldatarelocation		; remember segment
   768                              <1> 
   769                              <1> 	mov ax, cx		; selector => link info
   770                              <1> 	extcall ispm
   771                              <1> 	jz @F
   772                              <1> 	mov ax, bx		; segment => link info
   773                              <1> @@:
   774                              <1> 	mov word [bp + ?linkinfo_other], di
   775                              <1> 	mov word [bp + ?linkinfo_other + 2], ax
   776                              <1> 
   777                              <1> 	mov ds, ax		; => link info
   778                              <1> 	xor ax, ax
   779                              <1> 	cmp word [di + eldlSignature], 0E1D1h
   780                              <1> 	jne .error_other
   781                              <1> 	cmp word [di + eldlUseLinkHash], 1
   782                              <1> 	ja .error_other
   783                              <1> 	jb @F
   784                              <1> 	dec ax
   785                              <1> @@:
   786                              <1> 	mov word [bp + ?use_hash_other], ax
   787                              <1> 
   788                              <1> 	mov dx, word [bp + ?instance]
   789                              <1> 	add dx, linkerotherdatarelocations - code
   790                              <1> 	jmp .otherloop
   791                              <1> 
   792                              <1> .error_other:
   793                              <1> 	push cs
   794                              <1> 	pop ds
   795                              <1> 	mov ax, 0E33h
   796                              <1> 	extcall setrc
   797                              <1> 	mov dx, lmsg.error_other
   798                              <1> internalcoderelocation
   799                              <1> 	jmp @F
   800                              <1> 
   801                              <1> .no_other:
   802                              <1> 	push cs
   803                              <1> 	pop ds
   804                              <1> 	mov ax, 0E34h
   805                              <1> 	extcall setrc
   806                              <1> 	mov dx, lmsg.no_other
   807                              <1> internalcoderelocation
   808                              <1> @@:
   809                              <1> 	extcall putsz
   810                              <1> 	jmp .error
   811                              <1> 
   812                              <1> .otherdone:
   813                              <1> %endif
   814                              <1> 
   815 00000983 5B                  <1> 	pop bx				; -> our heap data
   816 00000984 5E                  <1> 	pop si				; -> our command line tail
   817 00000985 16                  <1> 	 push ss
   818 00000986 1F                  <1> 	 pop ds
   819 00000987 C47EFC              <1> 	les di, [bp + ?instance]
   820 0000098A 268B4502            <1> 	mov ax, word [es:di + eldiEndCode]
   821                              <1> houdini
   822 0000098E 2D[B006]            <1> 	sub ax, strict word endresident + code
   823                              <1> internalcoderelocation
   824 00000991 26C74502[B006]      <1> 	mov word [es:di + eldiEndCode], endresident + code
   825                              <1> internalcoderelocation
   826 00000997 2906[0000]          <1> 	sub word [relocateddata], ax
   827                              <1> linkdatarelocation extseg_used
   828                              <1> %if _DATA_SIZE == 0
   829                              <1> 	xor ax, ax
   830                              <1> 	mov word [es:di + eldiStartData], ax
   831                              <1> 	mov word [es:di + eldiEndData], ax
   832                              <1> %endif
   833 0000099B 89EC5D              <1> 	lleave code
   834                              <1> 		; INP:	es => ELD code segment
   835                              <1> 		;	ds:si -> command line tail
   836                              <1> 		;	ds:bx -> ELD data block
   837                              <1> 		;	ss:sp -> far return address for current mode
   838                              <1> 		; STT:	ds = ss, UP, EI
   839 0000099E E97FF6              <1> 	jmp start
   840                              <1> 
   841                              <1> .error:
   842 000009A1 89EC5D              <1> 	lleave
   843 000009A4 B8FFFF              <1> 	mov ax, -1
   844 000009A7 CB                  <1> 	retf
   845                              <1> 
   846                              <1> 
   847                              <1> %ifnidni _LISTING, ""
   848                              <1>  %assign ELDHINT 1
   849                              <1> %else
   850                              <1>  %assign ELDHINT 0
   851                              <1> %endif
   852                              <1> 
   853                              <1> %if ELDOTHER || ELDHINT
   854                              <1> 		; INP:	ah = multiplex number to check
   855                              <1> 		; OUT:	CY if multiplex number unused or no signature match,
   856                              <1> 		;	 bp, ah, ds unmodified
   857                              <1> 		;	NC if match found,
   858                              <1> 		;	 ah = multiplex number (unmodified)
   859                              <1> 		; CHG:	si, di, es, cx, dx
   860                              <1> plex_check:
   861 000009A8 16                  <1> 	push ss
   862 000009A9 1F                  <1> 	pop ds
   863 000009AA F606[0000]08        <1> 	testopt [relocateddata], 8
   864                              <1> linkdatarelocation internalflags4, -3
   865 000009AF 740B                <1> 	jz @F
   866 000009B1 BE[0000]            <1> 	mov si, relocateddata
   867                              <1> linkdatarelocation amis_multiplex_number, -2, optional
   868 000009B4 85F6                <1> 	test si, si
   869 000009B6 7404                <1> 	jz @F
   870 000009B8 3A24                <1> 	cmp ah, byte [si]
   871 000009BA 7420                <1> 	je .notfound		; do not use our own multiplexer -->
   872                              <1> @@:
   873 000009BC B000                <1> 	mov al, 00h		; AMIS installation check
   874 000009BE E8[0000]EB020000    <1> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
   875 000009C5 3CFF                <1> 	cmp al, 0FFh
   876 000009C7 7513                <1> 	jne .notfound
   877 000009C9 0E                  <1> 	push cs
   878 000009CA 1F                  <1> 	pop ds
   879 000009CB BE[4A0C]            <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   880                              <1> internalcoderelocation
   881 000009CE E8[0000]EB020000    <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
   882 000009D5 B90800              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
   883 000009D8 F3A7                <1> 	repe cmpsw
   884 000009DA 7401                <1> 	je .checkret		; ZR, NC = match -->
   885                              <1> .notfound:
   886 000009DC F9                  <1> 	stc			; CY no match
   887                              <1> .checkret:
   888 000009DD C3                  <1> 	retn
   889                              <1> %endif
   890                              <1> 
   891                              <1> 
   892 000009DE 00<rep 2h>          <1> 	align 4, db 0
   893                              <1> linkercoderelocations:
   894                              <1> %if _ELDCALL_OPTIONAL
   895                              <1> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   896                              <1> %else
   897 000009E0 8C05[820C]9405-     <1> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
   897 000009E6 [8D0C]A905[9E0C]C0- <1>
   897 000009ED 05[B00C]3006[CA0C]- <1>
   897 000009F4 3806[D60C]4006-     <1>
   897 000009FA [DF0C]4806[EB0C]50- <1>
   897 00000A01 06[F40C]5806[FC0C]- <1>
   897 00000A08 6006[030D]6806-     <1>
   897 00000A0E [0E0D]7006[150D]78- <1>
   897 00000A15 06[2B0D]8006[330D]- <1>
   897 00000A1C 8806[3F0D]9006-     <1>
   897 00000A22 [4B0D]9806[520D]A0- <1>
   897 00000A29 06[5A0D]4309[990D]- <1>
   897 00000A30 6A09[620D]7C09-     <1>
   897 00000A36 [A20D]BE09[A20D]CE- <1>
   897 00000A3D 09[AF0D]00000000    <1>
   898                              <1> %endif
   899                              <1> 
   900                              <1> %if _ELD_LINKER_PASSES
   901                              <1> linkerlinkercoderelocations:
   902                              <1> %if _ELDCALL_OPTIONAL
   903                              <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   904                              <1> %else
   905 00000A44 2408[620D]4008-     <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   905 00000A4A [6C0D]4A08[2B0D]53- <1>
   905 00000A51 08[7C0D]00000000    <1>
   906                              <1> %endif
   907                              <1> 
   908                              <1> 	align 2, db 0
   909                              <1> linktable:
   910                              <1> 	istruc LINKTABLE
   911                              <1> at ltCodeToCode
   912 00000A58 3A0C                <1> 	dw internallinkercodetocoderelocations - code
   913 00000A5A 7A0B                <1> 	dw internalcodetocoderelocations - code
   914                              <1> at ltCodeToData
   915 00000A5C 440C                <1> 	dw internallinkercodetodatarelocations - code
   916 00000A5E AA0B                <1> 	dw internalcodetodatarelocations - code
   917                              <1> at ltDataToCode
   918 00000A60 460C                <1> 	dw internallinkerdatatocoderelocations - code
   919 00000A62 220C                <1> 	dw internaldatatocoderelocations - code
   920                              <1> at ltDataToData
   921 00000A64 480C                <1> 	dw internallinkerdatatodatarelocations - code
   922 00000A66 240C                <1> 	dw internaldatatodatarelocations - code
   923                              <1> at ltLinkData
   924 00000A68 260C                <1> 	dw linkerlinkerdatarelocations - code
   925 00000A6A 700A                <1> 	dw linkerdatarelocations - code
   926                              <1> at ltLinkCode
   927 00000A6C 440A                <1> 	dw linkerlinkercoderelocations - code
   928 00000A6E E009                <1> 	dw linkercoderelocations - code
   929                              <1> 	iend
   930                              <1> %endif
   931                              <1> 
   932                              <1> 	align 2, db 0
   933                              <1> linkerdatarelocations:
   934 00000A70 01002400[BA0D]0100- <1> 	dw LINK_DATA_RELOCATIONS, 0
   934 00000A78 3A00[CA0D]01003F00- <1>
   934 00000A80 [CA0D]01004200-     <1>
   934 00000A86 [CA0D]01004600-     <1>
   934 00000A8C [CA0D]0100B100-     <1>
   934 00000A92 [D60D]0100B900-     <1>
   934 00000A98 [D60D]01006201-     <1>
   934 00000A9E [D60D]0100AD03-     <1>
   934 00000AA4 [E10D]0100B103-     <1>
   934 00000AAA [EF0D]0100EA03-     <1>
   934 00000AB0 [FD0D]0100EE03-     <1>
   934 00000AB6 [0C0E]01003D04-     <1>
   934 00000ABC [EF0D]01004604-     <1>
   934 00000AC2 [1B0E]01004C04-     <1>
   934 00000AC8 [260E]01008104-     <1>
   934 00000ACE [2F0E]01008504-     <1>
   934 00000AD4 [0C0E]0100A104-     <1>
   934 00000ADA [EF0D]0100C504-     <1>
   934 00000AE0 [EF0D]0100D204-     <1>
   934 00000AE6 [EF0D]0100E804-     <1>
   934 00000AEC [0C0E]0100EC04-     <1>
   934 00000AF2 [2F0E]01000205-     <1>
   934 00000AF8 [2F0E]01002105-     <1>
   934 00000AFE [390E]01002905-     <1>
   934 00000B04 [430E]01002C05-     <1>
   934 00000B0A [4D0E]01005E05-     <1>
   934 00000B10 [5F0E]01006205-     <1>
   934 00000B16 [BA0D]01006905-     <1>
   934 00000B1C [720E]01007405-     <1>
   934 00000B22 [7F0E]01008205-     <1>
   934 00000B28 [BA0D]0100BA05-     <1>
   934 00000B2E [CA0D]0100BE05-     <1>
   934 00000B34 [CA0D]0100C805-     <1>
   934 00000B3A [CA0D]0100CC05-     <1>
   934 00000B40 [CA0D]0100D905-     <1>
   934 00000B46 [1B0E]0100E205-     <1>
   934 00000B4C [260E]01001306-     <1>
   934 00000B52 [EF0D]01001906-     <1>
   934 00000B58 [0C0E]01004E09-     <1>
   934 00000B5E [B20E]01007709-     <1>
   934 00000B64 [260E]01009909-     <1>
   934 00000B6A [EF0D]0100AC09-     <1>
   934 00000B70 [D70E]0101B209-     <1>
   934 00000B76 [E80E]0000          <1>
   935                              <1> 
   936                              <1> 	align 2, db 0
   937                              <1> internalcodetocoderelocations:
   938 00000B7A DA03DF0312041704A7- <1> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
   938 00000B83 04AB04B204B904BF04- <1>
   938 00000B8C CE04D804DB04E304F1- <1>
   938 00000B95 04060509050F05FD05- <1>
   938 00000B9E 680972098F099509CC- <1>
   938 00000BA7 090000              <1>
   939                              <1> 
   940                              <1> 	align 2, db 0
   941                              <1> internalcodetodatarelocations:
   942 00000BAA 2E00590072007A0083- <1> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
   942 00000BB3 009200A500AB00C800- <1>
   942 00000BBC D600E800EC00EF00FD- <1>
   942 00000BC5 00040108011B011F01- <1>
   942 00000BCE 530157017E01830190- <1>
   942 00000BD7 01A001AB01E1013802- <1>
   942 00000BE0 4F0252026E027F0283- <1>
   942 00000BE9 02860290029402A202- <1>
   942 00000BF2 A602CB02CF02F80213- <1>
   942 00000BFB 03210325033B034903- <1>
   942 00000C04 58036F0373032D0431- <1>
   942 00000C0D 0471047504F4040C05- <1>
   942 00000C16 35053D0545054D050C- <1>
   942 00000C1F 060000              <1>
   943                              <1> 
   944                              <1> 	align 2, db 0
   945                              <1> internaldatatocoderelocations:
   946 00000C22 FFFF                <1> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
   947                              <1> 
   948                              <1> 	align 2, db 0
   949                              <1> internaldatatodatarelocations:
   950 00000C24 FFFF                <1> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
   951                              <1> 
   952                              <1> %if _ELD_LINKER_PASSES
   953                              <1> 	align 2, db 0
   954                              <1> linkerlinkerdatarelocations:
   955 00000C26 0100DC07[960E]0100- <1> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
   955 00000C2E 1B08[D60D]0100FC08- <1>
   955 00000C36 [A10E]0000          <1>
   956                              <1> 
   957                              <1> 	align 2, db 0
   958                              <1> internallinkercodetocoderelocations:
   959 00000C3A E207F10702082D0800- <1> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
   959 00000C43 00                  <1>
   960                              <1> 
   961                              <1> 	align 2, db 0
   962                              <1> internallinkercodetodatarelocations:
   963 00000C44 0000                <1> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
   964                              <1> 
   965                              <1> 	align 2, db 0
   966                              <1> internallinkerdatatocoderelocations:
   967 00000C46 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
   968                              <1> 
   969                              <1> 	align 2, db 0
   970                              <1> internallinkerdatatodatarelocations:
   971 00000C48 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
   972                              <1> %endif
   973                              <1> 
   974                              <1> %if ELDOTHER
   975                              <1> 	align 2, db 0
   976                              <1> linkerotherdatarelocations:
   977                              <1> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
   978                              <1> 
   979                              <1>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
   980                              <1>   %error Other linker data links not supported
   981                              <1>  %endif
   982                              <1> %endif
   983                              <1> 
   984                              <1> %if ELDOTHER || ELDHINT
   985                              <1> 	align 2, db 0
   986                              <1> debuggeramissig:
   987 00000C4A 65636D20<rep 5h>    <1> 		fill 8, 32, db "ecm"
   988 00000C52 6C446562756720-     <1> 		fill 8, 32, db "lDebug"
   988 00000C52 <rep 2h>            <1>
   989                              <1> %endif
   990                              <1> 
   991                              <1> %ifnidni _LISTING, ""
   992                              <1> listmsg:
   993 00000C5A 547261634C6973742D- <1> .hint:		db "TracList-add-offset=",_LISTING,"::"
   993 00000C63 6164642D6F66667365- <1>
   993 00000C6C 743D6578746C69622E- <1>
   993 00000C75 6C73743A3A          <1>
   994 00000C7A 2D2D2D2D680D0A00    <1> .hint.offset:	asciz "----h",13,10
   995                              <1> %endif
   996                              <1> 
   997 00000C82 6831085F646F736361- <1> 	eldcall_dump_names ELDCALL_CODE_NAMES
   997 00000C8B 6C6C8EF70E646F7363- <1>
   997 00000C94 616C6C5F6578747365- <1>
   997 00000C9D 67FF8B0F79795F626F- <1>
   997 00000CA6 6F745F726561642E62- <1>
   997 00000CAF 7863E41779795F626F- <1>
   997 00000CB8 6F745F7365656B5F63- <1>
   997 00000CC1 757272656E742E6278- <1>
   997 00000CCA D55509736B6970636F- <1>
   997 00000CD3 6D6D61E83A06697365- <1>
   997 00000CDC 6F6C3F03C309697373- <1>
   997 00000CE5 7472696E673FDDB906- <1>
   997 00000CEE 63686B656F6C551205- <1>
   997 00000CF7 707574737ABABD0463- <1>
   997 00000D00 6D643367B108747269- <1>
   997 00000D09 6D70757473C5C60470- <1>
   997 00000D12 757473849013697365- <1>
   997 00000D1B 6F6C3F2E6E6F747365- <1>
   997 00000D24 6D69636F6C6F6EB212- <1>
   997 00000D2D 057365747263A45509- <1>
   997 00000D36 736B6970636F6D6D30- <1>
   997 00000D3F F12309757070657263- <1>
   997 00000D48 617365289004697370- <1>
   997 00000D51 6D629605496E444F53- <1>
   997 00000D5A A7AA056572726F7284- <1>
   997 00000D63 8107686578776F7264- <1>
   997 00000D6C 6FA20D707574736C69- <1>
   997 00000D75 6E655F63726C66D0BB- <1>
   997 00000D7E 1A636F70795F73696E- <1>
   997 00000D87 676C655F636F756E74- <1>
   997 00000D90 65645F737472696E67- <1>
   997 00000D99 986906696E7463686B- <1>
   997 00000DA2 21300A63616C6C5F69- <1>
   997 00000DAB 6E743244B774087365- <1>
   997 00000DB4 746573326478        <1>
   998 00000DBA 899F0D696E7465726E- <1> 	link_data_dump_names LINK_DATA_NAMES
   998 00000DC3 616C666C6167738274- <1>
   998 00000DCC 096C6F61645F646174- <1>
   998 00000DD5 6184E3086C696E655F- <1>
   998 00000DDE 6F75742BC80B657874- <1>
   998 00000DE7 7365675F73697A65E7- <1>
   998 00000DF0 D30B6578747365675F- <1>
   998 00000DF9 75736564F6340C6578- <1>
   998 00000E02 74646174615F73697A- <1>
   998 00000E0B 65B2400C6578746461- <1>
   998 00000E14 74615F75736564EB42- <1>
   998 00000E1D 08657874647373656C- <1>
   998 00000E26 D52D06657874736567- <1>
   998 00000E2F 2AAE07657874646174- <1>
   998 00000E38 61FF7E076C696E6B73- <1>
   998 00000E41 656CFA7E076C696E6B- <1>
   998 00000E4A 7365672B850F6C696E- <1>
   998 00000E53 6B696E666F61646472- <1>
   998 00000E5C 6573730F08106C6F61- <1>
   998 00000E65 645F646174615F6C6F- <1>
   998 00000E6E 77657374C71C0A6578- <1>
   998 00000E77 745F68616E646C6522- <1>
   998 00000E80 29146578745F66696E- <1>
   998 00000E89 6973682E62705F6973- <1>
   998 00000E92 5F7365745ABC086F70- <1>
   998 00000E9B 74696F6E733768440E- <1>
   998 00000EA4 6C696E6B63616C6C5F- <1>
   998 00000EAD 7461626C65F09E2274- <1>
   998 00000EB6 72795F646562756767- <1>
   998 00000EBF 65725F616D69735F6D- <1>
   998 00000EC8 756C7469706C65785F- <1>
   998 00000ED1 6E756D626572CB510E- <1>
   998 00000EDA 696E7465726E616C66- <1>
   998 00000EE3 6C61677334688C1561- <1>
   998 00000EEC 6D69735F6D756C7469- <1>
   998 00000EF5 706C65785F6E756D62- <1>
   998 00000EFE 6572                <1>
   999                              <1> %if ELDOTHER
  1000                              <1> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1001                              <1> %endif
  1002                              <1> 
  1003                              <1> lmsg:
  1004                              <1> %if _ELD_LINKER_PASSES
  1005                              <1> %if _ELDCALL_OPTIONAL
  1006                              <1> .warning_code_optional:		counted "Optional code link missing, hash="
  1007                              <1> %endif
  1008 00000F00 214F7074696F6E616C- <1> .warning_data_optional:		counted "Optional data link missing, hash="
  1008 00000F09 2064617461206C696E- <1>
  1008 00000F12 6B206D697373696E67- <1>
  1008 00000F1B 2C20686173683D      <1>
  1009 00000F22 1844617461206C696E- <1> .error_data:			counted "Data link missing, hash="
  1009 00000F2B 6B206D697373696E67- <1>
  1009 00000F34 2C20686173683D      <1>
  1010 00000F3B 18436F6465206C696E- <1> .error_code:			counted "Code link missing, hash="
  1010 00000F44 6B206D697373696E67- <1>
  1010 00000F4D 2C20686173683D      <1>
  1011 00000F54 0A682C206C6162656C- <1> .error.2:			counted "h, label ",'"'
  1011 00000F5D 2022                <1>
  1012                              <1> %endif
  1013                              <1> %if ELDOTHER
  1014                              <1> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1015                              <1> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1016                              <1> %endif
  1017                              <1> 
  1018 00000F5F 00                  <1> 	align 16, db 0
  1148                                  
  1149                                  	align 16
  1150                                  code_size equ $ - code
  1151                                  
  1152                                  %if _ALIGNPAGE
  1153                                  LIBOFFSETUNALIGNED equ DATAOFFSET + data_size
  1154                                  	addsection ALIGNED, follows=DATA vstart=0
  1155                                  aligned:
  1156                                  	times (((512) - ((LIBOFFSETUNALIGNED) % (512))) % (512)) db 0
  1157                                  	endarea aligned
  1158                                  
  1159                                  LIBOFFSET equ LIBOFFSETUNALIGNED + aligned_size
  1160                                  	addsection LIB, follows=ALIGNED vstart=0
  1161                                  %else
  1162                                  LIBOFFSET equ DATAOFFSET + data_size
  1163                                  	addsection LIB, follows=DATA vstart=0
  1164                                  %endif
  1165                                  lib_start:
  1166                                  
  1167                                   %if _COMPRESSED
  1168                                    %if _XLD
  1169                                     %if _LZEXEDAT
  1170                                  	incbin "packlib.xlz"
  1171                                     %else
  1172                                  	incbin "packlib.xhs"
  1173                                     %endif
  1174                                    %else
  1175                                     %if _LZEXEDAT
  1176                                  	incbin "packlib.elz"
  1177                                     %else
  1178                                  	incbin "packlib.ehs"
  1179                                     %endif
  1180                                    %endif
  1181                                  lib_compressed_end:
  1182                                  length_to_truncate equ $ - lib_start + LIBOFFSET
  1183                                  
  1184                                  	align 16, db 0
  1185                                  
  1186                                  	addsection LIBDEPACKED, follows=LIB vstart=0
  1187                                  library_start_skip:
  1188                                   %endif
  1189                                  
  1190 00000CF0 <bin CF0h>-             dump_incbin INCBINLIST
  1190 00001D40 <bin 1050h>-       
  1190 000029D0 <bin C90h>-        
  1190 00003610 <bin C40h>-        
  1190 00004110 <bin B00h>-        
  1190 000059F0 <bin 18E0h>-       
  1190 00006580 <bin B90h>-        
  1190 000072C0 <bin D40h>-        
  1190 00008A30 <bin 1770h>-       
  1190 000096B0 <bin C80h>-        
  1190 0000B140 <bin 1A90h>-       
  1190 0000C350 <bin 1210h>-       
  1190 0000CD60 <bin A10h>-        
  1190 0000E0B0 <bin 1350h>-       
  1190 0000EEC0 <bin E10h>-        
  1190 0000FCD0 <bin E10h>-        
  1190 00011090 <bin 13C0h>-       
  1190 000121F0 <bin 1160h>-       
  1190 00012A30 <bin 840h>-        
  1190 00014120 <bin 16F0h>-       
  1190 00014960 <bin 840h>-        
  1190 00015150 <bin 7F0h>-        
  1190 00015D80 <bin C30h>-        
  1190 00017000 <bin 1280h>-       
  1190 00017AE0 <bin AE0h>-        
  1190 00019190 <bin 16B0h>-       
  1190 00019910 <bin 780h>-        
  1190 0001A7A0 <bin E90h>-        
  1190 0001B5C0 <bin E20h>-        
  1190 0001C710 <bin 1150h>-       
  1190 0001D3D0 <bin CC0h>-        
  1190 0001E080 <bin CB0h>-        
  1190 0001EC50 <bin BD0h>-        
  1190 0001F990 <bin D40h>-        
  1190 00020550 <bin BC0h>-        
  1190 00021350 <bin E00h>-        
  1190 00021FA0 <bin C50h>-        
  1190 00022BC0 <bin C20h>-        
  1190 00023500 <bin 940h>-        
  1190 00025BC0 <bin 26C0h>-       
  1190 00028550 <bin 2990h>-       
  1190 00029640 <bin 10F0h>-       
  1190 0002BA00 <bin 23C0h>-       
  1190 0002CBD0 <bin 11D0h>-       
  1190 0002DFA0 <bin 13D0h>-       
  1190 0002EB00 <bin B60h>-        
  1190 0002F710 <bin C10h>-        
  1190 00030240 <bin B30h>-        
  1190 00030E50 <bin C10h>-        
  1190 00031A30 <bin BE0h>-        
  1190 00032170 <bin 740h>-        
  1190 00033780 <bin 1610h>-       
  1190 000341D0 <bin A50h>-        
  1190 00035120 <bin F50h>-        
  1190 000366D0 <bin 15B0h>-       
  1190 00037310 <bin C40h>-        
  1190 000385E0 <bin 12D0h>-       
  1190 00039560 <bin F80h>-        
  1190 0003A450 <bin EF0h>-        
  1190 0003B3D0 <bin F80h>-        
  1190 0003C030 <bin C60h>-        
  1190 0003C030 <bin 12B0h>        
  1191                                  library_end_skip:
  1192                                  
  1193                                   %if _COMPRESSED
  1194                                  	dd length_to_truncate
  1195                                   %endif
  1196                                  %endif
