beautypg.com

Texas Instruments MSP50C614 User Manual

Page 334

background image

Assembler

5-34

5.7.2

Assembler Directives

Assembler directives are texts which have special meaning to the assembler.
Some of these directives are extremely helpful during conditional compiling,
debugging, adding additional features to existing codes, multiple hardware
development, code release etc. Other directives are an essential part of the
assembler to initialize variable with values, assigning symbols to memory
location, assigning origin of a program, etc. The assembler directives that start
with a # (hash) sign cannot have spaces before the directive. The following
assembler directives are recognized by the assembler. Some of these
assembler directives uses expression and symbol. These are explained
below:

expression can be any numeric value. Addition, subtraction, and
multiplication are allowed.

Examples:

(128 / 2 ) * 2 + (220 / 5) + 2 + *0x200

equates to 0xAE +

*0x200, where *0x200 indicates data memory location.

(2 * 2 / 2 + ((5 * 2) * 3) / 2) | (0x0F & 0x04)

equates to

0x15. Note that bitwise AND (& operator) and OR (| operator) operation is
allowed.

(10 * 2) + 5 * *0x120

expression points to data memory content at

0x120 and multiplies decimal 5 to it and finally adds decimal 20. Note that a
space is required between successive asterisks (*). Also note that *0x120
indicates content of memory location at 0x120 hex.

The grammer for expression and symbol is as follows:

number:

number | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

expression:

number

|

expression

+

expression

|

expression

expression

|

expression

*

expression

|

expression

/

expression

|

expression

|

expression

|

expression

&

expression

| ~

expression

|

expression

| +

expression

| *

expression

| (

expression

)

(~ indicates bitwise complement)