beautypg.com

Texas Instruments MSP50C6xx User Manual

Page 308

background image

Assembler

5-12

| (expression)

(~ indicates bitwise complement)

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 a 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 a 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