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 / 1203
1202  |  1204
Subject: 
Re: H8/300 Assembler/C interface
Newsgroups: 
lugnet.robotics.rcx
Date: 
Wed, 18 Apr 2001 23:17:45 GMT
Viewed: 
1221 times
  
Kekoa Proudfoot <kekoa@pixel.Stanford.EDU> wrote:
- 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)

Also:

- caller cleans up parameters on stack
- stack pointer is r7

The caller must clean up stack parameters b/c the return address is pushed
after parameters are.

-Kekoa



Message has 2 Replies:
  RE: H8/300 Assembler/C interface
 
(...) Not necessarily, that's why I'm asking. If the caller cleans up the stack, then the function just does an RTS and the caller adjusts the stack because it knows how much stuff was pushed on. For programs with lots of calls, this generates extra (...) (23 years ago, 19-Apr-01, to lugnet.robotics.rcx)
  RE: H8/300 Assembler/C interface
 
(...) I've just done some more browsing and found this tidbit: (URL) It seems to indicate that tghe registers are always filled and that a long may be split across r2 and the stack. Comments? Cheers, Ralph (23 years ago, 20-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