Texas Instruments MSP50C614 User Manual
Page 335

Assembler
5-35
Code Development Tools
symbol is any alphanumeric text starting with an alphabetic character, a
number, or an expression.
Examples:
SYM1
EQU (12 * 256)
SYM2
EQU SYM1 * (32 / 4)
SYM3
EQU SYM1 * SYM2 – *0x200
From the above example SYM1, SYM2 and SYM3 are symbols for some ex-
pression. The grammar for Symbol is as follows:
symbol: expression
|
symbol
Expression Restrictions: It is recommended that a space be inserted
between the operator (i.e., +, –, *, /, |, &) and the symbol or numeric expression
to perform arithmetic and bitwise operations. For example
ADD A0, A0, 1
+ –2
, adds a –1 to A0, because the argument is read as 1+(–2) = –1; but
writing the argument as 1+–2 may or may not give the correct result. Outside
parenthesis are not allowed in instruction arguments. For example,
ADD
A0~,A0~,(1 + (2 * 300) – 256)
causes compile time syntax error.
But removing the outside parenthesis i.e.,
ADD A0~,A0~, 1 + (2 *
300) – 256
, causes no error.
#ELSE: see #IF and #IFDEF
#END_FT : This directive is created by the C– – compiler when it outputs
assembly code to a file. It marks the end of the
function table used to track
function calls and C– – variables in the emulator.
Users should NEVER use
this directive in an assembly language program.
#ENDIF: marks the end of a conditional assembly structure started by #IF or
#IFDEF
#IF expression: Start of a conditional assembly structure expression is an
arithmetic expression that can contain symbols.
Caution: since the
conditional assembly is resolved during the first pass of the assembler,
no forward referenced symbols should be used in a conditional
assembly expression. If an expression is TRUE (non zero), then the lines
following this directive are assembled until a #ELSE or a #ENDIF directive are
encountered. If an expression is FALSE (equal to zero), then all input lines are
skipped until a #ELSE or a #ENDIF directive are encountered. If a #ELSE
directive is encountered first, all lines following it are assembled, until a
#ENDIF directive is found.