hexbin.htm
来自「Free 8051 asm compiler for linux new ho」· HTM 代码 · 共 229 行
HTM
229 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- The HEXBIN Utility (DOS) --><HTML><HEAD><TITLE>The HEXBIN Utility (DOS)</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.1.10 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 <hex> [<bin>] [/OFFSET:o] [/LENGTH:l] [/FILL:f] [/QUIET]</PRE></STRONG></P><P>where <hex> is the input file in <NOBR>Intel-HEX</NOBR> format, and <bin> is thebinary output file. The parameter <bin> is optional. When omitted, thefile name is derived from the <hex> file name, but with the extension BIN.All file names may be specified without extensions. In these cases, theprogram adds default extensions as shown below:</P><P><CENTER><TABLE BORDER CELLPADDING=8><TR><TH><BIG>file</BIG></TH><TH><BIG>extension</BIG></TH></TR><TR><TD><BIG><hex></BIG></TD><TD ALIGN=CENTER><BIG>.HEX</BIG></TD></TR><TR><TD><BIG><bin></BIG></TD><TD ALIGN=CENTER><BIG>.BIN</BIG></TD></TR></TABLE></CENTER></P><P>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 theoutput 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.</P><P>The binary file output can also be controlled with the options /OFFSET,/FILL and /LENGTH.</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 /OFFSET 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 /FILL option:<BLOCKQUOTE><STRONG><PRE>/FILL:0</PRE></STRONG></BLOCKQUOTE>would fill all peepholes between the HEX records with zero bytes as well asall the dummy bytes that might have been inserted with the /OFFSET or /LENGTHoption. The fill byte value must always be specified as a hex number.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 /LENGTH 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>When HEXBIN has been invoked with all the above options, it may display afile conversion report like this:<PRE> Hex File Converter HEXBIN V2.3 offset: 1000H bytes first address: 9000H last address: A255H fill peepholes with: 00H binary image length: 8000H bytes</PRE>The /QUIET option suppresses this console output, while error messages aredisplayed regardless.</P><P>Options may be abbreviated as long as they remain unique!</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 <hexfile> [<binary>] [options] options: /OFFSET:offset /LENGTH:length /FILL:fillbyte /QUIET</PRE><STRONG><PRE>1.) HEXBIN PROGRAM</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 TARZAN.OBJ JUNGLE/FILL:E5</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 PROJECT EPROM. /off:8000 /length:10000 /f:0</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 operating system:</P><P><CENTER><TABLE BORDER CELLPADDING=8><TR><TH ALIGN=LEFT><BIG>situation</BIG></TH><TH><BIG>ERRORLEVEL</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><P>There is also a Win32 console-mode version of HEXBIN: HEXBINW.EXE!<BR>HEXBINW is functionally identical to HEXBIN, but can handle long file names.</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="doswin.htm"><IMG SRC="up.gif" ALT="[up]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="asemw.htm"><IMG SRC="back.gif" ALT="[back]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="linux.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 + =
减小字号Ctrl + -
显示快捷键?