9.2.1 Referencing Assembly-Language Program External Names in C/C++ Programs

In assembly-language programs, .GLB is used to declare external symbol names (preceded by an underscore (_)).

In C/C++ programs, symbol names (not preceded by an underscore) are declared using the extern keyword.

[Example of assembly-language source]

     .glb _a, _b
     .SECTION D,ROMDATA,ALIGN=4
_a: .LWORD 1
_b: .LWORD 1
     .END

 

[Example of C source]

extern int a,b;
void f()
{
     a+=b;
}