Good morning.
I am trying to work on a small project for the Stellaris LM4F120 board, and as part of the project, I have a need to read the stack variable. (I'm constructing a small context switcher for demonstration purposes.) I obtained a segment of code from the web as follows:
static inline void * rd_stack_ptr(void){
void * result=NULL;
asm volatile ("MRS %0, msp\n\t"
"MOV r0, %0 \n\t"
: "=r" (result) );
return result;
}
Essentially, what the code is supposed to do is copy the stack pointer into the c variable "result" and return it. However, I am getting errors as follows:
Description Resource Path Location Type
#126 expected a "(" os.c /OperatingSystem line 27 C/C++ Problem
#18 expected a ")" os.c /OperatingSystem line 29 C/C++ Problem
I have been unable to really find examples of this syntax in the CCS help files, though the code is supposedly written for CCS. I am using TI compiler v4.9.5 if that provides any assistance.
Thanks for any info you have. I've done this many times before on other processors, I just haven't been able to find the right manual page with the right details for this part from the materials I have access to.
Walt Schilling