Functions

Declared functions are generated by the XREF directive. This enables them to be used with the assembler. Do not generate the function to be called from C, but defined in assembler, into the output file as the assembler does not allow the redefinition of labels declared with XREF. Such function prototypes are placed in an area started with #pragma CREATE_ASM_LISTING OFF, as shown in the following listing.

Listing: Function prototypes


#pragma CREATE_ASM_LISTING ON 
void main(void);

void f_C(int i, long l);

#pragma CREATE_ASM_LISTING OFF

void f_asm(void);

Creates:

Listing: Functions defined in assembler


    XREF  main
    XREF  f_C