Download C Compiler for the PICmicro Devices User's Manual
Transcript
CC5X C Compiler L [0] 0x012.0 G [0] 0x012.1 G [0] 0x015 B Knudsen Data 0 0 1 : 6: : 16: : 23: b1 bx b When a function is not called (unused), all its parameters and local variables are truncated to the same location. Example: L [-] 0x00F 1 : 16<> pm_2_ 8.4 List File The compiler can also produce a list file. The command line option is –L or -L[<col>,<lin>]. The maximum number of columns per line <col> and lines per page <lin> can be altered. The default setting is -L200,60. The contents of the list file can be changed by using the -A option. 8.5 Function Call Structure The function call structure can be written to file <src>.fcs. This is useful for codepage optimization and function restructuring in case of call level problems. Note that two different formats are produced; the first is a list of functions, the second is a recursive expansion of the function call structure. The command line option is -Q for both formats. Format sample: F: function1 func2 delay func3 :#1 : #5 : #2 : #3 : : : : p0 p0 p0 p0 <-> -> -> p1 p3 ** p2 * p0 The meaning of the symbols is: 1. func2, delay and func3 are called from function1 2. #1 : function1 is called once 3. #3 : func3 is called 3 times (once from function1) 4. p0 <- p1 : function1 resides on page 0 5. p0 <- p1 : function1 is called from page 1 6. p0 -> p3 : call to func2 (resides on page 3) 7. * : one pagebit have to be updated before call 8. ** : both pagebits have to be updated The call structure is expanded recursively. The indentation show the nesting of the function calls in the source. The true call level is printed at the beginning of the line. The true call level is different from the indentation level when CALL's have been replaced by GOTO's. A mark is then printed at the end of the line in such cases. The interrupt call level is handled automatically and checked. There is a separate expansion for the interrupt service routine. L0 main L1 function1 L2 func2 L2 delay L2 func3 L1 function1 .. Explanation of symbols used: • L1 : stack level 1 (max 2 or 8 levels). This is the REAL stack level, compensated when CALL's have been replaced by GOTO. • .. : only the first call is fully expanded if more that one call to the same function occur inside the same function body. • [CALL->GOTO] : CALL replaced by GOTO in order to get more call levels • [T-GOTO] : CALL+RETURN is replaced by GOTO to save a call level. • [RECURSIVE] : recursive function call 100