Page 1 of 1

Passing parameters to inline assembler

Posted: Fri Sep 21, 2018 7:35 am
by TechFor
Hi, I'm migrating from Keil to TrueStudio and gcc but I can not convert the following assembler routine:

SPSAV and CommandEntry are global registries.

/ **********************************
               "C" call
********************************** /
void DO_ERROR ()
     ForceIni (SPSAV, CommandEntry);

/ ************************************************* **************
Asm subroutine
Force stack to StackVal and jump to GoAddress,
************************************************** ************* /
__asm void ForceIni (unsigned long StackVal, unsigned long GoAddress)
     MOV sp, r0
     MOV lr, r1
     BX lr

With Keil Toolchain this routine works fine but with gcc it generates syntax errors.
I could not find information on passing parameters with gcc.
Can someone help me?