A68k Command-Line Parameters (How to use A68k)

Previous The A68k Assembler Next

The command-line syntax to run the assembler is as follows:

   a68k <source file name>
        [<object file name>]
        [<listing file name>]
(TIGCC) [-a]
        [-d[[!]<prefix>]]
        [-e[<equate file name>]]
        [-f]
        [-g]
        [-h<header file name>]
        [-i<include directory list>]
        [-k]
        [-l[<listing file name>]]
        [-m<small data offset>]
        [-n]
        [-o<object file name>]
        [-p<page depth>]
        [-q[<quiet interval>]]
(TIGCC) [-r[a][l][m]]
        [-s]
        [-t]
(TIGCC) [-u]
(TIGCC) [-v<name>[,<value>]
        [-w[<hash table size>][,<secondary heap size>]]
        [-x[<listing file name>]]
        [-y]
        [-z[<debug start line>][,<debug end line>]]
These options can be given in any order. Any parameter which is not a switch (denoted by a leading hyphen) is assumed to be a file name; up to three file names (assumed to be source, object, and listing file names respectively) can be given. A source file name is always required. If a switch is being given a value, that value must immediately follow the switch letter with no intervening spaces. For instance, to specify a page depth of 40 lines, the specification '-p40' should be used; '-p 40' will be rejected.

Switches perform the following actions:
-a
Causes all relocs to be emitted, even PC-relative relocs within a section. It also emits address differences in a special TIGCC-specific format. This will allow more aggressive linker-side optimization.

-d
Causes symbol table entries (hunk_symbol) to be written to the object module for the use of symbolic debuggers. If the switch is followed by a string of characters, only those symbols beginning with that prefix string will be written. This can be used to suppress internal symbols generated by compilers. If the first character is an exclamation mark ('!'), only symbols which do not begin with the following characters are written out. Here are some examples:

-dwrites all symbols
-dabc   writes only symbols beginning with "abc"
-d!xwrites symbols which do not begin with "x"

-e
Causes an equate file (see above) to be produced. A file name can be specified; otherwise a default name will be used.

-f
Causes any branches (Bcc, BRA, BSR) that could be converted to short form to be flagged. A68k will convert as many branches as possible to short form (unless the '-n' switch is is specified), but certain combinations of instructions may set up a ripple effect where shortening one branch brings another one into range. This switch will cause A68k to flag any branches that it may have missed; during pass 2 it is possible to tell this, although during pass 1 it might not be. If the '-n' switch (see below) is specified along with this switch (suppressing all optimization), no branches will be shortened, but all branches which could be shortened will be flagged.

-g
Causes any undefined symbols to be treated as if they were externally defined (XREF), rather than being flagged as errors.

-h
Causes a header file to be read prior to the source code file. A file name must be given. The action is the same as if the first statement of the source file were an INCLUDE statement naming the header file. To find the header file, the same directories will be searched as for INCLUDE files (see the '-i' switch below).

-i
Specifies directories to be searched for INCLUDE files in addition to the current directory. Several names, separated by commas, may be specified. No embedded blanks are allowed. For example, the specification
-imylib,df1:another.lib
will cause INCLUDE files to be searched for first in the current directory, then in "mylib", then in "df1:another.lib".

-k
Causes the object file to be kept even if any errors were found. Otherwise, it will be scratched if any errors occur.

-l
Causes a listing file to be produced. If you want the listing file to include a symbol table dump and cross-reference, use the '-x' switch instead (see below).

-m
Changes the assumed offset from the start of the DATA/BSS section to the base register used when the small code/data option is activated by the NEAR directive. If this parameter is not specified, the offset defaults to 32768.

-n
Causes all object code optimization (see above) to be disabled.

-o
Allows the default name for the object code file (see above) to be overridden.

-p
Causes the page depth to be set to the specified value. This takes the place of the PLEN directive in the Metacomco assembler. Page depth defaults to 60 lines ('-p60').

-q
Changes the interval at which A68k displays the line number it has reached in its progress through the assembly. The default is to display every 100 lines ('-q100'). Specifying larger values reduces console I/O, making assemblies run slightly faster.

If you specify a negative number (e.g. '-q-10'), line numbers will be displayed at an interval equal to the absolute value of the specified number, but will be given as positions within the current module (source, macro, or INCLUDE) rather than as a total statement count - the module name will also be displayed.

A special case is the value zero ('-q0' or just '-q') - this will cause all console output, except for error messages, to be suppressed.

(TIGCC) -r
Allows to disable specific optimizations:
-rm Disable the MOVEM -> MOVE optimization
-ra Disable the ADD(A)/SUB(A) -> LEA optimization
-rl Disable the LEA -> ADDQ/SUBQ optimization
You might use more than one -r switch (as in "-rm -ra") or combine them into a single switch (as in "-rma").

-s
Causes the object file to be written in Motorola S-record format, rather than AmigaDOS format. The default name for an S-record file ends with '.s' rather than '.o; this can still be overridden with the '-o' switch, though.

-t
Allows tabs in the source file to be passed through to the listing file, rather than being expanded. In addition, tabs will be generated in the listing file to skip from the object code to the source statement, etc. This can greatly reduce the size of the listing file, as well as making it quicker to produce. Do not use this option if you will be displaying or listing the list file on a device which does not assume a tab stop at every 8th position.

(TIGCC) -u
Disables automatic alignment of DC.W, DC.L, DCB.W, DCB.L, DS.W, DS.L and code.

(TIGCC) -v
Allows to set a variable in the command line (like -d with GCC). The variable will be a SET, not EQU variable. Syntax: "-v<name>[,<value>]" (without spaces, and without the quotes). Note that <value> can only be a NUMBER at the moment. (We might support symbols as values in a future version.) The default value of <value> is 1.

-w
Specifies the sizes of fixed memory areas that A68k allocates for its own use. You should normally never have to specify this switch, but it may be useful for tuning.

The first parameter gives the number of entries that the hash table (used for searching the symbol table) will contain. The default value of 2047 should be enough for all but the very largest programs. The assembly will not fail if this value is too small, but may slow down if too many long hash chains must be searched. The hashing statistics displayed by the '-y' switch (see below) can be used to tune this parameter. I've heard that you should really specify a prime number for this parameter, but I haven't gone into hashing theory enough to know whether it's actually necessary.

The second parameter of the '-w' switch specifies the size (in bytes) of the secondary heap, which is used to store nested macro and INCLUDE file information (see below). It defaults to 1024, which should be enough unless you use very deeply nested macros and/or INCLUDE files with long path names.

(TIGCC) The default sizes are 4095,2048 in the Win32 (since v.2.71.F3a) and GNU/Linux (since v.2.71.F3c) versions.


You can specify either or both parameters. For example:

-w4093secondary heap size remains at 1024 bytes
-w,2000hash table size remains at 2047 entries
-w4093,2000   increases the size of both areas

If you're really tight for memory, and are assembling small modules, you can use this switch to shrink these areas below their default sizes. At the end of an assembly, a message will be displayed giving the sizes actually used, in the form of the '-w' command you would have to enter to allocate that much space. This is primarily useful to see how much secondary heap space was used.

Note: All other memory used by A68k (e.g. the actual symbol table) is allocated as required (currently in 8K chunks).

-x
Works the same as '-l' (see above), except that a symbol table dump, including cross-reference information, will be added to the end of the listing file.

-y
Causes hashing statistics to be displayed at the end of the assembly. First the number of symbols in the table is given, followed by a summary of hash chains by length. Chains with length zero denote unused hash table entries. Ideally (i.e. if there were no collisions) there should be as many chains with length 1 as there are symbols, and there should be no chains of length 2 or greater. I added this option to help me tune my hashing algorithm, but you can also use it to see whether you should allocate a larger hash table (using the first parameter of the '-w' switch, see above).

-z
This switch was provided to help debug A68k itself. It causes A68k to list a range of source lines, complete with line number and current location counter value, during both passes. Lines are listed immediately after they have been read from the source file, before any processing occurs. Here are some examples of the '-z' switch:

-zlists all source lines
-z100,200   lists lines 100 through 200
-z100lists all lines starting at 100
-z,100lists the first 100 lines