Motorola dsp assembler Reference Manual



Yüklə 4,8 Kb.
Pdf görüntüsü
səhifə28/91
tarix08.10.2017
ölçüsü4,8 Kb.
#3546
1   ...   24   25   26   27   28   29   30   31   ...   91

Macro Operations And Conditional Assembly
DUP, DUPA, DUPC, DUPF Directives
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
5-9
macro label called _LOCAL and attempting to reference it as in the above example.  In
that case the macro local label override operator prevents the Assembler from seeing the
local label definition for that reference, and an error would result.
5.6
  DUP, DUPA, DUPC, DUPF DIRECTIVES
The DUPDUPADUPC, and DUPF directives are specialized macro forms. They can be
thought of as a simultaneous definition and call of an unnamed macro. The source state-
ments between the DUPDUPADUPC, and DUPF directives and the ENDM directive fol-
low the same rules as macro definitions, including (in the case of DUPADUPC, and
DUPF) the dummy operator characters described previously. For a detailed description of
these directives, refer to Chapter 6.
5.7
  CONDITIONAL ASSEMBLY
Conditional assembly facilitates the writing of comprehensive source programs that can
cover many conditions. Assembly conditions may be specified through the use of argu-
ments in the case of macros, and through definition of symbols via the DEFINE_,_SET_,_and_EQU'>DEFINESET, and
EQU directives. Variations of parameters can then cause assembly of only those parts
necessary for the given conditions. The built-in functions of the Assembler provide a ver-
satile means of testing many conditions of the assembly environment (see Section 3.8 for
more information on the Assembler built-in functions).
Conditional directives can also be used within a macro definition to ensure at expansion
time that arguments fall within a range of allowable values.  In this way macros become
self-checking and can generate error messages to any desired level of detail.
The conditional assembly directive IF has the following form:
IF

.
.
[ELSE]
(the ELSE directive is optional)
.
.
ENDIF
A section of a program that is to be conditionally assembled must be bounded by an IF-
ENDIF directive pair.  If the optional ELSE directive is not present, then the source state-
ments following the IF directive and up to the next ENDIF directive will be included as part
of the source file being assembled only if the  had a nonzero result.  If the
 has a value of zero, the source file will be assembled as if those statements
between the IF and the ENDIF directives were never encountered.  If the ELSE directive
is present and  has a nonzero result, then the statements between the IF
and  ELSE directives will be assembled, and the statements between the ELSE and
ENDIF directives will be skipped.  Alternatively, if  has a value of zero, then


Macro Operations And Conditional Assembly
Conditional Assembly
5-10
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
the statements between the IF and ELSE directives will be skipped, and the statements
between the ELSE and ENDIF directives will be assembled.


MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
6-1
Chapter 6
ASSEMBLER SIGNIFICANT CHARACTERS AND DIRECTIVES
6.1
  INTRODUCTION
This chapter describes the directives that are recognized by the Motorola DSP Assem-
bler.  The Assembler directives are instructions to the Assembler rather than instructions
to be directly translated into object code.  In addition, this chapter describes special char-
acters that are considered significant to the Assembler.
6.2
  ASSEMBLER SIGNIFICANT CHARACTERS
There are several one and two character sequences that are significant to the Assembler.
Some have multiple meanings depending on the context in which they are used. Special
characters associated with expression evaluation are described in Chapter 3. Other As-
sembler-significant characters are:
;
-
Comment delimiter
;;
-
Unreported comment delimiter
\
-
Line continuation character or
Macro dummy argument concatenation operator
?
-
Macro value substitution operator
%
-
Macro hex value substitution operator
^
-
Macro local label override operator
"
-
Macro string delimiter or
Quoted string DEFINE expansion character
@
-
Function delimiter
*
-
Location counter substitution
++
-
String concatenation operator
[ ]
-
Substring delimiter
<<
-
I/O short addressing mode force operator
<
-
Short addressing mode force operator
>
-
Long addressing mode force operator
#
-
Immediate addressing mode operator


Assembler Significant Characters And Directives
Assembler Directives
6-2
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
#<
-
Immediate short addressing mode force operator
#>
-
Immediate long addressing mode force operator
6.3
  ASSEMBLER DIRECTIVES
Assembler directives can be grouped by function into seven types:
1.  Assembly control
2.  Symbol definition
3.  Data definition/storage allocation
4.  Listing control and options
5.  Object file control
6.  Macros and conditional assembly
7.  Structured programming
6.3.1
  Assembly Control
The directives used for assembly control are:
COMMENT
- Start comment lines
DEFINE
- Define substitution string
END 
- End of source program
FAIL
- Programmer generated error message
FORCE
- Set operand forcing mode
HIMEM
- Set high memory bounds
INCLUDE
- Include secondary file
LOMEM
- Set low memory bounds
MODE
- Change relocation mode
MSG
- Programmer generated message
ORG
- Initialize memory space and location counters
RADIX
- Change input radix for constants
RDIRECT
- Remove directive or mnemonic from table
SCSJMP
- Set structured control branching mode
SCSREG
- Reassign structured control statement registers
UNDEF
- Undefine DEFINE symbol
WARN
- Programmer generated warning


Yüklə 4,8 Kb.

Dostları ilə paylaş:
1   ...   24   25   26   27   28   29   30   31   ...   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ə