The label which is associated with the start of the function should be the link name of the function. The following table shows an example of the link name of a pure assembly language function.
| C Code | Link Name |
|---|---|
| my_asm_func | _my_asm_func |
The labels defined in an assembly file have local scope. To access them from the other file (the .c file) they should be marked as global. For example,
.global _my_asm_func
The following listing is an example of a pure assembly language function.
.global _my_asm_func .text _my_asm_func: subq.l #4,a7 move.l d1,(a7) add.l (a7),d0 addq.l #4,a7 rts