beautypg.com

Texas Instruments MSP50C6xx User Manual

Page 312

background image

C– – Compiler

5-16

label RESW expression: This directive is used to reserve the number of words

indicated by expression, starting at the current RAM address. label is given the
value of the current RAM address. If the current RAM address is not EVEN,
the assembler increments it by 1 before allocating the desired amount. (Note
that RAM locations are accessed by their BYTE address in MSP50C6xx
assembly language, i.e., word 1 is at address 2, etc...)

RORG expression: Marks the start of a RELATIVE segment code, i.e., a segment that

can be relocated by the linker. Expression is an arbitrary number, but it must
be present or an assembly error will occur.

STRING text_string: Equivalent to the TEXT directive, but the text is terminated by

a 0. (automatically done by the assembler)

TEXT text_string: Equivalent to the BYTE directive, but the data is a text string

enclosed in double quotes.

UNLIST: The lines following this directive are not included in the listing file (extension

.lst) created by the assembler.

5.5

C– – Compiler

The C– – compiler generates an assembly language file of the same name,
with extension

.opt

. It also generates a file with extension

.glb

where global

variable initialization is taken care of, if the routine main was encountered in
the current file. A file with extension

.ext

is also generated to take care of

global and external declarations that will be used by the assembler. These two
files are included in the

.opt

file generated by the C– – compiler. Note that

all symbols defined in C– – source code are changed before being written to
assembly language: an underscore character is put in front of the first
character of each symbol. Also note that local labels created by the C– –
compiler are built using the current source file name followed by an ordinal
number. Consequently, to avoid problems at link time due to symbols bearing
the same name, never use symbol names starting with an underscore in
assembly language files. It is imperative to use file names that are different
for C– – files (extension

.cmm

) and assembly language files (extension

.asm

).

5.5.1

Foreword

C– – is a high level language to be used with the MSP50C6xx
microprocessors. Although it looks a lot like C, it has some
limitations/restrictions which will be highlighted throughout the remainder of
this chapter. This language is compiled into MSP50C6xx assembly language.