SPNU118Z September 1995 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
Mark Function Boundaries
symbol .asmfunc [stack_usage(num)]
.endasmfunc
The .asmfunc and .endasmfunc directives mark function boundaries. These directives are used with the compiler -g option (--symdebug:dwarf) to allow assembly code sections to be debugged in the same manner as C/C++ functions.
You should not use the same directives generated by the compiler (see Appendix A) to accomplish assembly debugging; those directives should be used only by the compiler to generate symbolic debugging information for C/C++ source files.
The symbol is a label that must appear in the label field.
The .asmfunc directive has an optional parameter, stack_usage, which indicates that the function may use up to num bytes.
Consecutive ranges of assembly code that are not enclosed within a pair of .asmfunc and .endasmfunc directives are given a default name in the following format:
$ filename: beginning source line: ending source line$
In this example the assembly source generates debug information for the user_func section.
1 00000000 .sect ".text"
2 .global user_func
3 .global printf
4
5 .align 4
6
7 00000000 .state32
8
9 user_func: .asmfunc
10 00000000 E92D4008 STMFD SP!, {A4, LR}
11 00000004 E28F000C ADR A1, SL1
12 00000008 EBFFFFFC! BL printf
13 0000000c E3A00000 MOV A1, #0
14 00000010 E8BD4008 LDMFD SP!, {A4, LR}
15 00000014 E12FFF1E BX LR
16 .endasmfunc
17
18 .align 4
19 00000018 48 SL1: .string "Hello World!",10,0
00000019 65
0000001a 6C
0000001b 6C
0000001c 6F
0000001d 20
0000001e 57
0000001f 6F
00000020 72
00000021 6C
00000022 64
00000023 21
00000024 0A
00000025 00