📄 hexbinl.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- The HEXBIN Utility (Linux) --><HTML><HEAD><TITLE>The HEXBIN Utility (Linux)</TITLE></HEAD><BODY BACKGROUND="spiral.gif" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#990099" ALINK="#FF0000"><TABLE WIDTH="98%"><TR><TD WIDTH=60 VALIGN=BOTTOM NOWRAP><IMG SRC="transp.gif" ALT="" WIDTH=60 HEIGHT=20></TD><TD><!-- Ab hier Seitentext: --><BIG><BR><P><STRONG><U>II.2.5 The HEXBIN Utility</U></STRONG></P><P>Most EPROM programmers are accepting the <NOBR>Intel-HEX</NOBR> object file format thatis output by <NOBR>ASEM-51</NOBR>. However, for dumb EPROM burners and special purposesit might be useful to convert the HEX file to a pure binary image file.For this the conversion utility hexbin is provided.It is invoked as follows:</P><P><STRONG><PRE> hexbin [<options>] <hexfile> [<binary>]</PRE></STRONG></P><P>where <hexfile> is the input file in <NOBR>Intel-HEX</NOBR> format, and <binary> is thebinary output file. All file names that are specified explicitly, are leftunchanged. The parameter <binary> is optional. When omitted, the file nameis derived from the <hexfile>, but with the extension ".bin".<BR>The maximum length of a file parameter is limited to 255 characters!</P><P>Instead of file names you may also specify device names to redirect the inputor output to I/O devices. Device names are assumed to start with "/dev/".Of course no extensions will be added to device names!<BR>It is not checked, whether the device is existing or suitable for the task.</P><P>hexbin recognizes the following options:</P><P><TABLE BORDER CELLPADDING=8><TR><TH NOWRAP><BIG>short options</BIG></TH><TH NOWRAP><BIG>long options</BIG></TH></TR><TR><TD NOWRAP><BIG><STRONG><CODE>-o <offset></CODE></STRONG></BIG></TD><TD NOWRAP><BIG><STRONG><CODE>--offset=<offset></CODE></STRONG></BIG></TD></TR><TR><TD NOWRAP><BIG><STRONG><CODE>-l <length></CODE></STRONG></BIG></TD><TD NOWRAP><BIG><STRONG><CODE>--length=<length></CODE></STRONG></BIG></TD></TR><TR><TD NOWRAP><BIG><STRONG><CODE>-f <fillbyte></CODE></STRONG></BIG></TD><TD NOWRAP><BIG><STRONG><CODE>--fill=<fillbyte></CODE></STRONG></BIG></TD></TR><TR><TD NOWRAP><BIG><STRONG><CODE>-v</CODE></STRONG></BIG></TD><TD NOWRAP><BIG><STRONG><CODE>--verbose</CODE></STRONG></BIG></TD></TR></TABLE></P><P>The short and long options in the same row are equivalent.<BR>Long options may be abbreviated as long as they remain unique.<BR>All option names are case-sensitive!</P><P>The binary file output can be controlled with the options<NOBR>--offset</NOBR>, <NOBR>--fill</NOBR> and <NOBR>--length</NOBR>.</P><P>Normally the first byte in the binary file is the first byte of the HEXrecord with the lowest load address. If a number of dummy bytes is to beinserted on top of the file (e.g. for alignment in an EPROM image), thiscan be performed with the <NOBR>--offset</NOBR> option:<BLOCKQUOTE><STRONG><PRE>--offset=1000</PRE></STRONG></BLOCKQUOTE>would insert 4096 dummy bytes before the first byte of the first HEX recordloaded. The offset must always be specified as a hex number. The defaultoffset is 0.</P><P>Since there may be peepholes between the HEX records, a fill byte value canbe defined with the <NOBR>--fill</NOBR> option:<BLOCKQUOTE><STRONG><PRE>--fill=0</PRE></STRONG></BLOCKQUOTE>would fill all peepholes between the HEX records with zero bytes as wellas all the dummy bytes that might have been inserted with the <NOBR>--offset</NOBR> or<NOBR>--length</NOBR> option. The fill byte value must always be specified as a hexnumber. The default fill byte is the EPROM-friendly FFH.</P><P>By default the last byte in the binary file is the last byte of the HEXrecord with the highest load address. If the binary file should have awell defined length, then a number of dummy bytes can be appended to thefile (e.g. for exactly matching an EPROM length), this can be performedwith the <NOBR>--length</NOBR> option:<BLOCKQUOTE><STRONG><PRE>--length=8000</PRE></STRONG></BLOCKQUOTE>would append as many dummy bytes behind the last byte of the file, that thetotal file length becomes exactly 32768 bytes. The file length must alwaysbe specified as a hex number.</P><P>By default, hexbin is totally "quiet", if no errors are detected.If the <NOBR>--verbose</NOBR> option is specified, additional product and versioninformation, and a file conversion report is written to standard output:<PRE> Hex File Converter HEXBIN V2.3 offset: FF0H bytes first address: 7FF0H last address: 8255H fill peepholes with: A5H binary image length: 2000H bytes</PRE></P><P><BR><STRONG>Examples:</STRONG><BLOCKQUOTE><STRONG><PRE>0.) hexbin</PRE></STRONG><BLOCKQUOTE>When invoked without parameters, hexbin displays a help screen:</BLOCKQUOTE><PRE> Hex File Converter HEXBIN V2.3 usage: hexbin [options] <hexfile> [<binary>] options: -o --offset=<offset> -l --length=<length> -f --fill=<fillbyte> -v --verbose</PRE><STRONG><PRE>1.) hexbin program.hex</PRE></STRONG><BLOCKQUOTE>will convert the <NOBR>Intel-HEX</NOBR> file program.hex to a pure binary image fileprogram.bin.</BLOCKQUOTE><STRONG><PRE>2.) hexbin -f E5 tarzan.obj jungle.bin</PRE></STRONG><BLOCKQUOTE>will convert the <NOBR>Intel-HEX</NOBR> file tarzan.obj to a binary image filejungle.bin and fill all peepholes between the HEX file records withthe binary value E5H.</BLOCKQUOTE><STRONG><PRE>3.) hexbin --off=8000 -l10000 --fill=0 project.hex eprom</PRE></STRONG><BLOCKQUOTE>will convert the <NOBR>Intel-HEX</NOBR> file project.hex to a binary imagefile eprom, insert 32K dummy bytes on top of file, fill all peepholesand the dummy bytes with nulls, and extend the file to exactly 64K.</BLOCKQUOTE></BLOCKQUOTE></P><P>When terminating hexbin returns an exit code to the calling process:</P><P><CENTER><TABLE BORDER CELLPADDING=8><TR><TH ALIGN=LEFT><BIG>situation</BIG></TH><TH><BIG>exit code</BIG></TH></TR><TR><TD NOWRAP><BIG>no errors</BIG></TD><TD ALIGN=CENTER><BIG>0</BIG></TD></TR><TR><TD NOWRAP><BIG>conversion errors detected</BIG></TD><TD ALIGN=CENTER><BIG>1</BIG></TD></TR><TR><TD NOWRAP><BIG>fatal runtime error</BIG></TD><TD ALIGN=CENTER><BIG>2</BIG></TD></TR></TABLE></CENTER></P></BIG><!-- Seitentext Ende --><P><BR><BR><CENTER><TABLE WIDTH="70%"><TR><TH><A HREF="contents.htm"><IMG SRC="home.gif" ALT="[contents]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="linux.htm"><IMG SRC="up.gif" ALT="[up]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="linuxenv.htm"><IMG SRC="back.gif" ALT="[back]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="demo.htm"><IMG SRC="next.gif" ALT="[next]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH></TR></TABLE></CENTER></P></TD></TR></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -