SLAU132Y September 2004 – June 2021
In the C++ program in Section 7.7.2.1, the extern "C" declaration tells the compiler to use C naming conventions (i.e., no name mangling). When the linker resolves the .global asmfunc reference, the corresponding definition in the assembly file will match.
The parameter var is passed in R12, and the result is returned in R12.