Hi,
I need to :
1. Inline an assembly code that modifies Stack pointer directly (__asm directive is not allowed to modify stack pointer) in a C++ file.
What is the best option? A function call to a label is not an option since I need to manually update Stack Pointer. I need to inline.
I read I can create SRC file. Can I create SRC from the C++ compiler ? if so what is the Directive/Flag? --SRC didn't work.
#prama asm was unrecognized pragma. perhaps because I'm not creating SRC.
Thanks.
These all work -
__set_MSP (newstack); // Built into CMSIS __set_PSP (newstack); __asm void __SetMsp(uint32_t stack) // If you don't want to call CMSIS for some reason { MSR PSP,R0 BX LR } __asm void __setPsp(uint32_t stack) { MSR PSP,R0 BX LR }