     1                                  
     2                                  ; Public Domain. Based on:
     3                                  ;
     4                                  ;/* AMITSRS.C	List TSRs using the alternate multiplex interrupt	*/
     5                                  ;/* Public Domain 1992 Ralf Brown					*/
     6                                  ;/* Version 0.90 							*/
     7                                  ;/* Last Edit: 9/12/92							*/
     8                                  
     9                                  ; test install command: install; amitsrs; amitsrs uninstall
    10                                  ; test run command: ; .; .
    11                                  
    12                                  %include "lmacros3.mac"
     1                              <1> [list -]
    14                              <2> [list -]
    14                              <1> [list -]
    13                                  %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
    14                                  %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
    15                                  %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
    16                                  
    17                                  
    18                                  ;/* hotkey type bits returned by Get Hotkeys (function 05h) */
    19                                  %define HK_INT09ENTRY	1    ;/* TSR checks keys before calling INT 09h */
    20                                  %define HK_INT09EXIT	2    ;/* TSR checks keys after calling INT 09h */
    21                                  %define HK_INT15ENTRY	4    ;/* TSR checks keys before chaining INT 15h/AH=4Fh */
    22                                  %define HK_INT15EXIT	8    ;/* TSR checks keys after chaining INT 15h/AH=4Fh */
    23                                  %define HK_INT16OLD	0x10 ;/* TSR checks on INT 16/AH=00h-02h */
    24                                  %define HK_INT16NEW	0x20 ;/* TSR checks on INT 16/AH=10h-12h */
    25                                  
    26                                  ;/* hotkey shift bits returned by Get Hotkeys (function 05h) */
    27                                  %define HK_NONE 	0x0000	;/* no shift keys */
    28                                  %define HK_RSHIFT	0x0001
    29                                  %define HK_LSHIFT	0x0002
    30                                  %define HK_BOTHSHIFT	0x0003	;/* both Shift keys must be pressed */
    31                                  %define HK_ANYCTRL	0x0004	;/* either Control key must be pressed */
    32                                  %define HK_ANYALT	0x0008	;/* either Alt key must be pressed */
    33                                  %define HK_SCRLLOCK_ON	0x0010	;/* ScrollLock must be on when hotkey pressed */
    34                                  %define HK_NUMLOCK_ON	0x0020	;/* NumLock must be on when hotkey pressed */
    35                                  %define HK_CAPSLOCK_ON	0x0040	;/* CapsLock must be on when hotkey pressed */
    36                                  %define HK_ANYSHIFT	0x0080	;/* either Shift key must be pressed */
    37                                  %define HK_LCTRL	0x0100
    38                                  %define HK_LALT 	0x0200
    39                                  %define HK_RCTRL	0x0400
    40                                  %define HK_RALT 	0x0800
    41                                  %define HK_BOTHCTRL	0x0500	;/* both Control keys must be pressed */
    42                                  %define HK_BOTHALT	0x0A00	;/* both Alt keys must be pressed */
    43                                  %define HK_SCROLLOCK	0x1000	;/* ScrollLock must be pressed with hotkey */
    44                                  %define HK_NUMLOCK	0x2000	;/* NumLock must be pressed with hotkey */
    45                                  %define HK_CAPSLOCK	0x4000	;/* CapsLock must be pressed with hotkey */
    46                                  %define HK_SYSREQ	0x8000	;/* SysRq must be pressed with hotkey */
    47                                  
    48                                  ;/* hotkey flag bist returned by Get Hotkeys (function 05h) */
    49                                  %define HK_CHAINBEFORE	1	;/* TSR chains hotkey before processing it */
    50                                  %define HK_CHAINAFTER	2	;/* TSR chains hotkey after processing it */
    51                                  %define HK_MONITOR	4	;/* TSR monitors hotkey, it should be passed thru */
    52                                  %define HK_NOPRESSRELEASE 8	;/* hotkey won't activate if other keys pressed */
    53                                  			        ;/* and released before hotkey combo completed */
    54                                  %define HK_REMAPPED	0x10	;/* this key is remapped into some other key */
    55                                  
    56                                  %define HK_NOCHAIN	0	;/* TSR swallows hotkey */
    57                                  
    58                                  ;/* hotkey scan codes returned by Get Hotkeys (function 05h) */
    59                                  %define SCAN_NONE	0
    60                                  %define SCAN_ESC	1
    61                                  %define SCAN_1		2
    62                                  %define SCAN_2		3
    63                                  %define SCAN_3		4
    64                                  %define SCAN_4		5
    65                                  %define SCAN_5		6
    66                                  %define SCAN_6		7
    67                                  %define SCAN_7		8
    68                                  %define SCAN_8		9
    69                                  %define SCAN_9		10
    70                                  %define SCAN_0		11
    71                                  %define SCAN_HYPHEN	12
    72                                  %define SCAN_EQUAL	13
    73                                  %define SCAN_BACKSP	14
    74                                  %define SCAN_TAB	15
    75                                  %define SCAN_Q		16
    76                                  %define SCAN_W		17
    77                                  %define SCAN_E		18
    78                                  %define SCAN_R		19
    79                                  %define	SCAN_T		20
    80                                  %define SCAN_Y		21
    81                                  %define SCAN_U		22
    82                                  %define SCAN_I		23
    83                                  %define SCAN_O		24
    84                                  %define SCAN_P		25
    85                                  %define SCAN_LBRACKET	26
    86                                  %define SCAN_RBRACKET	27
    87                                  %define SCAN_ENTER	28
    88                                  %define	SCAN_CTRL	29
    89                                  %define SCAN_A		30
    90                                  %define SCAN_S		31
    91                                  %define SCAN_D		32
    92                                  %define SCAN_F		33
    93                                  %define SCAN_G		34
    94                                  %define SCAN_H		35
    95                                  %define SCAN_J		36
    96                                  %define SCAN_K		37
    97                                  %define SCAN_L		38
    98                                  %define SCAN_SEMICOLON	39
    99                                  %define SCAN_SQUOTE	40
   100                                  %define SCAN_BACKQUOTE	41
   101                                  %define SCAN_LSHIFT	42
   102                                  %define SCAN_BACKSLASH	43
   103                                  %define SCAN_Z		44
   104                                  %define SCAN_X		45
   105                                  %define SCAN_C		46
   106                                  %define SCAN_V		47
   107                                  %define SCAN_B		48
   108                                  %define SCAN_N		49
   109                                  %define SCAN_M		50
   110                                  %define SCAN_COMMA	51
   111                                  %define SCAN_PERIOD	52
   112                                  %define SCAN_SLASH	53
   113                                  %define SCAN_RSHIFT	54
   114                                  %define SCAN_GREYSTAR	55
   115                                  %define SCAN_ALT	56
   116                                  %define SCAN_SPACE	57
   117                                  %define SCAN_CAPSLK	58
   118                                  %define SCAN_F1		59
   119                                  %define SCAN_F2		60
   120                                  %define SCAN_F3		61
   121                                  %define SCAN_F4		62
   122                                  %define SCAN_F5		63
   123                                  %define SCAN_F6		64
   124                                  %define SCAN_F7		65
   125                                  %define SCAN_F8		66
   126                                  %define SCAN_F9		67
   127                                  %define SCAN_F10	68
   128                                  %define SCAN_NUMLK	69
   129                                  %define SCAN_SCRLLK	70
   130                                  %define SCAN_HOME	71
   131                                  %define SCAN_UP		72
   132                                  %define SCAN_PGUP	73
   133                                  %define SCAN_GREYMINUS	74
   134                                  %define SCAN_LEFT	75
   135                                  %define SCAN_KP5	76
   136                                  %define SCAN_RIGHT	77
   137                                  %define SCAN_GREYPLUS	78
   138                                  %define SCAN_END	79
   139                                  %define SCAN_DOWN	80
   140                                  %define SCAN_PGDN	81
   141                                  %define SCAN_INS	82
   142                                  %define SCAN_DEL	83
   143                                  %define SCAN_SYSRQ	84
   144                                  %define SCAN_F11	87
   145                                  %define SCAN_F12	88
   146                                  %define HK_ONRELEASE	0x80  ;/* hotkey activates on key release (add to scan code) */
   147                                  
   148                                  
   149                                  	cpu 8086
   150                                  
   151                                  	addsection RELOCATEDDATA, nobits vstart=_ELD_RELOC_VSTART
   152                                  relocateddata:
   153                                  
   154                                  	addsection HEADER, start=0
   155                                  
   156                                  	istruc ELD_HEADERX
   157                                  at eldhxHeader
   158                                  		; ELD executable header
   159                                  	istruc ELD_HEADER
   160 00000000 454C4431                at eldhSignature,	db "ELD1"
   161 00000004 000000                  			db 0,0,0
   162 00000007 1A                      			db 26
   163 00000008 70000000                at eldhCodeOffset,	dd CODEOFFSET
   164 0000000C F011                    at eldhCodeImageLength,	dw code_size
   165 0000000E 0000                    at eldhCodeAllocLength,	dw 0
   166 00000010 60120000                at eldhDataOffset,	dd DATAOFFSET
   167 00000014 8006                    at eldhDataImageLength,	dw data_size
   168 00000016 1000                    at eldhDataAllocLength,	dw total_data_size - data_size
   169 00000018 AB07                    at eldhCodeEntrypoint,	dw linker - code
   170                                  at eldhReserved
   171 0000001A 00<rep 4h>2400          at eldhExtensionSize,	dw header_extension_end - $$
   172                                  	iend
   173 00000020 [30000000]              at eldhxDescriptionOffset,	dd description
   174                                  PUT_ELDHX_DATETIME_OFFSET
   175                                  header_extension_end:
   176 00000024 00<rep Ch>              	iend
   177                                  
   178 00000030 4C6973742054535273-     description:		asciz "List TSRs using the alternate multiplex interrupt."
   178 00000039 207573696E67207468-
   178 00000042 6520616C7465726E61-
   178 0000004B 7465206D756C746970-
   178 00000054 6C657820696E746572-
   178 0000005D 727570742E00       
   179                                  
   180                                  
   181 00000063 00<rep Dh>              	align 16, db 0
   182                                  
   183                                  	eldstrict on
   184                                  
   185                                  CODEOFFSET equ $ - $$
   186                                  	addsection CODE, follows=HEADER vstart=_ELD_CODE_VSTART
   187                                  %define CODEFIXUP - code + 0
   188                                  code:
   189                                  		; ELD instance header
   190                                  	istruc ELD_INSTANCE
   191                                  at eldiStartCode
   192 00000000 00<rep 2h>              at eldiEndCode
   193 00000002 00<rep 2h>              at eldiStartData
   194 00000004 00<rep 2h>              at eldiEndData
   195 00000006 00<rep 2h>414D4954-     at eldiIdentifier,	fill 8, 32, db "AMITSRS"
   195 0000000C 53525320           
   196 00000010 00<rep 2h>616D6974-     at eldiListing,		asciz _ELD_LISTING
   196 00000016 7372732E6C737400   
   197 0000001E 00<rep 2h>              	iend
   198                                  
   199                                  
   200                                  command:
   201 00000020 EB08                    	jmp strict short .entry
   202                                  .chain:
   203 00000022 E8[0000]EB020000        	extcall cmd3_not_ext, required	; must NOT be extcallcall
   204 00000029 90                      	times 10 - ($ - command) nop
   205                                  .entry:
   206 0000002A 56                      	push si
   207 0000002B 3C2D                    	cmp al, '-'
   208 0000002D 7503                    	jne @F
   209 0000002F E83606                  	extcallcall skipcomma
   210                                  @@:
   211 00000032 4E                      	dec si
   212                                  
   213 00000033 BA[0403]                reloc	mov dx, msg.amitsrs
   214                                  internaldatarelocation
   215 00000036 E83706                  	extcallcall isstring?
   216 00000039 7405                    	je .ours
   217 0000003B 5E                      	pop si
   218 0000003C 4E                      	dec si
   219 0000003D AC                      	lodsb
   220 0000003E EBE2                    	jmp .chain
   221                                  
   222                                  .ours:
   223 00000040 58                      	pop ax
   224 00000041 E82406                  	extcallcall skipcomma
   225 00000044 4E                      	dec si
   226 00000045 C706[0000][0000]        reloc2	mov word [relocateddata], relocateddata
   227                                  linkdatarelocation lastcmd, -4
   228                                  linkdatarelocation dmycmd
   229 0000004B BA[0000]                reloc	mov dx, relocateddata
   230                                  linkdatarelocation msg.uninstall
   231 0000004E E81F06                  	extcallcall isstring?
   232 00000051 7406                    	je uninstall
   233                                  
   234 00000053 E88300                  	call run
   235 00000056 E81F06                  	extcallcall cmd3
   236                                  
   237                                  uninstall:
   238 00000059 AC                      	lodsb
   239 0000005A E82306                  	extcallcall chkeol
   240                                  
   241 0000005D E86B00                  	call get_es_ext
   242                                  
   243 00000060 06                      	push es
   244 00000061 1F                      	pop ds
   245 00000062 31DB                    	xor bx, bx		; = 0 (no prior, modify ext_command_handler)
   246 00000064 BF[2000]                reloc	mov di, command		; di -> us
   247                                  internalcoderelocation
   248 00000067 368B36[0000]            reloc	mov si, word [ss:relocateddata]
   249                                  linkdatarelocation ext_command_handler
   250                                  				; si -> first
   251 0000006C 85F6                    	test si, si		; none installed ?
   252 0000006E 7450                    	jz .error		; error -->
   253                                  
   254                                  .loop:
   255 00000070 39F7                    	cmp di, si		; found ?
   256 00000072 740D                    	je .bx			; yes, use bx -->
   257 00000074 89F3                    	mov bx, si		; bx -> prior handler
   258 00000076 AD                      	lodsw			; skip entrypoint jmp strict short
   259 00000077 AC                      	lodsb			; get first byte of chainer
   260 00000078 3CE9                    	cmp al, 0E9h		; expecting jmp near ?
   261 0000007A 7544                    	jne .error		; no, error -->
   262 0000007C AD                      	lodsw			; get rel16 displacement
   263 0000007D 01C6                    	add si, ax		; -> next handler
   264 0000007F EBEF                    	jmp .loop
   265                                  
   266                                  .bx:
   267 00000081 85DB                    	test bx, bx		; any prior ?
   268 00000083 751A                    	jnz .bxnz		; yes -->
   269 00000085 AF                      	scasw			; skip entrypoint jmp strict short
   270 00000086 803DE8                  	cmp byte [di], 0E8h	; is it a call to cmd3_not_ext ?
   271 00000089 7507                    	jne @F			; no -->
   272                                  				; yes, reset ext_command_handler to zero
   273                                  .setbx:
   274 0000008B 36891E[0000]            reloc	mov word [ss:relocateddata], bx
   275                                  linkdatarelocation ext_command_handler
   276 00000090 EB1E                    	jmp .done
   277                                  
   278                                  @@:
   279 00000092 803DE9                  	cmp byte [di], 0E9h	; validate
   280 00000095 7529                    	jne .error		; failure -->
   281 00000097 47                      	inc di			; -> rel16 displacement
   282 00000098 8B1D                    	mov bx, word [di]	; get displacement
   283 0000009A AF                      	scasw			; -> after jmp near
   284 0000009B 01FB                    	add bx, di		; -> next handler
   285 0000009D EBEC                    	jmp .setbx		; set ext_command_handler to next
   286                                  
   287                                  .bxnz:
   288 0000009F 89DE                    	mov si, bx		; -> prior handler with us as downlink
   289 000000A1 87FE                    	xchg di, si		; si -> ours, di -> prior
   290 000000A3 A7                      	cmpsw			; skip entrypoint jmp strict short
   291 000000A4 A4                      	movsb			; copy 0E8h/0E9h
   292 000000A5 AD                      	lodsw			; ax = near rel16 displacement
   293 000000A6 01F0                    	add ax, si		; add in our base (= absolute offset)
   294 000000A8 29F8                    	sub ax, di
   295 000000AA 48                      	dec ax
   296 000000AB 48                      	dec ax			; subtract new base (= relative displacement)
   297 000000AC AB                      	stosw			; store new rel16 displacement
   298 000000AD A5                      	movsw			; jmp strict short
   299 000000AE A5                      	movsw			; linkcall target
   300 000000AF A4                      	movsb			; trailer
   301                                  .done:
   302 000000B0 8026[1000]FE            reloc	clropt [code + eldiFlags], eldifResident
   303                                  internalcoderelocation -3	; mark block as free
   304 000000B5 BA[0C03]                reloc	mov dx, msg.uninstall_done
   305                                  internaldatarelocation
   306                                  @@:
   307 000000B8 16                      	push ss
   308 000000B9 1F                      	pop ds
   309 000000BA E8CB05                  	extcallcall putsz
   310 000000BD E8B805                  	extcallcall cmd3	; return
   311                                  
   312                                  .error:
   313 000000C0 B8010E                  	mov ax, 0E01h
   314 000000C3 E8CA05                  	extcallcall setrc
   315 000000C6 BA[2303]                reloc	mov dx, msg.uninstall_error
   316                                  internaldatarelocation
   317 000000C9 EBED                    	jmp @B
   318                                  
   319                                  
   320                                  get_es_ext:
   321 000000CB 8E06[0000]              reloc	mov es, word [relocateddata]
   322                                  linkdatarelocation extdssel
   323 000000CF E8C605                  	extcallcall ispm
   324 000000D2 7404                    	jz @F
   325 000000D4 8E06[0000]              reloc	mov es, word [relocateddata]
   326                                  linkdatarelocation extseg
   327                                  @@:
   328 000000D8 C3                      	retn
   329                                  
   330                                  
   331                                  run:
   332 000000D9 16                      	push ss
   333 000000DA 07                      	pop es
   334                                  
   335 000000DB 31C0                    	xor ax, ax
   336 000000DD A3[7A06]                reloc	mov word [did_banner], ax
   337                                  internaldatarelocation		; {1} also writes verbose_mpx
   338 000000E0 A3[7C06]                reloc	mov word [verbose_hotkeys], ax
   339                                  internaldatarelocation		; {2} also writes verbose_int
   340 000000E3 A3[7E06]                reloc	mov word [verbose_block], ax
   341                                  internaldatarelocation		; also writes verbose_char
   342 000000E6 A3[8006]                reloc	mov word [verbose_device], ax
   343                                  internaldatarelocation		; also writes verbose_dpb
   344 000000E9 C706[7806]00FF          reloc	mov word [mpx_from], 0FF00h
   345                                  				; (also writes mpx_to)
   346                                  internaldatarelocation -4
   347                                  .verbose_loop:
   348 000000EF E87605                  	extcallcall skipcomma
   349 000000F2 E8AB05                  	extcallcall iseol?
   350 000000F5 7460                    	je .verbose_done
   351 000000F7 4E                      	dec si
   352                                  
   353 000000F8 BA[4703]                reloc	mov dx, msg.verbose
   354                                  internaldatarelocation
   355 000000FB E87205                  	extcallcall isstring?
   356 000000FE 750E                    	jne @F
   357 00000100 B8FFFF                  	mov ax, -1
   358 00000103 A2[7B06]                reloc	mov byte [verbose_mpx], al
   359                                  internaldatarelocation
   360 00000106 A3[8006]                reloc	mov word [verbose_device], ax
   361                                  internaldatarelocation
   362 00000109 A3[7C06]                reloc	mov word [verbose_hotkeys], ax
   363                                  internaldatarelocation
   364 0000010C EBE1                    	jmp .verbose_loop
   365                                  
   366                                  @@:
   367 0000010E BA[4203]                reloc	mov dx, msg.only
   368                                  internaldatarelocation
   369 00000111 E85C05                  	extcallcall isstring?
   370 00000114 7523                    	jne @F
   371 00000116 E84F05                  	extcallcall skipcomma
   372 00000119 4E                      	dec si
   373 0000011A E88B05                  	extcallcall skipequals
   374 0000011D E89005                  	extcallcall skipcomm0
   375 00000120 4E                      	dec si
   376 00000121 E89405                  	extcallcall get_value_range
   377 00000124 722E                    	jc .error
   378 00000126 85DB                    	test bx, bx
   379 00000128 752A                    	jnz .error
   380 0000012A 84F6                    	test dh, dh
   381 0000012C 7526                    	jnz .error
   382 0000012E 893E[7806]              reloc	mov word [mpx_from], di		; (also writes mpx_to)
   383                                  internaldatarelocation
   384 00000132 8816[7906]              reloc	mov byte [mpx_to], dl
   385                                  internaldatarelocation
   386 00000136 4E                      	dec si
   387 00000137 EBB6                    	jmp .verbose_loop
   388                                  
   389                                  @@:
   390 00000139 BB[0000]                reloc	mov bx, keywordtable
   391                                  internaldatarelocation
   392                                  @@:
   393 0000013C 8B17                    	mov dx, word [bx]
   394 0000013E 85D2                    	test dx, dx
   395 00000140 7412                    	jz .error
   396 00000142 E82B05                  	extcallcall isstring?
   397 00000145 7405                    	je @F
   398 00000147 83C304                  	add bx, 4
   399 0000014A EBF0                    	jmp @B
   400                                  
   401                                  @@:
   402 0000014C 8B5F02                  	mov bx, word [bx + 2]
   403 0000014F C607FF                  	mov byte [bx], 0FFh
   404 00000152 EB9B                    	jmp .verbose_loop
   405                                  
   406                                  .error:
   407 00000154 E86905                  	extcallcall error
   408                                  
   409                                  .verbose_done:
   410 00000157 B02D                    	mov al, 2Dh
   411 00000159 E86C05                  	extcallcall intchk	; ZR if offset = -1 or segment = 0
   412                                  				; CHG: ax, dx, bx
   413 0000015C 750D                    	jnz @F
   414 0000015E B8160E                  	mov ax, 0E16h
   415 00000161 E82C05                  	extcallcall setrc
   416 00000164 BA[9F03]                reloc	mov dx, msg.no2D
   417                                  internaldatarelocation
   418 00000167 E81E05                  	extcallcall putsz
   419 0000016A C3                      	retn
   420                                  
   421                                  @@:
   422                                  
   423                                  %if 0
   424                                  int main(int argc,char **argv)
   425                                  {
   426                                     int mpx ;
   427                                     int did_banner = 0, verbose = 0 ;
   428                                     union REGS regs ;
   429                                     char far *sig ;
   430                                     char signaturebuffer[8 + 8 + 64];
   431                                     
   432                                     /* prevent 'unused parameters' warnings */
   433                                     (void)argv ;
   434                                     /**/
   435                                     /* if any commandline arguments, turn on verbose mode */
   436                                     /**/
   437                                     if (argc > 1)
   438                                        verbose = 1 ;
   439                                  %endif
   440                                  
   441 0000016B B400                    	mov ah, 0
   442                                  .loop:
   443 0000016D 50                      	push ax
   444 0000016E 3A26[7806]              reloc	cmp ah, byte [mpx_from]
   445                                  internaldatarelocation
   446 00000172 720F                    	jb .next
   447 00000174 3A26[7906]              reloc	cmp ah, byte [mpx_to]
   448                                  internaldatarelocation
   449 00000178 7709                    	ja .next
   450 0000017A B000                    	mov al, 00h
   451 0000017C E85105                  	extcallcall call_int2D		; installation check
   452 0000017F 3CFF                    	cmp al, 0FFh
   453 00000181 7418                    	je .found
   454                                  
   455                                  .next:
   456                                  next equ $
   457 00000183 58                      	pop ax
   458 00000184 FEC4                    	inc ah
   459 00000186 75E5                    	jnz .loop
   460                                  
   461 00000188 D006[7A06]              reloc	rol byte [did_banner], 1
   462                                  internaldatarelocation
   463 0000018C 720C                    	jc .ret
   464                                  
   465 0000018E B8170E                  	mov ax, 0E17h
   466 00000191 E8FC04                  	extcallcall setrc
   467 00000194 BA[2404]                reloc	mov dx, msg.notsrs
   468                                  internaldatarelocation
   469 00000197 E8EE04                  	extcallcall putsz
   470                                  .ret:
   471 0000019A C3                      	retn
   472                                  
   473                                  %if 0
   474                                        }
   475                                     if (!did_banner)
   476                                        printf("No TSRs are using the alternate multiplex interrupt\n") ;
   477                                     return 0 ;
   478                                  }
   479                                  %endif
   480                                  
   481                                  .found:
   482 0000019B 8826[8206]              reloc	mov byte [mpx], ah
   483                                  internaldatarelocation
   484                                  
   485 0000019F D006[7A06]              reloc	rol byte [did_banner], 1
   486                                  internaldatarelocation
   487 000001A3 720C                    	jc @F
   488                                  
   489 000001A5 52                      	push dx
   490 000001A6 BA[C103]                reloc	mov dx, msg.banner
   491                                  internaldatarelocation
   492 000001A9 E8DC04                  	extcallcall putsz
   493 000001AC 5A                      	pop dx
   494 000001AD F616[7A06]              reloc	not byte [did_banner]
   495                                  internaldatarelocation
   496                                  @@:
   497                                  
   498                                  %if 0
   499                                     /**/
   500                                     /* loop through all 256 multiplex numbers, listing each signature we find */
   501                                     /**/
   502                                     for (mpx = 0 ; mpx <= 255 ; mpx++)
   503                                        {
   504                                        regs.h.ah = mpx ;
   505                                        regs.h.al = AMIS_INSTCHECK ;  /* installation check */
   506                                        int86(0x2D,&regs,&regs) ;
   507                                        if (regs.h.al == AMIS_SUCCESSFUL) /* installed? */
   508                                  	 {
   509                                  	 if (!did_banner)
   510                                  	    {
   511                                  	    printf("Manufact  Product\t\tDescription\n") ;
   512                                  	    printf("-------- -------- ----------------------------------------------\n") ;
   513                                  	    did_banner = 1 ;
   514                                  	    }
   515                                  %endif
   516                                  
   517 000001B1 51                      	push cx
   518                                  
   519 000001B2 BE[0000]                reloc	mov si, relocateddata
   520                                  linkdatarelocation line_out
   521                                  
   522 000001B5 E82005                  	extcallcall setes2dx
   523 000001B8 89FB                    	mov bx, di		; es:bx -> vendor
   524 000001BA B90800                  	mov cx, 8
   525 000001BD E89E04                  	call get_esbx_pad_length_maximum_cx
   526                                  
   527 000001C0 89DF                    	mov di, bx		; es:di -> vendor
   528 000001C2 E86704                  	call swap_es_ds
   529 000001C5 87FE                    	xchg di, si		; ds:si -> vendor, es:di -> buffer
   530 000001C7 51                      	push cx
   531 000001C8 B020                    	mov al, 32
   532 000001CA F3AA                    	rep stosb		; pad with pad length
   533 000001CC 59                      	pop cx
   534                                  
   535 000001CD F7D9                    	neg cx			; -8 if 0, -7 if 1, 0 if 8
   536 000001CF 83C108                  	add cx, 8		; = length of string
   537 000001D2 F3A4                    	rep movsb		; write text data
   538                                  
   539 000001D4 B020                    	mov al, 32
   540 000001D6 AA                      	stosb			; write a blank
   541                                  
   542 000001D7 87FE                    	xchg di, si		; si -> buffer
   543 000001D9 E85004                  	call swap_es_ds		; es:bx -> signatures
   544 000001DC 8D5F08                  	lea bx, [bx + 8]	; es:bx -> product
   545 000001DF B90800                  	mov cx, 8
   546 000001E2 E87904                  	call get_esbx_pad_length_maximum_cx
   547                                  
   548 000001E5 89DF                    	mov di, bx		; es:di -> product
   549 000001E7 E84204                  	call swap_es_ds
   550 000001EA 87FE                    	xchg di, si		; ds:si -> product, es:di -> buffer
   551 000001EC 51                      	push cx
   552 000001ED B020                    	mov al, 32
   553 000001EF F3AA                    	rep stosb		; pad with pad length
   554 000001F1 59                      	pop cx
   555                                  
   556 000001F2 F7D9                    	neg cx			; -8 if 0, -7 if 1, 0 if 8
   557 000001F4 83C108                  	add cx, 8		; = length
   558 000001F7 F3A4                    	rep movsb		; write text data
   559                                  
   560 000001F9 B020                    	mov al, 32
   561 000001FB AA                      	stosb			; write a blank
   562                                  
   563 000001FC 87FE                    	xchg di, si
   564 000001FE E82B04                  	call swap_es_ds		; es => signatures, ds:si -> buffer
   565 00000201 8D5F08                  	lea bx, [bx + 8]	; es:bx -> description
   566 00000204 B93D00                  	mov cx, 61
   567 00000207 E85404                  	call get_esbx_pad_length_maximum_cx
   568                                  
   569 0000020A 89DF                    	mov di, bx		; es:di -> description
   570 0000020C E81D04                  	call swap_es_ds
   571 0000020F 87FE                    	xchg di, si		; ds:si -> description, es:di -> buffer
   572 00000211 F7D9                    	neg cx			; -61 if 0, -60 if 1, 0 if 61
   573 00000213 83C13D                  	add cx, 61		; = length
   574 00000216 F3A4                    	rep movsb		; write text
   575                                  
   576 00000218 16                      	push ss
   577 00000219 1F                      	pop ds
   578 0000021A E8C304                  	extcallcall trimputs
   579                                  
   580 0000021D 5B                      	pop bx
   581                                  
   582                                  %if 0
   583                                  	 sig = MK_FP(regs.x.dx,regs.x.di) ;
   584                                  	 _fmemcpy(signaturebuffer, sig, 8 + 8 + 63);
   585                                  	 signaturebuffer[8 + 8 + 63] = 0;
   586                                  	 printf("%8.8s %8.8s %.61s\n",signaturebuffer,signaturebuffer+8,signaturebuffer+16) ;
   587                                  	 /**/
   588                                  	 /* if we were asked for a verbose display, also display TSR version */
   589                                  	 /* and private API entry point (if present) on a second line	     */
   590                                  	 /**/
   591                                  %endif
   592                                  
   593                                  display_second_line:
   594 0000021E D006[7B06]              reloc	rol byte [verbose_mpx], 1
   595                                  internaldatarelocation
   596 00000222 7351                    	jnc .done
   597                                  
   598 00000224 A0[8206]                reloc	mov al, byte [mpx]
   599                                  internaldatarelocation
   600                                  
   601 00000227 BF[0000]                reloc	mov di, relocateddata
   602                                  linkdatarelocation line_out
   603 0000022A BE[5E04]                reloc	mov si, msg.mpx.1
   604                                  internaldatarelocation
   605 0000022D E8B804                  	extcallcall copy_single_counted_string
   606                                  
   607 00000230 E8BD04                  	extcallcall hexbyte
   608                                  
   609 00000233 BE[6A04]                reloc	mov si, msg.mpx.2
   610                                  internaldatarelocation
   611 00000236 E8AF04                  	extcallcall copy_single_counted_string
   612                                  					; ch = 0
   613                                  
   614 00000239 31C0                    	xor ax, ax
   615 0000023B 88F8                    	mov al, bh
   616 0000023D E8B804                  	extcallcall decword
   617                                  
   618 00000240 B02E                    	mov al, '.'
   619 00000242 AA                      	stosb
   620                                  
   621 00000243 88D8                    	mov al, bl
   622 00000245 31D2                    	xor dx, dx
   623 00000247 B102                    	mov cl, 2			; cx = 2
   624 00000249 E8B404                  	extcallcall dec_dword_minwidth
   625                                  
   626 0000024C 8A26[8206]              reloc	mov ah, byte [mpx]
   627                                  internaldatarelocation
   628 00000250 B001                    	mov al, 01h
   629 00000252 E87B04                  	extcallcall call_int2D		; get private entrypoint
   630                                  
   631 00000255 3CFF                    	cmp al, 0FFh
   632 00000257 7513                    	jne .no_private_entry_point
   633                                  
   634 00000259 BE[7804]                reloc	mov si, msg.mpx.3.yes
   635                                  internaldatarelocation
   636 0000025C E88904                  	extcallcall copy_single_counted_string
   637                                  
   638 0000025F 92                      	xchg ax, dx
   639 00000260 E8A504                  	extcallcall hexword
   640                                  
   641 00000263 B03A                    	mov al, ':'
   642 00000265 AA                      	stosb
   643                                  
   644 00000266 93                      	xchg ax, bx
   645 00000267 E89E04                  	extcallcall hexword
   646                                  
   647 0000026A EB06                    	jmp .put_second_line
   648                                  
   649                                  .no_private_entry_point:
   650 0000026C BE[8804]                reloc	mov si, msg.mpx.3.no
   651                                  internaldatarelocation
   652 0000026F E87604                  	extcallcall copy_single_counted_string
   653                                  
   654                                  .put_second_line:
   655 00000272 E89B04                  	extcallcall putsline_crlf
   656                                  .done:
   657                                  
   658                                  %if 0
   659                                  	 if (verbose)
   660                                  	    {
   661                                  	    printf(" multiplex %02Xh    version %d.%02d",mpx,regs.h.ch,regs.h.cl) ;
   662                                  	    regs.h.ah = mpx ;
   663                                  	    regs.h.al = AMIS_ENTRYPOINT ;  /* get private entry point */
   664                                  	    int86(0x2D,&regs,&regs) ;
   665                                  	    if (regs.h.al == AMIS_SUCCESSFUL)
   666                                  	       printf("   entry point %04.4X:%04.4X ",regs.x.dx,regs.x.bx) ;
   667                                  	    else
   668                                  	       printf("   no private entry point") ;
   669                                  	    printf("\n") ;
   670                                  	    display_hotkeys(mpx) ;
   671                                  	    display_interrupts(mpx);
   672                                  	    }
   673                                  	 }
   674                                  %endif
   675                                  
   676                                  
   677                                  display_hotkeys:
   678 00000275 D006[7C06]              reloc	rol byte [verbose_hotkeys], 1
   679                                  internaldatarelocation
   680 00000279 7203E9C600              	jnc .done
   681                                  
   682                                  	houdini
   683 0000027E 8A26[8206]              reloc	mov ah, byte [mpx]
   684                                  internaldatarelocation
   685 00000282 B005                    	mov al, 05h
   686 00000284 E84904                  	extcallcall call_int2D		; get hotkeys
   687                                  
   688 00000287 3CFF                    	cmp al, 0FFh
   689 00000289 7409                    	je @F
   690                                  
   691                                  %if 0
   692                                  void display_hotkeys(int mpx_number)
   693                                  {
   694                                     union REGS regs ;
   695                                     char far *hotkeys ;
   696                                     int num_hotkeys, hotkey_type ;
   697                                     int shifts ;
   698                                     
   699                                     regs.h.ah = mpx_number ;
   700                                     regs.h.al = AMIS_HOTKEYS ;	/* get hotkeys */
   701                                     int86(0x2D,&regs,&regs) ;
   702                                     if (regs.h.al == AMIS_SUCCESSFUL) /* supported? */
   703                                        {
   704                                  %endif
   705                                  
   706 0000028B BA[E904]                reloc	mov dx, msg.no_hotkeys
   707                                  internaldatarelocation
   708 0000028E E8F703                  	extcallcall putsz
   709 00000291 E9B000                  	jmp .done
   710                                  
   711                                  %if 0
   712                                     else
   713                                        printf("%18sno hotkeys\n","") ;
   714                                     return ;
   715                                  }
   716                                  %endif
   717                                  
   718                                  @@:
   719 00000294 8916[7206]              reloc	mov word [saved], dx
   720                                  internaldatarelocation
   721                                  
   722 00000298 BF[0000]                reloc	mov di, relocateddata
   723                                  linkdatarelocation line_out
   724 0000029B BE[E904]                reloc	mov si, msg.no_hotkeys
   725                                  internaldatarelocation
   726 0000029E B91200                  	mov cx, 18
   727 000002A1 F3A4                    	rep movsb
   728                                  
   729 000002A3 E87C03                  	call get_saved_es
   730 000002A6 91                      	xchg ax, cx			; ah = 0
   731 000002A7 268B17                  	mov dx, word [es:bx]		; dl = hotkey type
   732 000002AA 88F0                    	mov al, dh			; ax = number of hotkeys
   733 000002AC 16                      	push ss
   734 000002AD 07                      	pop es
   735 000002AE E84704                  	extcallcall decword
   736                                  
   737 000002B1 BE[1505]                reloc	mov si, msg.hotkeys.singular
   738                                  internaldatarelocation
   739 000002B4 3C01                    	cmp al, 1
   740 000002B6 7403                    	je @F
   741 000002B8 BE[0805]                reloc	mov si, msg.hotkeys.plural
   742                                  internaldatarelocation
   743                                  @@:
   744 000002BB E82A04                  	extcallcall copy_single_counted_string
   745                                  
   746                                  %if 0
   747                                        hotkeys = MK_FP(regs.x.dx,regs.x.bx) ;
   748                                        hotkey_type = hotkeys[0] ;
   749                                        num_hotkeys = hotkeys[1] ;
   750                                        printf("%18s%d hotkey%s on ","",num_hotkeys,(num_hotkeys == 1)?"":"s") ;
   751                                  %endif
   752                                  
   753                                  
   754 000002BE F6C203                  	test dl, HK_INT09ENTRY | HK_INT09EXIT
   755 000002C1 7406                    	jz @F
   756 000002C3 BE[2105]                reloc	mov si, msg.hotkeys.int09
   757                                  internaldatarelocation
   758 000002C6 E81F04                  	extcallcall copy_single_counted_string
   759                                  @@:
   760                                  
   761 000002C9 F6C20C                  	test dl, HK_INT15ENTRY | HK_INT15EXIT
   762 000002CC 7406                    	jz @F
   763 000002CE BE[2B05]                reloc	mov si, msg.hotkeys.int15
   764                                  internaldatarelocation
   765 000002D1 E81404                  	extcallcall copy_single_counted_string
   766                                  @@:
   767                                  
   768 000002D4 52                      	push dx
   769 000002D5 53                      	push bx
   770 000002D6 E80704                  	extcallcall trimputs
   771                                  
   772                                  %if 0
   773                                        if ((hotkey_type & HK_INT09ENTRY) || (hotkey_type & HK_INT09EXIT))
   774                                  	 printf("INT 09h  ") ;
   775                                        if ((hotkey_type & HK_INT15ENTRY) || (hotkey_type & HK_INT15EXIT))
   776                                  	 printf("INT 15h") ;
   777                                        printf("\n") ;
   778                                  %endif
   779                                  
   780 000002D9 5B                      	pop bx
   781 000002DA 43                      	inc bx
   782 000002DB 43                      	inc bx
   783                                  
   784 000002DC 59                      	pop cx
   785 000002DD 88E9                    	mov cl, ch
   786 000002DF B500                    	mov ch, 0
   787 000002E1 E361                    	jcxz .done
   788                                  
   789                                  .loop:
   790 000002E3 51                      	push cx
   791                                  
   792 000002E4 BA[4F06]                reloc	mov dx, msg.22blanks
   793                                  internaldatarelocation
   794 000002E7 E89E03                  	extcallcall putsz
   795                                  
   796 000002EA E83503                  	call get_saved_es
   797 000002ED 268B4701                	mov ax, word [es:bx + 1]
   798 000002F1 16                      	push ss
   799 000002F2 07                      	pop es
   800                                  
   801 000002F3 53                      	push bx
   802 000002F4 BB[3600]                reloc	mov bx, shifttable1
   803                                  internaldatarelocation
   804 000002F7 E80203                  	call handleshift
   805 000002FA 5B                      	pop bx
   806                                  
   807 000002FB 50                      	push ax
   808 000002FC 53                      	push bx
   809 000002FD E82203                  	call get_saved_es
   810 00000300 268A1F                  	mov bl, byte [es:bx]
   811 00000303 16                      	push ss
   812 00000304 07                      	pop es
   813                                  
   814 00000305 B700                    	mov bh, 0
   815 00000307 89D8                    	mov ax, bx
   816 00000309 01DB                    	add bx, bx
   817 0000030B 3C59                    	cmp al, scancodes.amount
   818 0000030D 7308                    	jae .unknown
   819 0000030F 8B97[9A00]              reloc	mov dx, word [word scancodes + bx]
   820                                  internaldatarelocation
   821 00000313 85D2                    	test dx, dx
   822 00000315 7514                    	jnz .known
   823                                  
   824                                  .unknown:
   825 00000317 BF[0000]                reloc	mov di, relocateddata
   826                                  linkdatarelocation line_out
   827 0000031A BE[3505]                reloc	mov si, msg.unknownkey
   828                                  internaldatarelocation
   829 0000031D E8C803                  	extcallcall copy_single_counted_string
   830 00000320 E8CD03                  	extcallcall hexbyte
   831 00000323 B068                    	mov al, 'h'
   832 00000325 AA                      	stosb
   833 00000326 E8EF03                  	extcallcall putsline
   834 00000329 EB03                    	jmp @F
   835                                  
   836                                  .known:
   837 0000032B E85A03                  	extcallcall putsz
   838                                  @@:
   839                                  
   840 0000032E 5B                      	pop bx
   841 0000032F 58                      	pop ax
   842                                  
   843                                  %if 0
   844                                  	 if (*hotkeys) {
   845                                  	   if (*hotkeys < (sizeof(scancodes) / sizeof(scancodes[0]))
   846                                  	     && scancodes[*hotkeys]) {
   847                                  	     printf("%s",scancodes[*hotkeys]);
   848                                  	   } else {
   849                                  	     printf("unknownkey=%02Xh", *hotkeys);
   850                                  	   }
   851                                  	 } else {
   852                                  	   printf("nokey") ;
   853                                  	 }
   854                                  %endif
   855                                  
   856 00000330 53                      	push bx
   857 00000331 BB[8600]                reloc	mov bx, shifttable2
   858                                  internaldatarelocation
   859 00000334 E8C502                  	call handleshift
   860 00000337 5B                      	pop bx
   861                                  
   862 00000338 BA[6606]                reloc	mov dx, msg.linebreak
   863                                  internaldatarelocation
   864 0000033B E84A03                  	extcallcall putsz
   865                                  
   866 0000033E 83C306                  	add bx, 6
   867                                  
   868 00000341 59                      	pop cx
   869 00000342 E29F                    	loop .loop
   870                                  .done:
   871                                  
   872                                  display_devices:
   873 00000344 833E[7E06]00            reloc	cmp word [verbose_block], strict byte 0
   874                                  internaldatarelocation -3		; also checks verbose_char
   875 00000349 750F                    	jne @F
   876 0000034B D006[8106]              reloc	rol byte [verbose_dpb], 1
   877                                  internaldatarelocation
   878 0000034F 7209                    	jc @F
   879                                  
   880 00000351 D006[8006]              reloc	rol byte [verbose_device], 1
   881                                  internaldatarelocation
   882 00000355 7203E90C02              	jnc .done
   883                                  @@:
   884                                  
   885 0000035A 8A26[8206]              reloc	mov ah, byte [mpx]
   886                                  internaldatarelocation
   887 0000035E B006                    	mov al, 06h
   888 00000360 E86D03                  	extcallcall call_int2D		; get device driver headers
   889                                  
   890 00000363 3C00                    	cmp al, 0
   891 00000365 7503E9FC01              	je .no_device_driver
   892                                  
   893 0000036A BF[0000]                reloc	mov di, relocateddata
   894                                  linkdatarelocation line_out
   895 0000036D BE[A204]                reloc	mov si, msg.dev.1
   896                                  internaldatarelocation
   897 00000370 E87503                  	extcallcall copy_single_counted_string
   898                                  
   899 00000373 50                      	push ax
   900 00000374 B400                    	mov ah, 0
   901 00000376 A3[7606]                reloc	mov word [devicesamount], ax
   902                                  internaldatarelocation
   903 00000379 E87C03                  	extcallcall decword
   904 0000037C BE[AD04]                reloc	mov si, msg.dev.2.singular
   905                                  internaldatarelocation
   906 0000037F 3C01                    	cmp al, 1
   907 00000381 7403                    	je @F
   908 00000383 BE[C404]                reloc	mov si, msg.dev.2.plural
   909                                  internaldatarelocation
   910                                  @@:
   911 00000386 E85F03                  	extcallcall copy_single_counted_string
   912                                  
   913 00000389 58                      	pop ax
   914 0000038A 86C4                    	xchg al, ah
   915 0000038C E86103                  	extcallcall hexbyte
   916                                  
   917 0000038F BE[DC04]                reloc	mov si, msg.dev.3
   918                                  internaldatarelocation
   919                                  @@:
   920 00000392 E85303                  	extcallcall copy_single_counted_string
   921                                  
   922 00000395 52                      	push dx
   923 00000396 53                      	push bx
   924 00000397 92                      	xchg ax, dx
   925 00000398 E86D03                  	extcallcall hexword
   926                                  
   927 0000039B B8683A                  	mov ax, "h:"
   928 0000039E AB                      	stosw
   929                                  
   930 0000039F 93                      	xchg ax, bx
   931 000003A0 E86503                  	extcallcall hexword
   932                                  
   933 000003A3 B068                    	mov al, "h"
   934 000003A5 AA                      	stosb
   935                                  
   936 000003A6 E86703                  	extcallcall putsline_crlf
   937                                  
   938 000003A9 5B                      	pop bx
   939 000003AA 5A                      	pop dx
   940                                  
   941                                  .loop:
   942 000003AB 83FBFF                  	cmp bx, -1
   943 000003AE 7509                    	jne @F
   944 000003B0 BA[F505]                reloc	mov dx, msg.invaliddevice
   945                                  internaldatarelocation
   946 000003B3 E8D202                  	extcallcall putsz
   947 000003B6 E9AD01                  	jmp .done
   948                                  
   949                                  @@:
   950 000003B9 BF[0000]                reloc	mov di, relocateddata
   951                                  linkdatarelocation line_out
   952                                  
   953 000003BC B82020                  	mov ax, 2020h
   954 000003BF AB                      	stosw
   955                                  
   956 000003C0 89D0                    	mov ax, dx
   957 000003C2 E84303                  	extcallcall hexword
   958                                  
   959 000003C5 B8683A                  	mov ax, "h:"
   960 000003C8 AB                      	stosw
   961                                  
   962 000003C9 89D8                    	mov ax, bx
   963 000003CB E83A03                  	extcallcall hexword
   964                                  
   965 000003CE E88502                  	call setds2dx
   966 000003D1 8B4704                  	mov ax, [bx + 4]
   967 000003D4 16                      	push ss
   968 000003D5 1F                      	pop ds
   969                                  
   970 000003D6 A90080                  	test ax, 8000h
   971 000003D9 7414                    	jz .blockearly
   972                                  .charearly:
   973 000003DB BE[B805]                reloc	mov si, msg.eachdev.1.char
   974                                  internaldatarelocation
   975 000003DE D006[8006]              reloc	rol byte [verbose_device], 1
   976                                  internaldatarelocation
   977 000003E2 7223                    	jc @F
   978 000003E4 D006[7F06]              reloc	rol byte [verbose_char], 1
   979                                  internaldatarelocation
   980 000003E8 7203E96201              	jnc .next
   981 000003ED EB18                    	jmp @F
   982                                  
   983                                  .blockearly:
   984 000003EF BE[A205]                reloc	mov si, msg.eachdev.1.block
   985                                  internaldatarelocation
   986 000003F2 D006[8006]              reloc	rol byte [verbose_device], 1
   987                                  internaldatarelocation
   988 000003F6 720F                    	jc @F
   989 000003F8 D006[8106]              reloc	rol byte [verbose_dpb], 1
   990                                  internaldatarelocation
   991 000003FC 7209                    	jc @F
   992 000003FE D006[7E06]              reloc	rol byte [verbose_block], 1
   993                                  internaldatarelocation
   994 00000402 7203E94801              	jnc .next
   995                                  @@:
   996 00000407 E8DE02                  	extcallcall copy_single_counted_string
   997                                  
   998 0000040A E8FB02                  	extcallcall hexword
   999                                  
  1000 0000040D BE[CD05]                reloc	mov si, msg.eachdev.2
  1001                                  internaldatarelocation
  1002 00000410 E8D502                  	extcallcall copy_single_counted_string
  1003                                  
  1004 00000413 E84002                  	call setds2dx
  1005 00000416 FF7704                  	push word [bx + 4]
  1006 00000419 8B4706                  	mov ax, [bx + 6]
  1007 0000041C FF7708                  	 push word [bx + 8]
  1008 0000041F 16                      	push ss
  1009 00000420 1F                      	pop ds
  1010                                  
  1011 00000421 E8E402                  	extcallcall hexword
  1012                                  
  1013 00000424 BE[D705]                reloc	mov si, msg.eachdev.3
  1014                                  internaldatarelocation
  1015 00000427 E8BE02                  	extcallcall copy_single_counted_string
  1016                                  
  1017 0000042A 58                      	 pop ax
  1018 0000042B E8DA02                  	extcallcall hexword
  1019                                  
  1020 0000042E 58                      	pop ax
  1021 0000042F BE[DF05]                reloc	mov si, msg.eachdev.4.block
  1022                                  internaldatarelocation
  1023 00000432 A90080                  	test ax, 8000h
  1024 00000435 7403                    	jz @F
  1025 00000437 BE[E305]                reloc	mov si, msg.eachdev.4.char
  1026                                  internaldatarelocation
  1027                                  @@:
  1028 0000043A E8AB02                  	extcallcall copy_single_counted_string
  1029                                  
  1030 0000043D E81602                  	call setds2dx
  1031 00000440 8D770A                  	lea si, [bx + 10]
  1032 00000443 A90080                  	test ax, 8000h
  1033 00000446 741C                    	jz .block
  1034                                  .char:
  1035 00000448 B104                    	mov cl, 4
  1036 0000044A F3A5                    	rep movsw
  1037 0000044C 16                      	push ss
  1038 0000044D 1F                      	pop ds
  1039 0000044E B108                    	mov cl, 8
  1040                                  @@:
  1041 00000450 4F                      	dec di
  1042 00000451 803D20                  	cmp byte [di], 32
  1043 00000454 E1FA                    	loope @B
  1044 00000456 7401                    	je @F
  1045 00000458 47                      	inc di
  1046                                  @@:
  1047 00000459 B022                    	mov al, '"'
  1048 0000045B AA                      	stosb
  1049 0000045C 52                      	push dx
  1050 0000045D 53                      	push bx
  1051 0000045E E8AF02                  	extcallcall putsline_crlf
  1052 00000461 E9ED00                  	jmp .common
  1053                                  
  1054                                  .block:
  1055 00000464 31C0                    	xor ax, ax
  1056 00000466 AC                      	lodsb
  1057 00000467 16                      	push ss
  1058 00000468 1F                      	pop ds
  1059 00000469 A3[7006]                reloc	mov word [unitsamount], ax
  1060                                  internaldatarelocation
  1061 0000046C E88902                  	call decword
  1062                                  
  1063 0000046F BE[E805]                reloc	mov si, msg.eachdev.5.block.singular
  1064                                  internaldatarelocation
  1065 00000472 3C01                    	cmp al, 1
  1066 00000474 7403                    	je @F
  1067 00000476 BE[EE05]                reloc	mov si, msg.eachdev.5.block.plural
  1068                                  internaldatarelocation
  1069                                  @@:
  1070 00000479 E86C02                  	extcallcall copy_single_counted_string
  1071 0000047C 52                      	push dx
  1072 0000047D 53                      	push bx
  1073 0000047E E88F02                  	extcallcall putsline_crlf
  1074                                  
  1075 00000481 D006[8106]              reloc	rol byte [verbose_dpb], 1
  1076                                  internaldatarelocation
  1077 00000485 7203E9C700              	jnc .common
  1078                                  
  1079 0000048A E89302                  	extcallcall InDOS
  1080 0000048D 7403E92E02              	jnz error
  1081                                  
  1082 00000492 B80030                  	mov ax, 3000h
  1083 00000495 CD21                    	int 21h
  1084 00000497 BF1200                  	mov di, 12h
  1085 0000049A 3C04                    	cmp al, 4
  1086 0000049C 7201                    	jb @F
  1087 0000049E 47                      	inc di			; = 13h
  1088                                  @@:
  1089 0000049F 31D2                    	xor dx, dx
  1090 000004A1 B452                    	mov ah, 52h
  1091 000004A3 E88B01                  	call doscall_dx_for_es	; es:bx -> list of lists
  1092 000004A6 E8AD01                  	call setds2dx
  1093 000004A9 E8A101                  	call ldsbxbx_dx
  1094 000004AC 36891E[6A06]            reloc	mov word [ss:firstdpb], bx
  1095                                  internaldatarelocation
  1096 000004B1 368916[6C06]            reloc	mov word [ss:firstdpb + 2], dx
  1097                                  internaldatarelocation
  1098 000004B6 31C0                    	xor ax, ax
  1099                                  .finddpb:
  1100 000004B8 368B0E[7006]            reloc	mov cx, word [ss:unitsamount]
  1101                                  internaldatarelocation
  1102 000004BD E358                    	jcxz .common_j
  1103                                  
  1104                                  .loopdpb:
  1105 000004BF 368916[6E06]            reloc	mov word [ss:dpbsegment], dx
  1106                                  internaldatarelocation
  1107 000004C4 5E                      	pop si
  1108 000004C5 5A                      	pop dx
  1109 000004C6 52                      	push dx
  1110 000004C7 56                      	push si
  1111 000004C8 83FBFF                  	cmp bx, -1
  1112 000004CB 7463                    	je .nodpb
  1113 000004CD 384701                  	cmp byte [bx + 1], al		; device unit number
  1114 000004D0 7556                    	jne .nextdpb
  1115 000004D2 3931                    	cmp word [bx + di], si		; 12h v3, 13h v4+
  1116 000004D4 7552                    	jne .nextdpb
  1117 000004D6 395102                  	cmp word [bx + di + 2], dx	; device header
  1118 000004D9 754D                    	jne .nextdpb
  1119                                  
  1120                                  .founddpb:
  1121 000004DB 57                      	push di
  1122 000004DC 50                      	push ax				; low byte = unit
  1123 000004DD FF37                    	push word [bx]			; low byte = drive, A: = 0
  1124 000004DF 53                      	push bx
  1125                                  
  1126 000004E0 16                      	push ss
  1127 000004E1 07                      	pop es
  1128 000004E2 16                      	push ss
  1129 000004E3 1F                      	pop ds
  1130                                  
  1131 000004E4 BF[0000]                reloc	mov di, relocateddata
  1132                                  linkdatarelocation line_out
  1133                                  
  1134 000004E7 BE[1F06]                reloc	mov si, msg.dpb.1
  1135                                  internaldatarelocation
  1136 000004EA E8FB01                  	extcallcall copy_single_counted_string
  1137                                  
  1138 000004ED E80002                  	extcallcall hexbyte		; unit
  1139                                  
  1140 000004F0 BE[3006]                reloc	mov si, msg.dpb.2
  1141                                  internaldatarelocation
  1142 000004F3 E8F201                  	extcallcall copy_single_counted_string
  1143                                  
  1144 000004F6 A1[6E06]                reloc	mov ax, word [dpbsegment]
  1145                                  internaldatarelocation
  1146 000004F9 E80C02                  	extcallcall hexword		; segment
  1147                                  
  1148 000004FC B8683A                  	mov ax, "h:"
  1149 000004FF AB                      	stosw
  1150                                  
  1151 00000500 58                      	pop ax
  1152 00000501 E80402                  	extcallcall hexword		; offset
  1153                                  
  1154 00000504 BE[3606]                reloc	mov si, msg.dpb.3
  1155                                  internaldatarelocation
  1156 00000507 E8DE01                  	extcallcall copy_single_counted_string
  1157                                  
  1158 0000050A 58                      	pop ax				; drive
  1159 0000050B 0441                    	add al, 'A'
  1160 0000050D B43A                    	mov ah, ':'
  1161 0000050F AB                      	stosw
  1162                                  
  1163 00000510 E8FD01                  	extcallcall putsline_crlf
  1164 00000513 58                      	pop ax
  1165 00000514 5F                      	pop di
  1166 00000515 EB02                    	jmp .nextunit
  1167                                  
  1168                                  .common_j:
  1169 00000517 EB38                    	jmp .common
  1170                                  
  1171                                  .nextunit:
  1172 00000519 16                      	push ss
  1173 0000051A 1F                      	pop ds
  1174 0000051B FF0E[7006]              reloc	dec word [unitsamount]
  1175                                  internaldatarelocation
  1176 0000051F 40                      	inc ax
  1177 00000520 BB[6A06]                reloc	mov bx, firstdpb
  1178                                  internaldatarelocation
  1179 00000523 E82701                  	call ldsbxbx_dx
  1180 00000526 EB90                    	jmp .finddpb
  1181                                  
  1182                                  .nextdpb:
  1183 00000528 8D5906                  	lea bx, [bx + di - 12h + 18h]	; 18h v3, 19h v4+
  1184 0000052B E81F01                  	call ldsbxbx_dx
  1185 0000052E EB8F                    	jmp .loopdpb
  1186                                  
  1187                                  .nodpb:
  1188 00000530 57                      	push di
  1189 00000531 16                      	push ss
  1190 00000532 07                      	pop es
  1191 00000533 16                      	push ss
  1192 00000534 1F                      	pop ds
  1193                                  
  1194 00000535 BF[0000]                reloc	mov di, relocateddata
  1195                                  linkdatarelocation line_out
  1196                                  
  1197 00000538 BE[1F06]                reloc	mov si, msg.nodpb.1
  1198                                  internaldatarelocation
  1199 0000053B E8AA01                  	extcallcall copy_single_counted_string
  1200                                  
  1201 0000053E E8AF01                  	extcallcall hexbyte
  1202                                  
  1203 00000541 BE[4206]                reloc	mov si, msg.nodpb.2
  1204                                  internaldatarelocation
  1205 00000544 E8A101                  	extcallcall copy_single_counted_string
  1206                                  
  1207 00000547 50                      	push ax
  1208 00000548 E8C501                  	extcallcall putsline_crlf
  1209 0000054B 58                      	pop ax
  1210 0000054C 5F                      	pop di
  1211 0000054D EBCA                    	jmp .nextunit
  1212                                  
  1213                                  
  1214                                  .next:
  1215 0000054F 52                      	push dx
  1216 00000550 53                      	push bx
  1217                                  .common:
  1218 00000551 16                      	 push ss
  1219 00000552 1F                      	 pop ds
  1220 00000553 FF0E[7606]              reloc	dec word [devicesamount]
  1221                                  internaldatarelocation
  1222 00000557 5B                      	pop bx
  1223 00000558 5A                      	pop dx
  1224 00000559 740B                    	jz .done
  1225 0000055B E8F800                  	call setds2dx
  1226 0000055E E8EC00                  	call ldsbxbx_dx
  1227 00000561 16                      	push ss
  1228 00000562 1F                      	pop ds
  1229 00000563 E945FE                  	jmp .loop
  1230                                  
  1231                                  .no_device_driver:
  1232                                  .done:
  1233 00000566 16                      	push ss
  1234 00000567 1F                      	pop ds
  1235                                  
  1236                                  display_interrupts:
  1237 00000568 D006[7D06]              reloc	rol byte [verbose_int], 1
  1238                                  internaldatarelocation
  1239 0000056C 7203E98800              	jnc .done
  1240                                  
  1241 00000571 8A26[8206]              reloc	mov ah, byte [mpx]
  1242                                  internaldatarelocation
  1243 00000575 B004                    	mov al, 04h
  1244 00000577 B32D                    	mov bl, 2Dh
  1245 00000579 E85401                  	extcallcall call_int2D		; determine chained interrupts
  1246                                  
  1247                                  %if 0
  1248                                  void display_interrupts(int mpx_number)
  1249                                  {
  1250                                    union REGS regs;
  1251                                    uint8_t far * list;
  1252                                    int interrupt = 0, ii = 0;
  1253                                    uint16_t offset;
  1254                                    const char * separator = "";
  1255                                  
  1256                                    regs.h.ah = mpx_number;
  1257                                    regs.h.al = AMIS_VECTORS;
  1258                                    regs.h.bl = 0x2D;
  1259                                    int86(0x2D,&regs,&regs);
  1260                                  %endif
  1261                                  
  1262 0000057C 3C04                    	cmp al, 04h
  1263 0000057E 7408                    	je @F
  1264                                  
  1265                                  %if 0
  1266                                    if (regs.h.al == AMIS_CHAIN_HOOKLIST)
  1267                                    {
  1268                                  %endif
  1269                                  
  1270 00000580 BA[5705]                reloc	mov dx, msg.no_int_list
  1271                                  internaldatarelocation
  1272 00000583 E80201                  	extcallcall putsz
  1273 00000586 EB71                    	jmp .display_interrupts_done
  1274                                  
  1275                                  %if 0
  1276                                    }
  1277                                    printf(" chained interrupts cannot be determined\n");
  1278                                    return;
  1279                                  }
  1280                                  %endif
  1281                                  
  1282                                  @@:
  1283 00000588 8916[7206]              reloc	mov word [saved], dx
  1284                                  internaldatarelocation
  1285                                  
  1286 0000058C BA[4105]                reloc	mov dx, msg.int_list
  1287                                  internaldatarelocation
  1288 0000058F E8F600                  	extcallcall putsz
  1289                                  
  1290                                  %if 0
  1291                                      printf(" chained interrupts: ");
  1292                                      list = MK_FP(regs.x.dx,regs.x.bx);
  1293                                  %endif
  1294                                  
  1295 00000592 C706[7406][A105]        reloc2	mov word [message_separator], msg.empty
  1296                                  internaldatarelocation -4
  1297                                  internaldatarelocation
  1298 00000598 31D2                    	xor dx, dx
  1299 0000059A BF[0000]                reloc	mov di, relocateddata
  1300                                  linkdatarelocation line_out
  1301                                  
  1302                                  .int_loop:
  1303                                  
  1304 0000059D 8B36[7406]              reloc	mov si, word [message_separator]
  1305                                  internaldatarelocation
  1306 000005A1 E84401                  	extcallcall copy_single_counted_string
  1307                                  
  1308 000005A4 E87B00                  	call get_saved_es
  1309 000005A7 268A37                  	mov dh, byte [es:bx]
  1310 000005AA 88F0                    	mov al, dh
  1311 000005AC 16                      	push ss
  1312 000005AD 07                      	pop es
  1313 000005AE E83F01                  	extcallcall hexbyte
  1314                                  
  1315 000005B1 BE[8205]                reloc	mov si, msg.int.1
  1316                                  internaldatarelocation
  1317 000005B4 E83101                  	extcallcall copy_single_counted_string
  1318                                  
  1319 000005B7 A1[7206]                reloc	mov ax, word [saved]
  1320                                  internaldatarelocation
  1321 000005BA E84B01                  	extcallcall hexword
  1322                                  
  1323 000005BD B8683A                  	mov ax, "h:"
  1324 000005C0 AB                      	stosw
  1325                                  
  1326 000005C1 E85E00                  	call get_saved_es
  1327 000005C4 43                      	inc bx
  1328 000005C5 268B07                  	mov ax, word [es:bx]
  1329 000005C8 43                      	inc bx
  1330 000005C9 43                      	inc bx
  1331 000005CA 16                      	push ss
  1332 000005CB 07                      	pop es
  1333 000005CC E83901                  	extcallcall hexword
  1334                                  
  1335 000005CF B068                    	mov al, 'h'
  1336 000005D1 AA                      	stosb
  1337                                  
  1338                                  %if 0
  1339                                        interrupt = *list++;
  1340                                        offset = *list++;
  1341                                        offset |= *list++ * 0x100;
  1342                                        printf("%s%02Xh at %04Xh:%04Xh",
  1343                                                separator, interrupt, regs.x.dx, offset);
  1344                                  %endif
  1345                                  
  1346 000005D2 B8[8805]                reloc	mov ax, msg.separator_comma
  1347                                  internaldatarelocation
  1348 000005D5 42                      	inc dx
  1349                                  
  1350                                  %if 0
  1351                                        ++ ii;
  1352                                  %endif
  1353                                  
  1354 000005D6 80FA03                  	cmp dl, 3
  1355 000005D9 720F                    	jb @F
  1356 000005DB 53                      	push bx
  1357 000005DC 52                      	push dx
  1358 000005DD E83001                  	extcallcall putsline_crlf
  1359 000005E0 5A                      	pop dx
  1360 000005E1 5B                      	pop bx
  1361 000005E2 BF[0000]                reloc	mov di, relocateddata
  1362                                  linkdatarelocation line_out
  1363                                  
  1364 000005E5 B200                    	mov dl, 0
  1365 000005E7 B8[8B05]                reloc	mov ax, msg.separator_nextline
  1366                                  internaldatarelocation
  1367                                  @@:
  1368 000005EA A3[7406]                reloc	mov word [message_separator], ax
  1369                                  internaldatarelocation
  1370                                  
  1371                                  %if 0
  1372                                        if (ii % 3) {
  1373                                          separator = ", ";
  1374                                        } else {
  1375                                          separator = "\n                     ";
  1376                                                     /* " chained interrupts: " */
  1377                                        }
  1378                                  %endif
  1379                                  
  1380 000005ED 80FE2D                  	cmp dh, 2Dh
  1381 000005F0 75AB                    	jne .int_loop
  1382                                  
  1383                                  %if 0
  1384                                      while (interrupt != 0x2D) {
  1385                                  %endif
  1386                                  
  1387 000005F2 84D2                    	test dl, dl
  1388 000005F4 7403                    	jz @F
  1389 000005F6 E81701                  	extcallcall putsline_crlf
  1390                                  @@:
  1391                                  
  1392                                  %if 0
  1393                                      }
  1394                                      printf("\n");
  1395                                      return;
  1396                                  %endif
  1397                                  
  1398                                  .done:
  1399                                  .display_interrupts_done:
  1400 000005F9 E987FB                  	jmp next
  1401                                  
  1402                                  
  1403                                  handleshift:
  1404 000005FC 51                      	push cx
  1405                                  .outerloop:
  1406 000005FD 8B0F                    	mov cx, word [bx]
  1407 000005FF E31F                    	jcxz .outerdone
  1408 00000601 43                      	inc bx
  1409 00000602 43                      	inc bx
  1410                                  .loop:
  1411 00000603 89C2                    	mov dx, ax
  1412 00000605 2317                    	and dx, word [bx]
  1413 00000607 3B17                    	cmp dx, word [bx]
  1414 00000609 750E                    	jne .next
  1415 0000060B 8B5702                  	mov dx, word [bx + 2]
  1416 0000060E E87700                  	extcallcall putsz
  1417 00000611 01C9                    	add cx, cx
  1418 00000613 01C9                    	add cx, cx
  1419 00000615 01CB                    	add bx, cx
  1420 00000617 EBE4                    	jmp .outerloop
  1421                                  
  1422                                  .next:
  1423 00000619 8D5F04                  	lea bx, [bx + 4]
  1424 0000061C E2E5                    	loop .loop
  1425 0000061E EBDD                    	jmp .outerloop
  1426                                  
  1427                                  .outerdone:
  1428 00000620 59                      	pop cx
  1429 00000621 C3                      	retn
  1430                                  
  1431                                  
  1432                                  get_saved_es:
  1433 00000622 52                      	push dx
  1434 00000623 8B16[7206]              reloc	mov dx, word [saved]
  1435                                  internaldatarelocation
  1436 00000627 E8AE00                  	extcallcall setes2dx
  1437 0000062A 5A                      	pop dx
  1438 0000062B C3                      	retn
  1439                                  
  1440                                  
  1441                                  swap_es_ds:
  1442 0000062C 06                      	push es
  1443 0000062D 1E                      	push ds
  1444 0000062E 07                      	pop es
  1445 0000062F 1F                      	pop ds
  1446 00000630 C3                      	retn
  1447                                  
  1448                                  
  1449                                  doscall_dx_for_es:
  1450 00000631 E86400                  	extcallcall ispm
  1451 00000634 750E                    	jnz .rm
  1452                                  
  1453                                  subcpu 286
  1454 00000636 52                      	push dx
  1455 00000637 6A21                    	push word 21h
  1456 00000639 E8[0000]EB020000        	extcall intcall_ext_return_es, PM required	; must NOT be extcallcall
  1457 00000640 5A                      	pop dx				; discard interrupt number
  1458 00000641 5A                      	pop dx				; get es
  1459                                  subcpureset
  1460 00000642 EB06                    	jmp @F
  1461                                  .rm:
  1462 00000644 8EC2                    	mov es, dx
  1463 00000646 CD21                    	int 21h
  1464 00000648 8CC2                    	mov dx, es
  1465                                  @@:
  1466 0000064A 16                      	push ss
  1467 0000064B 07                      	pop es
  1468 0000064C C3                      	retn
  1469                                  
  1470                                  
  1471                                  ldsbxbx_dx:
  1472 0000064D 8B5702                  	mov dx, [bx + 2]
  1473 00000650 8B1F                    	mov bx, [bx]
  1474 00000652 E80100                  	call setds2dx
  1475 00000655 C3                      	retn
  1476                                  
  1477                                  
  1478                                  setds2dx:
  1479 00000656 06                      	push es
  1480 00000657 E87E00                  	extcallcall setes2dx
  1481 0000065A 06                      	 push es
  1482 0000065B 1F                      	 pop ds
  1483 0000065C 07                      	pop es
  1484 0000065D C3                      	retn
  1485                                  
  1486                                  
  1487                                  		; INP:	es:bx -> text data, maximum length cx
  1488                                  		;	cx = maximum length
  1489                                  		; OUT:	cx = pad length
  1490                                  		;	calculate maximum length - OUT:cx to get string length
  1491                                  		; CHG:	di, al
  1492                                  get_esbx_pad_length_maximum_cx:
  1493 0000065E 89DF                    	mov di, bx
  1494 00000660 B000                    	mov al, 0
  1495 00000662 F2AE                    	repne scasb		; cx = 7 if 0 text bytes, = 6 if 1 text byte
  1496 00000664 7501                    	jne @F			; if NZ, then jump and leave cx = 0 -->
  1497 00000666 41                      	inc cx			; 8 if 0, 7 if 1, 0 if 8
  1498                                  @@:
  1499 00000667 C3                      	retn
  1500                                  
  1501                                  
  1502 00000668 E8[0000]EB020000C3-     	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
  1502 00000670 E8[0000]EB020000C3-
  1502 00000678 E8[0000]EB020000C3-
  1502 00000680 E8[0000]EB020000C3-
  1502 00000688 E8[0000]EB020000C3-
  1502 00000690 E8[0000]EB020000C3-
  1502 00000698 E8[0000]EB020000C3-
  1502 000006A0 E8[0000]EB020000C3-
  1502 000006A8 E8[0000]EB020000C3-
  1502 000006B0 E8[0000]EB020000C3-
  1502 000006B8 E8[0000]EB020000C3-
  1502 000006C0 E8[0000]EB020000C3-
  1502 000006C8 E8[0000]EB020000C3-
  1502 000006D0 E8[0000]EB020000C3-
  1502 000006D8 E8[0000]EB020000C3-
  1502 000006E0 E8[0000]EB020000C3-
  1502 000006E8 E8[0000]EB020000C3-
  1502 000006F0 E8[0000]EB020000C3-
  1502 000006F8 E8[0000]EB020000C3-
  1502 00000700 E8[0000]EB020000C3-
  1502 00000708 E8[0000]EB020000C3-
  1502 00000710 E8[0000]EB020000C3-
  1502 00000718 E8[0000]EB020000C3-
  1502 00000720 E8[0000]EB020000C3 
  1503                                  
  1504                                  endinstalled equ ($ + CODEFIXUP + 15) & ~15
  1505                                  
  1506                                  
  1507                                  start:
  1508 00000728 8CC3                    	mov bx, es
  1509 0000072A 16                      	 push ss
  1510 0000072B 07                      	 pop es
  1511 0000072C E839FF                  	call skipcomma
  1512 0000072F 4E                      	dec si
  1513 00000730 BA[0000]                reloc	mov dx, relocateddata
  1514                                  linkdatarelocation msg.install
  1515 00000733 E83AFF                  	call isstring?
  1516 00000736 742C                    	je install
  1517 00000738 E89EF9                  	call run
  1518 0000073B E80300                  	call uninstall_oneshot
  1519 0000073E 31C0                    	xor ax, ax
  1520 00000740 CB                      	retf
  1521                                  
  1522                                  
  1523                                  uninstall_oneshot:
  1524 00000741 36F606[0000]01          reloc	testopt [ss:relocateddata], 1
  1525                                  linkdatarelocation options7, -3
  1526 00000747 751A                    	jnz @F
  1527                                  
  1528 00000749 2EA1[0200]              reloc	mov ax, word [cs:code + eldiEndCode]
  1529                                  internalcoderelocation
  1530 0000074D 2E2B06[0000]            reloc	sub ax, word [cs:code + eldiStartCode]
  1531                                  internalcoderelocation
  1532 00000752 2906[0000]              reloc	sub word [relocateddata], ax
  1533                                  linkdatarelocation extseg_used
  1534                                  
  1535 00000756 2EA1[0600]              reloc	mov ax, word [cs:code + eldiEndData]
  1536                                  internalcoderelocation
  1537 0000075A 2E2B06[0400]            reloc	sub ax, word [cs:code + eldiStartData]
  1538                                  internalcoderelocation
  1539 0000075F 2906[0000]              reloc	sub word [relocateddata], ax
  1540                                  linkdatarelocation extdata_used
  1541                                  @@:
  1542 00000763 C3                      	retn
  1543                                  
  1544                                  
  1545                                  install:
  1546 00000764 AC                      	lodsb
  1547 00000765 E8[0000]EB020000        	extcall chkeol
  1548                                  
  1549                                  	houdini
  1550 0000076C 8EC3                    	mov es, bx		; => ext seg (writable)
  1551 0000076E B88000                  	mov ax, endresident - endinstalled
  1552 00000771 262906[0200]            reloc	sub word [es:code + eldiEndCode], ax
  1553                                  internalcoderelocation		; adjust size
  1554 00000776 2906[0000]              reloc	sub word [relocateddata], ax
  1555                                  linkdatarelocation extseg_used	; adjust size
  1556 0000077A 8B1E[0000]              reloc	mov bx, word [relocateddata]
  1557                                  linkdatarelocation ext_command_handler
  1558                                  				; -> prior
  1559 0000077E BF[2000]                reloc	mov di, command		; -> our handler
  1560                                  internalcoderelocation
  1561 00000781 85DB                    	test bx, bx		; installing as first ?
  1562 00000783 740A                    	jz .only_first		; yes, simple --> (leave as extcall cmd3_not_ext)
  1563 00000785 AF                      	scasw			; skip entrypoint jmp strict short
  1564 00000786 B0E9                    	mov al, 0E9h		; = jmp near opcode
  1565 00000788 AA                      	stosb			; store
  1566 00000789 93                      	xchg ax, bx		; ax -> next handler
  1567 0000078A 29F8                    	sub ax, di
  1568 0000078C 48                      	dec ax
  1569 0000078D 48                      	dec ax			; ax = ax - (di + 2)
  1570 0000078E AB                      	stosw			; store our downlink as rel16 displacement
  1571                                  
  1572                                  .only_first:
  1573 0000078F 26800E[1000]01          reloc	setopt [es:code + eldiFlags], eldifResident
  1574                                  internalcoderelocation -3	; mark block as resident
  1575 00000795 C706[0000][2000]        reloc2	mov word [relocateddata], command
  1576                                  linkdatarelocation ext_command_handler, -4
  1577                                  internalcoderelocation		; -> our entrypoint
  1578                                  
  1579 0000079B F606[0000]04            reloc	testopt [relocateddata], 4
  1580                                  linkdatarelocation options7, -3
  1581 000007A0 7506                    	jnz @F
  1582 000007A2 BA[6906]                reloc	mov dx, msg.installed
  1583                                  internaldatarelocation
  1584 000007A5 E8E0FE                  	call putsz
  1585                                  @@:
  1586 000007A8 31C0                    	xor ax, ax
  1587 000007AA CB                      	retf
  1588                                  
  1589                                  
  1590                                  DATAOFFSET equ CODEOFFSET + code_size
  1591                                  	addsection DATA, follows=CODE vstart=_ELD_DATA_VSTART
  1592                                  %define DATAFIXUP - datastart + 0
  1593                                  datastart:
  1594                                  PUT_ELD_DATETIME
  1595                                  
  1596                                  	align 4, db 0
  1597                                  keywordtable:
  1598 00000000 [4F03]                  reloc	dw msg.mpx
  1599                                  internaldatarelocation
  1600 00000002 [7B06]                  reloc	dw verbose_mpx
  1601                                  internaldatarelocation
  1602                                  
  1603 00000004 [5F03]                  reloc	dw msg.version
  1604                                  internaldatarelocation
  1605 00000006 [7B06]                  reloc	dw verbose_mpx
  1606                                  internaldatarelocation
  1607                                  
  1608 00000008 [6703]                  reloc	dw msg.entry
  1609                                  internaldatarelocation
  1610 0000000A [7B06]                  reloc	dw verbose_mpx
  1611                                  internaldatarelocation
  1612                                  
  1613 0000000C [5303]                  reloc	dw msg.hotkeys
  1614                                  internaldatarelocation
  1615 0000000E [7C06]                  reloc	dw verbose_hotkeys
  1616                                  internaldatarelocation
  1617                                  
  1618 00000010 [6D03]                  reloc	dw msg.keys
  1619                                  internaldatarelocation
  1620 00000012 [7C06]                  reloc	dw verbose_hotkeys
  1621                                  internaldatarelocation
  1622                                  
  1623 00000014 [5B03]                  reloc	dw msg.int
  1624                                  internaldatarelocation
  1625 00000016 [7D06]                  reloc	dw verbose_int
  1626                                  internaldatarelocation
  1627                                  
  1628 00000018 [7203]                  reloc	dw msg.intlist
  1629                                  internaldatarelocation
  1630 0000001A [7D06]                  reloc	dw verbose_int
  1631                                  internaldatarelocation
  1632                                  
  1633 0000001C [7A03]                  reloc	dw msg.interrupts
  1634                                  internaldatarelocation
  1635 0000001E [7D06]                  reloc	dw verbose_int
  1636                                  internaldatarelocation
  1637                                  
  1638 00000020 [8503]                  reloc	dw msg.dev
  1639                                  internaldatarelocation
  1640 00000022 [8006]                  reloc	dw verbose_device
  1641                                  internaldatarelocation
  1642                                  
  1643 00000024 [8903]                  reloc	dw msg.device
  1644                                  internaldatarelocation
  1645 00000026 [8006]                  reloc	dw verbose_device
  1646                                  internaldatarelocation
  1647                                  
  1648 00000028 [9003]                  reloc	dw msg.block
  1649                                  internaldatarelocation
  1650 0000002A [7E06]                  reloc	dw verbose_block
  1651                                  internaldatarelocation
  1652                                  
  1653 0000002C [9603]                  reloc	dw msg.char
  1654                                  internaldatarelocation
  1655 0000002E [7F06]                  reloc	dw verbose_char
  1656                                  internaldatarelocation
  1657                                  
  1658 00000030 [9B03]                  reloc	dw msg.dpb
  1659                                  internaldatarelocation
  1660 00000032 [8106]                  reloc	dw verbose_dpb
  1661                                  internaldatarelocation
  1662                                  
  1663 00000034 0000                    	dw 0
  1664                                  
  1665                                  
  1666                                  %define MESSAGES db ""
  1667                                  
  1668                                  %imacro shiftentry 2.nolist
  1669                                  	dw %1
  1670                                  reloc	dw %%message
  1671                                  internaldatarelocation
  1672                                  
  1673                                  %xdefine MESSAGES MESSAGES, %%message:, {asciz %2}
  1674                                  %endmacro
  1675                                  
  1676                                  %imacro dumpmessages 1-*.nolist
  1677                                   %rep %0
  1678                                  	%1
  1679                                    %rotate 1
  1680                                   %endrep
  1681                                  %endmacro
  1682                                  
  1683                                  
  1684                                  	align 2, db 0
  1685                                  shifttable1:
  1686 00000036 0400                    	dw 4
  1687 00000038 0400[4C01]              	shiftentry HK_ANYCTRL, "Ctrl-"
  1688 0000003C 0005[5201]              	shiftentry HK_BOTHCTRL, "Ctrl-Ctrl-"
  1689 00000040 0001[5D01]              	shiftentry HK_LCTRL, "LCtrl-"
  1690 00000044 0004[6401]              	shiftentry HK_RCTRL, "RCtrl-"
  1691                                  
  1692 00000048 0400                    	dw 4
  1693 0000004A 8000[6B01]              	shiftentry HK_ANYSHIFT, "Shift-"
  1694 0000004E 0300[7201]              	shiftentry HK_BOTHSHIFT, "Shift-Shift-"
  1695 00000052 0200[7F01]              	shiftentry HK_LSHIFT, "LShift-"
  1696 00000056 0100[8701]              	shiftentry HK_RSHIFT, "RShift-"
  1697                                  
  1698 0000005A 0400                    	dw 4
  1699 0000005C 0800[8F01]              	shiftentry HK_ANYALT, "Alt-"
  1700 00000060 000A[9401]              	shiftentry HK_BOTHALT, "Alt-Alt-"
  1701 00000064 0002[9D01]              	shiftentry HK_LALT, "LAlt-"
  1702 00000068 0008[A301]              	shiftentry HK_RALT, "RAlt-"
  1703                                  
  1704 0000006C 0100                    	dw 1
  1705 0000006E 0010[A901]              	shiftentry HK_SCROLLOCK, "ScrlLk-"
  1706 00000072 0100                    	dw 1
  1707 00000074 0020[B101]              	shiftentry HK_NUMLOCK, "NumLk-"
  1708 00000078 0100                    	dw 1
  1709 0000007A 0040[B801]              	shiftentry HK_CAPSLOCK, "CapsLk-"
  1710 0000007E 0100                    	dw 1
  1711 00000080 0080[C001]              	shiftentry HK_SYSREQ, "SysRq-"
  1712                                  
  1713 00000084 0000                    	dw 0
  1714                                  
  1715                                  	align 2, db 0
  1716                                  shifttable2:
  1717 00000086 0100                    	dw 1
  1718 00000088 1000[C701]              	shiftentry HK_SCRLLOCK_ON, " (ScrlLk on)"
  1719 0000008C 0100                    	dw 1
  1720 0000008E 2000[D401]              	shiftentry HK_NUMLOCK_ON, " (NumLk on)"
  1721 00000092 0100                    	dw 1
  1722 00000094 4000[E001]              	shiftentry HK_CAPSLOCK_ON, " (CapsLk on)"
  1723                                  
  1724 00000098 0000                    	dw 0
  1725                                  
  1726                                  
  1727                                  %imacro scancodeentry 1.nolist
  1728                                  %ifidni %1, 0
  1729                                  	dw 0
  1730                                  %else
  1731                                  reloc	dw %%message
  1732                                  internaldatarelocation
  1733                                  
  1734                                  %xdefine MESSAGES MESSAGES, %%message:, {asciz %1}
  1735                                  %endif
  1736                                  %endmacro
  1737                                  
  1738                                  	align 2, db 0
  1739                                  scancodes:
  1740                                  .:
  1741 0000009A [ED01]                      scancodeentry "nokey"	;/* scan code 0 is "no key" */
  1742 0000009C [F301]                      scancodeentry "Esc"
  1743 0000009E [F701]                      scancodeentry "1"		;/* scan code 2 */
  1744 000000A0 [F901]                      scancodeentry "2"
  1745 000000A2 [FB01]                      scancodeentry "3"		;/* scan code 4 */
  1746 000000A4 [FD01]                      scancodeentry "4"
  1747 000000A6 [FF01]                      scancodeentry "5"		;/* scan code 6 */
  1748 000000A8 [0102]                      scancodeentry "6"
  1749 000000AA [0302]                      scancodeentry "7"		;/* scan code 8 */
  1750 000000AC [0502]                      scancodeentry "8"
  1751 000000AE [0702]                      scancodeentry "9"		;/* scan code 10 */
  1752 000000B0 [0902]                      scancodeentry "0"
  1753 000000B2 [0B02]                      scancodeentry "-"		;/* scan code 12 */
  1754 000000B4 [0D02]                      scancodeentry "="
  1755 000000B6 [0F02]                      scancodeentry "Backsp"	;/* scan code 14 */
  1756 000000B8 [1602]                      scancodeentry "Tab"
  1757 000000BA [1A02]                      scancodeentry "Q"
  1758 000000BC [1C02]                      scancodeentry "W"
  1759 000000BE [1E02]                      scancodeentry "E"
  1760 000000C0 [2002]                      scancodeentry "R"
  1761 000000C2 [2202]                      scancodeentry "T"
  1762 000000C4 [2402]                      scancodeentry "Y"
  1763 000000C6 [2602]                      scancodeentry "U"
  1764 000000C8 [2802]                      scancodeentry "I"
  1765 000000CA [2A02]                      scancodeentry "O"
  1766 000000CC [2C02]                      scancodeentry "P"		;/* scan code 25 */
  1767 000000CE [2E02]                      scancodeentry "["
  1768 000000D0 [3002]                      scancodeentry "]"
  1769 000000D2 [3202]                      scancodeentry "Enter"
  1770 000000D4 [3802]                      scancodeentry "Ctrl"
  1771 000000D6 [3D02]                      scancodeentry "A"
  1772 000000D8 [3F02]                      scancodeentry "S"
  1773 000000DA [4102]                      scancodeentry "D"
  1774 000000DC [4302]                      scancodeentry "F"
  1775 000000DE [4502]                      scancodeentry "G"
  1776 000000E0 [4702]                      scancodeentry "H"
  1777 000000E2 [4902]                      scancodeentry "J"
  1778 000000E4 [4B02]                      scancodeentry "K"
  1779 000000E6 [4D02]                      scancodeentry "L"
  1780 000000E8 [4F02]                      scancodeentry ";"
  1781 000000EA [5102]                      scancodeentry "'"		;/* scan code 40 */
  1782 000000EC [5302]                      scancodeentry "`"
  1783 000000EE [5502]                      scancodeentry "LShift"
  1784 000000F0 [5C02]                      scancodeentry "\"
  1785 000000F2 [5E02]                      scancodeentry "Z"
  1786 000000F4 [6002]                      scancodeentry "X"
  1787 000000F6 [6202]                      scancodeentry "C"
  1788 000000F8 [6402]                      scancodeentry "V"
  1789 000000FA [6602]                      scancodeentry "B"
  1790 000000FC [6802]                      scancodeentry "N"
  1791 000000FE [6A02]                      scancodeentry "M"
  1792 00000100 [6C02]                      scancodeentry ","
  1793 00000102 [6E02]                      scancodeentry "."
  1794 00000104 [7002]                      scancodeentry "/"		;/* scan code 53 */
  1795 00000106 [7202]                      scancodeentry "RShift"
  1796 00000108 [7902]                      scancodeentry "*"
  1797 0000010A [7B02]                      scancodeentry "Alt"
  1798 0000010C [7F02]                      scancodeentry "Space"
  1799 0000010E [8502]                      scancodeentry "CapsLk"
  1800 00000110 [8C02]                      scancodeentry "F1"
  1801 00000112 [8F02]                      scancodeentry "F2"
  1802 00000114 [9202]                      scancodeentry "F3"
  1803 00000116 [9502]                      scancodeentry "F4"
  1804 00000118 [9802]                      scancodeentry "F5"
  1805 0000011A [9B02]                      scancodeentry "F6"		;/* scan code 64 */
  1806 0000011C [9E02]                      scancodeentry "F7"
  1807 0000011E [A102]                      scancodeentry "F8"
  1808 00000120 [A402]                      scancodeentry "F9"
  1809 00000122 [A702]                      scancodeentry "F10"
  1810 00000124 [AB02]                      scancodeentry "NumLk"
  1811 00000126 [B102]                      scancodeentry "ScrlLk"
  1812 00000128 [B802]                      scancodeentry "Home"
  1813 0000012A [BD02]                      scancodeentry "Up"
  1814 0000012C [C002]                      scancodeentry "PgUp"	;/* scan code 73 */
  1815 0000012E [C502]                      scancodeentry "Grey-"
  1816 00000130 [CB02]                      scancodeentry "Left"
  1817 00000132 [D002]                      scancodeentry "KP5"
  1818 00000134 [D402]                      scancodeentry "Right"
  1819 00000136 [DA02]                      scancodeentry "Grey+"
  1820 00000138 [E002]                      scancodeentry "End"
  1821 0000013A [E402]                      scancodeentry "Down"
  1822 0000013C [E902]                      scancodeentry "PgDn"	;/* scan code 81 */
  1823 0000013E [EE02]                      scancodeentry "Ins"
  1824 00000140 [F202]                      scancodeentry "Del"
  1825 00000142 [F602]                      scancodeentry "SysRq"
  1826 00000144 0000                        scancodeentry 0
  1827 00000146 0000                        scancodeentry 0
  1828 00000148 [FC02]                      scancodeentry "F11"		;/* scan code 87 */
  1829 0000014A [0003]                      scancodeentry "F12"
  1830                                  .end:
  1831                                  .amount equ (.end - .) / 2
  1832                                  
  1833                                  
  1834 0000014C 4374726C2D00437472-     dumpmessages MESSAGES
  1834 00000155 6C2D4374726C2D004C-
  1834 0000015E 4374726C2D00524374-
  1834 00000167 726C2D005368696674-
  1834 00000170 2D0053686966742D53-
  1834 00000179 686966742D004C5368-
  1834 00000182 6966742D0052536869-
  1834 0000018B 66742D00416C742D00-
  1834 00000194 416C742D416C742D00-
  1834 0000019D 4C416C742D0052416C-
  1834 000001A6 742D005363726C4C6B-
  1834 000001AF 2D004E756D4C6B2D00-
  1834 000001B8 436170734C6B2D0053-
  1834 000001C1 797352712D00202853-
  1834 000001CA 63726C4C6B206F6E29-
  1834 000001D3 0020284E756D4C6B20-
  1834 000001DC 6F6E29002028436170-
  1834 000001E5 734C6B206F6E29006E-
  1834 000001EE 6F6B65790045736300-
  1834 000001F7 310032003300340035-
  1834 00000200 003600370038003900-
  1834 00000209 30002D003D00426163-
  1834 00000212 6B7370005461620051-
  1834 0000021B 005700450052005400-
  1834 00000224 5900550049004F0050-
  1834 0000022D 005B005D00456E7465-
  1834 00000236 72004374726C004100-
  1834 0000023F 530044004600470048-
  1834 00000248 004A004B004C003B00-
  1834 00000251 270060004C53686966-
  1834 0000025A 74005C005A00580043-
  1834 00000263 00560042004E004D00-
  1834 0000026C 2C002E002F00525368-
  1834 00000275 696674002A00416C74-
  1834 0000027E 005370616365004361-
  1834 00000287 70734C6B0046310046-
  1834 00000290 320046330046340046-
  1834 00000299 350046360046370046-
  1834 000002A2 380046390046313000-
  1834 000002AB 4E756D4C6B00536372-
  1834 000002B4 6C4C6B00486F6D6500-
  1834 000002BD 557000506755700047-
  1834 000002C6 7265792D004C656674-
  1834 000002CF 004B50350052696768-
  1834 000002D8 7400477265792B0045-
  1834 000002E1 6E6400446F776E0050-
  1834 000002EA 67446E00496E730044-
  1834 000002F3 656C00537973527100-
  1834 000002FC 4631310046313200   
  1835                                  
  1836                                  
  1837                                  msg:
  1838 00000304 414D495453525300        .amitsrs:		asciz "AMITSRS"
  1839 0000030C 414D49545352532075-     .uninstall_done:	db "AMITSRS uninstalled."
  1839 00000315 6E696E7374616C6C65-
  1839 0000031E 642E               
  1840                                  %if _ELD_RECLAIM_HINT
  1841                                  			db " (Don't forget to use reclaim.eld)"
  1842                                  %endif
  1843 00000320 0D0A00                  			asciz 13,10
  1844 00000323 414D49545352532075-     .uninstall_error:	asciz "AMITSRS unable to uninstall!",13,10
  1844 0000032C 6E61626C6520746F20-
  1844 00000335 756E696E7374616C6C-
  1844 0000033E 210D0A00           
  1845 00000342 4F4E4C5900              .only:			asciz "ONLY"
  1846 00000347 564552424F534500        .verbose:		asciz "VERBOSE"
  1847 0000034F 4D505800                .mpx:			asciz "MPX"
  1848 00000353 484F544B45595300        .hotkeys:		asciz "HOTKEYS"
  1849 0000035B 494E5400                .int:			asciz "INT"
  1850 0000035F 56455253494F4E00        .version:		asciz "VERSION"
  1851 00000367 454E54525900            .entry:			asciz "ENTRY"
  1852 0000036D 4B45595300              .keys:			asciz "KEYS"
  1853 00000372 494E544C49535400        .intlist:		asciz "INTLIST"
  1854 0000037A 494E54455252555054-     .interrupts:		asciz "INTERRUPTS"
  1854 00000383 5300               
  1855 00000385 44455600                .dev:			asciz "DEV"
  1856 00000389 44455649434500          .device:		asciz "DEVICE"
  1857 00000390 424C4F434B00            .block:			asciz "BLOCK"
  1858 00000396 4348415200              .char:			asciz "CHAR"
  1859 0000039B 44504200                .dpb:			asciz "DPB"
  1860 0000039F 4E6F2076616C696420-     .no2D:			asciz "No valid interrupt 2Dh handler!",13,10
  1860 000003A8 696E74657272757074-
  1860 000003B1 203244682068616E64-
  1860 000003BA 6C6572210D0A00     
  1861                                  .banner:
  1862 000003C1 4D616E756661637420-     	db "Manufact  Product",9,9,"Description",13,10
  1862 000003CA 2050726F6475637409-
  1862 000003D3 094465736372697074-
  1862 000003DC 696F6E0D0A         
  1863 000003E1 2D2D2D2D2D2D2D2D20-     	db "-------- -------- ----------------------------------------------",13,10
  1863 000003EA 2D2D2D2D2D2D2D2D20-
  1863 000003F3 2D2D2D2D2D2D2D2D2D-
  1863 000003FC 2D2D2D2D2D2D2D2D2D-
  1863 00000405 2D2D2D2D2D2D2D2D2D-
  1863 0000040E 2D2D2D2D2D2D2D2D2D-
  1863 00000417 2D2D2D2D2D2D2D2D2D-
  1863 00000420 2D0D0A             
  1864 00000423 00                      	asciz
  1865 00000424 4D617463686564206E-     .notsrs:	asciz "Matched no TSRs using the alternate multiplex interrupt",13,10
  1865 0000042D 6F2054535273207573-
  1865 00000436 696E67207468652061-
  1865 0000043F 6C7465726E61746520-
  1865 00000448 6D756C7469706C6578-
  1865 00000451 20696E746572727570-
  1865 0000045A 740D0A00           
  1866 0000045E 0B206D756C7469706C-     .mpx.1:		counted " multiplex "
  1866 00000467 657820             
  1867 0000046A 0D6820202020766572-     .mpx.2:		counted "h    version "
  1867 00000473 73696F6E20         
  1868 00000478 0F202020656E747279-     .mpx.3.yes:	counted "   entry point "
  1868 00000481 20706F696E7420     
  1869 00000488 192020206E6F207072-     .mpx.3.no:	counted "   no private entry point"
  1869 00000491 697661746520656E74-
  1869 0000049A 727920706F696E74   
  1870 000004A2 0A2070726F76696465-     .dev.1:		counted " provides "
  1870 000004AB 7320               
  1871 000004AD 162064657669636520-     .dev.2.singular:counted " device header, flags="
  1871 000004B6 6865616465722C2066-
  1871 000004BF 6C6167733D         
  1872 000004C4 172064657669636520-     .dev.2.plural:	counted " device headers, flags="
  1872 000004CD 686561646572732C20-
  1872 000004D6 666C6167733D       
  1873 000004DC 0C682C206669727374-     .dev.3:		counted "h, first at "
  1873 000004E5 20617420           
  1874 000004E9 20<rep 12h>             .no_hotkeys:		times 18 db 32
  1875 000004FB 6E6F20686F746B6579-     			asciz "no hotkeys",13,10
  1875 00000504 730D0A00           
  1876 00000508 0C20686F746B657973-     .hotkeys.plural:	counted " hotkeys on "
  1876 00000511 206F6E20           
  1877 00000515 0B20686F746B657920-     .hotkeys.singular:	counted " hotkey on "
  1877 0000051E 6F6E20             
  1878 00000521 09494E542030394820-     .hotkeys.int09:		counted "INT 09H  "
  1878 0000052A 20                 
  1879 0000052B 09494E542031354820-     .hotkeys.int15:		counted "INT 15H  "
  1879 00000534 20                 
  1880 00000535 0B756E6B6E6F776E6B-     .unknownkey:		counted "unknownkey="
  1880 0000053E 65793D             
  1881 00000541 20636861696E656420-     .int_list:	asciz " chained interrupts: "
  1881 0000054A 696E74657272757074-
  1881 00000553 733A2000           
  1882 00000557 20636861696E656420-     .no_int_list:	asciz " chained interrupts cannot be determined",13,10
  1882 00000560 696E74657272757074-
  1882 00000569 732063616E6E6F7420-
  1882 00000572 62652064657465726D-
  1882 0000057B 696E65640D0A00     
  1883 00000582 056820617420            .int.1:			counted "h at "
  1884 00000588 022C20                  .separator_comma:	counted ", "
  1885 0000058B 152020202020202020-     .separator_nextline:	counted "                     "
  1885 00000594 202020202020202020-
  1885 0000059D 20202020           
  1886 000005A1 00                      .empty:			db 0
  1887 000005A2 1568202D3E20626C6F-     .eachdev.1.block:	counted "h -> block dev, attr="
  1887 000005AB 636B206465762C2061-
  1887 000005B4 7474723D           
  1888 000005B8 1468202D3E20636861-     .eachdev.1.char:	counted "h -> char dev, attr="
  1888 000005C1 72206465762C206174-
  1888 000005CA 74723D             
  1889 000005CD 09682C207374726174-     .eachdev.2:		counted "h, strat="
  1889 000005D6 3D                 
  1890 000005D7 07682C20696E743D        .eachdev.3:		counted "h, int="
  1891 000005DF 03682C20                .eachdev.4.block:	counted "h, "
  1892 000005E3 04682C2022              .eachdev.4.char:	counted "h, ",'"'
  1893                                  .eachdev.5.block.singular:
  1894 000005E8 0520756E6974            			counted " unit"
  1895                                  .eachdev.5.block.plural:
  1896 000005EE 0620756E697473          			counted " units"
  1897 000005F5 2020496E76616C6964-     .invaliddevice:		asciz "  Invalid device driver header address!",13,10
  1897 000005FE 206465766963652064-
  1897 00000607 726976657220686561-
  1897 00000610 646572206164647265-
  1897 00000619 7373210D0A00       
  1898                                  .nodpb.1:
  1899 0000061F 102020204450422066-     .dpb.1:			counted "   DPB for unit "
  1899 00000628 6F7220756E697420   
  1900 00000630 056820617420            .dpb.2:			counted "h at "
  1901 00000636 0B68202D3E20647269-     .dpb.3:			counted "h -> drive "
  1901 0000063F 766520             
  1902 00000642 0C68206E6F7420666F-     .nodpb.2:		counted "h not found!"
  1902 0000064B 756E6421           
  1903 0000064F 20<rep 16h>             .22blanks:		times 22 db 32
  1904 00000665 00                      			asciz
  1905 00000666 0D0A00                  .linebreak:		asciz 13,10
  1906                                  
  1907                                  uinit_data: equ $
  1908 00000669 414D49545352532069-     .installed:		asciz "AMITSRS installed.",13,10
  1908 00000672 6E7374616C6C65642E-
  1908 0000067B 0D0A00             
  1909                                  
  1910 0000067E 00<rep 2h>              	align 16, db 0
  1911                                  transient_data_size equ $ - datastart
  1912                                  data_size equ $ - datastart
  1913                                  
  1914                                  	absolute uinit_data
  1915                                  
  1916 00000669 ??                      	alignb 2
  1917 0000066A ????????                firstdpb:		resd 1
  1918 0000066E ????                    dpbsegment:		resw 1
  1919 00000670 ????                    unitsamount:		resw 1
  1920 00000672 ????                    saved:			resw 1
  1921 00000674 ????                    message_separator:	resw 1
  1922 00000676 ????                    devicesamount:		resw 1
  1923 00000678 ??                      mpx_from:		resb 1
  1924 00000679 ??                      mpx_to:			resb 1	; must be directly after mpx_from
  1925 0000067A ??                      did_banner:		resb 1
  1926 0000067B ??                      verbose_mpx:		resb 1	; must be directly after did_banner {1}
  1927 0000067C ??                      verbose_hotkeys:	resb 1
  1928 0000067D ??                      verbose_int:		resb 1	; must be directly after verbose_hotkeys {2}
  1929 0000067E ??                      verbose_block:		resb 1
  1930 0000067F ??                      verbose_char:		resb 1	; must be directly after verbose_block
  1931 00000680 ??                      verbose_device:		resb 1
  1932 00000681 ??                      verbose_dpb:		resb 1	; must be directly after verbose_device
  1933 00000682 ??                      mpx:			resb 1
  1934                                  
  1935 00000683 <res Dh>                	alignb 16
  1936                                  uinit_data_end:
  1937                                  resident_data_end:
  1938                                  
  1939                                  uinit_data_size equ uinit_data_end - datastart
  1940                                  
  1941                                  
  1942                                  %if uinit_data_size >= transient_data_size
  1943                                   total_data_size equ uinit_data_size
  1944                                  %else
  1945                                   total_data_size equ transient_data_size
  1946                                  %endif
  1947                                  %assign _DATA_SIZE total_data_size
  1948                                  
  1949                                  	usesection CODE
  1950                                  
  1951                                  %include "eldlink.asm"
     1                              <1> %if 0
     2                              <1> 
     3                              <1> Extensions for lDebug linker
     4                              <1> 
     5                              <1> Copyright (C) 2008-2025 E. C. Masloch
     6                              <1> 
     7                              <1> Usage of the works is permitted provided that this
     8                              <1> instrument is retained with the works, so that any entity
     9                              <1> that uses the works is notified of this instrument.
    10                              <1> 
    11                              <1> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <1> 
    13                              <1> %endif
    14                              <1> 
    15                              <1> %include "lmacros3.mac"
     1                              <2> [list -]
    16                              <1> %include "eld.mac"
     1                              <2> %if 0
     2                              <2> 
     3                              <2> Extensions for lDebug macros
     4                              <2> 
     5                              <2> Copyright (C) 2008-2025 E. C. Masloch
     6                              <2> 
     7                              <2> Usage of the works is permitted provided that this
     8                              <2> instrument is retained with the works, so that any entity
     9                              <2> that uses the works is notified of this instrument.
    10                              <2> 
    11                              <2> DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
    12                              <2> 
    13                              <2> %endif
    14                              <2> 
    15                              <2> %ifndef ELD_MAC
    16                              <2> %define ELD_MAC 1
    17                              <2> 
    18                              <2> %include "lmacros3.mac"
    19                              <2> 
    20                              <2> 		; ELD executable header
    21                              <2> 	struc ELD_HEADER
    22                              <2> eldhSignature:		resb 4	; "ELD1"
    23                              <2> 			resb 3	; reserved
    24                              <2> 			resb 1	; 26 (Ctrl-Z)
    25                              <2> eldhCodeOffset:		resd 1	; position displacement from eldhSignature
    26                              <2> eldhCodeImageLength:	resw 1	; amount bytes, at least 32
    27                              <2> eldhCodeAllocLength:	resw 1	; amount bytes, added to prior. sum < 64 KiB
    28                              <2> eldhDataOffset:		resd 1
    29                              <2> eldhDataImageLength:	resw 1	; (zero allowed)
    30                              <2> eldhDataAllocLength:	resw 1	; (zero allowed)
    31                              <2> eldhCodeEntrypoint:	resw 1	; within code section, used as displacement
    32                              <2> eldhReserved:		resb 4	; reserved
    33                              <2> eldhExtensionSize:	resw 1	; from eldhSignature, -> past eldhx fields in use
    34                              <2> 	endstruc
    35                              <2> 	endarea ELD_HEADER, 1
    36                              <2> 
    37                              <2> 	struc ELD_HEADERX
    38                              <2> eldhxHeader:		resb ELD_HEADER_size
    39                              <2> eldhxDescriptionOffset:	resd 1	; zero if none, from eldhxHeader. <= 128 Bytes
    40                              <2> eldhxHelpOffset:	resd 1	; zero if none, from eldhxHeader
    41                              <2> eldhxLibTable:		resd 1	; zero if none, from eldhxHeader
    42                              <2> eldhxDateTimeOffset:	resd 1	; zero if none, from eldhxHeader
    43                              <2> 	alignb 16
    44                              <2> 	endstruc
    45                              <2> 
    46                              <2> 	struc ELD_TRAILER_HEADER
    47                              <2> eldthSignature:		resb 8	; "ELD1TAIL"
    48                              <2> eldthHeaderOffset:	resd 1	; negative displacement from eldthSignature,
    49                              <2> 				;  add this dword to the seek offset
    50                              <2> eldthReserved:		resw 1	; reserved, must be initialised to zero
    51                              <2> eldthChecksum:		resw 1	; sum of all words in trailer header = 0
    52                              <2> 	endstruc
    53                              <2> 	endarea ELD_TRAILER_HEADER, 1
    54                              <2> 
    55                              <2> 	struc ELD_LIBTABLE
    56                              <2> eldltFormat:		resw 1
    57                              <2> 	; 0 = uncompressed
    58                              <2> 	; 2 = heatshrink compressed
    59                              <2> 	; 3 = lzexedat -4 compressed
    60                              <2> 	; 4 = lzexedat -4 -l compressed
    61                              <2> eldltAmount:		resw 1
    62                              <2> eldltOffset:		resd 1	; from eldhxHeader
    63                              <2> eldltCompressedLength:		; (dword, only present if format 2, 3, or 4)
    64                              <2> 	endstruc
    65                              <2> 	endarea ELD_LIBTABLE, 1
    66                              <2> 
    67                              <2> 		; ELD instance header
    68                              <2> 	struc ELD_INSTANCE
    69                              <2> eldiStartCode:		resw 1	; -> this structure itself (para aligned)
    70                              <2> eldiEndCode:		resw 1	; -> behind memory used by instance (para aligned)
    71                              <2> eldiStartData:		resw 1	; -> data in data entry section (para aligned), or 0
    72                              <2> eldiEndData:		resw 1	; -> behind data (para aligned), or 0
    73                              <2> eldiIdentifier:		resb 8	; blank-filled text
    74                              <2> eldiFlags:		resw 1	; flags
    75                              <2> eldiListing_size equ 14
    76                              <2> eldiListing:		resb eldiListing_size
    77                              <2> 				; ASCIZ listing file name
    78                              <2> 	endstruc
    79                              <2> 		; flags for eldiFlags:
    80                              <2> eldifResident:		equ 1
    81                              <2> 
    82                              <2> 		; ELD link info header
    83                              <2> 	struc ELD_LINKINFO
    84                              <2> eldlSignature:		resw 1	; 0E1D1h
    85                              <2> eldlReserved:		resw 2
    86                              <2> eldlUseLinkHash:	resw 1
    87                              <2> eldlDataAmount:		resw 1
    88                              <2> eldlDataPrefixes:	resw 1
    89                              <2> eldlDataEntries:	resw 1
    90                              <2> eldlDataAddresses:	resw 1
    91                              <2> eldlCodeAmount:		resw 1
    92                              <2> eldlCodePrefixes:	resw 1
    93                              <2> eldlCodeEntries:	resw 1
    94                              <2> eldlCodeAddresses:	resw 1
    95                              <2> 	endstruc
    96                              <2> 
    97                              <2> 	numdef ELD_CODE_VSTART, 9001h
    98                              <2> 	numdef ELD_DATA_VSTART, 8000h
    99                              <2> 	numdef ELD_RELOC_VSTART, 8000h
   100                              <2> 
   101                              <2> 	numdef ELD_RECLAIM_HINT, 0
   102                              <2> 	strdef ELD_LISTING, ""
   103                              <2> 	numdef ELD_DATETIME, 0
   104                              <2> 
   105                              <2> %if _ELD_DATETIME
   106                              <2>  %define PUT_ELDHX_DATETIME_OFFSET at eldhxDateTimeOffset, dd DATAOFFSET + datetime - datastart
   107                              <2>  %macro PUT_ELD_DATETIME 0.nolist
   108                              <2> datetime:	asciz __UTC_DATE__,'T',__UTC_TIME__,'Z'
   109                              <2> 		asciz		; for future extension
   110                              <2>  %endmacro
   111                              <2> %else
   112                              <2>  %define PUT_ELDHX_DATETIME_OFFSET
   113                              <2>  %define PUT_ELD_DATETIME
   114                              <2> %endif
   115                              <2> 
   116                              <2> %endif
    17                              <1> 
    18                              <1> 	cpu 8086
    19                              <1> 
    20                              <1> %if ELDSTRICT
    21                              <1>  %if ELDSTRICTCOUNTER
    22                              <1>   %error Missing relocation
    23                              <1>  %endif
    24                              <1> %endif
    25                              <1> 	eldstrict off		; linker does some relocations
    26                              <1> 
    27                              <1> %ifn ELDCALLCALL_DUMPED
    28                              <1> 	eldcall_dump_callcall ELDCALL_CALLCALL_LIST
    29                              <1> %endif
    30                              <1> 
    31                              <1> 	numdef ELD_IDENTICALISE, 0
    32                              <1> 	numdef ELD_DEBUG, 0
    33                              <1> 	numdef ELD_LINKER_PASSES, 1
    34                              <1> 	strdef LISTING, _ELD_LISTING
    35                              <1> 	numdef ELDCALL_OPTIONAL, ELDCALL_OPTIONAL_STATUS
    36                              <1> 	numdef ELDDATA_OPTIONAL, ELDDATA_OPTIONAL_STATUS
    37                              <1> %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> 		; INP:	es:dx -> loaded initial ELD image
    70                              <1> 		;	 ELD instance structure filled
    71                              <1> 		;	es => ELD code area
    72                              <1> 		;	ds:di -> link info
    73                              <1> 		;	ss:bx -> loaded initial data
    74                              <1> 		;	ss:si -> command line tail
    75                              <1> 		;	cs:ip -> entrypoint
    76                              <1> 		;	ss:sp -> far return address for current mode
    77                              <1> 		; STT:	UP, EI
    78                              <1> linker:
    79                              <1> 		; The first 15 Bytes of the linker should be
    80                              <1> 		;  the same regardless of the linker options
    81                              <1> 		;  used (debug, passes, vstart). This allows
    82                              <1> 		;  the eldcomp ELD to match even if up to 15
    83                              <1> 		;  Bytes of the linker are trailing in the
    84                              <1> 		;  resident part of the ELD.
    85                              <1> 	lframe
    86                              <1>  %if ELDOTHER
    87                              <1> 	lvar dword, linkinfo_other
    88                              <1> 	lvar word, use_hash_other
    89                              <1>  %endif
    90 000007AB 5589E5              <1> 	lenter
    91                              <1> 	lvar dword, instance
    92 000007AE 06                  <1> 	 push es
    93 000007AF 52                  <1> 	 push dx		; -> start of where we're loaded in ELD cs
    94                              <1> 	lvar word, targetsection_low_optional_high
    95 000007B0 50                  <1> 	 push ax		; placeholder
    96                              <1> 	lequ ?targetsection_low_optional_high, targetsection
    97                              <1> 	lequ ?targetsection_low_optional_high + 1, optional
    98                              <1> 	lvar dword, linkinfo
    99 000007B1 1E                  <1> 	 push ds
   100 000007B2 57                  <1> 	 push di		; -> link info (in debugger ss or message seg)
   101                              <1> 	lvar dword, nextreloc
   102 000007B3 06                  <1> 	 push es		; => ELD cs
   103 000007B4 52                  <1> 	 push dx		; placeholder
   104                              <1> 	lvar dword, entry
   105 000007B5 06                  <1> 	 push es		; => ELD cs
   106 000007B6 50                  <1> 	 push ax		; placeholder
   107 000007B7 31C0                <1> 	xor ax, ax
   108 000007B9 813DD1E1            <1> 	cmp word [di + eldlSignature], 0E1D1h
   109                              <1> %if ($ - linker) < 16
   110                              <1>  %error Expected invariant first paragraph of linker
   111                              <1> %endif
   112 000007BD 7403E99202          <1> 	jne .error_j		; signature mismatch -->
   113 000007C2 837D0601            <1> 	cmp word [di + eldlUseLinkHash], 1
   114 000007C6 7603E98902          <1> 	ja .error_j		; unknown use link hash number -->
   115 000007CB 7201                <1> 	jb @F
   116 000007CD 48                  <1> 	dec ax			; = -1 if hash used
   117                              <1> @@:
   118                              <1> 	lvar word, use_hash
   119 000007CE 50                  <1> 	 push ax		; = -1 if hash used, else 0
   120                              <1> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   121                              <1> 	mov ax, linktable - code
   122                              <1> 	lvar word, lt
   123                              <1> 	 push ax		; -> link tables (a single reference)
   124                              <1> %endif
   125                              <1> %if _ELD_LINKER_PASSES || ELDOTHER
   126 000007CF 31C0                <1> 	xor ax, ax
   127                              <1>  %if _ELD_LINKER_PASSES
   128                              <1> 	lvar word, pass
   129 000007D1 50                  <1> 	 push ax		; = 0 for linker itself, = 2 for application
   130                              <1> 	lvar word, amounterrors
   131 000007D2 50                  <1> 	 push ax		; how many distinct errors encountered in pass 2
   132                              <1> 	lvar word, name
   133 000007D3 50                  <1> 	 push ax		; -> name currently being sought (in our table)
   134                              <1>  %endif
   135                              <1>  %if ELDOTHER
   136                              <1> 	lvar word, other
   137                              <1> 	 push ax		; byte: 0 = own data links, -1 = other data links
   138                              <1>  %endif
   139                              <1> %endif
   140 000007D4 56                  <1> 	push si			; -> command line tail
   141 000007D5 53                  <1> 	push bx			; -> data block in ELD data area (segment ss)
   142                              <1> 
   143                              <1> 			; simple: add instance base (dx) to code
   144 000007D6 06                  <1> 	push es
   145 000007D7 1F                  <1> 	pop ds			; ds = es => ELD cs
   146                              <1> %if _ELD_LINKER_PASSES
   147                              <1> .pass:
   148 000007D8 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   149 000007DB 01D3                <1> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   150                              <1>  %if _ELD_IDENTICALISE
   151                              <1> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   152                              <1> 	mov si, word [ltCodeToCode + bx]
   153                              <1>  %else
   154 000007DD 8BB7FC0B            <1> 	mov si, word [linktable - code + ltCodeToCode + bx]
   155                              <1>  %endif
   156                              <1> %else
   157                              <1> 	mov si, internalcodetocoderelocations - code
   158                              <1> %endif		 		; si -> table for code to code (linker or app)
   159 000007E1 01D6                <1> 	add si, dx		; relocate the table pointer itself
   160                              <1> @@:
   161 000007E3 AD                  <1> 	lodsw
   162 000007E4 85C0                <1> 	test ax, ax		; was last ?
   163 000007E6 740B                <1> 	jz @F			; yes -->
   164 000007E8 93                  <1> 	xchg bx, ax		; bx = entry
   165 000007E9 01D3                <1> 	add bx, dx		; relocate the entry itself
   166                              <1> %if _ELD_CODE_VSTART
   167 000007EB 812F[0000]          <1> 	sub word [bx], code	; undo adjustment
   168                              <1> %endif
   169 000007EF 0117                <1> 	add word [bx], dx	; relocate word referenced by entry
   170 000007F1 EBF0                <1> 	jmp @B
   171                              <1> 
   172                              <1> @@:
   173                              <1> 			; next, add heap data base (on stack) to code
   174                              <1> %if _ELD_LINKER_PASSES
   175 000007F3 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   176 000007F6 01D3                <1> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   177                              <1>  %if _ELD_IDENTICALISE
   178                              <1> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   179                              <1> 	mov si, word [ltCodeToData + bx]
   180                              <1>  %else
   181 000007F8 8BB7000C            <1> 	mov si, word [linktable - code + ltCodeToData + bx]
   182                              <1>  %endif
   183                              <1> %else
   184                              <1> 	mov si, internalcodetodatarelocations - code
   185                              <1> %endif				; si -> table for code to data (linker or app)
   186 000007FC 01D6                <1> 	add si, dx		; relocate the table pointer itself
   187                              <1> @@:
   188 000007FE AD                  <1> 	lodsw
   189 000007FF 85C0                <1> 	test ax, ax		; was last ?
   190 00000801 740C                <1> 	jz @F			; yes -->
   191 00000803 93                  <1> 	xchg bx, ax		; bx = entry
   192 00000804 01D3                <1> 	add bx, dx		; relocate the entry itself
   193                              <1> 		; ! access the offset of the data area block, topmost on stack
   194 00000806 58                  <1> 	pop ax			; ax -> heap data
   195 00000807 50                  <1> 	push ax
   196                              <1> %if _ELD_DATA_VSTART
   197 00000808 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   198                              <1> %endif
   199 0000080B 0107                <1> 	add word [bx], ax	; relocate word referenced by entry
   200 0000080D EBEF                <1> 	jmp @B
   201                              <1> 
   202                              <1> @@:
   203                              <1> 
   204                              <1> 			; add instance base (dx) to data
   205                              <1> %if _ELD_LINKER_PASSES
   206 0000080F 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   207 00000812 01D3                <1> 	add bx, dx
   208                              <1>  %if _ELD_IDENTICALISE
   209                              <1> 	add bx, word [bp + ?lt]
   210                              <1> 	mov si, word [ltDataToCode + bx]
   211                              <1>  %else
   212 00000814 8BB7040C            <1> 	mov si, word [linktable - code + ltDataToCode + bx]
   213                              <1>  %endif
   214                              <1> %else
   215                              <1> 	mov si, internaldatatocoderelocations - code
   216                              <1> %endif
   217 00000818 01D6                <1> 	add si, dx
   218                              <1> @@:
   219 0000081A AD                  <1> 	lodsw
   220 0000081B 83F8FF              <1> 	cmp ax, -1		; was last ?
   221 0000081E 740F                <1> 	je @F			; yes -->
   222 00000820 93                  <1> 	xchg bx, ax		; bx = entry
   223                              <1> 		; ! access the offset of the data area block, topmost on stack
   224 00000821 58                  <1> 	pop ax
   225 00000822 50                  <1> 	push ax
   226 00000823 01C3                <1> 	add bx, ax		; relocate the entry itself
   227                              <1> %if _ELD_CODE_VSTART
   228 00000825 36812F[0000]        <1> 	sub word [ss:bx], code	; undo adjustment
   229                              <1> %endif
   230 0000082A 360117              <1> 	add word [ss:bx], dx	; relocate word referenced by entry
   231 0000082D EBEB                <1> 	jmp @B
   232                              <1> 
   233                              <1> @@:
   234                              <1> 			; next, add heap data base (on stack) to data
   235                              <1> %if _ELD_LINKER_PASSES
   236 0000082F 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   237 00000832 01D3                <1> 	add bx, dx
   238                              <1>  %if _ELD_IDENTICALISE
   239                              <1> 	add bx, word [bp + ?lt]
   240                              <1> 	mov si, word [ltDataToData + bx]
   241                              <1>  %else
   242 00000834 8BB7080C            <1> 	mov si, word [linktable - code + ltDataToData + bx]
   243                              <1>  %endif
   244                              <1> %else
   245                              <1> 	mov si, internaldatatodatarelocations - code
   246                              <1> %endif
   247 00000838 01D6                <1> 	add si, dx
   248                              <1> @@:
   249 0000083A AD                  <1> 	lodsw
   250 0000083B 83F8FF              <1> 	cmp ax, -1		; was last ?
   251 0000083E 740D                <1> 	je @F			; yes -->
   252 00000840 93                  <1> 	xchg bx, ax		; bx = entry
   253                              <1> 		; ! access the offset of the data area block, topmost on stack
   254 00000841 58                  <1> 	pop ax			; ax -> heap data
   255 00000842 50                  <1> 	push ax
   256 00000843 01C3                <1> 	add bx, ax		; relocate the entry itself
   257                              <1> %if _ELD_DATA_VSTART
   258 00000845 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   259                              <1> %endif
   260 00000848 360107              <1> 	add word [ss:bx], ax	; relocate word referenced by entry
   261 0000084B EBED                <1> 	jmp @B
   262                              <1> 
   263                              <1> @@:
   264 0000084D 8B56FC              <1> 	mov dx, word [bp + ?instance]
   265                              <1> 				; reset (why??) -> ELD instance in ELD cs
   266                              <1> %if _ELD_LINKER_PASSES
   267 00000850 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   268 00000853 01D3                <1> 	add bx, dx
   269                              <1>  %if _ELD_IDENTICALISE
   270                              <1> 	add bx, word [bp + ?lt]
   271                              <1> 	add dx, word [ltLinkData + bx]
   272                              <1>  %else
   273 00000855 03970C0C            <1> 	add dx, word [linktable - code + ltLinkData + bx]
   274                              <1>  %endif
   275                              <1> %else
   276                              <1> 	add dx, linkerdatarelocations - code
   277                              <1> %endif
   278                              <1> .otherloop:
   279 00000859 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   280                              <1> 				; -> data link relocation table
   281                              <1> 
   282                              <1> .datarelocloop:		; must be done before further relocs
   283 0000085C C576F2              <1> 	lds si, [bp + ?nextreloc]
   284 0000085F AD                  <1> 	lodsw			; ax = section indicator
   285 00000860 85C0                <1> 	test ax, ax		; end of table ?
   286 00000862 7503E95701          <1> 	jz .donedatareloc
   287 00000867 48                  <1> 	dec ax			; al = 1 if data, 0 if code (NB ah may != 0)
   288                              <1> 		; ! access the offset of the data area block, topmost on stack
   289 00000868 5B                  <1> 	pop bx
   290 00000869 53                  <1> 	push bx			; bx -> ELD data block
   291 0000086A 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   292 0000086D 84C0                <1> 	test al, al		; data ?
   293 0000086F AD                  <1> 	lodsw
   294 00000870 7504                <1> 	jnz @F			; yes -->
   295 00000872 0346FC              <1> 	add ax, word [bp + ?instance]
   296                              <1> 				; relocate entry into code
   297 00000875 A9                  <1> 	db __TEST_IMM16		; (skip add)
   298                              <1> @@:
   299 00000876 01D8                <1> 	add ax, bx		; relocate entry into data
   300 00000878 8946EE              <1> 	mov word [bp + ?entry], ax
   301                              <1> 				; save away -> where to patch
   302 0000087B AD                  <1> 	lodsw			; get unrelocated -> name
   303 0000087C 8976F2              <1> 	mov word [bp + ?nextreloc], si
   304                              <1> 				; update -> behind relocation table entry
   305 0000087F E81001              <1> 	call .build_match	; get ax = scan value, si -> counted string,
   306                              <1> 				;  dl = original value at byte [si]
   307                              <1> 				; NC if symbol already not found before
   308                              <1> 				; CY if to search for the symbol
   309                              <1> %if _ELD_LINKER_PASSES
   310 00000882 73D8                <1> 	jnc .datarelocloop	; if duplicate of a not found symbol -->
   311                              <1> %endif
   312 00000884 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   313                              <1> %if ELDOTHER
   314                              <1> 	rol byte [bp + ?other], 1
   315                              <1> 	jnc @F
   316                              <1> 	les bx, [bp + ?linkinfo_other]
   317                              <1> @@:
   318                              <1> %endif				; es:bx -> link info table of the ELD host
   319 00000887 268B4F08            <1> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   320 0000088B 268B7F0A            <1> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   321                              <1> .datarelocfind:
   322 0000088F 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   323 00000892 F2AF                <1> 	repne scasw			; scan initial
   324 00000894 7541                <1> 	jne .datarelocnotfound
   325 00000896 57                  <1> 	push di
   326 00000897 51                  <1> 	push cx
   327 00000898 56                  <1> 	push si
   328 00000899 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   329 0000089D 4F                  <1> 	dec di
   330 0000089E 4F                  <1> 	dec di				; 0-based
   331 0000089F 26037F0C            <1> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   332 000008A3 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   333 000008A6 B500                <1> 	mov ch, 0
   334 000008A8 8A0C                <1> 	mov cl, byte [si]		; cx = length
   335 000008AA 41                  <1> 	inc cx
   336                              <1> 	; cmp al, al			; ZR if length is zero
   337 000008AB F3A6                <1> 	repe cmpsb			; match ?
   338 000008AD 5E                  <1> 	pop si
   339 000008AE 59                  <1> 	pop cx
   340 000008AF 5F                  <1> 	pop di
   341 000008B0 75DD                <1> 	jne .datarelocfind		; if not found this time,
   342                              <1> 					;  scan for next initial -->
   343 000008B2 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   344 000008B4 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   345 000008B8 4F                  <1> 	dec di
   346 000008B9 4F                  <1> 	dec di				; 0-based
   347 000008BA 26037F0E            <1> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   348 000008BE 268B05              <1> 	mov ax, word [es:di]		; get link data from the table
   349 000008C1 E80700              <1> 	call .address_data_reloc
   350                              <1> %if _ELD_RELOC_VSTART
   351 000008C4 2D[0000]            <1> 	sub ax, relocateddata		; *not* a relocation
   352                              <1> %endif
   353 000008C7 0104                <1> 	add word [si], ax		; relocate
   354 000008C9 EB91                <1> 	jmp .datarelocloop
   355                              <1> 
   356                              <1> .address_data_reloc:
   357 000008CB C576EE              <1> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   358 000008CE 807EFA00            <1> 	cmp byte [bp + ?targetsection], 0
   359                              <1> 					; relocation in code ?
   360 000008D2 7402                <1> 	je @F				; yes -->
   361 000008D4 16                  <1> 	push ss
   362 000008D5 1F                  <1> 	pop ds				; => our ELD data block
   363                              <1> @@:
   364 000008D6 C3                  <1> 	retn
   365                              <1> 
   366                              <1> .datarelocnotfound:
   367 000008D7 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   368 000008D9 807EFB00            <1> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   369                              <1> %if _ELD_DEBUG
   370                              <1> 	jne @F
   371                              <1>  %ifn _ELD_LINKER_PASSES
   372                              <1> 	mov si, 0			; (invalid link)
   373                              <1> linkdatarelocation internalflags6
   374                              <1> 	test si, si
   375                              <1> 	jz .datanotfound
   376                              <1> 	mov si, 0			; (invalid link)
   377                              <1> linkdatarelocation options7
   378                              <1> 	test si, si
   379                              <1> 	jz .datanotfound
   380                              <1>  %else
   381                              <1> 	cmp byte [bp + ?pass], 0
   382                              <1> 	je .datanotfound
   383                              <1>  %endif
   384                              <1> 	houdini				; (the above conditions are for this)
   385                              <1> 	jmp .datanotfound
   386                              <1> @@:
   387                              <1> %else
   388 000008DD 7448                <1> 	je .datanotfound		; no, handle as an error -->
   389                              <1> %endif
   390                              <1> 
   391                              <1> %if ELDDATA_PMREQUIRED_STATUS
   392                              <1> 	mov si, relocateddata
   393                              <1> linkdatarelocation build_option_PM
   394                              <1> 	test si, si			; is it a PM build ?
   395                              <1> 	jz @F				; no --> (treat PM required as optional)
   396                              <1> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   397                              <1> 	jnz .datanotfound		; yes, handle as an error -->
   398                              <1> @@:
   399                              <1> %endif
   400                              <1> 
   401                              <1> %if _ELD_LINKER_PASSES
   402 000008DF 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   403                              <1> linkdatarelocation options7, -3
   404 000008E5 7406                <1> 	jz @F				; no -->
   405 000008E7 BE[8D11]            <1> 	mov si, lmsg.warning_data_optional
   406                              <1> internalcoderelocation
   407 000008EA E85C00              <1> 	call .notfound			; display a warning
   408                              <1> @@:
   409                              <1> %endif
   410 000008ED E8DBFF              <1> 	call .address_data_reloc
   411 000008F0 832400              <1> 	and word [si], 0		; indicate optional data link failed
   412 000008F3 E966FF              <1> 	jmp .datarelocloop
   413                              <1> 
   414                              <1> 
   415                              <1> %if _ELDCALL_OPTIONAL
   416                              <1> .coderelocnotfound:
   417 000008F6 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   418 000008F8 807EFB00            <1> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   419                              <1> %if _ELD_DEBUG
   420                              <1> 	jne @F
   421                              <1>  %ifn _ELD_LINKER_PASSES
   422                              <1> 	mov si, 0			; (invalid link)
   423                              <1> linkdatarelocation internalflags6
   424                              <1> 	test si, si
   425                              <1> 	jz .codenotfound
   426                              <1> 	mov si, 0			; (invalid link)
   427                              <1> linkdatarelocation options7
   428                              <1> 	test si, si
   429                              <1> 	jz .codenotfound
   430                              <1>  %else
   431                              <1> 	cmp byte [bp + ?pass], 0
   432                              <1> 	je .codenotfound
   433                              <1>  %endif
   434                              <1> 	houdini				; (the above conditions are for this)
   435                              <1> 	jmp .codenotfound
   436                              <1> @@:
   437                              <1> %else
   438 000008FC 743A                <1> 	je .codenotfound		; no, handle as an error -->
   439                              <1> %endif
   440                              <1> 
   441                              <1> %if ELDCALL_PMREQUIRED_STATUS
   442                              <1>  %if _ELD_LINKER_PASSES
   443                              <1>   %assign ELDLINKER 0
   444                              <1>  %endif
   445 000008FE BE[0000]            <1> 	mov si, relocateddata
   446                              <1> linkdatarelocation build_option_PM
   447                              <1>  %if _ELD_LINKER_PASSES
   448                              <1>   %assign ELDLINKER 1
   449                              <1>  %endif
   450 00000901 85F6                <1> 	test si, si			; is it a PM build ?
   451 00000903 7406                <1> 	jz @F				; no --> (treat PM required as optional)
   452 00000905 F646FB02            <1> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   453 00000909 752D                <1> 	jnz .codenotfound		; yes, handle as an error -->
   454                              <1> @@:
   455                              <1> %endif
   456                              <1> 
   457                              <1> %if _ELD_LINKER_PASSES
   458 0000090B 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   459                              <1> linkdatarelocation options7, -3
   460 00000911 7406                <1> 	jz @F				; no -->
   461 00000913 BE[6B11]            <1> 	mov si, lmsg.warning_code_optional
   462                              <1> internalcoderelocation
   463 00000916 E83000              <1> 	call .notfound			; display a warning
   464                              <1> @@:
   465                              <1> %endif
   466 00000919 C576EE              <1> 	lds si, [bp + ?entry]		; -> code site (must be in ELD cs)
   467 0000091C C7049090            <1> 	mov word [si], 9090h
   468 00000920 C6440290            <1> 	mov byte [si + 2], 90h		; indicate optional code link failed
   469                              <1> 					;  (NOP out the 3-byte call near imm)
   470 00000924 E9A600              <1> 	jmp .coderelocloop
   471                              <1> %endif
   472                              <1> 
   473                              <1> 
   474                              <1> %if _ELD_LINKER_PASSES
   475                              <1> .datanotfound:
   476 00000927 BE[AF11]            <1> 	mov si, lmsg.error_data
   477                              <1> internalcoderelocation
   478 0000092A E81C00              <1> 	call .notfound			; display error
   479 0000092D 7203E92201          <1> 	jnc .error_j			; NC if in pass 0, error out now -->
   480 00000932 FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   481 00000935 E924FF              <1> 	jmp .datarelocloop		; go to next relocation entry -->
   482                              <1> 
   483                              <1> .codenotfound:
   484 00000938 BE[C811]            <1> 	mov si, lmsg.error_code
   485                              <1> internalcoderelocation
   486 0000093B E80B00              <1> 	call .notfound			; display error
   487 0000093E 7203E91101          <1> 	jnc .error_j			; NC if in pass 0 -->
   488 00000943 FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   489 00000946 E98400              <1> 	jmp .coderelocloop		; go to next -->
   490                              <1> 
   491                              <1> .notfound:
   492 00000949 807EEA00            <1> 	cmp byte [bp + ?pass], 0q	; pass 0 ?
   493 0000094D 743A                <1> 	je @F				; yes, do not try displaying --> (NC)
   494 0000094F 16                  <1> 	 push ss
   495 00000950 07                  <1> 	 pop es
   496 00000951 BF[0000]            <1> 	mov di, relocateddata
   497                              <1> linkdatarelocation line_out		; es:di -> line_out buffer
   498 00000954 E83300              <1> 	call .copy			; copy prefix message
   499 00000957 8B76E6              <1> 	mov si, word [bp + ?name]
   500 0000095A AD                  <1> 	lodsw				; = hash
   501 0000095B E8[0000]EB020000    <1> 	extcall hexword			; display the hash in hex
   502 00000962 56                  <1> 	push si
   503 00000963 BE[E111]            <1> 	mov si, lmsg.error.2
   504                              <1> internalcoderelocation
   505 00000966 E82100              <1> 	call .copy			; display message fragment
   506 00000969 5E                  <1> 	pop si
   507                              <1> %if _ELD_LINKER_PASSES
   508 0000096A 56                  <1> 	push si
   509 0000096B E81C00              <1> 	call .copy			; copy over the full name
   510 0000096E 5E                  <1> 	pop si
   511 0000096F C60400              <1> 	mov byte [si], 0		; mark as failed (counter byte = 0)
   512                              <1> %else
   513                              <1> 	call .copy
   514                              <1> %endif
   515 00000972 B022                <1> 	mov al, '"'
   516 00000974 AA                  <1> 	stosb				; end message with a closing quote mark
   517 00000975 16                  <1> 	 push ss
   518 00000976 1F                  <1> 	 pop ds
   519 00000977 E8[0000]EB020000    <1> 	extcall putsline_crlf		; display diagnostic line
   520 0000097E B8350E              <1> 	mov ax, 0E35h
   521 00000981 E8[0000]EB020000    <1> 	extcall setrc
   522 00000988 F9                  <1> 	stc				; CY, diagnostic displayed
   523                              <1> @@:
   524 00000989 C3                  <1> 	retn
   525                              <1> 
   526                              <1> .copy:		; (cannot use extcallcall here)
   527 0000098A E8[0000]EB020000    <1> 	extcall copy_single_counted_string
   528 00000991 C3                  <1> 	retn
   529                              <1> %else
   530                              <1> .datanotfound: equ .error_j
   531                              <1> .codenotfound: equ .error_j
   532                              <1> %endif
   533                              <1> 
   534                              <1> .build_match:
   535                              <1> %if _ELD_CODE_VSTART
   536 00000992 2D[0000]            <1> 	sub ax, code			; revert adjustment (= displacement)
   537                              <1> %endif
   538 00000995 0346FC              <1> 	add ax, word [bp + ?instance]	; make displacement into -> name string
   539 00000998 96                  <1> 	xchg si, ax			; si -> hash word, counted name string
   540                              <1> %if _ELD_LINKER_PASSES
   541 00000999 8976E6              <1> 	mov word [bp + ?name], si	; save away for diagnostics
   542                              <1> %endif
   543 0000099C AD                  <1> 	lodsw			; = hash, si -> counted string
   544 0000099D 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   545                              <1> %if _ELD_LINKER_PASSES
   546 0000099F 84D2                <1> 	test dl, dl		; marked as already failed ?
   547 000009A1 750A                <1> 	jnz @F
   548 000009A3 837EE800            <1> 	cmp word [bp + ?amounterrors], 0
   549                              <1> 				; validate error status
   550 000009A7 7503E9A800          <1> 	je .error_j		; no error known ?! cancel quickly -->
   551 000009AC C3                  <1> 	retn			; (NC)
   552                              <1> 
   553                              <1> @@:
   554                              <1> %endif
   555                              <1> %if ELDOTHER
   556                              <1> 	rol byte [bp + ?other], 1
   557                              <1> 	jnc @F
   558                              <1> 	rol byte [bp + ?use_hash_other], 1
   559                              <1> 	jmp @FF
   560                              <1> 
   561                              <1> @@:
   562                              <1> %endif
   563 000009AD D046EC              <1> 	rol byte [bp + ?use_hash], 1
   564                              <1> @@:
   565                              <1> 		; If to use the hash, then ax = hash and si ->
   566                              <1> 		;  the entire symbol name as a counted string.
   567 000009B0 720A                <1> 	jc @F			; if to use hash, return now -->
   568 000009B2 AC                  <1> 	lodsb			; al = length
   569 000009B3 91                  <1> 	xchg cx, ax		; cl = length
   570 000009B4 AD                  <1> 	lodsw			; ax = prefix
   571 000009B5 49                  <1> 	dec cx
   572 000009B6 49                  <1> 	dec cx			; cl = adjusted length
   573 000009B7 4E                  <1> 	dec si			; -> second byte of prefix
   574 000009B8 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   575 000009BA 880C                <1> 	mov byte [si], cl	; si -> counted string suffix
   576                              <1> 		; (this name entry has been edited to provide the
   577                              <1> 		;  name suffix as a counted string, as required by
   578                              <1> 		;  the old-style non-hash link info tables.
   579                              <1> 		; it will be reset later by writing dl to si -> the
   580                              <1> 		;  first byte of the match string.)
   581                              <1> @@:
   582                              <1> %if _ELD_LINKER_PASSES
   583 000009BC F9                  <1> 	stc			; CY
   584                              <1> %endif
   585 000009BD C3                  <1> 	retn
   586                              <1> 
   587                              <1> 
   588                              <1> .donedatareloc:
   589                              <1> %if ELDOTHER
   590                              <1> 	rol byte [bp + ?other], 1
   591                              <1> 	jc .otherdone		; other link only has data links,
   592                              <1> 				;  so at this point we're done -->
   593                              <1> %endif
   594                              <1> 
   595 000009BE 8B56FC              <1> 	mov dx, word [bp + ?instance]
   596                              <1> %if _ELD_LINKER_PASSES
   597 000009C1 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   598 000009C4 01D3                <1> 	add bx, dx
   599                              <1>  %if _ELD_IDENTICALISE
   600                              <1> 	add bx, word [bp + ?lt]
   601                              <1> 	add dx, word [ltLinkCode + bx]
   602                              <1>  %else
   603 000009C6 0397100C            <1> 	add dx, word [linktable - code + ltLinkCode + bx]
   604                              <1>  %endif
   605                              <1> %else
   606                              <1> 	add dx, linkercoderelocations - code
   607                              <1> %endif
   608 000009CA 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   609                              <1> 
   610                              <1> .coderelocloop:
   611 000009CD C576F2              <1> 	lds si, [bp + ?nextreloc]
   612 000009D0 AD                  <1> 	lodsw
   613                              <1> %if _ELDCALL_OPTIONAL
   614 000009D1 48                  <1> 	dec ax				; optional word is 1-based, get 0-based
   615 000009D2 7903E98F00          <1> 	js .donecodereloc
   616 000009D7 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   617 000009DA AD                  <1> 	lodsw
   618                              <1> %endif
   619 000009DB 0346FC              <1> 	add ax, word [bp + ?instance]
   620 000009DE 8946EE              <1> 	mov word [bp + ?entry], ax
   621 000009E1 AD                  <1> 	lodsw
   622 000009E2 8976F2              <1> 	mov word [bp + ?nextreloc], si
   623                              <1> %ifn _ELDCALL_OPTIONAL
   624                              <1> 	test ax, ax			; if no optional word, check -> match
   625                              <1> 	jz .donecodereloc
   626                              <1> %endif
   627 000009E5 E8AAFF              <1> 	call .build_match
   628                              <1> %if _ELD_LINKER_PASSES
   629 000009E8 73E3                <1> 	jnc .coderelocloop
   630                              <1> %endif
   631 000009EA C45EF6              <1> 	les bx, [bp + ?linkinfo]
   632 000009ED 268B4F10            <1> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   633 000009F1 268B7F12            <1> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   634                              <1> .coderelocfind:
   635 000009F5 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   636 000009F8 F2AF                <1> 	repne scasw			; scan initial
   637                              <1> %if _ELDCALL_OPTIONAL
   638 000009FA 7403E9F7FE          <1> 	jne .coderelocnotfound
   639                              <1> %else
   640                              <1>  %if _ELD_DEBUG
   641                              <1> 	je @F
   642                              <1> 	houdini
   643                              <1> 	jmp .codenotfound
   644                              <1> @@:
   645                              <1>  %else
   646                              <1> 	jne .codenotfound
   647                              <1>  %endif
   648                              <1> %endif
   649 000009FF 57                  <1> 	push di
   650 00000A00 51                  <1> 	push cx
   651 00000A01 56                  <1> 	push si
   652 00000A02 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   653 00000A06 4F                  <1> 	dec di
   654 00000A07 4F                  <1> 	dec di				; 0-based
   655 00000A08 26037F14            <1> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   656 00000A0C 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   657 00000A0F B500                <1> 	mov ch, 0
   658 00000A11 8A0C                <1> 	mov cl, byte [si]		; cx = length
   659 00000A13 41                  <1> 	inc cx
   660                              <1> 	; cmp al, al			; ZR if length is zero
   661 00000A14 F3A6                <1> 	repe cmpsb			; match ?
   662 00000A16 5E                  <1> 	pop si
   663 00000A17 59                  <1> 	pop cx
   664 00000A18 5F                  <1> 	pop di
   665 00000A19 75DA                <1> 	jne .coderelocfind
   666 00000A1B 8814                <1> 	mov byte [si], dl
   667 00000A1D 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   668 00000A21 4F                  <1> 	dec di
   669 00000A22 4F                  <1> 	dec di				; 0-based
   670 00000A23 01FF                <1> 	add di, di			; quadruple index
   671 00000A25 26037F16            <1> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   672 00000A29 26FF35              <1> 	push word [es:di]
   673 00000A2C C576EE              <1> 	lds si, [bp + ?entry]
   674 00000A2F 8F4405              <1> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   675                              <1> 					;  patch the destination address
   676 00000A32 803CE8              <1> 	cmp byte [si], 0E8h		; is it as expected ?
   677 00000A35 751D                <1> 	jne .error_j
   678 00000A37 268B7D02            <1> 	mov di, word [es:di + 2]
   679 00000A3B BB[0000]            <1> 	mov bx, relocateddata
   680                              <1> linkdatarelocation linkcall_table	; ss:bx -> link call table
   681 00000A3E 36833F01            <1> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   682 00000A42 7510                <1> 	jne .error_j			; no -->
   683 00000A44 368B4F02            <1> 	mov cx, word [ss:bx + 2]	; get amount of segments
   684 00000A48 E30A                <1> 	jcxz .error_j			; none -->
   685                              <1> @@:
   686 00000A4A 83C304              <1> 	add bx, 4			; -> next segment
   687 00000A4D 36393F              <1> 	cmp word [ss:bx], di		; value matches ?
   688 00000A50 7405                <1> 	je @F				; yes, found -->
   689 00000A52 E2F6                <1> 	loop @B				; try remaining segments
   690                              <1> .error_j:
   691 00000A54 E98A00              <1> 	jmp .error
   692                              <1> 
   693                              <1> @@:
   694 00000A57 368B5F02            <1> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   695                              <1> 		; si + 3 + delta = bx
   696                              <1> 		; delta = bx - si - 3
   697 00000A5B 29F3                <1> 	sub bx, si
   698 00000A5D 83EB03              <1> 	sub bx, 3
   699 00000A60 895C01              <1> 	mov word [si + 1], bx		; patch the call instruction
   700 00000A63 E967FF              <1> 	jmp .coderelocloop
   701                              <1> 
   702                              <1> .donecodereloc:
   703                              <1> %if _ELD_LINKER_PASSES
   704 00000A66 8B46E8              <1> 	mov ax, word [bp + ?amounterrors]
   705 00000A69 85C0                <1> 	test ax, ax
   706 00000A6B 75E7                <1> 	jnz .error_j
   707 00000A6D 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   708 00000A70 85DB                <1> 	test bx, bx
   709 00000A72 750B                <1> 	jnz @F
   710 00000A74 43                  <1> 	inc bx
   711 00000A75 43                  <1> 	inc bx
   712 00000A76 895EEA              <1> 	mov word [bp + ?pass], bx
   713 00000A79 8B56FC              <1> 	mov dx, word [bp + ?instance]
   714 00000A7C E959FD              <1> 	jmp .pass
   715                              <1> 
   716                              <1> @@:
   717                              <1> %endif
   718                              <1> 
   719                              <1> %ifnidni _LISTING, ""
   720                              <1> %assign ELDLINKER 0
   721                              <1> .hint:
   722 00000A7F 16                  <1> 	push ss
   723 00000A80 1F                  <1> 	pop ds
   724 00000A81 B02D                <1> 	mov al, 2Dh
   725 00000A83 E8[0000]EB020000    <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   726                              <1> 					; CHG: ax, dx, bx
   727 00000A8A 7437                <1> 	jz .no_hint
   728                              <1> 
   729 00000A8C 8A26[0000]          <1> 	mov ah, byte [relocateddata]
   730                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   731 00000A90 E85500              <1> 	call plex_check
   732 00000A93 7305                <1> 	jnc @F
   733                              <1> 
   734 00000A95 B4FF                <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   735                              <1> .loop_hint:
   736 00000A97 E84E00              <1> 	call plex_check
   737                              <1> @@:
   738 00000A9A 7307                <1> 	jnc .end_hint		; if found --> (NC)
   739 00000A9C 80EC01              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   740 00000A9F 73F6                <1> 	jnc .loop_hint		; try next if we didn't check all yet -->
   741 00000AA1 EB20                <1> 	jmp .no_hint
   742                              <1> 
   743                              <1> .end_hint:
   744 00000AA3 50                  <1> 	push ax
   745 00000AA4 C446FC              <1> 	les ax, [bp + ?instance]
   746 00000AA7 BF[230F]            <1> 	mov di, listmsg.hint.offset
   747                              <1> internalcoderelocation
   748 00000AAA E8[0000]EB020000    <1> 	extcall hexword
   749 00000AB1 BB[020F]            <1> 	mov bx, listmsg.hint
   750                              <1> internalcoderelocation
   751 00000AB4 368B16[0000]        <1> 	mov dx, [ss:relocateddata]
   752                              <1> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   753 00000AB9 58                  <1> 	pop ax
   754 00000ABA B040                <1> 	mov al, 40h		; AMIS message display service
   755 00000ABC E8[0000]EB020000    <1> 	extcall call_int2D
   756                              <1> .no_hint:
   757                              <1> %endif
   758                              <1> 
   759                              <1> %if ELDOTHER
   760                              <1> %assign ELDLINKER 0
   761                              <1> 	not byte [bp + ?other]
   762                              <1> 
   763                              <1> 	push ss
   764                              <1> 	pop ds
   765                              <1> 	mov al, 2Dh
   766                              <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   767                              <1> 					; CHG: ax, dx, bx
   768                              <1> 	jz .no_other
   769                              <1> 
   770                              <1> 	mov ah, byte [relocateddata]
   771                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   772                              <1> 	call plex_check
   773                              <1> 	jnc @F
   774                              <1> 
   775                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   776                              <1> .loop_other:
   777                              <1> 	call plex_check
   778                              <1> @@:
   779                              <1> 	jnc .end_other		; if found --> (NC)
   780                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   781                              <1> 	jnc .loop_other		; try next if we didn't check all yet -->
   782                              <1> 	jmp .no_other
   783                              <1> 
   784                              <1> .end_other:
   785                              <1> 	mov al, 42h		; AMIS get other link info service
   786                              <1> 	extcall call_int2D
   787                              <1> 	cmp al, 0FFh
   788                              <1> 	jne .no_other
   789                              <1> 
   790                              <1> 	mov ax, si		; selector => PSP
   791                              <1> 	extcall ispm
   792                              <1> 	jz @F
   793                              <1> 	mov ax, dx		; segment => PSP
   794                              <1> @@:
   795                              <1> 	 push ss
   796                              <1> 	 pop ds
   797                              <1> 	mov word [otherds], ax
   798                              <1> internaldatarelocation		; current mode sel/seg
   799                              <1> 	mov word [otherseg], dx
   800                              <1> internaldatarelocation		; remember segment
   801                              <1> 
   802                              <1> 	mov ax, cx		; selector => link info
   803                              <1> 	extcall ispm
   804                              <1> 	jz @F
   805                              <1> 	mov ax, bx		; segment => link info
   806                              <1> @@:
   807                              <1> 	mov word [bp + ?linkinfo_other], di
   808                              <1> 	mov word [bp + ?linkinfo_other + 2], ax
   809                              <1> 
   810                              <1> 	mov ds, ax		; => link info
   811                              <1> 	xor ax, ax
   812                              <1> 	cmp word [di + eldlSignature], 0E1D1h
   813                              <1> 	jne .error_other
   814                              <1> 	cmp word [di + eldlUseLinkHash], 1
   815                              <1> 	ja .error_other
   816                              <1> 	jb @F
   817                              <1> 	dec ax
   818                              <1> @@:
   819                              <1> 	mov word [bp + ?use_hash_other], ax
   820                              <1> 
   821                              <1> 	mov dx, word [bp + ?instance]
   822                              <1> 	add dx, linkerotherdatarelocations - code
   823                              <1> 	jmp .otherloop
   824                              <1> 
   825                              <1> .error_other:
   826                              <1> 	push cs
   827                              <1> 	pop ds
   828                              <1> 	mov ax, 0E33h
   829                              <1> 	extcall setrc
   830                              <1> 	mov dx, lmsg.error_other
   831                              <1> internalcoderelocation
   832                              <1> 	jmp @F
   833                              <1> 
   834                              <1> .no_other:
   835                              <1> 	push cs
   836                              <1> 	pop ds
   837                              <1> 	mov ax, 0E34h
   838                              <1> 	extcall setrc
   839                              <1> 	mov dx, lmsg.no_other
   840                              <1> internalcoderelocation
   841                              <1> @@:
   842                              <1> 	extcall putsz
   843                              <1> .error_j2:
   844                              <1> 	jmp .error
   845                              <1> 
   846                              <1> .otherdone:
   847                              <1>  %if _ELD_LINKER_PASSES
   848                              <1> 	mov ax, word [bp + ?amounterrors]
   849                              <1> 	test ax, ax
   850                              <1> 	jnz .error_j2
   851                              <1>  %endif
   852                              <1> %endif
   853                              <1> 
   854 00000AC3 5B                  <1> 	pop bx				; -> our heap data
   855 00000AC4 5E                  <1> 	pop si				; -> our command line tail
   856 00000AC5 16                  <1> 	 push ss
   857 00000AC6 1F                  <1> 	 pop ds
   858 00000AC7 C47EFC              <1> 	les di, [bp + ?instance]
   859 00000ACA 268B4502            <1> 	mov ax, word [es:di + eldiEndCode]
   860                              <1> houdini
   861 00000ACE 2D[B007]            <1> 	sub ax, strict word endresident + code
   862                              <1> internalcoderelocation
   863 00000AD1 26C74502[B007]      <1> 	mov word [es:di + eldiEndCode], endresident + code
   864                              <1> internalcoderelocation
   865 00000AD7 2906[0000]          <1> 	sub word [relocateddata], ax
   866                              <1> linkdatarelocation extseg_used
   867                              <1> %if _DATA_SIZE == 0
   868                              <1> 	xor ax, ax
   869                              <1> 	mov word [es:di + eldiStartData], ax
   870                              <1> 	mov word [es:di + eldiEndData], ax
   871                              <1> %endif
   872 00000ADB 89EC5D              <1> 	lleave code
   873                              <1> 		; INP:	es => ELD code segment
   874                              <1> 		;	ds:si -> command line tail
   875                              <1> 		;	ds:bx -> ELD data block
   876                              <1> 		;	ss:sp -> far return address for current mode
   877                              <1> 		; STT:	ds = ss, UP, EI
   878 00000ADE E947FC              <1> 	jmp start
   879                              <1> 
   880                              <1> .error:
   881 00000AE1 89EC5D              <1> 	lleave
   882 00000AE4 B8FFFF              <1> 	mov ax, -1
   883 00000AE7 CB                  <1> 	retf
   884                              <1> 
   885                              <1> 
   886                              <1> %ifnidni _LISTING, ""
   887                              <1>  %assign ELDHINT 1
   888                              <1> %else
   889                              <1>  %assign ELDHINT 0
   890                              <1> %endif
   891                              <1> 
   892                              <1> %if ELDOTHER || ELDHINT
   893                              <1> 		; INP:	ah = multiplex number to check
   894                              <1> 		; OUT:	CY if multiplex number unused or no signature match,
   895                              <1> 		;	 bp, ah, ds unmodified
   896                              <1> 		;	NC if match found,
   897                              <1> 		;	 ah = multiplex number (unmodified)
   898                              <1> 		; CHG:	si, di, es, cx, dx
   899                              <1> plex_check:
   900 00000AE8 16                  <1> 	push ss
   901 00000AE9 1F                  <1> 	pop ds
   902 00000AEA F606[0000]08        <1> 	testopt [relocateddata], 8
   903                              <1> linkdatarelocation internalflags4, -3
   904 00000AEF 740B                <1> 	jz @F
   905 00000AF1 BE[0000]            <1> 	mov si, relocateddata
   906                              <1> linkdatarelocation amis_multiplex_number, -2, optional
   907 00000AF4 85F6                <1> 	test si, si
   908 00000AF6 7404                <1> 	jz @F
   909 00000AF8 3A24                <1> 	cmp ah, byte [si]
   910 00000AFA 7420                <1> 	je .notfound		; do not use our own multiplexer -->
   911                              <1> @@:
   912 00000AFC B000                <1> 	mov al, 00h		; AMIS installation check
   913 00000AFE E8[0000]EB020000    <1> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
   914 00000B05 3CFF                <1> 	cmp al, 0FFh
   915 00000B07 7513                <1> 	jne .notfound
   916 00000B09 0E                  <1> 	push cs
   917 00000B0A 1F                  <1> 	pop ds
   918 00000B0B BE[F20E]            <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   919                              <1> internalcoderelocation
   920 00000B0E E8[0000]EB020000    <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
   921 00000B15 B90800              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
   922 00000B18 F3A7                <1> 	repe cmpsw
   923 00000B1A 7401                <1> 	je .checkret		; ZR, NC = match -->
   924                              <1> .notfound:
   925 00000B1C F9                  <1> 	stc			; CY no match
   926                              <1> .checkret:
   927 00000B1D C3                  <1> 	retn
   928                              <1> %endif
   929                              <1> 
   930                              <1> 
   931 00000B1E 00<rep 2h>          <1> 	align 4, db 0
   932                              <1> linkercoderelocations:
   933                              <1> %if _ELDCALL_OPTIONAL
   934 00000B20 01002200[2B0F]0103- <1> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   934 00000B28 3906[3A0F]01006806- <1>
   934 00000B30 [520F]01007006-     <1>
   934 00000B36 [5E0F]01007806-     <1>
   934 00000B3C [6A0F]01008006-     <1>
   934 00000B42 [710F]01008806-     <1>
   934 00000B48 [7A0F]01009006-     <1>
   934 00000B4E [820F]01009806-     <1>
   934 00000B54 [8A0F]0100A006-     <1>
   934 00000B5A [910F]0100A806-     <1>
   934 00000B60 [9A0F]0100B006-     <1>
   934 00000B66 [A70F]0100B806-     <1>
   934 00000B6C [B30F]0100C006-     <1>
   934 00000B72 [C50F]0100C806-     <1>
   934 00000B78 [CD0F]0100D006-     <1>
   934 00000B7E [D60F]0100D806-     <1>
   934 00000B84 [E30F]0100E006-     <1>
   934 00000B8A [EE0F]0100E806-     <1>
   934 00000B90 [F90F]0100F006-     <1>
   934 00000B96 [1610]0100F806-     <1>
   934 00000B9C [2010]01000007-     <1>
   934 00000BA2 [2A10]01000807-     <1>
   934 00000BA8 [3F10]01001007-     <1>
   934 00000BAE [4910]01001807-     <1>
   934 00000BB4 [5910]01002007-     <1>
   934 00000BBA [6410]01006507-     <1>
   934 00000BC0 [710F]0100830A-     <1>
   934 00000BC6 [CD0F]0100AA0A-     <1>
   934 00000BCC [3F10]0100BC0A-     <1>
   934 00000BD2 [D60F]0100FE0A-     <1>
   934 00000BD8 [D60F]01000E0B-     <1>
   934 00000BDE [E30F]0000          <1>
   935                              <1> %else
   936                              <1> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
   937                              <1> %endif
   938                              <1> 
   939                              <1> %if _ELD_LINKER_PASSES
   940                              <1> linkerlinkercoderelocations:
   941                              <1> %if _ELDCALL_OPTIONAL
   942 00000BE2 01005B09[3F10]0100- <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   942 00000BEA 7709[4910]01008109- <1>
   942 00000BF2 [820F]01008A09-     <1>
   942 00000BF8 [F90F]0000          <1>
   943                              <1> %else
   944                              <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   945                              <1> %endif
   946                              <1> 
   947                              <1> 	align 2, db 0
   948                              <1> linktable:
   949                              <1> 	istruc LINKTABLE
   950                              <1> at ltCodeToCode
   951 00000BFC E00E                <1> 	dw internallinkercodetocoderelocations - code
   952 00000BFE D00C                <1> 	dw internalcodetocoderelocations - code
   953                              <1> at ltCodeToData
   954 00000C00 EC0E                <1> 	dw internallinkercodetodatarelocations - code
   955 00000C02 F00C                <1> 	dw internalcodetodatarelocations - code
   956                              <1> at ltDataToCode
   957 00000C04 EE0E                <1> 	dw internallinkerdatatocoderelocations - code
   958 00000C06 BA0D                <1> 	dw internaldatatocoderelocations - code
   959                              <1> at ltDataToData
   960 00000C08 F00E                <1> 	dw internallinkerdatatodatarelocations - code
   961 00000C0A BC0D                <1> 	dw internaldatatodatarelocations - code
   962                              <1> at ltLinkData
   963 00000C0C C60E                <1> 	dw linkerlinkerdatarelocations - code
   964 00000C0E 140C                <1> 	dw linkerdatarelocations - code
   965                              <1> at ltLinkCode
   966 00000C10 E20B                <1> 	dw linkerlinkercoderelocations - code
   967 00000C12 200B                <1> 	dw linkercoderelocations - code
   968                              <1> 	iend
   969                              <1> %endif
   970                              <1> 
   971                              <1> 	align 2, db 0
   972                              <1> linkerdatarelocations:
   973 00000C14 01004700[6C10]0100- <1> 	dw LINK_DATA_RELOCATIONS, 0
   973 00000C1C 4900[7610]01004C00- <1>
   973 00000C24 [7F10]01006A00-     <1>
   973 00000C2A [8F10]01008E00-     <1>
   973 00000C30 [8F10]0100CD00-     <1>
   973 00000C36 [A510]0100D600-     <1>
   973 00000C3C [B010]0100B301-     <1>
   973 00000C42 [B910]01002802-     <1>
   973 00000C48 [B910]01009902-     <1>
   973 00000C4E [B910]01001803-     <1>
   973 00000C54 [B910]01006B03-     <1>
   973 00000C5A [B910]0100BA03-     <1>
   973 00000C60 [B910]0100E504-     <1>
   973 00000C66 [B910]01003605-     <1>
   973 00000C6C [B910]01009B05-     <1>
   973 00000C72 [B910]0100E305-     <1>
   973 00000C78 [B910]01003107-     <1>
   973 00000C7E [C410]01004407-     <1>
   973 00000C84 [D210]01005407-     <1>
   973 00000C8A [DD10]01006107-     <1>
   973 00000C90 [EB10]01007807-     <1>
   973 00000C96 [DD10]01007C07-     <1>
   973 00000C9C [8F10]01009707-     <1>
   973 00000CA2 [8F10]01009D07-     <1>
   973 00000CA8 [D210]0100FF08-     <1>
   973 00000CAE [FA10]01008E0A-     <1>
   973 00000CB4 [1D11]0100B70A-     <1>
   973 00000CBA [B010]0100D90A-     <1>
   973 00000CC0 [DD10]0100EC0A-     <1>
   973 00000CC6 [4211]0101F20A-     <1>
   973 00000CCC [5311]0000          <1>
   974                              <1> 
   975                              <1> 	align 2, db 0
   976                              <1> internalcodetocoderelocations:
   977 00000CD0 6500B2004B07500758- <1> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
   977 00000CD9 075D0774077F079207- <1>
   977 00000CE2 9907A80AB20ACF0AD5- <1>
   977 00000CEB 0A0C0B0000          <1>
   978                              <1> 
   979                              <1> 	align 2, db 0
   980                              <1> internalcodetodatarelocations:
   981 00000CF0 3400B600C700DE00E1- <1> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
   981 00000CF9 00E400E700EB00F900- <1>
   981 00000D02 040107010A010F0130- <1>
   981 00000D0B 0134013A0165017001- <1>
   981 00000D14 76018A0195019D01A1- <1>
   981 00000D1D 01A701AF0120022502- <1>
   981 00000D26 2B0234024E025A026D- <1>
   981 00000D2F 02770280028C029602- <1>
   981 00000D38 9C02B202B902C402CF- <1>
   981 00000D41 02E502F50211031B03- <1>
   981 00000D4A 3203390346034D0353- <1>
   981 00000D53 035C036E0377037D03- <1>
   981 00000D5C 84039003B103DC03E0- <1>
   981 00000D65 03E603F003F403FA03- <1>
   981 00000D6E 00040E042504300438- <1>
   981 00000D77 046A04700477048304- <1>
   981 00000D80 AF04B404BB04C204E8- <1>
   981 00000D89 04F104F70405051D05- <1>
   981 00000D92 21053905420555056A- <1>
   981 00000D9B 05730581058A058D05- <1>
   981 00000DA4 940596059F05B205B8- <1>
   981 00000DAD 05D305E805EB052506- <1>
   981 00000DB6 A3070000            <1>
   982                              <1> 
   983                              <1> 	align 2, db 0
   984                              <1> internaldatatocoderelocations:
   985 00000DBA FFFF                <1> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
   986                              <1> 
   987                              <1> 	align 2, db 0
   988                              <1> internaldatatodatarelocations:
   989 00000DBC 000002000400060008- <1> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
   989 00000DC5 000A000C000E001000- <1>
   989 00000DCE 12001400160018001A- <1>
   989 00000DD7 001C001E0020002200- <1>
   989 00000DE0 2400260028002A002C- <1>
   989 00000DE9 002E00300032003A00- <1>
   989 00000DF2 3E00420046004C0050- <1>
   989 00000DFB 00540058005E006200- <1>
   989 00000E04 66006A00700076007C- <1>
   989 00000E0D 0082008A0090009600- <1>
   989 00000E16 9A009C009E00A000A2- <1>
   989 00000E1F 00A400A600A800AA00- <1>
   989 00000E28 AC00AE00B000B200B4- <1>
   989 00000E31 00B600B800BA00BC00- <1>
   989 00000E3A BE00C000C200C400C6- <1>
   989 00000E43 00C800CA00CC00CE00- <1>
   989 00000E4C D000D200D400D600D8- <1>
   989 00000E55 00DA00DC00DE00E000- <1>
   989 00000E5E E200E400E600E800EA- <1>
   989 00000E67 00EC00EE00F000F200- <1>
   989 00000E70 F400F600F800FA00FC- <1>
   989 00000E79 00FE00000102010401- <1>
   989 00000E82 060108010A010C010E- <1>
   989 00000E8B 011001120114011601- <1>
   989 00000E94 18011A011C011E0120- <1>
   989 00000E9D 012201240126012801- <1>
   989 00000EA6 2A012C012E01300132- <1>
   989 00000EAF 013401360138013A01- <1>
   989 00000EB8 3C013E014001420148- <1>
   989 00000EC1 014A01FFFF          <1>
   990                              <1> 
   991                              <1> %if _ELD_LINKER_PASSES
   992                              <1> 	align 2, db 0
   993                              <1> linkerlinkerdatarelocations:
   994 00000EC6 0100E208[D210]0100- <1> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
   994 00000ECE 0E09[D210]01005209- <1>
   994 00000ED6 [B910]01003C0A-     <1>
   994 00000EDC [0C11]0000          <1>
   995                              <1> 
   996                              <1> 	align 2, db 0
   997                              <1> internallinkercodetocoderelocations:
   998 00000EE0 E80814092809390964- <1> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
   998 00000EE9 090000              <1>
   999                              <1> 
  1000                              <1> 	align 2, db 0
  1001                              <1> internallinkercodetodatarelocations:
  1002 00000EEC 0000                <1> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
  1003                              <1> 
  1004                              <1> 	align 2, db 0
  1005                              <1> internallinkerdatatocoderelocations:
  1006 00000EEE FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
  1007                              <1> 
  1008                              <1> 	align 2, db 0
  1009                              <1> internallinkerdatatodatarelocations:
  1010 00000EF0 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
  1011                              <1> %endif
  1012                              <1> 
  1013                              <1> %if ELDOTHER
  1014                              <1> 	align 2, db 0
  1015                              <1> linkerotherdatarelocations:
  1016                              <1> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
  1017                              <1> 
  1018                              <1>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
  1019                              <1>   %error Other linker data links not supported
  1020                              <1>  %endif
  1021                              <1> %endif
  1022                              <1> 
  1023                              <1> %if ELDOTHER || ELDHINT
  1024                              <1> 	align 2, db 0
  1025                              <1> debuggeramissig:
  1026 00000EF2 65636D20<rep 5h>    <1> 		fill 8, 32, db "ecm"
  1027 00000EFA 6C446562756720-     <1> 		fill 8, 32, db "lDebug"
  1027 00000EFA <rep 2h>            <1>
  1028                              <1> %endif
  1029                              <1> 
  1030                              <1> %ifnidni _LISTING, ""
  1031                              <1> listmsg:
  1032 00000F02 547261634C6973742D- <1> .hint:		db "TracList-add-offset=",_LISTING,"::"
  1032 00000F0B 6164642D6F66667365- <1>
  1032 00000F14 743D616D6974737273- <1>
  1032 00000F1D 2E6C73743A3A        <1>
  1033 00000F23 2D2D2D2D680D0A00    <1> .hint.offset:	asciz "----h",13,10
  1034                              <1> %endif
  1035                              <1> 
  1036 00000F2B 30CD0C636D64335F6E- <1> 	eldcall_dump_names ELDCALL_CODE_NAMES
  1036 00000F34 6F745F6578742C9A15- <1>
  1036 00000F3D 696E7463616C6C5F65- <1>
  1036 00000F46 78745F72657475726E- <1>
  1036 00000F4F 5F6573D55509736B69- <1>
  1036 00000F58 70636F6D6D6103C309- <1>
  1036 00000F61 6973737472696E673F- <1>
  1036 00000F6A BABD04636D6433DDB9- <1>
  1036 00000F73 0663686B656F6C5512- <1>
  1036 00000F7C 05707574737AB21205- <1>
  1036 00000F85 736574726328900469- <1>
  1036 00000F8E 73706DE83A06697365- <1>
  1036 00000F97 6F6C3FBFBC0A736B69- <1>
  1036 00000FA0 70657175616C73A455- <1>
  1036 00000FA9 09736B6970636F6D6D- <1>
  1036 00000FB2 30650F0F6765745F76- <1>
  1036 00000FBB 616C75655F72616E67- <1>
  1036 00000FC4 65A7AA056572726F72- <1>
  1036 00000FCD 986906696E7463686B- <1>
  1036 00000FD6 21300A63616C6C5F69- <1>
  1036 00000FDF 6E743244B774087365- <1>
  1036 00000FE8 74657332647867B108- <1>
  1036 00000FF1 7472696D70757473D0- <1>
  1036 00000FFA BB1A636F70795F7369- <1>
  1036 00001003 6E676C655F636F756E- <1>
  1036 0000100C 7465645F737472696E- <1>
  1036 00001015 67821B076865786279- <1>
  1036 0000101E 7465EBA60764656377- <1>
  1036 00001027 6F726403AA12646563- <1>
  1036 00001030 5F64776F72645F6D69- <1>
  1036 00001039 6E7769647468848107- <1>
  1036 00001042 686578776F72646FA2- <1>
  1036 0000104B 0D707574736C696E65- <1>
  1036 00001054 5F63726C66398C0870- <1>
  1036 0000105D 7574736C696E656296- <1>
  1036 00001066 05496E444F53        <1>
  1037 0000106C C30B076C617374636D- <1> 	link_data_dump_names LINK_DATA_NAMES
  1037 00001075 646B5D06646D79636D- <1>
  1037 0000107E 6454400D6D73672E75- <1>
  1037 00001087 6E696E7374616C6C97- <1>
  1037 00001090 B6136578745F636F6D- <1>
  1037 00001099 6D616E645F68616E64- <1>
  1037 000010A2 6C6572EB4208657874- <1>
  1037 000010AB 647373656CD52D0665- <1>
  1037 000010B4 787473656784E3086C- <1>
  1037 000010BD 696E655F6F75748D71- <1>
  1037 000010C6 0B6D73672E696E7374- <1>
  1037 000010CF 616C6C5ABC086F7074- <1>
  1037 000010D8 696F6E7337E7D30B65- <1>
  1037 000010E1 78747365675F757365- <1>
  1037 000010EA 64B2400C6578746461- <1>
  1037 000010F3 74615F757365645503- <1>
  1037 000010FC 0F6275696C645F6F70- <1>
  1037 00001105 74696F6E5F504D6844- <1>
  1037 0000110E 0E6C696E6B63616C6C- <1>
  1037 00001117 5F7461626C65F09E22- <1>
  1037 00001120 7472795F6465627567- <1>
  1037 00001129 6765725F616D69735F- <1>
  1037 00001132 6D756C7469706C6578- <1>
  1037 0000113B 5F6E756D626572CB51- <1>
  1037 00001144 0E696E7465726E616C- <1>
  1037 0000114D 666C61677334688C15- <1>
  1037 00001156 616D69735F6D756C74- <1>
  1037 0000115F 69706C65785F6E756D- <1>
  1037 00001168 626572              <1>
  1038                              <1> %if ELDOTHER
  1039                              <1> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1040                              <1> %endif
  1041                              <1> 
  1042                              <1> lmsg:
  1043                              <1> %if _ELD_LINKER_PASSES
  1044                              <1> %if _ELDCALL_OPTIONAL
  1045 0000116B 214F7074696F6E616C- <1> .warning_code_optional:		counted "Optional code link missing, hash="
  1045 00001174 20636F6465206C696E- <1>
  1045 0000117D 6B206D697373696E67- <1>
  1045 00001186 2C20686173683D      <1>
  1046                              <1> %endif
  1047 0000118D 214F7074696F6E616C- <1> .warning_data_optional:		counted "Optional data link missing, hash="
  1047 00001196 2064617461206C696E- <1>
  1047 0000119F 6B206D697373696E67- <1>
  1047 000011A8 2C20686173683D      <1>
  1048 000011AF 1844617461206C696E- <1> .error_data:			counted "Data link missing, hash="
  1048 000011B8 6B206D697373696E67- <1>
  1048 000011C1 2C20686173683D      <1>
  1049 000011C8 18436F6465206C696E- <1> .error_code:			counted "Code link missing, hash="
  1049 000011D1 6B206D697373696E67- <1>
  1049 000011DA 2C20686173683D      <1>
  1050 000011E1 0A682C206C6162656C- <1> .error.2:			counted "h, label ",'"'
  1050 000011EA 2022                <1>
  1051                              <1> %endif
  1052                              <1> %if ELDOTHER
  1053                              <1> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1054                              <1> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1055                              <1> %endif
  1056                              <1> 
  1057 000011EC 00<rep 4h>          <1> 	align 16, db 0
  1952                                  
  1953                                  	align 16
  1954                                  code_size equ $ - code
