📄 doscmd.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- DOS Command Line Operation --><HTML><HEAD><TITLE>DOS Command Line Operation</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.3 DOS Command Line Operation</U></STRONG></P><P><NOBR>ASEM-51</NOBR> provides full support of command line operation and batchcapability as the best commercial development tools. <IMG SRC="smile.gif" ALT="(smile)" WIDTH=15 HEIGHT=15><BR>Nevertheless, it can be integrated into foreign development environments,if desired. The assembler is invoked by typing:</P><P><BLOCKQUOTE><STRONG><PRE>ASEM <source> [<object> [<listing>]] [<options>]</PRE></STRONG></BLOCKQUOTE></P><P>where <source> is the 8051 assembler source, <object> is the output file,and <listing> is the assembler list file. The parameters <object> and<listing> are optional. When omitted, the file names are derived from the<source> file name, but with extensions HEX (or OMF) and LST. All file namesmay be specified without extensions. In these cases, the assembler addsdefault extensions as shown below:</P><P><CENTER><TABLE BORDER CELLPADDING=8><TR><TH ALIGN=LEFT><BIG>file</BIG></TH><TH ALIGN=LEFT><BIG>extension</BIG></TH></TR><TR><TD><BIG><source></BIG></TD><TD><BIG>.A51</BIG></TD></TR><TR><TD><BIG><object></BIG></TD><TD NOWRAP><BIG>.HEX (with /OMF-51 option: .OMF)</BIG></TD></TR><TR><TD><BIG><listing></BIG></TD><TD><BIG>.LST</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.Although it is possible to read the source file from a character device(e.g. CON:) instead of a file, this cannot be recommended: Since <NOBR>ASEM-51</NOBR>is a two-pass assembler, it always reads the source file twice!</P><P>ASEM recognizes the following options:<BLOCKQUOTE><STRONG><PRE> /INCLUDES:path1[;path2[; ... ;pathn]] /DEFINE:symbol[:value[:type]] /OMF-51 /COLUMNS /QUIET</PRE></STRONG></BLOCKQUOTE></P><P>When the /INCLUDES option is used, the assembler searches the specifiedpath for include files that cannot be found in the working directory.The path may be any number of directories separated by ';' characters.The directories will be searched from left to right.The path, specified with the /INCLUDES option, is searched before thepath, defined with the (optional) DOS environment variable ASEM51INC!</P><P>The /DEFINE option is useful for selecting particular program variantsfrom the command line that have been implemented with conditional assembly.It allows to define a symbol with a value and a segment type in thecommand line. Value and type are optional. The segment type of the symboldefaults to NUMBER, if omitted. The symbol value defaults to 0, if omitted.The symbol value may be any numerical constant. The symbol type must be oneof the following characters:<BLOCKQUOTE><STRONG><PRE> C = CODE D = DATA I = IDATA X = XDATA B = BIT N = NUMBER (default)</PRE></STRONG></BLOCKQUOTE></P><P>By default, <NOBR>ASEM-51</NOBR> generates an object file in <NOBR>Intel-HEX</NOBR> format.When the <NOBR>/OMF-51</NOBR> option is specified, an absolute <NOBR>OMF-51</NOBR>module is generated.</P><P>Options may be abbreviated as long as they remain unique!</P><P><BR><STRONG>Examples:</STRONG><STRONG><PRE> 0.) ASEM</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>When invoked without parameters, the assembler displays a help screen:</BLOCKQUOTE></BLOCKQUOTE><PRE> MCS-51 Family Macro Assembler ASEM-51 V1.3 usage: ASEM <source> [<object> [<listing>]] [options] options: /INCLUDES:path1;path2;path3 /DEFINE:symbol[:value[:type]] /OMF-51 /COLUMNS /QUIET</PRE><STRONG><PRE> 1.) ASEM PROGRAM</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>will assemble the 8051 assembly language program PROGRAM.A51 and producean <NOBR>Intel-HEX</NOBR> file PROGRAM.HEX and a listing PROGRAM.LST.</BLOCKQUOTE></BLOCKQUOTE><STRONG><PRE> 2.) ASEM TARZAN.ASM JANE JUNGLE.PRN</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>will assemble the 8051 assembly language program TARZAN.ASM andproduce an <NOBR>Intel-HEX</NOBR> file JANE.HEX and a listing JUNGLE.PRN.</BLOCKQUOTE></BLOCKQUOTE><STRONG><PRE> 3.) ASEM PROJECT EPROM.</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>will assemble the 8051 assembly language program PROJECT.A51 andproduce an <NOBR>Intel-HEX</NOBR> file EPROM and a listing PROJECT.LST.</BLOCKQUOTE></BLOCKQUOTE><STRONG><PRE> 4.) ASEM ROVER /OMF</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>will assemble the 8051 assembly language program ROVER.A51 and producean absolute <NOBR>OMF-51</NOBR> object module ROVER.OMF and a listing ROVER.LST.</BLOCKQUOTE></BLOCKQUOTE><STRONG><PRE> 5.) ASEM sample COM2: NUL</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>will assemble the 8051 assembly language program SAMPLE.A51, sendthe HEX file output to the serial interface COM2 and suppress thelist file output by sending it to the NUL device.</BLOCKQUOTE></BLOCKQUOTE><STRONG><PRE> 6.) ASEM APPLICAT /INC:C:\ASEM51\MCU;D:\MICROS\8051\HEADERS</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>will assemble the program APPLICAT.A51, while all required includefiles will be searched first in the default directory, then inC:\ASEM51\MCU, and finally in D:\MICROS\8051\HEADERS.</BLOCKQUOTE></BLOCKQUOTE><STRONG><PRE> 7.) ASEM UNIVERSL /D:Eva_Board:8000H:C</PRE></STRONG><BLOCKQUOTE><BLOCKQUOTE>will assemble the program UNIVERSL.A51, while the CODE symbolEVA_BOARD will be predefined with value 8000H during assembly.</BLOCKQUOTE></BLOCKQUOTE></P><P>When program errors are detected, they are flagged on the console. Thismay look as follows:</P><P><BLOCKQUOTE><PRE> MCS-51 Family Macro Assembler ASEM-51 V1.3 APPLICAT.A51(14): must be known on first pass USERBITS.INC(6): attempt to divide by zero DEFINES.INC(37): symbol not defined APPLICAT.A51(20): symbol not defined APPLICAT.A51(27): no END statement found 5 errors detected</PRE></BLOCKQUOTE></P><P>Every error is flagged with the name of the source or include file, thelocal line number where it was found, and the error message itself.This output format makes it easy to integrate <NOBR>ASEM-51</NOBR> intoexisting foreign development environments or workbenches.<BR>A perfect fit for the <NOBR>Turbo C++</NOBR> IDE (and perhaps others) canbe reached with the /COLUMNS option. When specified, the column numbers ofprogram errors are output additionally after the line numbers:</P><P><BLOCKQUOTE><PRE> MCS-51 Family Macro Assembler ASEM-51 V1.3 APPLICAT.A51(14,12): must be known on first pass USERBITS.INC(6,27): attempt to divide by zero DEFINES.INC(37,18): symbol not defined APPLICAT.A51(20,18): symbol not defined APPLICAT.A51(27,1): no END statement found 5 errors detected</PRE></BLOCKQUOTE></P><P>If errors are detected in macro expansion lines, there is no correspondinglocation in the source file. Therefore, the error is flagged with the nameof the source or include file, and the local line number from where themacro expansion has been invoked. (For callable macros this is the linewith the macro call, and for repeat blocks this is the ENDM line.)To give the user a hint, the macro name and expansion line (and optionallycolumn) number are inserted before the actual error message:</P><P><BLOCKQUOTE><PRE> MCS-51 Family Macro Assembler ASEM-51 V1.3 UARTIO.A51(44,1): RECEIVE(3,22): segment type mismatch UARTIO.A51(87,1): REPT(4,19): symbol not defined UARTIO.A51(87,1): REPT(8,19): symbol not defined UARTIO.A51(87,1): REPT(12,19): symbol not defined 4 errors detected</PRE></BLOCKQUOTE></P><P>The expansion line number is the number of the expansion line within thecorresponding macro expansion, starting with 1. If the error occurs duringexpansion of a repeat block, the keyword REPT replaces the macro name.</P><P>The /QUIET option suppresses all console output except error messages.</P><P>When terminating, <NOBR>ASEM-51</NOBR> 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>program 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><STRONG>Note:</STRONG> Warnings do not influence the exit code!</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="dinstall.htm"><IMG SRC="back.gif" ALT="[back]" BORDER=0 WIDTH=32 HEIGHT=32></A></TH> <TH><A HREF="dosenv.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 + -