Blame | Last modification | View Log | Download | RSS feed
.TH asl 1.SH NAME.B asl \- cross assembler for microprocessors and -controllers.SH SYNTAX.B asl[ option(s) ] file(s) [ option(s) ] file(s) ....SH DESCRIPTIONAS is a cross assembler that can be used to write assembler programsfor a variety of different microprocessors and -controllers..B aslis the UNIX/C implementation of AS. A complete description of AS isfar beyond the scope of this manual page, which is only intended asa quick reference for AS's command line interface. For a more detailedintroduction into the usage of AS, see the user's manual..SH COMMAND-LINE PARAMETERSEvery argument that starts with a slash (/), plus (+) or minus (-) signis regarded as a command-line parameter. Some command-line parameterstake an argument as additional parameter. Every argument that is notrecognized as a command-line parameter is regarded as an assembler sourcefile to be assembled. A source file name that does not have an extensionis automatically extended with the default extension '.asm'.Options are turned on with a parameter starting witha slash (/) or minus sign (-), whereas a parameter with a leading plus sign(+) turns an option off. In the following list, all options will be shown inthe form that is needed to change the default behaviour, which might be aplus or minus sign, depening on wether the option is on or off by default..B aslaccepts the following command-line parameters:.TP.B -AChange the data structure that is internally used to store the symbol table.By default, AS uses binary trees to store macro and symbol definitions. Turningthis option on will change this to AVL-balanced trees. Depending on the ratioof symbol entries and lookups, this might speed up assembly. Using AVL-balancedtrees helps also reducing the stack usage, which is however irrelevant for the Cversion of AS..TP.B -aInstruct AS to write out the shared symbol definitions in a format suitablefor including into an AS assembler program. The file's name is constructed byreplacing the source file's extension with '.inc'. See the user manual for moreinformation about symbol sharing..TP.B -cpu <name>Set the target processor to <name>. Use this option if the source file doesnot contain a CPU statement..TP.B -alias <new name=old name>Define a CPU alias. An alias is a name that can be used as an argument to theCPU pseudo-instruction just like an intrinsic CPU type. Its usage will setthe same target as the old name, however the predefined symbols MOMCPU andMOMCPUNAME will be set to the new name. This option is primarily useful foradding a new member to a processor family that has the same core, but isdifferent in its internal peripherals, thus allowing to distinguish betweenthem..TP.B -CAdd a cross reference table to the assembler listing. A cross referencetable lists all symbols that have been referenced at least once during assembly,including the source line number(s) and count of every reference. This optiononly makes sense when the generation of an assembly listing has been turned onvia the.B -Lor.B -lparameters..TP.B -cInstruct AS to write out the shared symbol definitions in a format suitablefor including into a C program. The file's name is constructed by replacingthe source file's extension with '.h'. See the user manual for more informationabout symbol sharing..TP.B -compmodeEnable the 'compatibility mode', which aims at making the behaviour of AS morelike the respective 'original assembler' in some situations. See the manual fortarget-specific details..TP.B -D <name[=value]>[,...]Pre-define symbols. Predefined symbols are entered into the global symboltable prior to assembly of the source file(s). If no value is given for asymbol, it is assigned the integer value 1. Value expressions may containarithmetic expressions as described in the user manual, but they may notreference any other predefined or internal symbols..TP.B -E [file]Force AS to send warning and error messages to.B filerather than to the standard error output. The file names !0 to !4 are usedto refer to the standard input, output, error, auxilliary, and printer channelspredefined by the operating system (on some systems, some of these handlesmight not exist). If the [file] specification is omitted, a name is constructedby replacing the source file's extension with '.log'..TP.B +GSupress code generation, reducing the functionality of AS to macropreprocessing..TP.B -g [MAP|Atmel|NoICE]Instruct AS to write an additional file containing debug information. Thisinformation covers the symbol table and the relation between source linenumbers and machine addresses. The argument specifies whether debug infoshall be written in AS's own MAP format, the object format for Atmel's AVRtools, or a command file suitable for John Hartman's NoICE. If no argumentis given, MAP will be chosen. The file's name is constructed by replacingthe source file's extension with '.map', '.obj', or '.noi' respectively..TP.B -gnuerrorsOutput errors and their location in the source code in a format similarto the GNU C compiler, thus making it easier to integrate AS intoenvironments designed for this format. Note that in contrast to thestandard format used by AS, locations inside macros are not reported!.TP.B -maxerrors <num>Force AS to terminate assembly after the given number of errors occured..TP.B -maxinclevel <num>Limit the maximum nesting level of include statements to the given number.By default, this limit is set to 200..TP.B -werrorForce AS to treat warnings as errors..TP.B -hForce AS to print all hexadecimal constants with lowercase letters, ratherthan with uppercase letters A..F which is the default..TP.B -listradix <2..36>Set the number system to be used in the listing. By default, all integervalues are printed in hex, but an arbitrary base between 2 and 36 may beused via this switch..TP.B -splitbyte [character]Use split-byte display of numbers in the listing, e.g. to obtain splitoctal notation..TP.B -i <path[:path...]>Add new entries to the list of paths that are searched for include files.New entries are prepended to the current include path list, so if multiplepaths are given with one command-line parameter, they will be entered intothe path list in reverse order..TP.B -IAdd an include file list to the assembly listing. An include file list containsall files that have been included while assembling the source files, includingmultiple and nested inclusion. Nesting of inclusion is identified by differentindention. This option only makes sense when the generation of an assemblylisting has been turned on via the.B -Lor.B -lparameters..TP.B -LTurn on generation of an assembly listing and send it to a file whose name isconstructed by replacing the source file's extension with '.lst'..TP.B -lTurn on generation of an assembly listing and send it to the console..TP.B -olist <file name>Override the default path and file name for the file the listing is written to..TP.B -MTurn on generation of a macro definition file. A macro definition file isa file that contains all macro definitions that have been detected duringassembly, in a format suitable for an inclusion into another file. The macrodefinition file's name is constructed by replacing the source file'sextension with '.mac'..TP.B -nForce AS to extend all error and warning messages with their internal errorresp. warning number..TP.B -noicemask [mask]By default, AS will only write symbols to the NoICE debug info that arelocated in the code segment. By changing this binary mask, more and/ordifferent masks may be chosen. The assignment is bit 1=code, 2=data,3=idata, 4=xdata, 5=ydata, 6=bitdata, 7=io, 8=reg, 9=romdata . Negatingthis option reverts the mask to code-only..TP.B -o <name>Tell AS to write the code output to a file <name>. By default, the codeoutput file's name is constructed by replacing the source file's extensionwith '.p'. If multiple files are assembled with one command, this parametermay also be given multiply. If there are less output specifications thansource file names, AS will switch back to the default naming convention afterall output specifications have been used up..TP.B -olist <name>Tell AS to write the assembly lsting to a file <name>, instead of a filewith the standard name in the source file's directory. This option onlymakes sense when an assembly listing has been requested via the '-L' option..TP.B -shareout <name>Tell AS to write shared symbol definitions to a file <name>, instead ofconstructing the name from the source file's name. See the user manual formore information about symbol sharing..TP.B -PTurn on generation of a macro output file. A macro output file contains theintermediate source code that remains after macro expansion and conditional assembly.The macro output file's name is constructed by replacing the source file'sextension with '.i'..TP.B -pInstruct AS to write out the shared symbol definitions in a format suitablefor including into a Pascal or Modula-2 program. The file's name isconstructed by replacing the source file's extension with '.inc'. See theuser manual for more information about symbol sharing..TP.B -q or -quietTurn on silent assembly mode. In silent compilation mode, AS will notdo any console output except for warning and error messages..TP.B -r [pass number]Tell AS to output warnings when a situation appears in a source file thatforces another pass of assembly. Such situations either take place when a symbolis undefined in the first pass or a symbol's value has changed compared to theprevious pass. This option is useful to track down sources of excessivemulti-passing, but be aware that it might yield a fairly large number ofwarnings, especially in the first pass. Optionally, a pass number may be addedto this option to inhibit output until a certain pass is reached..TP.B -relaxedEnable the relaxed mode by default, which allows all syntax variantsfor hexadecimal/binary/ocatal constants (Intel, Motorola, Hitachi, C),rahter than only the target-specific one..TP.B -sAdd a section list to the assembly listing. A section list containsall sections that have been defined in the source files, marking theirnesting level by different levels of indentation. This option onlymakes sense when the generation of an assembly listing has been turnedon via the.B -Lor.B -lparameters..TP.B -shareout <file>Override the default path and file name for the file containing sharedsymbols..TP.B -t <mask>Turn on or off parts of the assembly listing that have no individualcommand line parameter. AS internally keeps an integer value whose bitsrepresent certain components of the listing. A positive command lineparameter (-t or /t) sets the bits set in <mask>, whereas a negatedparameter (+t) resets the bits set in <mask>. The individual bits havethe following meaning: bit 0 = source lines and generated machine code,bit 1 = symbol table, bit 2 = macro table, bit 3 = function table, bit 4 =line numbering..TP.B -uTell AS to do additional bookkeeping about which address ranges have beenused by the assembled program. This option enables the detection of overlappingmemory usage. If an assembly listing has been turned on via the.B -Lor.B -lparameters, it will also contain a list of all used memory areas..TP.B -UForce AS to operate in case-sensitive mode. By default, names of symbols,macros, user-defined functions and sections are treated in a case-insensitivemanner..TP.B -wSuppress output of warnings..TP.B -xTurn on extended error reporting. With extended error reporting, severalerror and warning messages will also print the item that created the message,e.g. the name of an unknown instruction. When this option is given twice,the erroneous source line is additionally printed..TP.B -warnrangesOnly warn about integer constants exceedings the given data type's range, insteadof issuing an error..SH PRESETTING PARAMETERSParameters need not neccessarily be given in the command line itself. Beforeprocessing of command line parameters starts, AS will look if the.B ASCMDenvironment variable is defined. If it exists, its contents will betreated as additional command line parameters whose syntax is absolutelyequal to normal command line parameters. An exception is made if thevariable's contents start with a '@' sign; in such a case, the string afterthe '@' sign is treated as the name of a file that contains the options.Such a file (also called a 'key file') has the advantage that it allowsthe options to be written in different lines, and it does not have a sizelimit. Some operating systems (like MS-DOS) have a length limit oncommand lines and environment variable contents, so the key file may beyour only option if you have a lot of lengthy parameters for AS.As parameters given in the.B ASCMDenvironment variable or a key file are processed prior to the command lineitself, and can therefore be overridden by command line parameters..SH NATIONAL LANGUAGE SUPPORTAS supports the needs of different languages and countries in the sense thatit will try to adapt to the language and date/time formats valid for thecurrent environment. Upon startup, the COUNTRY setting made in theCONFIG.SYS file is queried for DOS and OS/2 implementations of AS. ForUNIX systems, AS tries to read the LC_TIME resp. LC_MESSAGES environmentvariables to find out the correct format for date/time outputs resp. thelocal language. If this fails, the LC_ALL and finally LANG variables areprobed. If none of these environment variables points to a specific localenvironment resp. contains a locale specification unknown to AS, thestandard english/C locale is used.The messages AS can output in different languages are stored in separatefiles with the extension '.msg' . AS will search for these files in thefollowing directories:- The current directory- The directory the executable of AS was loaded from (only on DOS platforms version >=3.0 or if path was explicitly specified)- The directory specified in the AS_MSGPATH environment variable resp. the directories listed in the PATH environment variable if AS_MSGPATH does not exist.- The LIBDIR directory set at compile time from the Makefile..SH RETURN CODESDepending on the assembly's turnout,.B aslwill generate different return codes:.TP.B 0No errors, warnings might have occured..TP.B 1No command line parameters were given, AS printed a short listof possible command line parameters and terminated thereafter..TP.B 2Errors occured during assembly of at least one source file, nocode file was generated for the corresponding source file(s)..TP.B 3A fatal error occured during assembly that forced immediateprogram termination. Code files may be generated, but are probablyunusuable..TP.B 4Program termination already occured during initialization. Thismight be either due to a incorrect command line parameter or an errorduring loading the program's overlay file (only possible on MS-DOS)..TP.B 255During initialization, an internal error happened that should notoccur. If the reaction is reproducable, note down the situation andsend a bug report to the author..SH EXAMPLESTo assemble a source file.B file1.asmwithout any additional bells and whistles, use:.PP.B asl file1.PPwhich will create an output file.B file1.pgiven that there are no errors. If you additionally want a listing andrename the output file to.B a.out,use.PP.B asl -L file1 -o a.out.PPTo make the listing as comprehensive as possible and to get more detailederror messages, use:.PP.B asl -LuCIs -t 16 -nx file1.SH TIPScalling AS without any parameters will print a short help containing allcommand line parameters and implemented target processors, while callingwith command line parameters but without any source file name will resultin AS asking for a source file name on the console..SH SEE ALSOplist(1), pbind(1), p2hex(1), p2bin(1).SH HISTORYAS originally appeared as a DOS program in 1989, written inBorland-Pascal, and was ported to C and UNIX in 1996..SH BUGSThere are too many options.Command line interpreters of some operating systems reserve somecharacters for their own use, so it might be necessary to givecommand line parameters with certain tricks (e.g., with the helpof escape characters)..SH AUTHOR(S)Alfred Arnold (alfred@ccac.rwth-aachen.de), and a few others...