Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] Re: Q: Global variables with C and ASM / pass argument from ASM to C function ?

2005-04-17 by 42Bastian Schick

> I have no idea, how to create an asm template.
> These are the interesting and simple things that are never mentioned
> in a compiler documentation or book :-)

Which compiler do you use ? Sounds like gcc, so if you look up the gcc 
options you'll find -S (stop after generating assembly).
So compile a simple

void a(int b)
{
}

with -S and you get your template.

But anyway, as Richard noted, define your main as void main(int result) 
and put
your result in r0.


-- 
42Bastian Schick

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.