Motorola DSP Object File Format (COFF)
Object File Data Expression Format
E-32
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
and parentheses. Expressions may contain user-defined labels, integers, floating point
numbers, or literal strings. An object file data expression generally follows the guidelines
of Assembler expressions, except that functions are not supported (e.g. they must be
evaluated at assembly time), and operators are provided for Linker-specific operations.
Also, floating point terms found in these expressions are converted to binary values.
E.5.1 Data Expression Generation
Link file data expressions are generated when external or relocatable operands are en-
countered during assembly or incremental link processing. In most cases the operand ex-
pression is copied verbatim from the source and embellished with link evaluation control
constructs. For example, consider the source line below:
MOVE #FOO,R0
The DSP96000 Assembler produces the following encoding for this line in the object file:
$3A8D2000 {FOO}@0#0
Since the symbol FOO is not known to the Assembler it generates a two-word instruction
and places a relocation reference to the expression in the position of the second instruc-
tion word. The braces (
{ }
) indicate that this is a user expression that should adhere to
certain integrity constraints such as those governing absolute and relative terms. Other-
wise the braces are treated much like parentheses. The at sign (
@
) is a binary operator
indicating the memory space of the left operand by the right. The pound sign (
#
) is a binary
operator signifying the size in bits of the left operand by the right. More information on
these special operators and their operands is given below.
Here is another example of data expression generation:
JCLR
#1,X:LOC,LABEL
For this conditional jump the Assembler produces the following object file code:
(($02A00481&~(~(~0<<8)<<12))I(({LOC}@1#8&~(~0<<8))<<12)) {LABEL}@0#0
The first expression is evaluated such that the relative address LOC, resolved at link time,
is shifted and masked into the middle eight bits of the base instruction word ($02A00481).
The expression could have been more complex if the bit number was an external refer-
ence. The relative value of the symbol LABEL occupies the second instruction word.
E.5.2 Data Expression Interpretation
Object file data expressions are similar to standard Assembler expressions which gener-
ally follow the rules of algebra and boolean arithmetic. They are written using infix notation
in conjunction with unary and binary operators and parentheses. There are also exten-
sions to the usual set of Assembler arithmetic and grouping operators. These are control
constructs that assist the Linker in determining the size, type, and characteristics of an
expression operand.
F
Freescale Semiconductor, Inc.
n
.