|
| 1 | + EXE2COM 1.04 |
| 2 | + By Chris Dunford/Cove Software |
| 3 | + |
| 4 | + | indicates information changed/added in recent versions. |
| 5 | + |
| 6 | + Purpose |
| 7 | + ------- |
| 8 | + EXE2COM is a one-for-one replacement for the EXE2BIN program |
| 9 | + that was formerly distributed with DOS. Beginning with DOS 3.3, |
| 10 | + EXE2BIN has been moved to the disk that comes with the DOS |
| 11 | + Technical Reference and thus is not available without extra |
| 12 | + cost. |
| 13 | + |
| 14 | + |
| 15 | + Usage |
| 16 | + ----- |
| 17 | + Usage is identical to DOS's EXE2BIN except that the output file |
| 18 | + extension defaults to COM rather than BIN, and there is an |
| 19 | + optional switch that displays EXE file information rather than |
| 20 | + converting the file to COM. |
| 21 | + |
| 22 | + Complete usage is: |
| 23 | + |
| 24 | + EXE2COM [/I] [d:][path]file[ext] [d:][path][file][ext] |
| 25 | + |
| 26 | + The drive and path of the first file default to the current |
| 27 | + drive and path, if not specified. The extension of the first |
| 28 | + file defaults to EXE, if not specified. |
| 29 | + |
| 30 | + If the second file is completely unspecified, it defaults to the |
| 31 | + same drive, path, and filename as the first, except that the |
| 32 | + extension will be COM. |
| 33 | + |
| 34 | + If the second file is specified but without an extension, COM |
| 35 | + will be assumed (this is different from EXE2BIN). |
| 36 | + |
| 37 | + | If /I is specified, information about the EXE file is displayed |
| 38 | + | and no conversion is performed. The output file name, if |
| 39 | + | specified, is ignored. |
| 40 | + |
| 41 | + The simplest (and usual) usage is simply: |
| 42 | + |
| 43 | + EXE2COM file |
| 44 | + |
| 45 | + which will take the named EXE file in the current directory and |
| 46 | + convert it to a COM file in the same directory. |
| 47 | + |
| 48 | + |
| 49 | + Operation |
| 50 | + --------- |
| 51 | + EXE2COM runs the same way as EXE2BIN, with the following |
| 52 | + exceptions: |
| 53 | + |
| 54 | + 1. The binary fixup option of EXE2BIN (IP=0, segment fixups |
| 55 | + required) is not supported. |
| 56 | + |
| 57 | + 2. The EXE file checksum is not verified. |
| 58 | + |
| 59 | + 3. Error messages are more useful, and a warning is provided |
| 60 | + if a COM file is created with an initial IP other than 100H. |
| 61 | + |
| 62 | + 4. The default output file extension is COM rather than BIN. |
| 63 | + |
| 64 | + |
| 65 | + | Information display |
| 66 | + | ------------------- |
| 67 | + | If you use the /I switch, EXE2COM just displays information |
| 68 | + | about the EXE file and does not attempt to convert it to COM |
| 69 | + | (therefore, the EXE file need not be a convertible file). Here |
| 70 | + | is a typical display, resulting from running EXE2COM on itself |
| 71 | + | (version 1.04) with the /I switch: |
| 72 | + | |
| 73 | + | exe2com.exe (hex) (dec) |
| 74 | + | EXE file size 396B 14699 |
| 75 | + | EXE header size (para) 20 32 |
| 76 | + | Program image size (bytes) 376B 14187 |
| 77 | + | Minimum load size (bytes) 8CDB 36059 |
| 78 | + | Min allocation (para) 557 1367 |
| 79 | + | Max allocation (para) FFFF 65535 |
| 80 | + | * Initial CS:IP 0000:072C |
| 81 | + | * Initial SS:SP 084D:0800 2048 (stack size) |
| 82 | + | * Relocation count 4 4 |
| 83 | + | Relo table start 001E 30 |
| 84 | + | EXE file checksum 411D 16669 |
| 85 | + | Overlay number 0 0 |
| 86 | + | * = this item prevents conversion to BIN/COM |
| 87 | + | |
| 88 | + | The fields that may need some explanation: |
| 89 | + | |
| 90 | + | Program image size: this is the size of the program itself |
| 91 | + | (i.e., the size of the EXE file less the size of the header |
| 92 | + | information). This much memory is required to load a copy of |
| 93 | + | the program's code and pre-allocated data. |
| 94 | + | |
| 95 | + | Minimum load size: at least this much free memory is required in |
| 96 | + | order to run the program. |
| 97 | + | |
| 98 | + | Min/max allocation: the minimum/maximum number of 16-byte |
| 99 | + | paragraphs that will be needed above the end of the program |
| 100 | + | image when it is loaded. Minimum load size is the sum of the |
| 101 | + | program image size and the minimum allocation. |
| 102 | + | |
| 103 | + | If an item is starred (*), this prevents the EXE file from being |
| 104 | + | converted to a COM file. |
| 105 | + |
| 106 | + |
| 107 | + Error Messages |
| 108 | + -------------- |
| 109 | + These are EXE2COM's error messages. If one of these is seen, |
| 110 | + the EXE file will not be converted and the errorlevel returned |
| 111 | + by EXE2COM will be 1. |
| 112 | + |
| 113 | + ERROR READING EXE HEADER |
| 114 | + EXE2COM was unable to read the EXE file header from disk. |
| 115 | + |
| 116 | + ERROR WRITING OUTPUT FILE |
| 117 | + EXE2COM was unable to write the converted file to disk. |
| 118 | + |
| 119 | + INVALID EXE FILE SIGNATURE |
| 120 | + The first two bytes of an EXE file should be ASCII 'M' and |
| 121 | + 'Z'. This was not the case, and it's probably not an EXE |
| 122 | + file. |
| 123 | + |
| 124 | + EXE HAS RELOCATABLE ITEMS |
| 125 | + In order to be converted to a COM file, an EXE file cannot |
| 126 | + have any direct references to segments. For example, the |
| 127 | + assembler instruction "mov ax,code" (where CODE is a segment |
| 128 | + name) is a segment reference. One or more segment |
| 129 | + references were found in the EXE file. |
| 130 | + |
| 131 | + EXE HAS STACK SEGMENT |
| 132 | + In order to be converted to a COM file, an EXE file cannot |
| 133 | + have a stack segment. |
| 134 | + |
| 135 | + EXE HAS NONZERO CS |
| 136 | + In order to be converted to a COM file, an EXE file must |
| 137 | + have a code segment that begins at offset 0 of the code |
| 138 | + image in the EXE file. |
| 139 | + |
| 140 | + IP NOT 0 OR 100H |
| 141 | + In order to be converted to a binary file, an EXE file must |
| 142 | + have an entry point of 0 or 100H within the code segment. |
| 143 | + For COM files, the entry point should be 100H. For SYS |
| 144 | + files (device drivers), the entry point should be 0. |
| 145 | + |
| 146 | + PROGRAM EXCEEDS 64K |
| 147 | + In order to be converted to a binary file, the total size of |
| 148 | + the code to be loaded (including the PSP) must not exceed |
| 149 | + 64K bytes. |
| 150 | + |
| 151 | + UNKNOWN ERROR |
| 152 | + Internal error. Notify the author. |
| 153 | + |
| 154 | + |
| 155 | + Warning message |
| 156 | + --------------- |
| 157 | + EXE2COM has one warning message: |
| 158 | + |
| 159 | + COM FILE, INITIAL IP NOT 100H |
| 160 | + |
| 161 | + The entry point of all COM files should be 100H. If you are |
| 162 | + creating a COM file an the entry point is not 100H, EXE2COM will |
| 163 | + do the job but let you know that there is a potential problem. |
| 164 | + |
| 165 | + |
| 166 | + Source |
| 167 | + ------ |
| 168 | + Source code should be included with this archive. Users are |
| 169 | + encouraged to modify, improve, and/or correct the source for |
| 170 | + EXE2COM and submit the new program to the author for |
| 171 | + distribution. Please identify clearly any changes made and |
| 172 | + stick with portable code (no inline assembler, PLEASE). |
| 173 | + |
| 174 | + Source for EXE2COM was written for the Microsoft C compiler |
| 175 | + (v.5.0) but will also compile correctly with Borland's Turbo C |
| 176 | + (v.1.5). It should be easily portable to most other compilers. |
| 177 | + |
| 178 | + |
| 179 | + Public domain |
| 180 | + ------------- |
| 181 | + EXE2COM is hereby donated by the author to the public domain. |
| 182 | + |
| 183 | + |
| 184 | + History |
| 185 | + ------- |
| 186 | + Version 1.00 04/17/87: Original version by |
| 187 | + Christopher J. Dunford |
| 188 | + The Cove Software Group |
| 189 | + PO Box 1072 |
| 190 | + Columbia, MD 21044 |
| 191 | + (301) 992-9371 |
| 192 | + CompuServe 76703,2002 |
| 193 | + |
| 194 | + Version 1.01: port to Turbo C by |
| 195 | + Roger Schlafly |
| 196 | + Borland International |
| 197 | + Scotts Valley, CA 95066 |
| 198 | + CompuServe 76067,511 |
| 199 | + |
| 200 | + Version 1.02 11/22/87: bug fix for even 512-byte file made to |
| 201 | + Turbo C port by |
| 202 | + Chris Blum ( Consultant ) |
| 203 | + 509 West Main, Front |
| 204 | + Ashland, Ohio 44805 |
| 205 | + CompuServe 76625,1041 |
| 206 | + |
| 207 | + Chris Dunford duplicated the fix in the C86 source. |
| 208 | + |
| 209 | + Version 1.03 12/30/87: by Chris Dunford |
| 210 | + Ported to Microsoft C 5.0. This is now the "official" |
| 211 | + version. |
| 212 | + |
| 213 | + Increased size of I/O buffer to 4K for speed reasons. |
| 214 | + EXE2COM 1.03 is twice as fast as 1.02 and slightly |
| 215 | + faster than EXE2BIN. |
| 216 | + |
| 217 | + Version 1.04 03/08/88: by Chris Dunford |
| 218 | + Cleaned up some old code from the original quickie. |
| 219 | + |
| 220 | + Source should now compile under either MSC or TC. |
| 221 | + |
| 222 | + Added /I switch. |
| 223 | + |
| 224 | + In earlier versions, we defined an error code for nonzero |
| 225 | + CS, but didn't actually check; now we do. |
0 commit comments