Most EPROM programmers are accepting the
HEXBIN <hex> [<bin>] [/OFFSET:o] [/LENGTH:l] [/FILL:f] [/QUIET]
where <hex> is the input file in
file | extension |
---|---|
<hex> | .HEX |
<bin> | .BIN |
If you want a file name to have no extension, terminate it with a '.'! Instead of file names you may also specify device names to redirect the output to character I/O ports. Device names may be terminated with a ':'! It is not checked, whether the device is existing or suitable for the task.
The binary file output can also be controlled with the options /OFFSET, /FILL and /LENGTH.
Normally the first byte in the binary file is the first byte of the HEX record with the lowest load address. If a number of dummy bytes is to be inserted on top of the file (e.g. for alignment in an EPROM image), this can be performed with the /OFFSET option:
would insert 4096 dummy bytes before the first byte of the first HEX record loaded. The offset must always be specified as a hex number. The default offset is 0./OFFSET:1000
Since there may be peepholes between the HEX records, a fill byte value can be defined with the /FILL option:
would fill all peepholes between the HEX records with zero bytes as well as all the dummy bytes that might have been inserted with the /OFFSET or /LENGTH option. The fill byte value must always be specified as a hex number. The default fill byte is the EPROM-friendly FFH./FILL:0
By default the last byte in the binary file is the last byte of the HEX record with the highest load address. If the binary file should have a well defined length, then a number of dummy bytes can be appended to the file (e.g. for exactly matching an EPROM length), this can be performed with the /LENGTH option:
would append as many dummy bytes behind the last byte of the file, that the total file length becomes exactly 32768 bytes. The file length must always be specified as a hex number./LENGTH:8000
When HEXBIN has been invoked with all the above options, it may display a file conversion report like this:
Hex File Converter HEXBIN V2.3 offset: 1000H bytes first address: 9000H last address: A255H fill peepholes with: 00H binary image length: 8000H bytesThe /QUIET option suppresses this console output, while error messages are displayed regardless.
Options may be abbreviated as long as they remain unique!
Examples:
0.) HEXBINWhen invoked without parameters, HEXBIN displays a help screen:Hex File Converter HEXBIN V2.3 usage: HEXBIN <hexfile> [<binary>] [options] options: /OFFSET:offset /LENGTH:length /FILL:fillbyte /QUIET1.) HEXBIN PROGRAMwill convert theIntel-HEX file PROGRAM.HEX to a pure binary image file PROGRAM.BIN.2.) HEXBIN TARZAN.OBJ JUNGLE/FILL:E5will convert theIntel-HEX file TARZAN.OBJ to a binary image file JUNGLE.BIN and fill all peepholes between the HEX file records with the binary value E5H.3.) HEXBIN PROJECT EPROM. /off:8000 /length:10000 /f:0will convert theIntel-HEX file PROJECT.HEX to a binary image file EPROM, insert 32K dummy bytes on top of file, fill all peepholes and the dummy bytes with nulls, and extend the file to exactly 64K.
When terminating HEXBIN returns an exit code to the operating system:
situation | ERRORLEVEL |
---|---|
no errors | 0 |
conversion errors detected | 1 |
fatal runtime error | 2 |
There is also a Win32 console-mode version of HEXBIN: HEXBINW.EXE!
HEXBINW is functionally identical to HEXBIN, but can handle long file names.