Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Example of C and inline ASM in a file?

2006-04-08 by jayasooriah

Hello AH.  Thanks for your very short and simple question:

--- In lpc2000@yahoogroups.com, "ah_sandiego" <ah_sandiego@...> wrote:
> Can someone post a simple example of C and inline ASM in a single 
> file. I use the LPC2148 but any LPC board example would be helpful.

If you wanted to branch to an address stored in a variable (pointer),
"addr" in arm or thumb mode as appropriate, you could use the
following statement:

>  asm volatile (" bx %0" : : "r" (addr));

The ":" syntax in ASM constructs is specific to GCC (AFAIK) and it is
used as a way of getting the instruction generator to do what you want
it to do. The following reference is a good start:

  http://www.ethernut.de/en/documents/arm-inline-asm.html

Hope this helps.

Jaya

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.