9.2.3 Referencing C++ Program External Names (Functions) from Assembly-Language Programs

By declaring functions to be referenced from an assembly-language program using the extern "C" keyword, the function can be referenced using the same rules as in (2) above. However, functions declared using extern "C" cannot be overloaded.

[Example of C++ source]

extern "C"
void sub()
{
     :
}

 

[Example of assembly-language source]

     .GLB _sub
     .SECTION P,CODE
       :
     PUSH.L R13
     MOV.L 4[R0],R1
     MOV.L R3,R12
     MOV.L #_sub,R14
     JSR R14
     POP R13
     RTS
       :
     .END