.sect "section_name"
assigns the code into the user defined memory section called section_name. Code
from different source files with the same section names are placed together.
.USECT directive: The .usect reserves space in an uninitialized section. It is similar
to the .bss directive. It allows the placement of data into user defined sections instead
of.bss sections. It is often used to separate large data sections into logical partitions,
such as separating the transmitter data variables from the receiver data variables. The
syntax of .usect directive is
symbol .usect "section_name", size_in_words
where symbol is the variable, or the starting address of a data array, which will be
placed into the section named section_name. In the latter case, the size_in_words
defines the number of words in the array.
.TEXT directive: The .text directive tells the assembler to begin assembling source
code into the .text section, which normally contains executable code. This is the
default section for program code. If we do not specify a program code section, the
assembler will put all the programs into the .text section.
The directives, .bss, .sect, .usect, and.text are used to define the memory
sections. The following directives are used to initialize constants.
.INT (.WORD) directive: The .int (or .word) directive places one or more 16-bit
integer values into consecutive words in the current section. This allows users to
initialize memory with constants. For example,
data1 .word 0x1234
data2 .int 1010111b
In these examples, data1 is initialized to the hexadecimal number 0x1234 (decimal
number 4660), while data2 is initialized to the binary number of 1010111b (decimal
87). The suffix `b' indicates the data 1010111 is in binary format.
.SET (.EQU) directive: The .set (or .equ) directive assigns values to symbols. This
type of symbol is known as an assembly-time constant. It can then be used in source
statements in the same manner as a numeric constant. The .set directive has the
form:
symbol .set value
where the symbol must appear in the first column. This example equates the constant
value to the symbol. The symbolic name used in the program will be replaced with the
constant by the assembler during assembly time, thus allowing programmers to write
more readable programs. The .set and .equ directives can be used interchangeably,
and do not produce object code.
The assembler is used to convert assembly language source code to COFF format
object files for the C55x processor. The following command invokes the C55x mne-
monic assembler:
masm55 [input_file [object_file [list_file]]] [-options]
The input_file is the name of the assembly source program. If no extension is
supplied, the assembler assumes that the input_file has the default extension
SOFTWARE DEVELOPMENT TOOLS
45