.line
Create a Line Number Entry
B-6
Syntax
.line
line number [, address]
Description
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.
Example
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:
31 .line 7
32 00000d 4400 LD *SP(0),16,A ; cycle 1
33 00000e 3102 MPYA *SP(2) ; cycle 2
34 00000f 8102 STL B,*SP(2) ; cycle 3
35 .line 6
36 000010 6b01 ADDM #1,*SP(1) ; cycle 4
000011 0001
37 000012 f7b8 SSBX SXM ; cycle 6
38 000013 f495 nop
39 000014 1004 LD *SP(4),A ; cycle 8
40 000015 0801 SUB *SP(1),A ; cycle 9
41 000016 f842 BC L2,AGEQ ; cycle 10
000017 000d’
42 ; branch occurs ; cycle 15
43 000018 L3:
44 .line 8
45 000018 1002 LD *SP(2),A
46 .line 9
47 000019 ee03 FRAME #3 ; cycle 1
48 00001a fc00 RET ; cycle 2
49 ; branch occurs ; cycle 7
50 .endfunc 9,000000000h,3
Summary of Contents for TMS320C54x
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 44: ......
Page 45: ......
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 62: ......
Page 276: ......
Page 277: ......
Page 278: ......
Page 279: ......
Page 280: ......
Page 281: ......
Page 282: ......
Page 283: ......
Page 284: ......
Page 285: ......
Page 286: ......
Page 287: ......
Page 288: ......
Page 289: ......
Page 290: ......
Page 291: ......
Page 292: ......
Page 293: ......
Page 294: ......
Page 295: ......
Page 296: ......
Page 297: ......
Page 298: ......
Page 299: ......
Page 300: ......
Page 301: ......
Page 302: ......