I am working on a project using an ADSP-BF533 and I need to pass a C++ variable in assembly.
More specifically, i am performing a ram physical integrity check and i want to move the stack pointer to a temporary location. I have declared a global structure with several attributes called "RamAttributes" and one of those attributes is a uint8 array "RamAttributes.stackTemp".
So I want to move the stack pointer to the reserved memory &RamAttributes.stackTemp. The reason i want the 10th position of the array is because the stack is filling backwards, ie from highest to lowest memory cell. Isn't that correct?
This is how I am doing it:
asm (".EXTERN _RamAttributes.stackTemp;");
asm (".type _RamAttributes.stackTemp,STT_OBJECT;");
asm ("R5 = [SP];");
asm ("[P4] = R5;");
asm ("SP = R7;");
When I try to compile I get the following error:
[Error ea5004] "C:\DOCUME~1\f20410\LOCALS~1\Temp\acc02d061d0000\acc02d061d0001.s":93 Syntax Error in :
syntax error is at or near text '['. Attempting error recovery by ignoring text until the ';'
I get this error for each reference of _RamAttributes.stackTemp. If I remove the  then it compiles with no errors (I don't know if it runs on target yet).
Can I use a C declared array in assembly? How?