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-07 by brendanmurphy37

In the long run, using in-line assembler is probably not a good idea. 
It is very compiler specific, and you need to have a good 
understanding of how the particular compiler interacts with the 
assembler.

If you need to use assembler you can invariably do it in a separate 
function, callable from 'C' (or the other way round where assembler 
calls a 'C' function). Just make sure you stick to the ATPCS (ARM-
Thumb Procedure Call Standard), which is very simple for simple 
functions, and you'll be OK (see ARM site for details on this).

You don't mention why you're using assembler: if it's for efficiency 
reasons, try compiling with maximum optimisation first and taking a 
look at the code produced.

Brendan

--- 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.
> 
> Thanks,
> AH
>

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.