Specifications

740 Family
Programming Guide <C Language>
REJ05B0468-0100Z /Rev.1.00 September 2004 Page 90 of 102
2.4 Linkage with Assembly Language
2.4.1 Interfacing between Functions
Assembly language subroutines can be called from a C language program. Use this interface to call
assembly language from C language.
This section describes interfacing between functions in the ICC740.
Entry and exit processing of functions
The primary processing needed to call a function in the ICC740 consists of the following two:
(1) Argument transfer to and from function
(2) Return value transfer to and from function
int func( int, int ) ; int func( int x, int y )
{
void main( void ) :
{ }
int a = 3, b = 5 ;
int c ;
:
c = func( a, b ) ;
:
}
Preparation to pass arguments
JSR np:REFFN
Receiving return value
Global declaration of label
func:
Receiving arguments
Storing return value
RTS