TASM can be invoked as follows (optional fields shown in brackets, symbolic fields in italics):
tasm -pn [-options ...] src_file [obj_file [lst_file [exp_file [sym_file]]]]
Where options can be one or more of the following:
-table Specify version (table = table designation)
-ttable Table (alternate form of above)
-aamask Assembly control (optional error checking)
-b Produce object in binary (.COM) format
-c Object file written as a contiguous block
-dmacro Define a macro (or just a macro label)
-e Show source lines after macro expansion
-ffillbyte Fill entire memory space with fillbyte (hex)
-gobjtype Object file (0=Intel Hex, 1=MOS Tech, 2=Motorola, 3=binary,4=Intel Hex (Word))
-h Produce hex table of the assembled code (in list file)
-i Ignore case for labels
-l[al] Produce a label table in the listing
-m Produce object in MOS Technology format
-oobytes Bytes per object record (for hex obj formats)
-p[lines] Page the listing file (lines per page. default=60)
-q Quiet, disable the listing file
-rkb Set read buffer size in Kbytes (default 2 Kbytes)
-s Write a symbol table file
-x[xmask] Enable extended instruction set (if any)
-y Time the assembly
The filename parameters are defined as follows:
src_file Source file name
obj_file Object code file name
lst_file Listing file name
exp_file Symbol export file (only if the EXPORT directive is used).
sym_file Symbol table file (only if the -s option or the SYM/AVSYM directives are used).
The source file must be specified. If not, some usage information is displayed. Default file names for all the other files are generated if they are not explicitly provided. The filename is formed by taking the source filename and changing the extension to one of the following:
Extension File type
.OBJ Object file
.LST Listing file
.EXP Symbol export file
.SYM Symbol table file
TASM has no built-in instruction set tables. Instruction set definition files are read at run time. TASM determines which table to use based on the '-table' field shown above. For example, to assemble the code in a file called source.asm, one would enter
tasm -48 source.asm for an 8048 assembly
tasm -65 source.asm for a 6502 assembly
tasm -51 source.asm for an 8051 assembly.
tasm -85 source.asm for an 8085 assembly.
tasm -80 source.asm for a Z80 assembly.
tasm -05 source.asm for a 6805 assembly.
tasm -68 source.asm for a 6800/6801/68HC11 assembly.
tasm -70 source.asm for a TMS7000 assembly.
tasm -3210 source.asm for a TMS32010 assembly.
tasm -3225 source.asm for a TMS320C25 assembly.
tasm -96 source.asm for a 8096/80196 assembly
Tables are read from a file named by taking the digits specified after the '-' and appending it to 'TASM' then appending the '.TAB' extension. Thus, the -48 flag would cause the tables to be read from the file 'TASM48.TAB'.
It is possible to designate tables by non numeric part numbers if the -t flag is used. For example, if a user built a table called TASMF8.TAB then TASM could be invoked as follows:
tasm -tf8 source.asm
Each option flag must be preceded by a dash. Options need not precede the file names. The various options are described in the sections that follow.
a - Assembly Control
TASM can provide additional error checking by specifying the -a option at the time of execution. If the -a is provided without a digit following, then all the available error checking is done. If a digit follows, then it is used as a mask to determine the error checks to be made. The bits of the mask are defined as follows:
Bit Option Default Description
0 -a1 OFF Check for apparent illegal use of indirection
1 -a2 ON Check for unused data in the arguments
2 -a4 ON Check for duplicate labels
3 -a8 OFF Check for non-unary operators at start of expression.
Combinations of the above bits can also be used. For example, -a5 would enable the checking for illegal indirection and duplicate labels.
Illegal indirection applies to micros that use parenthesis around an argument to indicate indirection. Since it is always legal to put an extra pair of parenthesis around any expression (as far as the expression parser is concerned), the user may think that he/she is indicating indirection for an instruction that has no indirection and TASM would not complain. Enabling this checking will result in an error message (warning) whenever an outer pair of parenthesis is used and the instruction set definition table does not explicitly indicate that to be a valid form of addressing.
Unused data in arguments applies to cases where a single byte of data is needed from an argument, but the argument contains more than one byte of data. If a full sixteen bit address is used in a 'Load Immediate' type instruction that needs only a single byte, for example, an error message would be generated. Here is an example (6502 code):
0001 1234 .org $1234
test.asm line 0002: Unused data in MS byte of argument.
0002 1234 A9 34 start lda #start
To make the above checks occur whenever you do an assembly, add a line like this to your AUTOEXEC.BAT file:
SET TASMOPTS=-a
b - Binary Object Format
This option causes the object file to be written in binary - one byte for each byte of code/data. Note that no address information is included in the object file in this format. The contiguous block (-c) output mode is forced when this option is invoked. This flag is equivalent to -g3.
c - Contiguous Block Output
If this option is specified, then all bytes in the range from the lowest used byte to the highest will be defined in the object file. Normally, with the default Intel Hex object format enabled, if the Program Counter (PC) jumps forward because of an .ORG directive, the bytes skipped over will not have any value assigned them in the object file. With this option enabled, no output to the object file occurs until the end of the assembly at which time the whole block is written. This is useful when using TASM to generate code that will be put into a PROM so that all locations will have a known value. This option is often used in conjunction with the -f option to ensure all unused bytes will have a known value.
d - Define a Macro
Macros are defined on the command line generally to control the assembly of various IFDEF's that are in the source file. This is a convenient way to generate various versions of object code from a single source file.
e - Expand Source
Normally TASM shows lines in the listing file just as they are in the source file. If macros are in use (via the DEFINE directive) it is sometimes desirable to see the source lines after expansion. Use the '-e' flag to accomplish this.
f - Fill Memory
This option causes the memory image that TASM maintains to be initialized to the value specified by the two hex characters immediately following the 'f'. TASM maintains a memory image that is a full 64K bytes in size (even if the target processor cannot utilize that memory space). Invocation of this option introduces a delay at start up of up to 2 seconds (time required to initialize all 64K bytes).
g - Object File Format
TASM can generate object code in four different formats as indicated below:
Option Description
-g0 Intel hex (default)
-g1 MOS Technology hex (same as -m)
-g2 Motorola hex
-g3 binary (same as -b)
-g4 Intel hex with word addresses
The -m and -b flags may also be used, as indicated above. If both are used the right-most option on the command line will be obeyed.
See the section on OBJECT FILE FORMATS for descriptions of each of the above.
h - Hex Object Code Table
This option causes a hex table of the produced object code to appear in the listing file. Each line of the table shows sixteen bytes of code.
i - Ignore Case in Labels
TASM is normally case sensitive when dealing with labels. For those that prefer case insensitivity, the '-i' command line option can be employed.
l - Label Table
This option causes a label table to appear in the listing file. Each label is shown with its corresponding value. Macro labels (as established via the DEFINE directives) do not appear.
Two optional suffixes may follow the -l option:
Suffix Description
l Use long form listing
a Show all labels (including local labels)
The suffix should immediately follow the '-l'. Here are some examples:
-l to show non-local labels in the short form
-la to show all labels in the short form
-ll to show non-local labels in the long form
-lal to show all labels in the long form
m - MOS Technology Object Format
This option causes the object file to be written in MOS Technology hex format rather than the default Intel hex format. See section on OBJECT FILE FORMATS for a description of the format.
o - Set Number of Bytes per Object Record
When generating object code in either the MOS Technology format or the Intel hex format, a default of 24 (decimal) bytes of object are defined on each record. This can be altered by invoking the '-o' option immediately followed by two hex digits defining the number of bytes per record desired. For example, if 32 bytes per record are desired, one might invoke TASM as:
tasm -48 -o20 source.asm
p - Page Listing File
This option causes the listing file to have top of page headers and form feeds inserted at appropriate intervals (every sixty lines of output). To override the default of sixty lines per page, indicate the desired number of lines per page as a decimal number immediately following the '-p'. Here is an example:
tasm -48 -p56 source.asm
q - Disable Listing File
This option causes all output to the listing file to be suppressed, unless a .LIST directive is encountered in the source file (see LIST/NOLIST directives).
r - Set Read Buffer Size
This option overrides the default read buffer size of 2 Kbytes. The first hexadecimal digit immediately after the 'r' is taken as the number of K bytes to allocate for the read buffer (.e.g. -r8 indicates an 8K byte buffer, -rf indicates a 15K byte buffer). Note that that read buffers are taken from the same memory pool as labels and macro storage, and that additional read buffers are needed if "includes" are used. Thus, using 8K byte buffers may be suitable for most assemblies, but programs with large numbers of symbols may not allow such a value. Also, reducing the buffer size to 1 Kbyte can increase the memory pool available for label storage, if such is needed.
s - Enable Symbol File Generation
If this flag is set, a symbol file is generated at the end of the assembly. The format of the file is one line per label, each label starts in the first column and is followed by white space and then four hexadecimal digits representing the value of the label. The following illustrates the format:
label1 FFFE
label2 FFFF
label3 1000
The symbol file name can be provided as the fifth file name on the command line, or the name will be generated from the source file name with a '.SYM' extension. The symbol table file can also be generated by invoking the SYM directive. The AVSYM directive also generates the symbol file but in a different format (see section on ASSEMBLER DIRECTIVES).
t - Table Name
As an alternative to specifying the instruction set table as two decimal digits, the table indication may be proceeded by the '-t' option. This is useful if the desired table name starts with a non-numeric. Thus, a table for an F8 might be selected as:
tasm -tf8 source.asm
TASM would expect to read the instruction set definition tables from a file named TASMF8.TAB.
x - Enable Extended Instruction Set
If a processor family has instructions that are valid for only certain members, this option can be used to enable those beyond the basic standard instruction set. A hex digit may follow the 'x' to indicate a mask value used in selecting the appropriate instruction set. Bit 0 of the mask selects the basic instruction set, thus a '-x1' would have no effect. A '-x3' would enable the basic set plus whatever instructions have bit 1 set in their class mask. A '-x' without a digit following is equivalent to a '-xf' which sets all four of the mask bits. The following table indicates the current extended instruction sets available in the TASM tables:
Base Table Base Family Ext 1 (-x3) Ext 2 (-x7) Ext 3 (-x5) Ext 4 (-x9)
48 8048 8041A 8022 8021
65 6502 R65C02 R65C00/21
05 6805 M146805 CMOS HC05C4
80 Z80 HD64180
68 6800 6801/6803 68HC11
51 8051
85 8080
3210 TMS32010
3225 TMS320C25 TMS320C26
70 TMS7000
The above table does not attempt to show the many microprocessor family members that may apply under a given column.
See the TASMTABS.TXT on-line document for details on each specific table.
y - Enable Assembly Timing
If this option is enabled TASM will generate a statement of elapsed time and assembled lines per second at the end of the assembly.
TASM. Copyright (C) 1998 by Squak Valley Software.
All rights reserved.