Yahoo Groups archive

Lpc2000

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

Message

RE: [lpc2000] Re: Assembly call in C

2006-05-17 by Woolsey Matt

I don't remember the specific details now, but when I asked them that
question, I was trying to implement exception handlers that could
make use of the back-trace information pushed on the stack in APCS,
but Keil does not do that.  Maybe the basic parameter passing is 
the same, but Keil does not implement all of the standard.

MX

>-----Original Message-----
>From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com]On Behalf
>Of derbaier
>Sent: Wednesday, May 17, 2006 10:03 AM
>To: lpc2000@yahoogroups.com
>Subject: [lpc2000] Re: Assembly call in C
>
>
>--- In lpc2000@yahoogroups.com, "Woolsey Matt" 
><matt.woolsey@...> wrote:
>>
>> >
>> >vaneenbergen schrieb:
>> >
>> >> in gcc (i use rowley) the first 4 arguments are in R0 - 
>R3, the rest 
>> >> will be put on stack (so best keep everything withing 4 
>arguments). 
>> >> the return will be in R0.
>> >
>> >This is the (T)APCS standard by ARM. AFAIK all compilers for ARM are
>> >doing like this.
>> >
>> >-- 
>> >42Bastian
>> >
>> 
>> 
>> Keil compiler for ARM does not use APCS.
>>
>
>If you keep things simple CARM seems to follow APCS close enough.
>
>From CARM Compiler User's Guide 
>VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
>Function Parameters
>C and C++ functions pass up to four parameters in registers R0-R3. The
>first parameter is passed in register R0. Parameters that cannot fit
>into registers are passed on the stack and are accessed using
>[SP+#displacement] instructions.
>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>A single function return value is returned in R0, so for pointers or
>32 bit integers or smaller, CARM follows APCS close enough. Perhaps it
>deviates for more complex variables???
>
>--Dave
>
>
>
>
>
>
>------------------------ Yahoo! Groups Sponsor 
>--------------------~--> 
>Everything you need is one click away.  Make Yahoo! your home page now.
>http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/dN_tlB/TM
>---------------------------------------------------------------
>-----~-> 
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>

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.