Passing parameters to inline assembler

Share code examples or discuss embedded software, including device drivers, interrupt handlers, middleware and application code.

Moderators: Markus Girdland, Mattias Norlander

TechFor
Posts: 7
Joined: Sat Aug 25, 2018 11:33 am

Passing parameters to inline assembler

Postby TechFor » Fri Sep 21, 2018 7:35 am

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?

Return to “Embedded target code development discussions”

Who is online

Users browsing this forum: No registered users and 4 guests