Section 3: Assembler
141
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
3.3.4.2. Creating
Sections
Special directives are used to create and activate sections (see sections
3.6 Asm68 Assembler Directives and 3.7 Asm68k Assembler Directives). All
object code that is generated by instructions and directives is placed in the most
recently created or activated section. When a section has been completed, its
size is padded (if necessary) to a quad boundary with the current fill value (see
.opt fillval / OPT FILLVAL). Prior to the issuance of the first section directive,
the relocatable, text-type section .text is used. If the
-O
flag is specified,
however, the default section is an absolute, text-type section beginning at the
specified address.
3.3.4.3. Location
Counter
Each section has a location counter, which maintains the current position within
the section, i.e., the address at which object code will be placed next. This
address is absolute in an absolute section and is section-relative in a relocatable
section.
The location counter allows a resumed section to continue as if there had been
no interruption: additional object code is placed immediately following the last
code that was generated in that section. It also allows instructions and directives
to reference the address at which they are located. The location counter can be
referenced in integer expressions with a period ( . ) (asm68) or an asterisk (
*
)
(asm68k).
3.3.4.4. Structure
Templates
Structure template sections are used to define labels suitable for structure field
references. They are merely dummy sections — they cannot contain any object
code, and they are not included in the output object file. See the
.struct / OFFSET directives for a complete description of their usage.
3.3.5. Symbols
Symbols are used to label addresses and represent constants. They can be
either absolute or relocatable. The value of an absolute symbol is fixed, while
that of a relocatable symbol is dependent upon the section in which it is defined.
During assembly, the value of a relocatable symbol is an offset from the base of
a relocatable section; it becomes absolute during linkage (after relocatable
sections have been bound to absolute addresses).