| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		
			Herbert
 
 
  Joined: 20 Jul 2008 Posts: 32 Location: Brisbane, Australia 
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				| Missing address for a goto in the C/ASM Listing | 
			 
			
				 Posted: Fri Dec 26, 2008 9:07 pm     | 
				     | 
			 
			
				
  | 
			 
			
				Does anybody have any thoughts on the following observations, please.  Compiler is PCWH V4.079, developing for a 18F2620.
 
 
After a successful compile the C/ASM listing shows the following (with a lot of gumpf taken out)
 
 	  | Code: | 	 		  
 
1034:  GOTO   1058
 
....................         case AAA       : Switch_to_AA(); 
 
1038:  CALL   0264
 
....................                  break; 
 
103C:  MOVLB  3
 
103E:  BRA    1054
 
....................         case BBB    : Switch_to_BB(); 
 
1040:  BRA    0FE6
 
....................                  break; 
 
1042:  MOVLB  3
 
1044:  BRA    1054
 
....................         case CC      : Switch_to_CCC(); 
 
1046:  BRA    0FFC
 
....................                  break; 
 
1048:  MOVLB  3
 
104A:  BRA    1054
 
....................         case External_Port : Switch_to_External(); 
 
104C:  BRA    1012
 
....................                  break; 
 
104E:  MOVLB  3
 
1050:  BRA    1054
 
1052:  MOVLB  3
 
....................       } 
 
....................    }   
 
1054:  MOVLB  0
 
1056:  RETLW  00
 
....................      
 
 
....................    { 
 
....................    int8 DDD[6]; 
 
....................  
 
....................       If ( GGG < HHH)  
 
*
 
1084:  MOVF   53,W
 
1086:  SUBLW  09
 
1088:  BNC   10D2
 
 | 	  
 
The GoTo refers to an address 1058, which does not exist in the listing.  The addresses jump from 1056 to 1084, with nothing in between.  A search of the C/ASM listing only shows a reference to it in the goto.
 
 
Also notice that addresses in the rest of the listing are not always sequential.  Blocks of addresses can be in totally different positions, is this normal?
 
 
Trying to chase a problem where the position of a bit of code determines how other bits of code execute.  I expect its a pointer problem, but seeing a listing with missing addresses is a bit of a concern. | 
			 
		  | 
	
	
		  | 
	
	
		
			PCM programmer
 
 
  Joined: 06 Sep 2003 Posts: 21708
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Fri Dec 26, 2008 11:30 pm     | 
				     | 
			 
			
				
  | 
			 
			
				To see all the CCS library code, comment out the #nolist statement near
 
the start of the 18F2620.h file.    Example:
 
 	  | Quote: | 	 		  //////// Standard Header file for the PIC18F2620 device ///
 
#device PIC18F2620
 
// #nolist | 	  
 
Then re-compile and look at the .LST file again. | 
			 
		  | 
	
	
		  | 
	
	
		
			andrewg
 
 
  Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia 
			
			 
			 
			
			 
			
			
			
			
			
  
		  | 
		
			
				| Re: Missing address for a goto in the C/ASM Listing | 
			 
			
				 Posted: Sat Dec 27, 2008 12:02 am     | 
				     | 
			 
			
				
  | 
			 
			
				 	  | Herbert wrote: | 	 		  | Also notice that addresses in the rest of the listing are not always sequential.  Blocks of addresses can be in totally different positions, is this normal? | 	  Yes. The compiler will reorder code to achieve a more optimal arrangement. _________________ Andrew | 
			 
		  | 
	
	
		  | 
	
	
		
			Herbert
 
 
  Joined: 20 Jul 2008 Posts: 32 Location: Brisbane, Australia 
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Sun Dec 28, 2008 7:09 pm     | 
				     | 
			 
			
				
  | 
			 
			
				| Thanks very much PCM and Andrewg.  Feel better now!  It starts to make more sense. | 
			 
		  | 
	
	
		  | 
	
	
		 |