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 / 1204
1203  |  1205
Subject: 
RE: H8/300 Assembler/C interface
Newsgroups: 
lugnet.robotics.rcx
Date: 
Thu, 19 Apr 2001 00:11:42 GMT
Viewed: 
1487 times
  
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.

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 code.

If you write assembler for the RCX, and I know Kekoa does, then your
function has to copy the return address to a register, clean
up the stack and then JMP through the register to the return address.

ANyways, thanks for clearing this up, Kekoa, and it looks like
I'll need to do some M4 magic to be able to generate assembler I
can use in pbForth and GCC.

Cheers, Ralph



Message has 1 Reply:
  Re: H8/300 Assembler/C interface
 
(...) Yeah, you are right. My bad. -Kekoa (24 years ago, 19-Apr-01, to lugnet.robotics.rcx)

Message is in Reply To:
  Re: H8/300 Assembler/C interface
 
(...) 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 (24 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