RTEMS Logo

RTEMS 4.7.99.2 On-Line Library


SuperH Specific Information Calling Conventions

PREV UP NEXT Bookshelf RTEMS CPU Architecture Supplement

7.2: Calling Conventions

  • SuperH Specific Information Calling Mechanism
  • SuperH Specific Information Register Usage
  • SuperH Specific Information Parameter Passing
  • SuperH Specific Information User-Provided Routines
  • Each high-level language compiler generates subroutine entry and exit code based upon a set of rules known as the compiler's calling convention. These rules address the following issues:

    A compiler's calling convention is of importance when interfacing to subroutines written in another language either assembly or high-level. Even when the high-level language and target processor are the same, different compilers may use different calling conventions. As a result, calling conventions are both processor and compiler dependent.

    The Hitachi SH architecture supports a simple yet effective call and return mechanism. A subroutine is invoked via the branch to subroutine (XXX) or the jump to subroutine (XXX) instructions. These instructions push the return address on the current stack. The return from subroutine (rts) instruction pops the return address off the current stack and transfers control to that instruction. It is is important to note that the MC68xxx call and return mechanism does not automatically save or restore any registers. It is the responsibility of the high-level language compiler to define the register preservation and usage convention.


    PREV UP NEXT Bookshelf RTEMS CPU Architecture Supplement

    Copyright © 1988-2004 OAR Corporation