C– – Efficiency
5-37
Code Development Tools
C to ASM function return
|
|
|
|
|––––––––––––––|
|––––––––––––––|
|
|
|
|
|––––––––––––––|
|––––––––––––––|
|
|
|
|
|––––––––––––––|
|––––––––––––––|
|
|
|
|
|––––––––––––––|
|––––––––––––––|
|
|
|
|
|––––––––––––––|
|––––––––––––––|
|Return Addr
|
|Return Addr
|
|––––––––––––––|
|––––––––––––––|
|Return Addr
|
|Return Addr
|
|––––––––––––––|
|––––––––––––––|
R7
|Param 2
|
|Param 2
|
|––––––––––––––|
|––––––––––––––|
|Param 2
|
|Param 2
|
|––––––––––––––|
|––––––––––––––|
|Param 1
|
|Param 1
|
|––––––––––––––|
|––––––––––––––|
|Param 1
|
|Param 1
|
|––––––––––––––|
|––––––––––––––|
R5
|Stack data
|R7,R5
|Stack data |
|––––––––––––––|
|––––––––––––––|
RET
SUBB R7, 4
5.7
C–– Efficiency
C– – allows top-level control code to be written in a C-like language. It does
have limitations though. Assembly routines are needed to support C function
calls for operations such as reading/writing ports and speaking. The assembly
code produced by the C– – compiler is not optimized and will not be as efficient
as hand written assembly. Because C– – is not optimized, time critical
operations should always be written in assembly.
Since the compiler does not optimize the assembly, writing C– – code in
different ways results in different levels of overhead. While and do-while loops
have similar overhead (one conditional jump and 1 unconditional jump per
Содержание MSP50C6xx
Страница 1: ...MSP50C6xx Mixed Signal Processor User s Guide Mixed Signal Products SPSU014A Printed on Recycled Paper...
Страница 6: ...vi...
Страница 14: ...xiv...
Страница 24: ...1 10...
Страница 296: ...Instruction Set Summay 4 210 Assembly Language Instructions...
Страница 332: ...Implementation Details 5 36 R7 Return Addr Return Addr Param 2 Param 2 Param 1 Param 1 R5 Stack data Function call...
Страница 366: ...6 12...