Implementation Details
5-51
Code Development Tools
Function declarations ( or function prototypes) are introduced by the
mnemonic
cmm_func
. We only allow the new style of function declarations
/prototypes, where the type of the arguments is declared within the function’s
parentheses. For example:
cmm_func bidon(int i1,char *i2)
is valid, but:
cmm_func bidon(i1,i2) int i1,char *i2;
is invalid.
Note: The exact implementation of the MSP50P614/MSP50C614 stack is as
follows:
on CALL:
1) Increment R7
2) Transfer TOS (top of stack) register to *R7
3) Transfer return address to TOS register
on RET:
1) next PC = TOS
2) transfer *R7 to TOS
3) decrement R7
We can freely manipulate R7 before a CALL/C
cc and after a RET to load and
unload arguments to and from the stack. Of course, it would be a bad idea to
mess with the TOS register in the body of a function.
5.10.4 Programming Example
The following example implements string multiplication (i.e, the multiplication
of 2 integer strings). The same source file (with the exception of the first line)
can be used for C– – or regular C. In the case of regular C, it has to be compiled
and linked with
cmm_func.c
#define _CMM /*must be present for C– –compiler ONLY*/
#ifdef _CMM
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include “cmm_back.h”
#endif
#include “cmm_func.h”
#include “cmm_macr.h”
Summary of Contents for MSP50C614
Page 1: ...MSP50C614 Mixed Signal Processor User s Guide SPSU014 January 2000 Printed on Recycled Paper ...
Page 6: ...vi ...
Page 92: ...3 22 ...
Page 300: ...Instruction Set Summay 4 208 Assembly Language Instructions ...
Page 314: ...Software Emulator 5 14 Figure 5 13 Project Menu Figure 5 14 Project Open Dialog ...
Page 325: ...Software Emulator 5 25 Code Development Tools Figure 5 25 EPROM Programming Dialog ...
Page 331: ...Software Emulator 5 31 Code Development Tools Figure 5 31 Context Sensitive Help System ...
Page 368: ...5 68 ...
Page 394: ...7 12 ...
Page 402: ...A 8 ...
Page 412: ...Packaging B 10 ...