Using The .Call Directive In Linear Assembly - Texas Instruments TMS320C6000 Programmer's Manual

Hide thumbs Also See for TMS320C6000:
Table of Contents

Advertisement

Linear Assembly Considerations
8.3.1.1 Function Calls and ADDKPC in Linear Assembly
Example 8–22. Using the .call Directive in Linear Assembly
.data
hello
.string "Hello World", 0
.text
.global _puts
.global _main
_main
.cproc
.reg
loop:
MVKL
MVKH
.call
B
.endproc
Example 8–23. Compiler Output Using ADDKPC
loop:
;
.call
_puts(pointer)
B
.S1
MVKL
.S1
ADDKPC
.S2
MVKH
.S1
RL0:
; CALL OCCURS
8-48
The 'C64x provides a new instruction, ADDKPC , which is designed to reduce
codesize when making function calls. This new instruction is not directly ac-
cessible from Linear Assembly. However, Linear Assembly provides the func-
tion call directive, .call, and this directive makes use of ADDKPC. The .call di-
rective is explained in detail in the TMS320C6000 Optimizing C/C++ Compiler
User's Guide .
Example 8–22 illustrates a simple use of the .call directive. The Assembly Op-
timizer issues an ADDKPC as part of the function call sequence for this .call,
as shown in the compiler output in Example 8–23.
pointer
hello,
pointer
hello,
pointer
_puts(pointer)
loop
; Print the string "Hello World".
_puts
; |15|
hello,A4
; |12|
RL0,B3,2
; |15|
hello,A4
; |13|
; |15|
; Generate a 32–bit pointer to the
; phrase "Hello World".
; Print the string "Hello World".
; Keep printing it.
Generate a 32–bit pointer to the
phrase "Hello World".

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C6000 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents