.line
Create a Line Number Entry
Syntax
Description
Example
31
32 00000d 4400
33 00000e 3102
34 00000f 8102
35
36 000010 6b01
37 000012 f7b8
38 000013 f495
39 000014 1004
40 000015 0801
41 000016 f842
42
43 000018
44
45 000018 1002
46
47 000019 ee03
48 00001a fc00
49
50
B-6
.line line number [, address ]
The .line directive creates a line number entry in the object file. Line number
entries are used in symbolic debugging to associate addresses in the object
code with the lines in the source code that generated them.
The .line directive has two operands:
-
The line number indicates the line of the C source that generated a portion
of code. Line numbers are relative to the beginning of the current function.
This is a required parameter.
-
The address is an expression that is the address associated with the line
number. This is an optional parameter; if you don't specify an address, the
assembler will use the current SPC value.
The .line directive is followed by the assembly language source statements
that are generated by the indicated line of C source. For example, assume that
the lines of C source below are line 4 and 5 in the original C source; line 5
produces the assembly language source statements that are shown below.
C source:
for (i = 1; i <= n; ++i)
p = p * x;
Resulting assembly language code:
000011 0001
000017 000d'
L3:
.line
7
LD
*SP(0),16,A
MPYA
*SP(2)
STL
B,*SP(2)
.line
6
ADDM
#1,*SP(1)
SSBX
SXM
nop
LD
*SP(4),A
SUB
*SP(1),A
BC
L2,AGEQ
; branch occurs
.line
8
LD
*SP(2),A
.line
9
FRAME
#3
RET
; branch occurs
.endfunc
9,000000000h,3
; cycle 1
; cycle 2
; cycle 3
; cycle 4
; cycle 6
; cycle 8
; cycle 9
; cycle 10
; cycle 15
; cycle 1
; cycle 2
; cycle 7
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?