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