--- 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
Message
Re: Assembly call in C
2006-05-17 by derbaier
Attachments
- No local attachments were found for this message.