     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> %assign ELDDATA_NEXT_STATUS 0			; not any seen yet
    36                              <2> %assign ELDDATA_NEXT_ENTRY -1
    37                              <2> %assign ELDDATA_NEXT_SECTION -1
    38                              <2> %assign ELDDATA_NEXT_OTHER -1
    39                              <2> 
    40                              <2> 	%imacro internalcoderelocation 0-1.nolist -2
    41                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    42                              <2> %if ELDLINKER
    43                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    44                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    45                              <2>  %else
    46                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    47                              <2>  %endif
    48                              <2> %else
    49                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    50                              <2>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    51                              <2>  %else
    52                              <2>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    53                              <2>  %endif
    54                              <2> %endif
    55                              <2> 	eldstrictcheck
    56                              <2> 	%endmacro
    57                              <2> 
    58                              <2> 	%imacro internaldatarelocation 0-1.nolist -2
    59                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    60                              <2> %if ELDLINKER
    61                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    62                              <2>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    63                              <2>  %else
    64                              <2>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    65                              <2>  %endif
    66                              <2> %else
    67                              <2>  %ifidni _CURRENT_SECTION_TYPE, DATA
    68                              <2>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    69                              <2>  %else
    70                              <2>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    71                              <2>  %endif
    72                              <2> %endif
    73                              <2> 	eldstrictcheck
    74                              <2> 	%endmacro
    75                              <2> 
    76                              <2> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    77                              <2> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    78                              <2> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    79                              <2> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    80                              <2> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    81                              <2> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    82                              <2> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    83                              <2> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    84                              <2> 
    85                              <2> 
    86                              <2> %define LINK_DATA_RELOCATIONS ""
    87                              <2> %define LINK_LINKER_DATA_RELOCATIONS ""
    88                              <2> %define LINK_DATA_NAMES db ""
    89                              <2> %define LINK_DATA_DETECTION none, none
    90                              <2> 
    91                              <2> %define LINK_OTHER_DATA_RELOCATIONS ""
    92                              <2> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    93                              <2> %define LINK_OTHER_DATA_NAMES db ""
    94                              <2> %define LINK_OTHER_DATA_DETECTION none, none
    95                              <2> 
    96                              <2> %ifndef ELDOTHER
    97                              <2>  %assign ELDOTHER 0
    98                              <2> %endif
    99                              <2> %assign ELDOTHERLINK 0
   100                              <2> 
   101                              <2> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
   102                              <2> %if ELDOTHER
   103                              <2>  %assign ELDOTHERLINK 1
   104                              <2> %endif
   105                              <2> 	linkdatarelocation %1, %2, %3
   106                              <2> %assign ELDOTHERLINK 0
   107                              <2> 	%endmacro
   108                              <2> 
   109                              <2> 	%imacro linkdatarelocation 1-4.nolist -2, required, single
   110                              <2> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   111                              <2> %ifidni %3, required
   112                              <2>  %assign %%optional 0
   113                              <2> %elifidni %3, optional
   114                              <2>  %assign %%optional 100h
   115                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   116                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   117                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   118                              <2>  %else
   119                              <2>   %error Optional data link not allowed here
   120                              <2>  %endif
   121                              <2> %elifidni %3, PM required
   122                              <2>  %assign %%optional 300h
   123                              <2>  %assign ELDDATA_PMREQUIRED_STATUS 1
   124                              <2>  %if ELDDATA_OPTIONAL_STATUS == 0
   125                              <2>   %assign ELDDATA_OPTIONAL_STATUS 1
   126                              <2>  %elif ELDDATA_OPTIONAL_STATUS == 1
   127                              <2>  %else
   128                              <2>   %error Optional data link not allowed here
   129                              <2>  %endif
   130                              <2> %else
   131                              <2>  %fatal Unknown optional keyword
   132                              <2> %endif
   133                              <2> %ifidni _CURRENT_SECTION_TYPE, DATA
   134                              <2>  %assign %%DATASECTION 1
   135                              <2> %else
   136                              <2>  %assign %%DATASECTION 0
   137                              <2> %endif
   138                              <2> %ifidni %4, single
   139                              <2>  %if ELDDATA_NEXT_STATUS == 1		; after next ?
   140                              <2>   %error Unexpected single data link after next data link
   141                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   142                              <2>   %assign ELDDATA_NEXT_STATUS 3		; note single with next/last present
   143                              <2>  %endif
   144                              <2>  %assign %%next 0
   145                              <2> %elifidni %4, next
   146                              <2>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   147                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   148                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   149                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   150                              <2>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   151                              <2>   %assign ELDDATA_NEXT_STATUS 1		; in next
   152                              <2>  %elif ELDDATA_NEXT_STATUS == 1		; repeated next ?
   153                              <2>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   156                              <2>    %error Unexpected next data link
   157                              <2>   %endif
   158                              <2>  %else
   159                              <2>   %error Next data link not allowed here
   160                              <2>  %endif
   161                              <2>  %ifn %%optional
   162                              <2>   %error Next data link only valid as optional or PM required
   163                              <2>  %endif
   164                              <2>  %assign %%next 400h
   165                              <2>  %assign ELDDATA_NEXT_ENTRY %%entry
   166                              <2>  %assign ELDDATA_NEXT_SECTION %%DATASECTION
   167                              <2>  %assign ELDDATA_NEXT_OTHER ELDOTHERLINK
   168                              <2> %elifidni %4, last
   169                              <2>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   170                              <2>   %error Next last data link not allowed here
   171                              <2>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   172                              <2>   %error Next last data link not allowed here
   173                              <2>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   174                              <2>   %error Next last data link not allowed here
   175                              <2>  %elif ELDDATA_NEXT_STATUS == 1		; after next ?
   176                              <2>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   179                              <2>    %error Unexpected next data link
   180                              <2>   %endif
   181                              <2>   %assign ELDDATA_NEXT_STATUS 2		; note now after last
   182                              <2>  %else
   183                              <2>   %error Next data link not allowed here
   184                              <2>  %endif
   185                              <2>  %assign %%next 800h
   186                              <2>  %assign ELDDATA_NEXT_ENTRY -1
   187                              <2>  %assign ELDDATA_NEXT_SECTION -1
   188                              <2> %else
   189                              <2>  %fatal Unknown next keyword
   190                              <2> %endif
   191                              <2> 	%if ELDOTHERLINK
   192                              <2> %if ELDLINKER
   193                              <2>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   194                              <2> %else
   195                              <2>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   196                              <2> %endif
   197                              <2> 	%else
   198                              <2> %if ELDLINKER
   199                              <2>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   200                              <2> %else
   201                              <2>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   202                              <2> %endif
   203                              <2> 	%endif
   204                              <2> %defstr %%string %1
   205                              <2> %strlen %%length %%string
   206                              <2> %if %%length > 64
   207                              <2> 	; Could be increased, but mustn't exceed 127 bytes
   208                              <2> 	;  because flag 80h is used to mark optional links
   209                              <2> 	;  that failed to be matched.
   210                              <2>  %error Too long link name: %1
   211                              <2> %endif
   212                              <2> %define LINK_DATA_CHECK %1
   213                              <2> 	%if ELDOTHERLINK
   214                              <2> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   215                              <2> %if LINK_DATA_NEW
   216                              <2>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   217                              <2> 	hashdef HASH, %%string
   218                              <2>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   220                              <2> %else
   221                              <2>  %%name equ LINK_DATA_DUPLICATE
   222                              <2> %endif
   223                              <2> 	%else
   224                              <2> 	linkdata_detect LINK_DATA_DETECTION
   225                              <2> %if LINK_DATA_NEW
   226                              <2>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   227                              <2> 	hashdef HASH, %%string
   228                              <2>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   230                              <2> %else
   231                              <2>  %%name equ LINK_DATA_DUPLICATE
   232                              <2> %endif
   233                              <2> 	%endif
   234                              <2> 	eldstrictcheck
   235                              <2> 	%endmacro
   236                              <2> 
   237                              <2> 	%imacro linkdata_detect 2-*.nolist
   238                              <2> %assign LINK_DATA_NEW 1
   239                              <2> %rep (%0 - 2) / 2
   240                              <2>  %rotate 2
   241                              <2>  %ifidni %1, LINK_DATA_CHECK
   242                              <2>   %assign LINK_DATA_NEW 0
   243                              <2>   %xdefine LINK_DATA_DUPLICATE %2
   244                              <2>   %exitrep
   245                              <2>  %endif
   246                              <2> %endrep
   247                              <2> 	%endmacro
   248                              <2> 
   249                              <2> 	%imacro link_data_dump_names 1-*.nolist
   250                              <2> %rep %0
   251                              <2> 	%1
   252                              <2>  %rotate 1
   253                              <2> %endrep
   254                              <2> 	%endmacro
   255                              <2> 
   256                              <2> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   257                              <2> ; dw LINK_DATA_RELOCATIONS, 0, 0
   258                              <2> ; link_data_dump_names ELDCALL_CODE_NAMES
   259                              <2> 
   260                              <2> %endif
    21                              <1> 
    22                              <1> %assign ELDLINKER 0
    23                              <1> 
    24                              <1> [section relocatedzero nobits vstart=0]
    25                              <1> relocatedzero:
    26                              <1> __SECT__
    27                              <1> 
    28                              <1> 	numdef HOUDINI, 1
    29                              <1> 	numdef HOUDINI_CONDITIONAL, 1
    30                              <1> 
    31                              <1> %imacro houdini 0.nolist
    32                              <1> %if _HOUDINI
    33                              <1>  %if _HOUDINI_CONDITIONAL
    34                              <1> reloc	testopt [ss:relocateddata], 100h
    35                              <1> linkdatarelocation options7, -3
    36                              <1> 	jz %%skip
    37                              <1>  %endif
    38                              <1> reloc	testopt [ss:relocateddata], 100h
    39                              <1> linkdatarelocation internalflags6, -3
    40                              <1> 	jz %%skip
    41                              <1> 	int3
    42                              <1> %%skip:
    43                              <1> %endif
    44                              <1> %endmacro
    45                              <1> 
    46                              <1> %define ELDCALL_CODE_RELOCATIONS ""
    47                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS ""
    48                              <1> %define ELDCALL_CODE_RELOCATIONS_OPTIONAL ""
    49                              <1> %define ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ""
    50                              <1> %define ELDCALL_CODE_NAMES db ""
    51                              <1> %define ELDCALL_CODE_DETECTION none, none
    52                              <1> %assign ELDCALL_OPTIONAL_STATUS 0		; not any seen yet
    53                              <1> %assign ELDCALL_PMREQUIRED_STATUS 0		; not any seen yet
    54                              <1> %assign ELDCALL_NEXT_STATUS 0			; not any seen yet
    55                              <1> %assign ELDCALL_NEXT_ENTRY -1
    56                              <1> 
    57                              <1> 	%imacro extcall 1-3.nolist required, single
    58                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
    59                              <1>  %error "ELD call cannot be used in ELD data block"
    60                              <1> %endif
    61                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP
    62                              <1> %ifidni %2, required
    63                              <1>  %assign %%optional 0
    64                              <1> %elifidni %2, optional
    65                              <1>  %assign %%optional 100h
    66                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    67                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    68                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    69                              <1>  %else
    70                              <1>   %error Optional code link not allowed here
    71                              <1>  %endif
    72                              <1> %elifidni %2, PM required
    73                              <1>  %assign %%optional 300h
    74                              <1>  %assign ELDCALL_PMREQUIRED_STATUS 1
    75                              <1>  %if ELDCALL_OPTIONAL_STATUS == 0
    76                              <1>   %assign ELDCALL_OPTIONAL_STATUS 1
    77                              <1>  %elif ELDCALL_OPTIONAL_STATUS == 1
    78                              <1>  %else
    79                              <1>   %error Optional code link not allowed here
    80                              <1>  %endif
    81                              <1> %else
    82                              <1>  %fatal Unknown optional keyword
    83                              <1> %endif
    84                              <1> %ifidni %3, single
    85                              <1>  %if ELDCALL_NEXT_STATUS == 1		; after next ?
    86                              <1>   %error Unexpected single code link after next code link
    87                              <1>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
    88                              <1>   %assign ELDCALL_NEXT_STATUS 3		; note single with next/last present
    89                              <1>  %endif
    90                              <1>  %assign %%next 0
    91                              <1> %elifidni %3, next
    92                              <1>  %if ELDCALL_NEXT_STATUS == 0		; no next/last yet ?
    93                              <1>   %assign ELDCALL_NEXT_STATUS 1		; in next
    94                              <1>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
    95                              <1>   %assign ELDCALL_NEXT_STATUS 1		; in next
    96                              <1>  %elif ELDCALL_NEXT_STATUS == 3		; after single ?
    97                              <1>   %assign ELDCALL_NEXT_STATUS 1		; in next
    98                              <1>  %elif ELDCALL_NEXT_STATUS == 1		; repeated next ?
    99                              <1>   %if ELDCALL_NEXT_ENTRY != %%entry
   100                              <1>    %error Unexpected next code link
   101                              <1>   %endif
   102                              <1>  %else
   103                              <1>   %error Next code link not allowed here
   104                              <1>  %endif
   105                              <1>  %ifn %%optional
   106                              <1>   %error Next code link only valid as optional or PM required
   107                              <1>  %endif
   108                              <1>  %assign %%next 400h
   109                              <1>  %assign ELDCALL_NEXT_ENTRY %%entry
   110                              <1> %elifidni %3, last
   111                              <1>  %if ELDCALL_NEXT_STATUS == 0		; no next/last yet ?
   112                              <1>   %error Next last code link not allowed here
   113                              <1>  %elif ELDCALL_NEXT_STATUS == 2		; after last ?
   114                              <1>   %error Next last code link not allowed here
   115                              <1>  %elif ELDCALL_NEXT_STATUS == 3		; after single ?
   116                              <1>   %error Next last code link not allowed here
   117                              <1>  %elif ELDCALL_NEXT_STATUS == 1		; after next ?
   118                              <1>   %if ELDCALL_NEXT_ENTRY != %%entry
   119                              <1>    %error Unexpected next code link
   120                              <1>   %endif
   121                              <1>   %assign ELDCALL_NEXT_STATUS 2		; note now after last
   122                              <1>  %else
   123                              <1>   %error Next code link not allowed here
   124                              <1>  %endif
   125                              <1>  %assign %%next 800h
   126                              <1>  %assign ELDCALL_NEXT_ENTRY -1
   127                              <1>  %assign ELDCALL_NEXT_SECTION -1
   128                              <1> %else
   129                              <1>  %fatal Unknown next keyword
   130                              <1> %endif
   131                              <1> %if %%next != 400h
   132                              <1> %if 0
   133                              <1> [warning -reloc-rel-word]
   134                              <1> 	call near relocatedzero
   135                              <1> [warning +reloc-rel-word]
   136                              <1> %else
   137                              <1> 	db 0E8h
   138                              <1> reloc	dw relocatedzero
   139                              <1> 	eldstrictcheck
   140                              <1> %endif
   141                              <1> 	jmp strict short %%skipparameter
   142                              <1> 	dw 0
   143                              <1> %%skipparameter:
   144                              <1> %endif
   145                              <1> %if ELDLINKER
   146                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS ELDCALL_LINKER_CODE_RELOCATIONS, %%entry, %%name
   147                              <1>  %xdefine ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional + %%next, %%entry, %%name
   148                              <1> %else
   149                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS ELDCALL_CODE_RELOCATIONS, %%entry, %%name
   150                              <1>  %xdefine ELDCALL_CODE_RELOCATIONS_OPTIONAL ELDCALL_CODE_RELOCATIONS_OPTIONAL, 1 + %%optional + %%next, %%entry, %%name
   151                              <1> %endif
   152                              <1> %defstr %%string %1
   153                              <1> %strlen %%length %%string
   154                              <1> %if %%length > 64
   155                              <1> 	; Could be increased, but mustn't exceed 127 bytes
   156                              <1> 	;  because flag 80h is used to mark optional links
   157                              <1> 	;  that failed to be matched.
   158                              <1>  %error Too long link name: %1
   159                              <1> %endif
   160                              <1> %define ELDCALL_CODE_CHECK %1
   161                              <1> 	linkcode_detect ELDCALL_CODE_DETECTION
   162                              <1> %if ELDCALL_CODE_NEW
   163                              <1>  %xdefine ELDCALL_CODE_DETECTION ELDCALL_CODE_DETECTION, %1, %%name
   164                              <1> 	hashdef HASH, %%string
   165                              <1> %xdefine ELDCALL_CODE_NAMES 	ELDCALL_CODE_NAMES, %%name:, dw _HASH, {counted %%string}
   167                              <1> %else
   168                              <1>  %%name equ ELDCALL_CODE_DUPLICATE
   169                              <1> %endif
   170                              <1> 	%endmacro
   171                              <1> 
   172                              <1> 	%imacro linkcode_detect 2-*.nolist
   173                              <1> %assign ELDCALL_CODE_NEW 1
   174                              <1> %rep (%0 - 2) / 2
   175                              <1>  %rotate 2
   176                              <1>  %ifidni %1, ELDCALL_CODE_CHECK
   177                              <1>   %assign ELDCALL_CODE_NEW 0
   178                              <1>   %xdefine ELDCALL_CODE_DUPLICATE %2
   179                              <1>   %exitrep
   180                              <1>  %endif
   181                              <1> %endrep
   182                              <1> 	%endmacro
   183                              <1> 
   184                              <1> 
   185                              <1> %define ELDCALL_CALLCALL_LIST none
   186                              <1> %define ELDCALL_CALLCALL_PROCESSED_PRIOR ""
   187                              <1> 
   188                              <1> 	%imacro extcallcall 1.nolist
   189                              <1> 	call %1
   190                              <1> %xdefine ELDCALL_CALLCALL_LIST ELDCALL_CALLCALL_LIST, %1
   191                              <1> 	%endmacro
   192                              <1> 
   193                              <1> %assign ELDCALLCALL_DUMPED 0
   194                              <1> 
   195                              <1> 	%imacro eldcall_dump_callcall 1-*.nolist
   196                              <1> %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED_PRIOR
   197                              <1>  %rep %0 - 1
   198                              <1>   %rotate 1
   199                              <1>   %define ELDCALL_CHECK %1
   200                              <1> 	eldcall_callcall_detect ELDCALL_CALLCALL_PROCESSED
   201                              <1>   %if ELDCALL_NEW
   202                              <1>    %xdefine ELDCALL_CALLCALL_PROCESSED ELDCALL_CALLCALL_PROCESSED, %1
   203                              <1> 	align 8, nop
   204                              <1> %1:
   205                              <1> 	extcall %1
   206                              <1> 	retn
   207                              <1>   %endif
   208                              <1>  %endrep
   209                              <1> %assign ELDCALLCALL_DUMPED 1
   210                              <1> %define ELDCALL_CALLCALL_LIST none
   211                              <1> 	%endmacro
   212                              <1> 
   213                              <1> 	%imacro eldcall_new_callcall 0.nolist
   214                              <1> %if ELDCALLCALL_DUMPED
   215                              <1>  %xdefine ELDCALL_CALLCALL_PROCESSED_PRIOR   ELDCALL_CALLCALL_PROCESSED_PRIOR, ELDCALL_CALLCALL_PROCESSED
   217                              <1>  %assign ELDCALLCALL_DUMPED 0
   218                              <1>  %define ELDCALL_CALLCALL_LIST none
   219                              <1> %endif
   220                              <1> 	%endmacro
   221                              <1> 
   222                              <1> 	%imacro eldcall_callcall_detect 1-*.nolist
   223                              <1> %assign ELDCALL_NEW 1
   224                              <1> %rep %0
   225                              <1>  %ifidni %1, ELDCALL_CHECK
   226                              <1>   %assign ELDCALL_NEW 0
   227                              <1>   %exitrep
   228                              <1>  %endif
   229                              <1>  %rotate 1
   230                              <1> %endrep
   231                              <1> 	%endmacro
   232                              <1> 
   233                              <1> 	%imacro eldcall_dump_names 1-*.nolist
   234                              <1> %rep %0
   235                              <1> 	%1
   236                              <1>  %rotate 1
   237                              <1> %endrep
   238                              <1> 	%endmacro
   239                              <1> 
   240                              <1> ; eldcall_dump_callcall ELDCALL_CALLCALL_LIST
   241                              <1> ; if using optional code links:
   242                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
   243                              <1> ;  dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
   244                              <1> ; if not using optional code links:
   245                              <1> ;  dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
   246                              <1> ;  dw ELDCALL_CODE_RELOCATIONS, 0, 0
   247                              <1> ; eldcall_dump_names ELDCALL_CODE_NAMES
   248                              <1> 
   249                              <1> %endif
    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> %assign ELDDATA_NEXT_STATUS 0			; not any seen yet
    36                              <1> %assign ELDDATA_NEXT_ENTRY -1
    37                              <1> %assign ELDDATA_NEXT_SECTION -1
    38                              <1> %assign ELDDATA_NEXT_OTHER -1
    39                              <1> 
    40                              <1> 	%imacro internalcoderelocation 0-1.nolist -2
    41                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    42                              <1> %if ELDLINKER
    43                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    44                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, %%entry
    45                              <1>  %else
    46                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, %%entry
    47                              <1>  %endif
    48                              <1> %else
    49                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    50                              <1>   %xdefine INTERNAL_DATA_TO_CODE_RELOCATIONS INTERNAL_DATA_TO_CODE_RELOCATIONS, %%entry
    51                              <1>  %else
    52                              <1>   %xdefine INTERNAL_CODE_TO_CODE_RELOCATIONS INTERNAL_CODE_TO_CODE_RELOCATIONS, %%entry
    53                              <1>  %endif
    54                              <1> %endif
    55                              <1> 	eldstrictcheck
    56                              <1> 	%endmacro
    57                              <1> 
    58                              <1> 	%imacro internaldatarelocation 0-1.nolist -2
    59                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %1
    60                              <1> %if ELDLINKER
    61                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    62                              <1>   %xdefine INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, %%entry
    63                              <1>  %else
    64                              <1>   %xdefine INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, %%entry
    65                              <1>  %endif
    66                              <1> %else
    67                              <1>  %ifidni _CURRENT_SECTION_TYPE, DATA
    68                              <1>   %xdefine INTERNAL_DATA_TO_DATA_RELOCATIONS INTERNAL_DATA_TO_DATA_RELOCATIONS, %%entry
    69                              <1>  %else
    70                              <1>   %xdefine INTERNAL_CODE_TO_DATA_RELOCATIONS INTERNAL_CODE_TO_DATA_RELOCATIONS, %%entry
    71                              <1>  %endif
    72                              <1> %endif
    73                              <1> 	eldstrictcheck
    74                              <1> 	%endmacro
    75                              <1> 
    76                              <1> ; dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
    77                              <1> ; dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
    78                              <1> ; dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
    79                              <1> ; dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
    80                              <1> ; dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
    81                              <1> ; dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
    82                              <1> ; dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
    83                              <1> ; dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
    84                              <1> 
    85                              <1> 
    86                              <1> %define LINK_DATA_RELOCATIONS ""
    87                              <1> %define LINK_LINKER_DATA_RELOCATIONS ""
    88                              <1> %define LINK_DATA_NAMES db ""
    89                              <1> %define LINK_DATA_DETECTION none, none
    90                              <1> 
    91                              <1> %define LINK_OTHER_DATA_RELOCATIONS ""
    92                              <1> %define LINK_OTHER_LINKER_DATA_RELOCATIONS ""
    93                              <1> %define LINK_OTHER_DATA_NAMES db ""
    94                              <1> %define LINK_OTHER_DATA_DETECTION none, none
    95                              <1> 
    96                              <1> %ifndef ELDOTHER
    97                              <1>  %assign ELDOTHER 0
    98                              <1> %endif
    99                              <1> %assign ELDOTHERLINK 0
   100                              <1> 
   101                              <1> 	%imacro otherlinkdatarelocation 1-3.nolist -2, required
   102                              <1> %if ELDOTHER
   103                              <1>  %assign ELDOTHERLINK 1
   104                              <1> %endif
   105                              <1> 	linkdatarelocation %1, %2, %3
   106                              <1> %assign ELDOTHERLINK 0
   107                              <1> 	%endmacro
   108                              <1> 
   109                              <1> 	%imacro linkdatarelocation 1-4.nolist -2, required, single
   110                              <1> %assign %%entry $ + _CURRENT_SECTION %+ FIXUP + %2
   111                              <1> %ifidni %3, required
   112                              <1>  %assign %%optional 0
   113                              <1> %elifidni %3, optional
   114                              <1>  %assign %%optional 100h
   115                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   116                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   117                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   118                              <1>  %else
   119                              <1>   %error Optional data link not allowed here
   120                              <1>  %endif
   121                              <1> %elifidni %3, PM required
   122                              <1>  %assign %%optional 300h
   123                              <1>  %assign ELDDATA_PMREQUIRED_STATUS 1
   124                              <1>  %if ELDDATA_OPTIONAL_STATUS == 0
   125                              <1>   %assign ELDDATA_OPTIONAL_STATUS 1
   126                              <1>  %elif ELDDATA_OPTIONAL_STATUS == 1
   127                              <1>  %else
   128                              <1>   %error Optional data link not allowed here
   129                              <1>  %endif
   130                              <1> %else
   131                              <1>  %fatal Unknown optional keyword
   132                              <1> %endif
   133                              <1> %ifidni _CURRENT_SECTION_TYPE, DATA
   134                              <1>  %assign %%DATASECTION 1
   135                              <1> %else
   136                              <1>  %assign %%DATASECTION 0
   137                              <1> %endif
   138                              <1> %ifidni %4, single
   139                              <1>  %if ELDDATA_NEXT_STATUS == 1		; after next ?
   140                              <1>   %error Unexpected single data link after next data link
   141                              <1>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   142                              <1>   %assign ELDDATA_NEXT_STATUS 3		; note single with next/last present
   143                              <1>  %endif
   144                              <1>  %assign %%next 0
   145                              <1> %elifidni %4, next
   146                              <1>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   147                              <1>   %assign ELDDATA_NEXT_STATUS 1		; in next
   148                              <1>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   149                              <1>   %assign ELDDATA_NEXT_STATUS 1		; in next
   150                              <1>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   151                              <1>   %assign ELDDATA_NEXT_STATUS 1		; in next
   152                              <1>  %elif ELDDATA_NEXT_STATUS == 1		; repeated next ?
   153                              <1>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   156                              <1>    %error Unexpected next data link
   157                              <1>   %endif
   158                              <1>  %else
   159                              <1>   %error Next data link not allowed here
   160                              <1>  %endif
   161                              <1>  %ifn %%optional
   162                              <1>   %error Next data link only valid as optional or PM required
   163                              <1>  %endif
   164                              <1>  %assign %%next 400h
   165                              <1>  %assign ELDDATA_NEXT_ENTRY %%entry
   166                              <1>  %assign ELDDATA_NEXT_SECTION %%DATASECTION
   167                              <1>  %assign ELDDATA_NEXT_OTHER ELDOTHERLINK
   168                              <1> %elifidni %4, last
   169                              <1>  %if ELDDATA_NEXT_STATUS == 0		; no next/last yet ?
   170                              <1>   %error Next last data link not allowed here
   171                              <1>  %elif ELDDATA_NEXT_STATUS == 2		; after last ?
   172                              <1>   %error Next last data link not allowed here
   173                              <1>  %elif ELDDATA_NEXT_STATUS == 3		; after single ?
   174                              <1>   %error Next last data link not allowed here
   175                              <1>  %elif ELDDATA_NEXT_STATUS == 1		; after next ?
   176                              <1>   %if ELDDATA_NEXT_ENTRY != %%entry 	|| ELDDATA_NEXT_SECTION != %%DATASECTION 	|| ELDDATA_NEXT_OTHER != ELDOTHERLINK
   179                              <1>    %error Unexpected next data link
   180                              <1>   %endif
   181                              <1>   %assign ELDDATA_NEXT_STATUS 2		; note now after last
   182                              <1>  %else
   183                              <1>   %error Next data link not allowed here
   184                              <1>  %endif
   185                              <1>  %assign %%next 800h
   186                              <1>  %assign ELDDATA_NEXT_ENTRY -1
   187                              <1>  %assign ELDDATA_NEXT_SECTION -1
   188                              <1> %else
   189                              <1>  %fatal Unknown next keyword
   190                              <1> %endif
   191                              <1> 	%if ELDOTHERLINK
   192                              <1> %if ELDLINKER
   193                              <1>  %xdefine LINK_OTHER_LINKER_DATA_RELOCATIONS LINK_OTHER_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   194                              <1> %else
   195                              <1>  %xdefine LINK_OTHER_DATA_RELOCATIONS LINK_OTHER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   196                              <1> %endif
   197                              <1> 	%else
   198                              <1> %if ELDLINKER
   199                              <1>  %xdefine LINK_LINKER_DATA_RELOCATIONS LINK_LINKER_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   200                              <1> %else
   201                              <1>  %xdefine LINK_DATA_RELOCATIONS LINK_DATA_RELOCATIONS, 1 + %%DATASECTION + %%optional + %%next, %%entry, %%name
   202                              <1> %endif
   203                              <1> 	%endif
   204                              <1> %defstr %%string %1
   205                              <1> %strlen %%length %%string
   206                              <1> %if %%length > 64
   207                              <1> 	; Could be increased, but mustn't exceed 127 bytes
   208                              <1> 	;  because flag 80h is used to mark optional links
   209                              <1> 	;  that failed to be matched.
   210                              <1>  %error Too long link name: %1
   211                              <1> %endif
   212                              <1> %define LINK_DATA_CHECK %1
   213                              <1> 	%if ELDOTHERLINK
   214                              <1> 	linkdata_detect LINK_OTHER_DATA_DETECTION
   215                              <1> %if LINK_DATA_NEW
   216                              <1>  %xdefine LINK_OTHER_DATA_DETECTION LINK_OTHER_DATA_DETECTION, %1, %%name
   217                              <1> 	hashdef HASH, %%string
   218                              <1>  %xdefine LINK_OTHER_DATA_NAMES 	LINK_OTHER_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   220                              <1> %else
   221                              <1>  %%name equ LINK_DATA_DUPLICATE
   222                              <1> %endif
   223                              <1> 	%else
   224                              <1> 	linkdata_detect LINK_DATA_DETECTION
   225                              <1> %if LINK_DATA_NEW
   226                              <1>  %xdefine LINK_DATA_DETECTION LINK_DATA_DETECTION, %1, %%name
   227                              <1> 	hashdef HASH, %%string
   228                              <1>  %xdefine LINK_DATA_NAMES 	LINK_DATA_NAMES, %%name:, dw _HASH, {counted %%string}
   230                              <1> %else
   231                              <1>  %%name equ LINK_DATA_DUPLICATE
   232                              <1> %endif
   233                              <1> 	%endif
   234                              <1> 	eldstrictcheck
   235                              <1> 	%endmacro
   236                              <1> 
   237                              <1> 	%imacro linkdata_detect 2-*.nolist
   238                              <1> %assign LINK_DATA_NEW 1
   239                              <1> %rep (%0 - 2) / 2
   240                              <1>  %rotate 2
   241                              <1>  %ifidni %1, LINK_DATA_CHECK
   242                              <1>   %assign LINK_DATA_NEW 0
   243                              <1>   %xdefine LINK_DATA_DUPLICATE %2
   244                              <1>   %exitrep
   245                              <1>  %endif
   246                              <1> %endrep
   247                              <1> 	%endmacro
   248                              <1> 
   249                              <1> 	%imacro link_data_dump_names 1-*.nolist
   250                              <1> %rep %0
   251                              <1> 	%1
   252                              <1>  %rotate 1
   253                              <1> %endrep
   254                              <1> 	%endmacro
   255                              <1> 
   256                              <1> ; dw LINK_LINKER_DATA_RELOCATIONS, 0, 0
   257                              <1> ; dw LINK_DATA_RELOCATIONS, 0, 0
   258                              <1> ; link_data_dump_names ELDCALL_CODE_NAMES
   259                              <1> 
   260                              <1> %endif
    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 D011                    at eldhCodeImageLength,	dw code_size
   165 0000000E 0000                    at eldhCodeAllocLength,	dw 0
   166 00000010 40120000                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> 	numdef ELDDATA_NEXT, ELDDATA_NEXT_STATUS
    38                              <1> 	numdef ELDCALL_NEXT, ELDCALL_NEXT_STATUS
    39                              <1> %if _ELD_IDENTICALISE
    40                              <1>  ;%assign _ELDCALL_OPTIONAL 1
    41                              <1> %endif
    42                              <1> %ifn _ELDCALL_OPTIONAL
    43                              <1> %assign ELDCALL_OPTIONAL_STATUS 2		; not allowed
    44                              <1> %endif
    45                              <1> ;%ifn _ELDDATA_OPTIONAL
    46                              <1> ;%assign ELDDATA_OPTIONAL_STATUS 2		; not allowed
    47                              <1> ;%endif
    48                              <1> 	gendef MAP, ""
    49                              <1> 
    50                              <1> %ifnidni _MAP, ""
    51                              <1>  [map all _MAP]
    52                              <1> %endif
    53                              <1> 
    54                              <1> 
    55                              <1> endresident: equ ($ + _CURRENT_SECTION %+ FIXUP + 15) & ~15
    56                              <1> 
    57                              <1> %if _ELD_LINKER_PASSES
    58                              <1> %assign ELDLINKER 1
    59                              <1> 
    60                              <1> 	struc LINKTABLE
    61 00000000 ????????            <1> ltCodeToCode:	resw 2
    62 00000004 ????????            <1> ltCodeToData:	resw 2
    63 00000008 ????????            <1> ltDataToCode:	resw 2
    64 0000000C ????????            <1> ltDataToData:	resw 2
    65 00000010 ????????            <1> ltLinkData:	resw 2
    66 00000014 ????????            <1> ltLinkCode:	resw 2
    67                              <1> 	endstruc
    68                              <1> %endif
    69                              <1> 
    70                              <1> 
    71                              <1> 		; INP:	es:dx -> loaded initial ELD image
    72                              <1> 		;	 ELD instance structure filled
    73                              <1> 		;	es => ELD code area
    74                              <1> 		;	ds:di -> link info
    75                              <1> 		;	ss:bx -> loaded initial data
    76                              <1> 		;	ss:si -> command line tail
    77                              <1> 		;	cs:ip -> entrypoint
    78                              <1> 		;	ss:sp -> far return address for current mode
    79                              <1> 		; STT:	UP, EI
    80                              <1> linker:
    81                              <1> 		; The first 15 Bytes of the linker should be
    82                              <1> 		;  the same regardless of the linker options
    83                              <1> 		;  used (debug, passes, vstart). This allows
    84                              <1> 		;  the eldcomp ELD to match even if up to 15
    85                              <1> 		;  Bytes of the linker are trailing in the
    86                              <1> 		;  resident part of the ELD.
    87                              <1> 	lframe
    88                              <1>  %if ELDOTHER
    89                              <1> 	lvar dword, linkinfo_other
    90                              <1> 	lvar word, use_hash_other
    91                              <1>  %endif
    92 000007AB 5589E5              <1> 	lenter
    93                              <1> 	lvar dword, instance
    94 000007AE 06                  <1> 	 push es
    95 000007AF 52                  <1> 	 push dx		; -> start of where we're loaded in ELD cs
    96                              <1> 	lvar word, targetsection_low_optional_high
    97 000007B0 50                  <1> 	 push ax		; placeholder
    98                              <1> 	lequ ?targetsection_low_optional_high, targetsection
    99                              <1> 	lequ ?targetsection_low_optional_high + 1, optional
   100                              <1> 	lvar dword, linkinfo
   101 000007B1 1E                  <1> 	 push ds
   102 000007B2 57                  <1> 	 push di		; -> link info (in debugger ss or message seg)
   103                              <1> 	lvar dword, nextreloc
   104 000007B3 06                  <1> 	 push es		; => ELD cs
   105 000007B4 52                  <1> 	 push dx		; placeholder
   106                              <1> 	lvar dword, entry
   107 000007B5 06                  <1> 	 push es		; => ELD cs
   108 000007B6 50                  <1> 	 push ax		; placeholder
   109 000007B7 31C0                <1> 	xor ax, ax
   110 000007B9 813DD1E1            <1> 	cmp word [di + eldlSignature], 0E1D1h
   111                              <1> %if ($ - linker) < 16
   112                              <1>  %error Expected invariant first paragraph of linker
   113                              <1> %endif
   114 000007BD 7403                <1> 	je @F
   115                              <1> .error_j1:
   116 000007BF E92C03              <1> 	jmp .error		; signature mismatch -->
   117                              <1> @@:
   118 000007C2 837D0601            <1> 	cmp word [di + eldlUseLinkHash], 1
   119 000007C6 77F7                <1> 	ja .error_j1		; unknown use link hash number -->
   120 000007C8 7201                <1> 	jb @F
   121                              <1> %if _ELDDATA_NEXT || _ELDCALL_NEXT
   122                              <1> 	dec al			; = -1 if hash used
   123                              <1> %else
   124 000007CA 48                  <1> 	dec ax
   125                              <1> %endif
   126                              <1> @@:
   127                              <1> 	lvar word, use_hash_low_skip_last_high
   128 000007CB 50                  <1> 	 push ax		; = -1 if hash used, else 0
   129                              <1> 	lequ ?use_hash_low_skip_last_high, use_hash
   130                              <1> 	lequ ?use_hash_low_skip_last_high + 1, skip_last
   131                              <1> %if _ELD_IDENTICALISE && _ELD_LINKER_PASSES
   132                              <1> 	mov ax, linktable - code
   133                              <1> 	lvar word, lt
   134                              <1> 	 push ax		; -> link tables (a single reference)
   135                              <1> %endif
   136                              <1> %if _ELD_LINKER_PASSES || ELDOTHER || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   137 000007CC 31C0                <1> 	xor ax, ax
   138                              <1>  %if _ELD_LINKER_PASSES
   139                              <1> 	lvar word, pass
   140 000007CE 50                  <1> 	 push ax		; = 0 for linker itself, = 2 for application
   141                              <1> 	lvar word, amounterrors
   142 000007CF 50                  <1> 	 push ax		; how many distinct errors encountered in pass 2
   143                              <1>  %endif
   144                              <1>  %if _ELD_LINKER_PASSES || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   145                              <1> 	lvar word, name
   146 000007D0 50                  <1> 	 push ax		; -> name currently being sought (in our table)
   147                              <1>  %endif
   148                              <1>  %if ELDOTHER
   149                              <1> 	lvar word, other
   150                              <1> 	 push ax		; byte: 0 = own data links, -1 = other data links
   151                              <1>  %endif
   152                              <1>  %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   153                              <1> 	lvar word, optionalmissing
   154 000007D1 50                  <1> 	 push ax
   155                              <1>  %endif
   156                              <1> %endif
   157 000007D2 56                  <1> 	push si			; -> command line tail
   158 000007D3 53                  <1> 	push bx			; -> data block in ELD data area (segment ss)
   159                              <1> 
   160                              <1> 			; simple: add instance base (dx) to code
   161 000007D4 06                  <1> 	push es
   162 000007D5 1F                  <1> 	pop ds			; ds = es => ELD cs
   163                              <1> %if _ELD_LINKER_PASSES
   164                              <1> .pass:
   165 000007D6 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   166 000007D9 01D3                <1> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   167                              <1>  %if _ELD_IDENTICALISE
   168                              <1> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   169                              <1> 	mov si, word [ltCodeToCode + bx]
   170                              <1>  %else
   171 000007DB 8BB7080C            <1> 	mov si, word [linktable - code + ltCodeToCode + bx]
   172                              <1>  %endif
   173                              <1> %else
   174                              <1> 	mov si, internalcodetocoderelocations - code
   175                              <1> %endif		 		; si -> table for code to code (linker or app)
   176 000007DF 01D6                <1> 	add si, dx		; relocate the table pointer itself
   177                              <1> @@:
   178 000007E1 AD                  <1> 	lodsw
   179 000007E2 85C0                <1> 	test ax, ax		; was last ?
   180 000007E4 740B                <1> 	jz @F			; yes -->
   181 000007E6 93                  <1> 	xchg bx, ax		; bx = entry
   182 000007E7 01D3                <1> 	add bx, dx		; relocate the entry itself
   183                              <1> %if _ELD_CODE_VSTART
   184 000007E9 812F[0000]          <1> 	sub word [bx], code	; undo adjustment
   185                              <1> %endif
   186 000007ED 0117                <1> 	add word [bx], dx	; relocate word referenced by entry
   187 000007EF EBF0                <1> 	jmp @B
   188                              <1> 
   189                              <1> @@:
   190                              <1> 			; next, add heap data base (on stack) to code
   191                              <1> %if _ELD_LINKER_PASSES
   192 000007F1 8B5EEA              <1> 	mov bx, word [bp + ?pass]	; 0 or 2
   193 000007F4 01D3                <1> 	add bx, dx		; -> start of the ELD instance in cs, +0 or +2
   194                              <1>  %if _ELD_IDENTICALISE
   195                              <1> 	add bx, word [bp + ?lt]	; add in single reference to linktable
   196                              <1> 	mov si, word [ltCodeToData + bx]
   197                              <1>  %else
   198 000007F6 8BB70C0C            <1> 	mov si, word [linktable - code + ltCodeToData + bx]
   199                              <1>  %endif
   200                              <1> %else
   201                              <1> 	mov si, internalcodetodatarelocations - code
   202                              <1> %endif				; si -> table for code to data (linker or app)
   203 000007FA 01D6                <1> 	add si, dx		; relocate the table pointer itself
   204                              <1> @@:
   205 000007FC AD                  <1> 	lodsw
   206 000007FD 85C0                <1> 	test ax, ax		; was last ?
   207 000007FF 740C                <1> 	jz @F			; yes -->
   208 00000801 93                  <1> 	xchg bx, ax		; bx = entry
   209 00000802 01D3                <1> 	add bx, dx		; relocate the entry itself
   210                              <1> 		; ! access the offset of the data area block, topmost on stack
   211 00000804 58                  <1> 	pop ax			; ax -> heap data
   212 00000805 50                  <1> 	push ax
   213                              <1> %if _ELD_DATA_VSTART
   214 00000806 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   215                              <1> %endif
   216 00000809 0107                <1> 	add word [bx], ax	; relocate word referenced by entry
   217 0000080B EBEF                <1> 	jmp @B
   218                              <1> 
   219                              <1> @@:
   220                              <1> 
   221                              <1> 			; add instance base (dx) to data
   222                              <1> %if _ELD_LINKER_PASSES
   223 0000080D 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   224 00000810 01D3                <1> 	add bx, dx
   225                              <1>  %if _ELD_IDENTICALISE
   226                              <1> 	add bx, word [bp + ?lt]
   227                              <1> 	mov si, word [ltDataToCode + bx]
   228                              <1>  %else
   229 00000812 8BB7100C            <1> 	mov si, word [linktable - code + ltDataToCode + bx]
   230                              <1>  %endif
   231                              <1> %else
   232                              <1> 	mov si, internaldatatocoderelocations - code
   233                              <1> %endif
   234 00000816 01D6                <1> 	add si, dx
   235                              <1> @@:
   236 00000818 AD                  <1> 	lodsw
   237 00000819 83F8FF              <1> 	cmp ax, -1		; was last ?
   238 0000081C 740F                <1> 	je @F			; yes -->
   239 0000081E 93                  <1> 	xchg bx, ax		; bx = entry
   240                              <1> 		; ! access the offset of the data area block, topmost on stack
   241 0000081F 58                  <1> 	pop ax
   242 00000820 50                  <1> 	push ax
   243 00000821 01C3                <1> 	add bx, ax		; relocate the entry itself
   244                              <1> %if _ELD_CODE_VSTART
   245 00000823 36812F[0000]        <1> 	sub word [ss:bx], code	; undo adjustment
   246                              <1> %endif
   247 00000828 360117              <1> 	add word [ss:bx], dx	; relocate word referenced by entry
   248 0000082B EBEB                <1> 	jmp @B
   249                              <1> 
   250                              <1> @@:
   251                              <1> 			; next, add heap data base (on stack) to data
   252                              <1> %if _ELD_LINKER_PASSES
   253 0000082D 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   254 00000830 01D3                <1> 	add bx, dx
   255                              <1>  %if _ELD_IDENTICALISE
   256                              <1> 	add bx, word [bp + ?lt]
   257                              <1> 	mov si, word [ltDataToData + bx]
   258                              <1>  %else
   259 00000832 8BB7140C            <1> 	mov si, word [linktable - code + ltDataToData + bx]
   260                              <1>  %endif
   261                              <1> %else
   262                              <1> 	mov si, internaldatatodatarelocations - code
   263                              <1> %endif
   264 00000836 01D6                <1> 	add si, dx
   265                              <1> @@:
   266 00000838 AD                  <1> 	lodsw
   267 00000839 83F8FF              <1> 	cmp ax, -1		; was last ?
   268 0000083C 740D                <1> 	je @F			; yes -->
   269 0000083E 93                  <1> 	xchg bx, ax		; bx = entry
   270                              <1> 		; ! access the offset of the data area block, topmost on stack
   271 0000083F 58                  <1> 	pop ax			; ax -> heap data
   272 00000840 50                  <1> 	push ax
   273 00000841 01C3                <1> 	add bx, ax		; relocate the entry itself
   274                              <1> %if _ELD_DATA_VSTART
   275 00000843 2D[0000]            <1> 	sub ax, datastart	; undo adjustment
   276                              <1> %endif
   277 00000846 360107              <1> 	add word [ss:bx], ax	; relocate word referenced by entry
   278 00000849 EBED                <1> 	jmp @B
   279                              <1> 
   280                              <1> @@:
   281 0000084B 8B56FC              <1> 	mov dx, word [bp + ?instance]
   282                              <1> 				; reset (why??) -> ELD instance in ELD cs
   283                              <1> %if _ELD_LINKER_PASSES
   284 0000084E 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   285 00000851 01D3                <1> 	add bx, dx
   286                              <1>  %if _ELD_IDENTICALISE
   287                              <1> 	add bx, word [bp + ?lt]
   288                              <1> 	add dx, word [ltLinkData + bx]
   289                              <1>  %else
   290 00000853 0397180C            <1> 	add dx, word [linktable - code + ltLinkData + bx]
   291                              <1>  %endif
   292                              <1> %else
   293                              <1> 	add dx, linkerdatarelocations - code
   294                              <1> %endif
   295                              <1> .otherloop:
   296 00000857 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   297                              <1> 				; -> data link relocation table
   298                              <1> 
   299                              <1> .datarelocloop:		; must be done before further relocs
   300 0000085A C576F2              <1> 	lds si, [bp + ?nextreloc]
   301 0000085D AD                  <1> 	lodsw			; ax = section indicator
   302 0000085E 85C0                <1> 	test ax, ax		; end of table ?
   303 00000860 7503E96601          <1> 	jz .donedatareloc
   304 00000865 48                  <1> 	dec ax			; al = 1 if data, 0 if code (NB ah may != 0)
   305                              <1> 		; ! access the offset of the data area block, topmost on stack
   306 00000866 5B                  <1> 	pop bx
   307 00000867 53                  <1> 	push bx			; bx -> ELD data block
   308 00000868 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   309 0000086B 84C0                <1> 	test al, al		; data ?
   310 0000086D AD                  <1> 	lodsw
   311 0000086E 7504                <1> 	jnz @F			; yes -->
   312 00000870 0346FC              <1> 	add ax, word [bp + ?instance]
   313                              <1> 				; relocate entry into code
   314 00000873 A9                  <1> 	db __TEST_IMM16		; (skip add)
   315                              <1> @@:
   316 00000874 01D8                <1> 	add ax, bx		; relocate entry into data
   317 00000876 8946EE              <1> 	mov word [bp + ?entry], ax
   318                              <1> 				; save away -> where to patch
   319 00000879 AD                  <1> 	lodsw			; get unrelocated -> name
   320 0000087A 8976F2              <1> 	mov word [bp + ?nextreloc], si
   321                              <1> 				; update -> behind relocation table entry
   322                              <1> %if _ELDDATA_NEXT
   323                              <1> 	rol byte [bp + ?skip_last], 1	; skipping ?
   324                              <1> 	jnc @F				; no -->
   325                              <1> 	test byte [bp + ?optional], 8	; is it a last relocation ?
   326                              <1> 	jz .datarelocloop		; no, leave skip_last set -->
   327                              <1> 	not byte [bp + ?skip_last]	; disable skip_last
   328                              <1> 	jmp .datarelocloop
   329                              <1> @@:
   330                              <1> %endif
   331 0000087D E81001              <1> 	call .build_match	; get ax = scan value, si -> counted string,
   332                              <1> 				;  dl = original value at byte [si]
   333                              <1> 				; NC if symbol already not found before
   334                              <1> 				; CY if to search for the symbol
   335                              <1> %if _ELD_LINKER_PASSES
   336 00000880 73D8                <1> 	jnc .datarelocloop	; if duplicate of a not found symbol -->
   337                              <1> %endif
   338 00000882 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   339                              <1> %if ELDOTHER
   340                              <1> 	rol byte [bp + ?other], 1
   341                              <1> 	jnc @F
   342                              <1> 	les bx, [bp + ?linkinfo_other]
   343                              <1> @@:
   344                              <1> %endif				; es:bx -> link info table of the ELD host
   345 00000885 268B4F08            <1> 	mov cx, word [es:bx + eldlDataAmount]	; amount data link info
   346 00000889 268B7F0A            <1> 	mov di, word [es:bx + eldlDataPrefixes]	; -> prefixes or hashes
   347                              <1> .datarelocfind:
   348 0000088D 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   349 00000890 F2AF                <1> 	repne scasw			; scan initial
   350                              <1> %if _ELDDATA_OPTIONAL
   351                              <1> 	jne .datanotfound_may_be_optional
   352                              <1> %else
   353 00000892 7403E98900          <1> 	jne .datanotfound
   354                              <1> %endif
   355 00000897 57                  <1> 	push di
   356 00000898 51                  <1> 	push cx
   357 00000899 56                  <1> 	push si
   358 0000089A 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   359 0000089E 4F                  <1> 	dec di
   360 0000089F 4F                  <1> 	dec di				; 0-based
   361 000008A0 26037F0C            <1> 	add di, word [es:bx + eldlDataEntries]	; -> entry
   362 000008A4 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   363 000008A7 B500                <1> 	mov ch, 0
   364 000008A9 8A0C                <1> 	mov cl, byte [si]		; cx = length
   365 000008AB 41                  <1> 	inc cx
   366                              <1> 	; cmp al, al			; ZR if length is zero
   367 000008AC F3A6                <1> 	repe cmpsb			; match ?
   368 000008AE 5E                  <1> 	pop si
   369 000008AF 59                  <1> 	pop cx
   370 000008B0 5F                  <1> 	pop di
   371 000008B1 75DA                <1> 	jne .datarelocfind		; if not found this time,
   372                              <1> 					;  scan for next initial -->
   373 000008B3 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   374 000008B5 262B7F0A            <1> 	sub di, word [es:bx + eldlDataPrefixes]	; = double index, 1-based
   375 000008B9 4F                  <1> 	dec di
   376 000008BA 4F                  <1> 	dec di				; 0-based
   377 000008BB 26037F0E            <1> 	add di, word [es:bx + eldlDataAddresses]	; -> address (offset)
   378 000008BF 268B05              <1> 	mov ax, word [es:di]		; get link data from the table
   379 000008C2 E80700              <1> 	call .address_data_reloc
   380                              <1> %if _ELD_RELOC_VSTART
   381 000008C5 2D[0000]            <1> 	sub ax, relocateddata		; *not* a relocation
   382                              <1> %endif
   383 000008C8 0104                <1> 	add word [si], ax		; relocate
   384                              <1> %if _ELDDATA_NEXT
   385                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   386                              <1> 	jz .datarelocloop
   387                              <1> 	mov byte [bp + ?skip_last], -1	; skip subsequent next/last relocs
   388                              <1> %endif
   389 000008CA EB8E                <1> 	jmp .datarelocloop
   390                              <1> 
   391                              <1> .address_data_reloc:
   392 000008CC C576EE              <1> 	lds si, [bp + ?entry]		; -> entry if in ELD code instance
   393 000008CF 807EFA00            <1> 	cmp byte [bp + ?targetsection], 0
   394                              <1> 					; relocation in code ?
   395 000008D3 7402                <1> 	je @F				; yes -->
   396 000008D5 16                  <1> 	push ss
   397 000008D6 1F                  <1> 	pop ds				; => our ELD data block
   398                              <1> @@:
   399 000008D7 C3                  <1> 	retn
   400                              <1> 
   401                              <1> %if _ELDDATA_OPTIONAL
   402                              <1> .datanotfound_may_be_optional:
   403                              <1> 	mov byte [si], dl		; restore the original byte at counter
   404                              <1> %if _ELDDATA_NEXT
   405                              <1> 	test byte [bp + ?optional], 3	; is it an optional relocation ?
   406                              <1> %else
   407                              <1> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   408                              <1> %endif
   409                              <1> %if _ELD_DEBUG
   410                              <1> 	jnz @F
   411                              <1>  %ifn _ELD_LINKER_PASSES
   412                              <1> 	mov si, 0			; (invalid link)
   413                              <1> linkdatarelocation internalflags6
   414                              <1> 	test si, si
   415                              <1> 	jz .datanotfound
   416                              <1> 	mov si, 0			; (invalid link)
   417                              <1> linkdatarelocation options7
   418                              <1> 	test si, si
   419                              <1> 	jz .datanotfound
   420                              <1>  %else
   421                              <1> 	cmp byte [bp + ?pass], 0
   422                              <1> 	je .datanotfound
   423                              <1>  %endif
   424                              <1> 	houdini				; (the above conditions are for this)
   425                              <1> 	jmp .datanotfound
   426                              <1> @@:
   427                              <1> %else
   428                              <1> 	jz .datanotfound		; no, handle as an error -->
   429                              <1> %endif
   430                              <1> 
   431                              <1> %if ELDDATA_PMREQUIRED_STATUS
   432                              <1> 	mov si, relocateddata
   433                              <1> linkdatarelocation build_option_PM
   434                              <1> 	test si, si			; is it a PM build ?
   435                              <1> 	jz @F				; no --> (treat PM required as optional)
   436                              <1> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   437                              <1> 	jnz .datanotfound		; yes, handle as an error -->
   438                              <1> @@:
   439                              <1> %endif
   440                              <1> 
   441                              <1> %if _ELD_LINKER_PASSES
   442                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   443                              <1> 	rol byte [bp + ?optionalmissing], 1
   444                              <1> 	jnc .optionaldatamissingmsg
   445                              <1> 	mov si, [bp + ?name]
   446                              <1> 	or byte [si], 80h
   447                              <1> 	not byte [bp + ?optionalmissing]
   448                              <1> 	jmp @F
   449                              <1> .optionaldatamissingmsg:
   450                              <1> %endif
   451                              <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   452                              <1> linkdatarelocation options7, -3
   453                              <1> 	jz @F				; no -->
   454                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   455                              <1> 	mov byte [bp + ?optionalmissing + 1], -1
   456                              <1> %endif
   457                              <1> 	mov si, lmsg.warning_data_optional
   458                              <1> internalcoderelocation
   459                              <1> 	call .notfound			; display a warning
   460                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   461                              <1> 	not byte [bp + ?optionalmissing + 1]
   462                              <1> %endif
   463                              <1> @@:
   464                              <1> %endif
   465                              <1> %if _ELDDATA_NEXT
   466                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   467                              <1> 	jnz .datarelocloop
   468                              <1> %endif
   469                              <1> 	call .address_data_reloc
   470                              <1> 	and word [si], 0		; indicate optional data link failed
   471                              <1> 	jmp .datarelocloop
   472                              <1> %endif
   473                              <1> 
   474                              <1> 
   475                              <1> %if _ELDCALL_OPTIONAL
   476                              <1> .codenotfound_may_be_optional:
   477 000008D8 8814                <1> 	mov byte [si], dl		; restore the original byte at counter
   478                              <1> %if _ELDCALL_NEXT
   479                              <1> 	test byte [bp + ?optional], 3	; is it an optional relocation ?
   480                              <1> %else
   481 000008DA 807EFB00            <1> 	cmp byte [bp + ?optional], 0	; is it an optional relocation ?
   482                              <1> %endif
   483                              <1> %if _ELD_DEBUG
   484                              <1> 	jnz @F
   485                              <1>  %ifn _ELD_LINKER_PASSES
   486                              <1> 	mov si, 0			; (invalid link)
   487                              <1> linkdatarelocation internalflags6
   488                              <1> 	test si, si
   489                              <1> 	jz .codenotfound
   490                              <1> 	mov si, 0			; (invalid link)
   491                              <1> linkdatarelocation options7
   492                              <1> 	test si, si
   493                              <1> 	jz .codenotfound
   494                              <1>  %else
   495                              <1> 	cmp byte [bp + ?pass], 0
   496                              <1> 	je .codenotfound
   497                              <1>  %endif
   498                              <1> 	houdini				; (the above conditions are for this)
   499                              <1> 	jmp .codenotfound
   500                              <1> @@:
   501                              <1> %else
   502 000008DE 7451                <1> 	jz .codenotfound		; no, handle as an error -->
   503                              <1> %endif
   504                              <1> 
   505                              <1> %if ELDCALL_PMREQUIRED_STATUS
   506                              <1>  %if _ELD_LINKER_PASSES
   507                              <1>   %assign ELDLINKER 0
   508                              <1>  %endif
   509 000008E0 BE[0000]            <1> 	mov si, relocateddata
   510                              <1> linkdatarelocation build_option_PM
   511                              <1>  %if _ELD_LINKER_PASSES
   512                              <1>   %assign ELDLINKER 1
   513                              <1>  %endif
   514 000008E3 85F6                <1> 	test si, si			; is it a PM build ?
   515 000008E5 7406                <1> 	jz @F				; no --> (treat PM required as optional)
   516 000008E7 F646FB02            <1> 	test byte [bp + ?optional], 2	; optional status is PM required ?
   517 000008EB 7544                <1> 	jnz .codenotfound		; yes, handle as an error -->
   518                              <1> @@:
   519                              <1> %endif
   520                              <1> 
   521                              <1> %if _ELD_LINKER_PASSES
   522                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   523 000008ED D046E4              <1> 	rol byte [bp + ?optionalmissing], 1
   524 000008F0 730B                <1> 	jnc .optionalcodemissingmsg
   525 000008F2 8B76E6              <1> 	mov si, [bp + ?name]
   526 000008F5 800C80              <1> 	or byte [si], 80h
   527 000008F8 F656E4              <1> 	not byte [bp + ?optionalmissing]
   528 000008FB EB15                <1> 	jmp @F
   529                              <1> .optionalcodemissingmsg:
   530                              <1> %endif
   531 000008FD 36F606[0000]02      <1> 	testopt [ss:relocateddata], 2	; debug optional link ?
   532                              <1> linkdatarelocation options7, -3
   533 00000903 740D                <1> 	jz @F				; no -->
   534                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   535 00000905 C646E5FF            <1> 	mov byte [bp + ?optionalmissing + 1], -1
   536                              <1> %endif
   537 00000909 BE[6F11]            <1> 	mov si, lmsg.warning_code_optional
   538                              <1> internalcoderelocation
   539 0000090C E83000              <1> 	call .notfound			; display a warning
   540                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   541 0000090F F656E5              <1> 	not byte [bp + ?optionalmissing + 1]
   542                              <1> %endif
   543                              <1> @@:
   544                              <1> %endif
   545                              <1> %if _ELDCALL_NEXT
   546                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   547                              <1> 	jnz .coderelocloop
   548                              <1> %endif
   549 00000912 C576EE              <1> 	lds si, [bp + ?entry]		; -> code site (must be in ELD cs)
   550 00000915 C7049090            <1> 	mov word [si], 9090h
   551 00000919 C6440290            <1> 	mov byte [si + 2], 90h		; indicate optional code link failed
   552                              <1> 					;  (NOP out the 3-byte call near imm)
   553 0000091D E9BA00              <1> 	jmp .coderelocloop
   554                              <1> %endif
   555                              <1> 
   556                              <1> 
   557                              <1> %if _ELD_LINKER_PASSES
   558                              <1> .datanotfound:
   559 00000920 BE[9111]            <1> 	mov si, lmsg.error_data
   560                              <1> internalcoderelocation
   561 00000923 E81900              <1> 	call .notfound			; display error
   562 00000926 7306                <1> 	jnc .error_j3			; NC if in pass 0, error out now -->
   563 00000928 FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   564 0000092B E92CFF              <1> 	jmp .datarelocloop		; go to next relocation entry -->
   565                              <1> 
   566                              <1> .error_j3:
   567 0000092E E9BD01              <1> 	jmp .error
   568                              <1> 
   569                              <1> .codenotfound:
   570 00000931 BE[AA11]            <1> 	mov si, lmsg.error_code
   571                              <1> internalcoderelocation
   572 00000934 E80800              <1> 	call .notfound			; display error
   573 00000937 73F5                <1> 	jnc .error_j3			; NC if in pass 0 -->
   574 00000939 FF46E8              <1> 	inc word [bp + ?amounterrors]	; count the amount of errors
   575 0000093C E99B00              <1> 	jmp .coderelocloop		; go to next -->
   576                              <1> 
   577                              <1> .notfound:
   578 0000093F 807EEA00            <1> 	cmp byte [bp + ?pass], 0	; pass 0 ?
   579 00000943 7442                <1> 	je .notfound.retn		; yes, do not try displaying --> (NC)
   580 00000945 16                  <1> 	 push ss
   581 00000946 07                  <1> 	 pop es
   582 00000947 BF[0000]            <1> 	mov di, relocateddata
   583                              <1> linkdatarelocation line_out		; es:di -> line_out buffer
   584 0000094A E83B00              <1> 	call .copy			; copy prefix message
   585 0000094D 8B76E6              <1> 	mov si, word [bp + ?name]
   586 00000950 AD                  <1> 	lodsw				; = hash
   587 00000951 E8[0000]EB020000    <1> 	extcall hexword			; display the hash in hex
   588 00000958 56                  <1> 	push si
   589 00000959 BE[C311]            <1> 	mov si, lmsg.error.2
   590                              <1> internalcoderelocation
   591 0000095C E82900              <1> 	call .copy			; display message fragment
   592 0000095F 5E                  <1> 	pop si
   593                              <1> %if _ELD_LINKER_PASSES
   594 00000960 56                  <1> 	push si
   595 00000961 E82400              <1> 	call .copy			; copy over the full name
   596 00000964 5E                  <1> 	pop si
   597                              <1>  %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   598 00000965 800C80              <1> 	or byte [si], 80h		; mark as failed optional link
   599 00000968 D046E5              <1> 	rol byte [bp + ?optionalmissing + 1], 1
   600                              <1> 					; was it optional ?
   601 0000096B 7203                <1> 	jc @F				; yes -->
   602                              <1>  %endif
   603 0000096D C60400              <1> 	mov byte [si], 0		; mark as failed (counter byte = 0)
   604                              <1> @@:
   605                              <1> %else
   606                              <1> 	call .copy
   607                              <1> %endif
   608 00000970 B022                <1> 	mov al, '"'
   609 00000972 AA                  <1> 	stosb				; end message with a closing quote mark
   610 00000973 16                  <1> 	 push ss
   611 00000974 1F                  <1> 	 pop ds
   612 00000975 E8[0000]EB020000    <1> 	extcall putsline_crlf		; display diagnostic line
   613 0000097C B8350E              <1> 	mov ax, 0E35h
   614 0000097F E8[0000]EB020000    <1> 	extcall setrc
   615 00000986 F9                  <1> 	stc				; CY, diagnostic displayed
   616                              <1> .notfound.retn:
   617 00000987 C3                  <1> 	retn
   618                              <1> 
   619                              <1> .copy:		; (cannot use extcallcall here)
   620 00000988 E8[0000]EB020000    <1> 	extcall copy_single_counted_string
   621 0000098F C3                  <1> 	retn
   622                              <1> %else
   623                              <1> .datanotfound: equ .error
   624                              <1> .codenotfound: equ .error
   625                              <1> %endif
   626                              <1> 
   627                              <1> .build_match:
   628                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   629 00000990 C646E400            <1> 	mov byte [bp + ?optionalmissing], 0
   630                              <1> 		; This is needed for eldtestj.asm with debugoptlink.
   631                              <1> 		;  The optional data link sets flag 80h, then the
   632                              <1> 		;  required data link to the same symbol sets this
   633                              <1> 		;  flag but doesn't reset it. So the first optional
   634                              <1> 		;  code link still had this set. Reset here to fix.
   635                              <1> %endif
   636                              <1> %if _ELD_CODE_VSTART
   637 00000994 2D[0000]            <1> 	sub ax, code			; revert adjustment (= displacement)
   638                              <1> %endif
   639 00000997 0346FC              <1> 	add ax, word [bp + ?instance]	; make displacement into -> name string
   640 0000099A 96                  <1> 	xchg si, ax			; si -> hash word, counted name string
   641                              <1> %if _ELD_LINKER_PASSES || _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   642 0000099B 8976E6              <1> 	mov word [bp + ?name], si	; save away for diagnostics
   643                              <1> %endif
   644 0000099E AD                  <1> 	lodsw			; = hash, si -> counted string
   645 0000099F 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   646                              <1> %if _ELD_LINKER_PASSES
   647 000009A1 84D2                <1> 	test dl, dl		; marked as already failed ?
   648                              <1> 				;  (80h = optional, 0 = required)
   649 000009A3 750A                <1> 	jnz @F			; no -->
   650 000009A5 837EE800            <1> 	cmp word [bp + ?amounterrors], 0
   651                              <1> 				; validate error status
   652 000009A9 7503E9B300          <1> 	je .error_j		; no error known ?! cancel quickly -->
   653 000009AE C3                  <1> 	retn			; (NC)
   654                              <1> 
   655                              <1> @@:
   656                              <1> %else
   657                              <1> 	test dl, dl
   658                              <1> %endif
   659                              <1> %if _ELDDATA_OPTIONAL || _ELDCALL_OPTIONAL
   660 000009AF 7909                <1> 	jns @F
   661 000009B1 80E27F              <1> 	and dl, 7Fh
   662 000009B4 8814                <1> 	mov byte [si], dl
   663 000009B6 C646E4FF            <1> 	mov byte [bp + ?optionalmissing], -1
   664                              <1> @@:
   665                              <1> %endif
   666                              <1> %if ELDOTHER
   667                              <1> 	rol byte [bp + ?other], 1
   668                              <1> 	jnc @F
   669                              <1> 	rol byte [bp + ?use_hash_other], 1
   670                              <1> 	jmp @FF
   671                              <1> 
   672                              <1> @@:
   673                              <1> %endif
   674 000009BA D046EC              <1> 	rol byte [bp + ?use_hash], 1
   675                              <1> @@:
   676                              <1> 		; If to use the hash, then ax = hash and si ->
   677                              <1> 		;  the entire symbol name as a counted string.
   678 000009BD 720A                <1> 	jc @F			; if to use hash, return now -->
   679 000009BF AC                  <1> 	lodsb			; al = length
   680 000009C0 91                  <1> 	xchg cx, ax		; cl = length
   681 000009C1 AD                  <1> 	lodsw			; ax = prefix
   682 000009C2 49                  <1> 	dec cx
   683 000009C3 49                  <1> 	dec cx			; cl = adjusted length
   684 000009C4 4E                  <1> 	dec si			; -> second byte of prefix
   685 000009C5 8A14                <1> 	mov dl, byte [si]	; dl = original start byte of match
   686 000009C7 880C                <1> 	mov byte [si], cl	; si -> counted string suffix
   687                              <1> 		; (this name entry has been edited to provide the
   688                              <1> 		;  name suffix as a counted string, as required by
   689                              <1> 		;  the old-style non-hash link info tables.
   690                              <1> 		; it will be reset later by writing dl to si -> the
   691                              <1> 		;  first byte of the match string.)
   692                              <1> @@:
   693                              <1> %if _ELD_LINKER_PASSES
   694 000009C9 F9                  <1> 	stc			; CY
   695                              <1> %endif
   696 000009CA C3                  <1> 	retn
   697                              <1> 
   698                              <1> 
   699                              <1> .donedatareloc:
   700                              <1> %if ELDOTHER
   701                              <1> 	rol byte [bp + ?other], 1
   702                              <1> 	jc .otherdone		; other link only has data links,
   703                              <1> 				;  so at this point we're done -->
   704                              <1> %endif
   705                              <1> 
   706 000009CB 8B56FC              <1> 	mov dx, word [bp + ?instance]
   707                              <1> %if _ELD_LINKER_PASSES
   708 000009CE 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   709 000009D1 01D3                <1> 	add bx, dx
   710                              <1>  %if _ELD_IDENTICALISE
   711                              <1> 	add bx, word [bp + ?lt]
   712                              <1> 	add dx, word [ltLinkCode + bx]
   713                              <1>  %else
   714 000009D3 03971C0C            <1> 	add dx, word [linktable - code + ltLinkCode + bx]
   715                              <1>  %endif
   716                              <1> %else
   717                              <1> 	add dx, linkercoderelocations - code
   718                              <1> %endif
   719 000009D7 8956F2              <1> 	mov word [bp + ?nextreloc], dx
   720                              <1> 
   721                              <1> .coderelocloop:
   722 000009DA C576F2              <1> 	lds si, [bp + ?nextreloc]
   723 000009DD AD                  <1> 	lodsw
   724                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
   725 000009DE 48                  <1> 	dec ax				; optional word is 1-based, get 0-based
   726 000009DF 7903E98F00          <1> 	js .donecodereloc
   727 000009E4 8946FA              <1> 	mov word [bp + ?targetsection_low_optional_high], ax
   728 000009E7 AD                  <1> 	lodsw
   729                              <1> %endif
   730 000009E8 0346FC              <1> 	add ax, word [bp + ?instance]
   731 000009EB 8946EE              <1> 	mov word [bp + ?entry], ax
   732 000009EE AD                  <1> 	lodsw
   733 000009EF 8976F2              <1> 	mov word [bp + ?nextreloc], si
   734                              <1> %ifn _ELDCALL_OPTIONAL || _ELDCALL_NEXT
   735                              <1> 	test ax, ax			; if no optional word, check -> match
   736                              <1> 	jz .donecodereloc
   737                              <1> %endif
   738                              <1> %if _ELDCALL_NEXT
   739                              <1> 	rol byte [bp + ?skip_last], 1	; skipping ?
   740                              <1> 	jnc @F				; no -->
   741                              <1> 	test byte [bp + ?optional], 8	; is it a last relocation ?
   742                              <1> 	jz .coderelocloop		; no, leave skip_last set -->
   743                              <1> 	not byte [bp + ?skip_last]	; disable skip_last
   744                              <1> 	jmp .coderelocloop
   745                              <1> @@:
   746                              <1> %endif
   747 000009F2 E89BFF              <1> 	call .build_match
   748                              <1> %if _ELD_LINKER_PASSES
   749 000009F5 73E3                <1> 	jnc .coderelocloop
   750                              <1> %endif
   751 000009F7 C45EF6              <1> 	les bx, [bp + ?linkinfo]
   752 000009FA 268B4F10            <1> 	mov cx, word [es:bx + eldlCodeAmount]	; amount code link info
   753 000009FE 268B7F12            <1> 	mov di, word [es:bx + eldlCodePrefixes]	; -> prefixes or hashes
   754                              <1> .coderelocfind:
   755 00000A02 83F901              <1> 	cmp cx, 1			; NZ if cx == 0
   756 00000A05 F2AF                <1> 	repne scasw			; scan initial
   757                              <1> %if _ELDCALL_OPTIONAL
   758 00000A07 7403E9CCFE          <1> 	jne .codenotfound_may_be_optional
   759                              <1> %else
   760                              <1>  %if _ELD_DEBUG
   761                              <1> 	je @F
   762                              <1> 	houdini
   763                              <1> 	jmp .codenotfound
   764                              <1> @@:
   765                              <1>  %else
   766                              <1> 	jne .codenotfound
   767                              <1>  %endif
   768                              <1> %endif
   769 00000A0C 57                  <1> 	push di
   770 00000A0D 51                  <1> 	push cx
   771 00000A0E 56                  <1> 	push si
   772 00000A0F 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   773 00000A13 4F                  <1> 	dec di
   774 00000A14 4F                  <1> 	dec di				; 0-based
   775 00000A15 26037F14            <1> 	add di, word [es:bx + eldlCodeEntries]	; -> entry
   776 00000A19 268B3D              <1> 	mov di, [es:di]			; -> counted suffix/string
   777 00000A1C B500                <1> 	mov ch, 0
   778 00000A1E 8A0C                <1> 	mov cl, byte [si]		; cx = length
   779 00000A20 41                  <1> 	inc cx
   780                              <1> 	; cmp al, al			; ZR if length is zero
   781 00000A21 F3A6                <1> 	repe cmpsb			; match ?
   782 00000A23 5E                  <1> 	pop si
   783 00000A24 59                  <1> 	pop cx
   784 00000A25 5F                  <1> 	pop di
   785 00000A26 75DA                <1> 	jne .coderelocfind
   786 00000A28 8814                <1> 	mov byte [si], dl
   787 00000A2A 262B7F12            <1> 	sub di, word [es:bx + eldlCodePrefixes]	; = double index, 1-based
   788 00000A2E 4F                  <1> 	dec di
   789 00000A2F 4F                  <1> 	dec di				; 0-based
   790 00000A30 01FF                <1> 	add di, di			; quadruple index
   791 00000A32 26037F16            <1> 	add di, word [es:bx + eldlCodeAddresses]	; -> address (offset, segment)
   792 00000A36 26FF35              <1> 	push word [es:di]
   793 00000A39 C576EE              <1> 	lds si, [bp + ?entry]
   794 00000A3C 8F4405              <1> 	pop word [si + 3 + 2]		; call near imm (3), jmp short (2)
   795                              <1> 					;  patch the destination address
   796 00000A3F 803CE8              <1> 	cmp byte [si], 0E8h		; is it as expected ?
   797 00000A42 751D                <1> 	jne .error_j
   798 00000A44 268B7D02            <1> 	mov di, word [es:di + 2]
   799 00000A48 BB[0000]            <1> 	mov bx, relocateddata
   800                              <1> linkdatarelocation linkcall_table	; ss:bx -> link call table
   801 00000A4B 36833F01            <1> 	cmp word [ss:bx], 1		; is it initialised to format 1 ?
   802 00000A4F 7510                <1> 	jne .error_j			; no -->
   803 00000A51 368B4F02            <1> 	mov cx, word [ss:bx + 2]	; get amount of segments
   804 00000A55 E30A                <1> 	jcxz .error_j			; none -->
   805                              <1> @@:
   806 00000A57 83C304              <1> 	add bx, 4			; -> next segment
   807 00000A5A 36393F              <1> 	cmp word [ss:bx], di		; value matches ?
   808 00000A5D 7405                <1> 	je @F				; yes, found -->
   809 00000A5F E2F6                <1> 	loop @B				; try remaining segments
   810                              <1> .error_j:
   811 00000A61 E98A00              <1> 	jmp .error
   812                              <1> 
   813                              <1> @@:
   814 00000A64 368B5F02            <1> 	mov bx, word [ss:bx + 2]	; -> call destination offset
   815                              <1> 		; si + 3 + delta = bx
   816                              <1> 		; delta = bx - si - 3
   817 00000A68 29F3                <1> 	sub bx, si
   818 00000A6A 83EB03              <1> 	sub bx, 3
   819 00000A6D 895C01              <1> 	mov word [si + 1], bx		; patch the call instruction
   820                              <1> %if _ELDCALL_NEXT
   821                              <1> 	test byte [bp + ?optional], 4	; is it a next relocation ?
   822                              <1> 	jz .coderelocloop
   823                              <1> 	mov byte [bp + ?skip_last], -1	; skip subsequent next/last relocs
   824                              <1> %endif
   825 00000A70 E967FF              <1> 	jmp .coderelocloop
   826                              <1> 
   827                              <1> .donecodereloc:
   828                              <1> %if _ELD_LINKER_PASSES
   829 00000A73 8B46E8              <1> 	mov ax, word [bp + ?amounterrors]
   830 00000A76 85C0                <1> 	test ax, ax
   831 00000A78 75E7                <1> 	jnz .error_j
   832 00000A7A 8B5EEA              <1> 	mov bx, word [bp + ?pass]
   833 00000A7D 85DB                <1> 	test bx, bx
   834 00000A7F 750B                <1> 	jnz @F
   835 00000A81 43                  <1> 	inc bx
   836 00000A82 43                  <1> 	inc bx
   837 00000A83 895EEA              <1> 	mov word [bp + ?pass], bx
   838 00000A86 8B56FC              <1> 	mov dx, word [bp + ?instance]
   839 00000A89 E94AFD              <1> 	jmp .pass
   840                              <1> 
   841                              <1> @@:
   842                              <1> %endif
   843                              <1> 
   844                              <1> %ifnidni _LISTING, ""
   845                              <1> %assign ELDLINKER 0
   846                              <1> .hint:
   847 00000A8C 16                  <1> 	push ss
   848 00000A8D 1F                  <1> 	pop ds
   849 00000A8E B02D                <1> 	mov al, 2Dh
   850 00000A90 E8[0000]EB020000    <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   851                              <1> 					; CHG: ax, dx, bx
   852 00000A97 7437                <1> 	jz .no_hint
   853                              <1> 
   854                              <1> %if ELDOTHER
   855                              <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   856                              <1> internalcoderelocation
   857                              <1> %endif
   858                              <1> 
   859 00000A99 8A26[0000]          <1> 	mov ah, byte [relocateddata]
   860                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   861 00000A9D E85500              <1> 	call plex_check
   862 00000AA0 7305                <1> 	jnc @F
   863                              <1> 
   864 00000AA2 B4FF                <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   865                              <1> .loop_hint:
   866 00000AA4 E84E00              <1> 	call plex_check
   867                              <1> @@:
   868 00000AA7 7307                <1> 	jnc .end_hint		; if found --> (NC)
   869 00000AA9 80EC01              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   870 00000AAC 73F6                <1> 	jnc .loop_hint		; try next if we didn't check all yet -->
   871 00000AAE EB20                <1> 	jmp .no_hint
   872                              <1> 
   873                              <1> .end_hint:
   874 00000AB0 50                  <1> 	push ax
   875 00000AB1 C446FC              <1> 	les ax, [bp + ?instance]
   876 00000AB4 BF[270F]            <1> 	mov di, listmsg.hint.offset
   877                              <1> internalcoderelocation
   878 00000AB7 E8[0000]EB020000    <1> 	extcall hexword
   879 00000ABE BB[060F]            <1> 	mov bx, listmsg.hint
   880                              <1> internalcoderelocation
   881 00000AC1 368B16[0000]        <1> 	mov dx, [ss:relocateddata]
   882                              <1> linkdatarelocation extseg	; must be 86 Mode segment even in PM
   883 00000AC6 58                  <1> 	pop ax
   884 00000AC7 B040                <1> 	mov al, 40h		; AMIS message display service
   885 00000AC9 E8[0000]EB020000    <1> 	extcall call_int2D
   886                              <1> .no_hint:
   887                              <1> %endif
   888                              <1> 
   889                              <1> %if ELDOTHER
   890                              <1> %assign ELDLINKER 0
   891                              <1> 	not byte [bp + ?other]
   892                              <1> 
   893                              <1> 	push ss
   894                              <1> 	pop ds
   895                              <1> 	mov al, 2Dh
   896                              <1> 	extcall intchk			; ZR if offset = -1 or segment = 0
   897                              <1> 					; CHG: ax, dx, bx
   898                              <1> 	jz .no_other
   899                              <1> 
   900                              <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
   901                              <1> internalcoderelocation
   902                              <1> 
   903                              <1> 	mov ah, byte [relocateddata]
   904                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   905                              <1> 	call plex_check
   906                              <1> 	jnc @F
   907                              <1> 
   908                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   909                              <1> .loop_other_debug:
   910                              <1> 	call plex_check
   911                              <1> @@:
   912                              <1> 	jnc .end_other		; if found --> (NC)
   913                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   914                              <1> 	jnc .loop_other_debug	; try next if we didn't check all yet -->
   915                              <1> 
   916                              <1> 	mov si, loaderamissig	; ds:si -> our AMIS name strings
   917                              <1> internalcoderelocation
   918                              <1> 
   919                              <1> 	mov ah, byte [relocateddata]
   920                              <1> linkdatarelocation try_debugger_amis_multiplex_number
   921                              <1> 	call plex_check
   922                              <1> 	jnc @F
   923                              <1> 
   924                              <1> 	mov ah, 0FFh		; start with multiplex number 0FFh
   925                              <1> .loop_other_loader:
   926                              <1> 	call plex_check
   927                              <1> @@:
   928                              <1> 	jnc .end_other		; if found --> (NC)
   929                              <1> 	sub ah, 1		; search is backward (to find latest installed first), from 0FFh to 00h including
   930                              <1> 	jnc .loop_other_loader	; try next if we didn't check all yet -->
   931                              <1> 
   932                              <1> 	jmp .no_other
   933                              <1> 
   934                              <1> .end_other:
   935                              <1> 	mov al, 42h		; AMIS get other link info service
   936                              <1> 	extcall call_int2D
   937                              <1> 	cmp al, 0FFh
   938                              <1> 	jne .no_other
   939                              <1> 
   940                              <1> 	mov ax, si		; selector => PSP
   941                              <1> 	extcall ispm
   942                              <1> 	jz @F
   943                              <1> 	mov ax, dx		; segment => PSP
   944                              <1> @@:
   945                              <1> 	 push ss
   946                              <1> 	 pop ds
   947                              <1> 	mov word [otherds], ax
   948                              <1> internaldatarelocation		; current mode sel/seg
   949                              <1> 	mov word [otherseg], dx
   950                              <1> internaldatarelocation		; remember segment
   951                              <1> 
   952                              <1> 	mov ax, cx		; selector => link info
   953                              <1> 	extcall ispm
   954                              <1> 	jz @F
   955                              <1> 	mov ax, bx		; segment => link info
   956                              <1> @@:
   957                              <1> 	mov word [bp + ?linkinfo_other], di
   958                              <1> 	mov word [bp + ?linkinfo_other + 2], ax
   959                              <1> 
   960                              <1> 	mov ds, ax		; => link info
   961                              <1> 	xor ax, ax
   962                              <1> 	cmp word [di + eldlSignature], 0E1D1h
   963                              <1> 	jne .error_other
   964                              <1> 	cmp word [di + eldlUseLinkHash], 1
   965                              <1> 	ja .error_other
   966                              <1> 	jb @F
   967                              <1> 	dec ax
   968                              <1> @@:
   969                              <1> 	mov word [bp + ?use_hash_other], ax
   970                              <1> 
   971                              <1> 	mov dx, word [bp + ?instance]
   972                              <1> 	add dx, linkerotherdatarelocations - code
   973                              <1> 	jmp .otherloop
   974                              <1> 
   975                              <1> .error_other:
   976                              <1> 	push cs
   977                              <1> 	pop ds
   978                              <1> 	mov ax, 0E33h
   979                              <1> 	extcall setrc
   980                              <1> 	mov dx, lmsg.error_other
   981                              <1> internalcoderelocation
   982                              <1> 	jmp @F
   983                              <1> 
   984                              <1> .no_other:
   985                              <1> 	push cs
   986                              <1> 	pop ds
   987                              <1> 	mov ax, 0E34h
   988                              <1> 	extcall setrc
   989                              <1> 	mov dx, lmsg.no_other
   990                              <1> internalcoderelocation
   991                              <1> @@:
   992                              <1> 	extcall putsz
   993                              <1> .error_j2:
   994                              <1> 	jmp .error
   995                              <1> 
   996                              <1> .otherdone:
   997                              <1>  %if _ELD_LINKER_PASSES
   998                              <1> 	mov ax, word [bp + ?amounterrors]
   999                              <1> 	test ax, ax
  1000                              <1> 	jnz .error_j2
  1001                              <1>  %endif
  1002                              <1> %endif
  1003                              <1> 
  1004 00000AD0 5B                  <1> 	pop bx				; -> our heap data
  1005 00000AD1 5E                  <1> 	pop si				; -> our command line tail
  1006 00000AD2 16                  <1> 	 push ss
  1007 00000AD3 1F                  <1> 	 pop ds
  1008 00000AD4 C47EFC              <1> 	les di, [bp + ?instance]
  1009 00000AD7 268B4502            <1> 	mov ax, word [es:di + eldiEndCode]
  1010                              <1> houdini
  1011 00000ADB 2D[B007]            <1> 	sub ax, strict word endresident + code
  1012                              <1> internalcoderelocation
  1013 00000ADE 26C74502[B007]      <1> 	mov word [es:di + eldiEndCode], endresident + code
  1014                              <1> internalcoderelocation
  1015 00000AE4 2906[0000]          <1> 	sub word [relocateddata], ax
  1016                              <1> linkdatarelocation extseg_used
  1017                              <1> %if _DATA_SIZE == 0
  1018                              <1> 	xor ax, ax
  1019                              <1> 	mov word [es:di + eldiStartData], ax
  1020                              <1> 	mov word [es:di + eldiEndData], ax
  1021                              <1> %endif
  1022 00000AE8 89EC5D              <1> 	lleave code
  1023                              <1> 		; INP:	es => ELD code segment
  1024                              <1> 		;	ds:si -> command line tail
  1025                              <1> 		;	ds:bx -> ELD data block
  1026                              <1> 		;	ss:sp -> far return address for current mode
  1027                              <1> 		; STT:	ds = ss, UP, EI
  1028 00000AEB E93AFC              <1> 	jmp start
  1029                              <1> 
  1030                              <1> .error:
  1031 00000AEE 89EC5D              <1> 	lleave
  1032 00000AF1 B8FFFF              <1> 	mov ax, -1
  1033 00000AF4 CB                  <1> 	retf
  1034                              <1> 
  1035                              <1> 
  1036                              <1> %ifnidni _LISTING, ""
  1037                              <1>  %assign ELDHINT 1
  1038                              <1> %else
  1039                              <1>  %assign ELDHINT 0
  1040                              <1> %endif
  1041                              <1> 
  1042                              <1> %if ELDOTHER || ELDHINT
  1043                              <1> 		; INP:	ah = multiplex number to check
  1044                              <1> 		;	(if ELDOTHER:)
  1045                              <1> 		;	 cs:si -> 16-byte AMIS signature to check
  1046                              <1> 		; OUT:	CY if multiplex number unused or no signature match,
  1047                              <1> 		;	 bp, ah, ds unmodified
  1048                              <1> 		;	NC if match found,
  1049                              <1> 		;	 ah = multiplex number (unmodified)
  1050                              <1> 		; CHG:	di, es, cx, dx
  1051                              <1> 		;	(if ELDOTHER:) bx
  1052                              <1> 		;	(if not ELDOTHER:) si
  1053                              <1> plex_check:
  1054 00000AF5 16                  <1> 	push ss
  1055 00000AF6 1F                  <1> 	pop ds
  1056 00000AF7 F606[0000]08        <1> 	testopt [relocateddata], 8
  1057                              <1> linkdatarelocation internalflags4, -3
  1058 00000AFC 740B                <1> 	jz @F
  1059                              <1> %if ELDOTHER
  1060                              <1> 	mov bx, relocateddata
  1061                              <1> linkdatarelocation amis_multiplex_number, -2, optional
  1062                              <1> 	test bx, bx
  1063                              <1> 	jz @F
  1064                              <1> 	cmp ah, byte [bx]
  1065                              <1> 	je .notfound		; do not use our own multiplexer -->
  1066                              <1> %else
  1067 00000AFE BE[0000]            <1> 	mov si, relocateddata
  1068                              <1> linkdatarelocation amis_multiplex_number, -2, optional
  1069 00000B01 85F6                <1> 	test si, si
  1070 00000B03 7404                <1> 	jz @F
  1071 00000B05 3A24                <1> 	cmp ah, byte [si]
  1072 00000B07 7420                <1> 	je .notfound		; do not use our own multiplexer -->
  1073                              <1> %endif
  1074                              <1> @@:
  1075 00000B09 B000                <1> 	mov al, 00h		; AMIS installation check
  1076 00000B0B E8[0000]EB020000    <1> 	extcall call_int2D	; AMIS (or "DOS reserved" = iret if no AMIS present)
  1077 00000B12 3CFF                <1> 	cmp al, 0FFh
  1078 00000B14 7513                <1> 	jne .notfound
  1079 00000B16 0E                  <1> 	push cs
  1080 00000B17 1F                  <1> 	pop ds
  1081                              <1> %if ELDOTHER
  1082                              <1> 	push si
  1083                              <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
  1084                              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
  1085                              <1> 	repe cmpsw
  1086                              <1> 	pop si
  1087                              <1> %else
  1088 00000B18 BE[F60E]            <1> 	mov si, debuggeramissig	; ds:si -> our AMIS name strings
  1089                              <1> internalcoderelocation
  1090 00000B1B E8[0000]EB020000    <1> 	extcall setes2dx	; es:di -> name strings of AMIS multiplexer that just answered
  1091 00000B22 B90800              <1> 	mov cx, 8		; Ignore description, only compare vendor and program name
  1092 00000B25 F3A7                <1> 	repe cmpsw
  1093                              <1> %endif
  1094 00000B27 7401                <1> 	je .checkret		; ZR, NC = match -->
  1095                              <1> .notfound:
  1096 00000B29 F9                  <1> 	stc			; CY no match
  1097                              <1> .checkret:
  1098 00000B2A C3                  <1> 	retn
  1099                              <1> %endif
  1100                              <1> 
  1101                              <1> 
  1102 00000B2B 00                  <1> 	align 4, db 0
  1103                              <1> linkercoderelocations:
  1104                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
  1105 00000B2C 01002200[2F0F]0103- <1> 	dw ELDCALL_CODE_RELOCATIONS_OPTIONAL, 0
  1105 00000B34 3906[3E0F]01006806- <1>
  1105 00000B3C [560F]01007006-     <1>
  1105 00000B42 [620F]01007806-     <1>
  1105 00000B48 [6E0F]01008006-     <1>
  1105 00000B4E [750F]01008806-     <1>
  1105 00000B54 [7E0F]01009006-     <1>
  1105 00000B5A [860F]01009806-     <1>
  1105 00000B60 [8E0F]0100A006-     <1>
  1105 00000B66 [950F]0100A806-     <1>
  1105 00000B6C [9E0F]0100B006-     <1>
  1105 00000B72 [AB0F]0100B806-     <1>
  1105 00000B78 [B70F]0100C006-     <1>
  1105 00000B7E [C90F]0100C806-     <1>
  1105 00000B84 [D10F]0100D006-     <1>
  1105 00000B8A [DA0F]0100D806-     <1>
  1105 00000B90 [E70F]0100E006-     <1>
  1105 00000B96 [F20F]0100E806-     <1>
  1105 00000B9C [FD0F]0100F006-     <1>
  1105 00000BA2 [1A10]0100F806-     <1>
  1105 00000BA8 [2410]01000007-     <1>
  1105 00000BAE [2E10]01000807-     <1>
  1105 00000BB4 [4310]01001007-     <1>
  1105 00000BBA [4D10]01001807-     <1>
  1105 00000BC0 [5D10]01002007-     <1>
  1105 00000BC6 [6810]01006507-     <1>
  1105 00000BCC [750F]0100900A-     <1>
  1105 00000BD2 [D10F]0100B70A-     <1>
  1105 00000BD8 [4310]0100C90A-     <1>
  1105 00000BDE [DA0F]01000B0B-     <1>
  1105 00000BE4 [DA0F]01001B0B-     <1>
  1105 00000BEA [E70F]0000          <1>
  1106                              <1> %else
  1107                              <1> 	dw ELDCALL_CODE_RELOCATIONS, 0, 0
  1108                              <1> %endif
  1109                              <1> 
  1110                              <1> %if _ELD_LINKER_PASSES
  1111                              <1> linkerlinkercoderelocations:
  1112                              <1> %if _ELDCALL_OPTIONAL || _ELDCALL_NEXT
  1113 00000BEE 01005109[4310]0100- <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS_OPTIONAL, 0
  1113 00000BF6 7509[4D10]01007F09- <1>
  1113 00000BFE [860F]01008809-     <1>
  1113 00000C04 [FD0F]0000          <1>
  1114                              <1> %else
  1115                              <1> 	dw ELDCALL_LINKER_CODE_RELOCATIONS, 0, 0
  1116                              <1> %endif
  1117                              <1> 
  1118                              <1> 	align 2, db 0
  1119                              <1> linktable:
  1120                              <1> 	istruc LINKTABLE
  1121                              <1> at ltCodeToCode
  1122 00000C08 E60E                <1> 	dw internallinkercodetocoderelocations - code
  1123 00000C0A DC0C                <1> 	dw internalcodetocoderelocations - code
  1124                              <1> at ltCodeToData
  1125 00000C0C F00E                <1> 	dw internallinkercodetodatarelocations - code
  1126 00000C0E FC0C                <1> 	dw internalcodetodatarelocations - code
  1127                              <1> at ltDataToCode
  1128 00000C10 F20E                <1> 	dw internallinkerdatatocoderelocations - code
  1129 00000C12 C60D                <1> 	dw internaldatatocoderelocations - code
  1130                              <1> at ltDataToData
  1131 00000C14 F40E                <1> 	dw internallinkerdatatodatarelocations - code
  1132 00000C16 C80D                <1> 	dw internaldatatodatarelocations - code
  1133                              <1> at ltLinkData
  1134 00000C18 D20E                <1> 	dw linkerlinkerdatarelocations - code
  1135 00000C1A 200C                <1> 	dw linkerdatarelocations - code
  1136                              <1> at ltLinkCode
  1137 00000C1C EE0B                <1> 	dw linkerlinkercoderelocations - code
  1138 00000C1E 2C0B                <1> 	dw linkercoderelocations - code
  1139                              <1> 	iend
  1140                              <1> %endif
  1141                              <1> 
  1142                              <1> 	align 2, db 0
  1143                              <1> linkerdatarelocations:
  1144 00000C20 01004700[7010]0100- <1> 	dw LINK_DATA_RELOCATIONS, 0
  1144 00000C28 4900[7A10]01004C00- <1>
  1144 00000C30 [8310]01006A00-     <1>
  1144 00000C36 [9310]01008E00-     <1>
  1144 00000C3C [9310]0100CD00-     <1>
  1144 00000C42 [A910]0100D600-     <1>
  1144 00000C48 [B410]0100B301-     <1>
  1144 00000C4E [BD10]01002802-     <1>
  1144 00000C54 [BD10]01009902-     <1>
  1144 00000C5A [BD10]01001803-     <1>
  1144 00000C60 [BD10]01006B03-     <1>
  1144 00000C66 [BD10]0100BA03-     <1>
  1144 00000C6C [BD10]0100E504-     <1>
  1144 00000C72 [BD10]01003605-     <1>
  1144 00000C78 [BD10]01009B05-     <1>
  1144 00000C7E [BD10]0100E305-     <1>
  1144 00000C84 [BD10]01003107-     <1>
  1144 00000C8A [C810]01004407-     <1>
  1144 00000C90 [D610]01005407-     <1>
  1144 00000C96 [E110]01006107-     <1>
  1144 00000C9C [EF10]01007807-     <1>
  1144 00000CA2 [E110]01007C07-     <1>
  1144 00000CA8 [9310]01009707-     <1>
  1144 00000CAE [9310]01009D07-     <1>
  1144 00000CB4 [D610]0100E108-     <1>
  1144 00000CBA [FE10]01009B0A-     <1>
  1144 00000CC0 [2111]0100C40A-     <1>
  1144 00000CC6 [B410]0100E60A-     <1>
  1144 00000CCC [E110]0100F90A-     <1>
  1144 00000CD2 [4611]0101FF0A-     <1>
  1144 00000CD8 [5711]0000          <1>
  1145                              <1> 
  1146                              <1> 	align 2, db 0
  1147                              <1> internalcodetocoderelocations:
  1148 00000CDC 6500B2004B07500758- <1> 	dw INTERNAL_CODE_TO_CODE_RELOCATIONS, 0
  1148 00000CE5 075D0774077F079207- <1>
  1148 00000CEE 9907B50ABF0ADC0AE2- <1>
  1148 00000CF7 0A190B0000          <1>
  1149                              <1> 
  1150                              <1> 	align 2, db 0
  1151                              <1> internalcodetodatarelocations:
  1152 00000CFC 3400B600C700DE00E1- <1> 	dw INTERNAL_CODE_TO_DATA_RELOCATIONS, 0
  1152 00000D05 00E400E700EB00F900- <1>
  1152 00000D0E 040107010A010F0130- <1>
  1152 00000D17 0134013A0165017001- <1>
  1152 00000D20 76018A0195019D01A1- <1>
  1152 00000D29 01A701AF0120022502- <1>
  1152 00000D32 2B0234024E025A026D- <1>
  1152 00000D3B 02770280028C029602- <1>
  1152 00000D44 9C02B202B902C402CF- <1>
  1152 00000D4D 02E502F50211031B03- <1>
  1152 00000D56 3203390346034D0353- <1>
  1152 00000D5F 035C036E0377037D03- <1>
  1152 00000D68 84039003B103DC03E0- <1>
  1152 00000D71 03E603F003F403FA03- <1>
  1152 00000D7A 00040E042504300438- <1>
  1152 00000D83 046A04700477048304- <1>
  1152 00000D8C AF04B404BB04C204E8- <1>
  1152 00000D95 04F104F70405051D05- <1>
  1152 00000D9E 21053905420555056A- <1>
  1152 00000DA7 05730581058A058D05- <1>
  1152 00000DB0 940596059F05B205B8- <1>
  1152 00000DB9 05D305E805EB052506- <1>
  1152 00000DC2 A3070000            <1>
  1153                              <1> 
  1154                              <1> 	align 2, db 0
  1155                              <1> internaldatatocoderelocations:
  1156 00000DC6 FFFF                <1> 	dw INTERNAL_DATA_TO_CODE_RELOCATIONS, -1
  1157                              <1> 
  1158                              <1> 	align 2, db 0
  1159                              <1> internaldatatodatarelocations:
  1160 00000DC8 000002000400060008- <1> 	dw INTERNAL_DATA_TO_DATA_RELOCATIONS, -1
  1160 00000DD1 000A000C000E001000- <1>
  1160 00000DDA 12001400160018001A- <1>
  1160 00000DE3 001C001E0020002200- <1>
  1160 00000DEC 2400260028002A002C- <1>
  1160 00000DF5 002E00300032003A00- <1>
  1160 00000DFE 3E00420046004C0050- <1>
  1160 00000E07 00540058005E006200- <1>
  1160 00000E10 66006A00700076007C- <1>
  1160 00000E19 0082008A0090009600- <1>
  1160 00000E22 9A009C009E00A000A2- <1>
  1160 00000E2B 00A400A600A800AA00- <1>
  1160 00000E34 AC00AE00B000B200B4- <1>
  1160 00000E3D 00B600B800BA00BC00- <1>
  1160 00000E46 BE00C000C200C400C6- <1>
  1160 00000E4F 00C800CA00CC00CE00- <1>
  1160 00000E58 D000D200D400D600D8- <1>
  1160 00000E61 00DA00DC00DE00E000- <1>
  1160 00000E6A E200E400E600E800EA- <1>
  1160 00000E73 00EC00EE00F000F200- <1>
  1160 00000E7C F400F600F800FA00FC- <1>
  1160 00000E85 00FE00000102010401- <1>
  1160 00000E8E 060108010A010C010E- <1>
  1160 00000E97 011001120114011601- <1>
  1160 00000EA0 18011A011C011E0120- <1>
  1160 00000EA9 012201240126012801- <1>
  1160 00000EB2 2A012C012E01300132- <1>
  1160 00000EBB 013401360138013A01- <1>
  1160 00000EC4 3C013E014001420148- <1>
  1160 00000ECD 014A01FFFF          <1>
  1161                              <1> 
  1162                              <1> %if _ELD_LINKER_PASSES
  1163                              <1> 	align 2, db 0
  1164                              <1> linkerlinkerdatarelocations:
  1165 00000ED2 01000009[D610]0100- <1> 	dw LINK_LINKER_DATA_RELOCATIONS, 0
  1165 00000EDA 4809[BD10]0100490A- <1>
  1165 00000EE2 [1011]0000          <1>
  1166                              <1> 
  1167                              <1> 	align 2, db 0
  1168                              <1> internallinkercodetocoderelocations:
  1169 00000EE6 0A09210932095A0900- <1> 	dw INTERNAL_LINKER_CODE_TO_CODE_RELOCATIONS, 0
  1169 00000EEF 00                  <1>
  1170                              <1> 
  1171                              <1> 	align 2, db 0
  1172                              <1> internallinkercodetodatarelocations:
  1173 00000EF0 0000                <1> 	dw INTERNAL_LINKER_CODE_TO_DATA_RELOCATIONS, 0
  1174                              <1> 
  1175                              <1> 	align 2, db 0
  1176                              <1> internallinkerdatatocoderelocations:
  1177 00000EF2 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_CODE_RELOCATIONS, -1
  1178                              <1> 
  1179                              <1> 	align 2, db 0
  1180                              <1> internallinkerdatatodatarelocations:
  1181 00000EF4 FFFF                <1> 	dw INTERNAL_LINKER_DATA_TO_DATA_RELOCATIONS, -1
  1182                              <1> %endif
  1183                              <1> 
  1184                              <1> %if ELDOTHER
  1185                              <1> 	align 2, db 0
  1186                              <1> linkerotherdatarelocations:
  1187                              <1> 	dw LINK_OTHER_DATA_RELOCATIONS, 0
  1188                              <1> 
  1189                              <1>  %ifnidn LINK_OTHER_LINKER_DATA_RELOCATIONS, ""
  1190                              <1>   %error Other linker data links not supported
  1191                              <1>  %endif
  1192                              <1> %endif
  1193                              <1> 
  1194                              <1> %if ELDOTHER || ELDHINT
  1195                              <1> 	align 2, db 0
  1196                              <1> debuggeramissig:
  1197 00000EF6 65636D20<rep 5h>    <1> 		fill 8, 32, db "ecm"
  1198 00000EFE 6C446562756720-     <1> 		fill 8, 32, db "lDebug"
  1198 00000EFE <rep 2h>            <1>
  1199                              <1> %endif
  1200                              <1> 
  1201                              <1> %if ELDOTHER
  1202                              <1> 	align 2, db 0
  1203                              <1> loaderamissig:
  1204                              <1> 		fill 8, 32, db "ecm"
  1205                              <1> 		fill 8, 32, db "Loader"
  1206                              <1> %endif
  1207                              <1> 
  1208                              <1> %ifnidni _LISTING, ""
  1209                              <1> listmsg:
  1210 00000F06 547261634C6973742D- <1> .hint:		db "TracList-add-offset=",_LISTING,"::"
  1210 00000F0F 6164642D6F66667365- <1>
  1210 00000F18 743D616D6974737273- <1>
  1210 00000F21 2E6C73743A3A        <1>
  1211 00000F27 2D2D2D2D680D0A00    <1> .hint.offset:	asciz "----h",13,10
  1212                              <1> %endif
  1213                              <1> 
  1214 00000F2F 30CD0C636D64335F6E- <1> 	eldcall_dump_names ELDCALL_CODE_NAMES
  1214 00000F38 6F745F6578742C9A15- <1>
  1214 00000F41 696E7463616C6C5F65- <1>
  1214 00000F4A 78745F72657475726E- <1>
  1214 00000F53 5F6573D55509736B69- <1>
  1214 00000F5C 70636F6D6D6103C309- <1>
  1214 00000F65 6973737472696E673F- <1>
  1214 00000F6E BABD04636D6433DDB9- <1>
  1214 00000F77 0663686B656F6C5512- <1>
  1214 00000F80 05707574737AB21205- <1>
  1214 00000F89 736574726328900469- <1>
  1214 00000F92 73706DE83A06697365- <1>
  1214 00000F9B 6F6C3FBFBC0A736B69- <1>
  1214 00000FA4 70657175616C73A455- <1>
  1214 00000FAD 09736B6970636F6D6D- <1>
  1214 00000FB6 30650F0F6765745F76- <1>
  1214 00000FBF 616C75655F72616E67- <1>
  1214 00000FC8 65A7AA056572726F72- <1>
  1214 00000FD1 986906696E7463686B- <1>
  1214 00000FDA 21300A63616C6C5F69- <1>
  1214 00000FE3 6E743244B774087365- <1>
  1214 00000FEC 74657332647867B108- <1>
  1214 00000FF5 7472696D70757473D0- <1>
  1214 00000FFE BB1A636F70795F7369- <1>
  1214 00001007 6E676C655F636F756E- <1>
  1214 00001010 7465645F737472696E- <1>
  1214 00001019 67821B076865786279- <1>
  1214 00001022 7465EBA60764656377- <1>
  1214 0000102B 6F726403AA12646563- <1>
  1214 00001034 5F64776F72645F6D69- <1>
  1214 0000103D 6E7769647468848107- <1>
  1214 00001046 686578776F72646FA2- <1>
  1214 0000104F 0D707574736C696E65- <1>
  1214 00001058 5F63726C66398C0870- <1>
  1214 00001061 7574736C696E656296- <1>
  1214 0000106A 05496E444F53        <1>
  1215 00001070 C30B076C617374636D- <1> 	link_data_dump_names LINK_DATA_NAMES
  1215 00001079 646B5D06646D79636D- <1>
  1215 00001082 6454400D6D73672E75- <1>
  1215 0000108B 6E696E7374616C6C97- <1>
  1215 00001094 B6136578745F636F6D- <1>
  1215 0000109D 6D616E645F68616E64- <1>
  1215 000010A6 6C6572EB4208657874- <1>
  1215 000010AF 647373656CD52D0665- <1>
  1215 000010B8 787473656784E3086C- <1>
  1215 000010C1 696E655F6F75748D71- <1>
  1215 000010CA 0B6D73672E696E7374- <1>
  1215 000010D3 616C6C5ABC086F7074- <1>
  1215 000010DC 696F6E7337E7D30B65- <1>
  1215 000010E5 78747365675F757365- <1>
  1215 000010EE 64B2400C6578746461- <1>
  1215 000010F7 74615F757365645503- <1>
  1215 00001100 0F6275696C645F6F70- <1>
  1215 00001109 74696F6E5F504D6844- <1>
  1215 00001112 0E6C696E6B63616C6C- <1>
  1215 0000111B 5F7461626C65F09E22- <1>
  1215 00001124 7472795F6465627567- <1>
  1215 0000112D 6765725F616D69735F- <1>
  1215 00001136 6D756C7469706C6578- <1>
  1215 0000113F 5F6E756D626572CB51- <1>
  1215 00001148 0E696E7465726E616C- <1>
  1215 00001151 666C61677334688C15- <1>
  1215 0000115A 616D69735F6D756C74- <1>
  1215 00001163 69706C65785F6E756D- <1>
  1215 0000116C 626572              <1>
  1216                              <1> %if ELDOTHER
  1217                              <1> 	link_data_dump_names LINK_OTHER_DATA_NAMES
  1218                              <1> %endif
  1219                              <1> 
  1220                              <1> lmsg:
  1221                              <1> %if _ELD_LINKER_PASSES
  1222                              <1> %if _ELDCALL_OPTIONAL
  1223 0000116F 214F7074696F6E616C- <1> .warning_code_optional:		counted "Optional code link missing, hash="
  1223 00001178 20636F6465206C696E- <1>
  1223 00001181 6B206D697373696E67- <1>
  1223 0000118A 2C20686173683D      <1>
  1224                              <1> %endif
  1225                              <1> %if _ELDDATA_OPTIONAL
  1226                              <1> .warning_data_optional:		counted "Optional data link missing, hash="
  1227                              <1> %endif
  1228 00001191 1844617461206C696E- <1> .error_data:			counted "Data link missing, hash="
  1228 0000119A 6B206D697373696E67- <1>
  1228 000011A3 2C20686173683D      <1>
  1229 000011AA 18436F6465206C696E- <1> .error_code:			counted "Code link missing, hash="
  1229 000011B3 6B206D697373696E67- <1>
  1229 000011BC 2C20686173683D      <1>
  1230 000011C3 0A682C206C6162656C- <1> .error.2:			counted "h, label ",'"'
  1230 000011CC 2022                <1>
  1231                              <1> %endif
  1232                              <1> %if ELDOTHER
  1233                              <1> .no_other:		asciz "ELD linker: No other link info found!",13,10
  1234                              <1> .error_other:		asciz "ELD linker: Other link info unknown format!",13,10
  1235                              <1> %endif
  1236                              <1> 
  1237 000011CE 00<rep 2h>          <1> 	align 16, db 0
  1952                                  
  1953                                  	align 16
  1954                                  code_size equ $ - code
