Motorola dsp assembler Reference Manual



Yüklə 4,8 Kb.
Pdf görüntüsü
səhifə80/91
tarix08.10.2017
ölçüsü4,8 Kb.
#3546
1   ...   76   77   78   79   80   81   82   83   ...   91

Motorola DSP Object File Format (COFF)
Object File Data Expression Format
E-32
DSP ASSEMBLER REFERENCE MANUAL
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.


Motorola DSP Object File Format (COFF)
Object File Data Expression Format
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
E-33
E.5.2.1  User Expression - { ... }
The curly braces ({ }) delimit a user expression within a data expression. A user expres-
sion is that part of a data expression that was written by the programmer and not gener-
ated by the Assembler or Linker as part of its control requirements. It is useful to isolate
the user expression in order to check for relationships among absolute and relative terms.
In all other respects the curly braces behave like parentheses.
E.5.2.2  Relocatable Expression - [ ... ]
The square brackets ([ ]) are used to enclose a relocatable expression. The value con-
tained in the square brackets is an offset from the base of the current section. Usually this
grouping operator is placed around the value of an Assembler local label (underscore la-
bel) since these symbols do not migrate to the link file.
E.5.2.3  Memory Space Operator - @
The at sign (@) is a binary operator that checks the memory space compatibility of the left
operand based on the value of the right operand.  The right operand can have the follow-
ing values:
0
=
None
1
=
X space
2
=
Y space
3
=
L space
4
=
P space
5
=
E space
6
=
D space
The compatibility check is made based on the matrix outlined in section 3.3,   Expression
Memory Space Attribute.
E.5.2.4  Bit Size Operator - #
The pound sign (#) is a binary operator used to verify the size in bits of the left operand
given the value of the right operand. The following bit sizes and operand type correspon-
dences are defined:
-1515 -
15-bit signed short offset
-88
-
8-bit signed short offset
-77
-
7-bit signed short offset
-55
-
5-bit signed short offset
-19
-
19-bit page address
-16
-
16-bit signed short immediate
-15
-
15-bit signed short immediate or offset


Motorola DSP Object File Format (COFF)
Object File Data Expression Format
E-34
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
  -7
-
 7-bit signed short immediate or offset
-6
-
 6-bit signed short PC-relative address
-5
-
 5-bit signed short offset
  -2
-
 6-bit non-zero positive value
  -1
-
 Negated immediate shift
   0
-
 DSP word size immediate or absolute
  1
-
 Immediate shift
  2
-
 Even value
  5
-
 5-bit short absolute
  6
-
 6-bit short immediate or absolute
  7
-
 7-bit short immediate, absolute, or offset
  8
-
 8-bit short immediate or absolute
12
-
12-bit short immediate or absolute
13
-
13-bit short immediate or absolute
19
-
19-bit short immediate or absolute
 67,69 -
 7,9-bit masked I/O short absolute
 76
-
 6-bit alternate I/O short absolute
 85,86,87 -
 5,6,7-bit I/O short absolute
100
-
 Nonzero value
102
-
 Limited I/O short absolute
105
-
 5-bit non-zero immediate
106
-
 6-bit non-zero immediate
E.5.2.5  Memory Attribute Operator - :
The colon (:) is used to assign a memory space and counter encoded in the right operand
to the left operand.  The low sixteen bits of the right operand contain the counter designa-
tor for the left operand.  The high sixteen bits contain the memory space designator for
the left operand.  The value here corresponds to the memory space values given for the
memory space operator (@) described above.
E.5.2.6  Line Number Operator - !
The exclamation point (!) is a binary operator that associates the source file line number
of the left operand to the value of the right operand. The left operand is a decimal value
representing the source file line number. The right operand is an arbitrary relocation ex-
pression. The line number operator assists the Linker in correlating source line numbers
to expression terms which could be evaluated erroneously at link time, e.g. forced oper-
ands which do not fit into the instruction word after relocation.


Yüklə 4,8 Kb.

Dostları ilə paylaş:
1   ...   76   77   78   79   80   81   82   83   ...   91




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə