138
Section 3: Assembler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
3.3.1. Overview
The two assemblers, asm68 and asm68k, translate assembler source to object
code. This translation is performed using a single pass of the assembler source
file. After the source has been completely scanned, forward references are
resolved. Any references that cannot be resolved (e.g., references to symbols
defined in other files) are left for the linker to resolve.
This section describes the format of assembler source files, management of
object code sections, symbol definition and usage, and symbolic expression
construction. The format of the object files that are produced is UNIX System V
COFF (see section 1.4 Object File Format).
3.3.2. Assembler
Statements
An assembly language program consists of statements that are used to generate
machine instructions, control the behavior of the assembler, and provide
documentation. The assemblers asm68 and asm68k have different statement
syntaxes, which are described below.
3.3.2.1.
Statement Syntax (asm68)
The syntaxes for the various types of assembler statements accepted by asm68
are summarized in Table 3.3. Any of the fields shown can begin in any column,
provided they observe the specified syntax. Whitespace (i.e., spaces and tabs) is
used to separate the various fields, although no whitespace is required after the
label field or before the comment field. Whitespace is permitted within any of the
fields.
Statement
Syntax
Label
label : [ ; comment ]
Instruction
[
label : ] instruction [operand ] [ ; comment ]
Directive
[
label : ] directive [operand ] [ ; comment ]
Assignment
[
label : ] symbol { = | == } expression [ ; comment ]
Comment
;
comment
Table 3.3: Statement Syntax (asm68)