Texas Instruments MSP50C614 Stereo System User Manual


 
C– – Compiler
5-45
Code Development Tools
5.9.6 Function Prototypes and Declarations
As mentioned above,
C– – function prototypes and declarations MUST be preceded with the
keyword
cmm_func.
Also, since all functions return through accumulator A0, all functions are of
type integer, so that the function type can be omitted in the function
declaration. If present, it is ignored anyway. Trying to typecast a function as
returning a pointer will result in a compiler error.
Note: To change a C– – program back into a regular C program (at least from
the point of view of function prototypes and declarations), the following line can
be inserted at the beginning of the C– –program:
#define cmm_func
A library of regular C functions to substitute for the special MSP50P614/
MSP50C614 functions is supplied with the C– – compiler, allowing the user to
compare the results of regular C programs with those of C– –programs. The
library is contained in the C source file cmm_func.c .It should be linked with
the C equivalent of the C– – program, and run in Borland C.
5.9.7 Initializations
Due (in part) to the architecture of the MSP50P614/MSP50C614 processor,
initialization is only allowed for global variables. As a side effect, local static
variables are not allowed. For example, a global array can be declared and
initialized as follows:
int int_array[5]={1,2,3,4,5};
Initialization values are store in program memory.
5.9.8 RAM Usage
RAM location 0 is reserved (and used intensively) by the compiler. The choice
of location 0 does not conflict with the usual definition of a NULL pointer.
5.9.9 Variable Types
As mentioned above, there are strong restrictions to the variable types that are
recognized by C– –.
5.9.10 String Functions
Arithmetic string functions are special functions that perform string arithmetic,
of all things. The functions currently implemented are shown in Table 5–1.