| 
	
	|  |  |  
	
		| View previous topic :: View next topic |  
		| Author | Message |  
		| Paul Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| Interpretation of the .lst file |  
				|  Posted: Thu Jan 11, 2007 2:13 am |   |  
				| 
 |  
				| Hi, 
 Sometimes I look at the .lst file to see what the compiler makes of my c. Usually it is easy to see what statements generate what code. I recently had a question about a #USE rs232 that I needed to see the compiled code for. It took me a lot of time to realise that the code for this statement is in the beginning of the main() function and nowhere near the actual #USE rs232 statement in the list file.
 
 My question: could I have known that? Is there a way to 'know' where code is placed?
 
 Thanks,
 
 Paul Holthuizen
 PCWH 3.248
 |  |  
		|  |  
		| PCM programmer 
 
 
 Joined: 06 Sep 2003
 Posts: 21708
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Thu Jan 11, 2007 5:42 pm |   |  
				| 
 |  
				| See this FAQ article: http://www.ccsinfo.com/faq.php?page=lst_out_of_order
 
 Some of the initialization code for the #use libraries is put at
 the start of main().   For example, that's where the compiler
 puts the setup code for the UART if you specify #use rs232().
 
 The code that performs the UART functions is usually placed
 inline if it's short, such as the putc() code for a hardware UART.
 It's placed under the #use rs232() statement if it's longer code,
 such as for a 'soft' UART, or if parity calculations are required, etc.,
 because the compiler typically will 'call' that code instead of placing
 it inline.
 |  |  
		|  |  
		|  |  
  
	| 
 
 | You cannot post new topics in this forum You cannot reply to topics in this forum
 You cannot edit your posts in this forum
 You cannot delete your posts in this forum
 You cannot vote in polls in this forum
 
 |  
 Powered by phpBB © 2001, 2005 phpBB Group
 
 |