To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 1206
1205  |  1207
Subject: 
RE: H8/300 Assembler/C interface
Newsgroups: 
lugnet.robotics.rcx
Date: 
Thu, 19 Apr 2001 13:18:55 GMT
Viewed: 
1258 times
  
Kekoa wrote:

Somebody correct me if I'm wrong.  I just compiled some programs to check
this.  I believe that maybe the *ROM* calling convection is as Ralph
described, but almost definitely the GCC calling convention is:

- r0, r1, r2 hold parameters from left to right
- additional parameters are pushed onto the stack before call
- rightmost parameters are pushed first
- registers may be joined to pass 32-bit parameters (i.e. r0r1 or r1r2)
- 32-bit parameters never split between r2 and stack
- return value in r0 (or r0r1 if 32-bits)

Thanks Kekoa.

One more question, are the other registers r3,r4,r5,r6 considered
volatile across a function call in GCC?

Cheers, Ralph



Message has 1 Reply:
  Re: H8/300 Assembler/C interface
 
(...) By the caller? No. They are callee-save. -Kekoa (23 years ago, 19-Apr-01, to lugnet.robotics.rcx)

Message is in Reply To:
  Re: H8/300 Assembler/C interface
 
(...) Somebody correct me if I'm wrong. I just compiled some programs to check this. I believe that maybe the *ROM* calling convection is as Ralph described, but almost definitely the GCC calling convention is: - r0, r1, r2 hold parameters from left (...) (23 years ago, 18-Apr-01, to lugnet.robotics.rcx)

20 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR