  | 
	  | 
		 
	 
	
		| View previous topic :: View next topic   | 
	 
	
	
		| Author | 
		Message | 
	 
	
		
			neil
 
 
  Joined: 08 Sep 2003 Posts: 128
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				| CCS RAM allocation - problem? | 
			 
			
				 Posted: Tue Dec 17, 2002 9:13 am     | 
				     | 
			 
			
				
  | 
			 
			
				Hello all, anyone familiar with the way CCS allocates RAM to functions should be able to explain this...
 
 
My code crashes occasionally, which most probably IS my code! But... I had a look at the Symbol listing and found amongst the various disposable variables belonging to functions at address 048, there is a scratch variable belonging to main(). This looks to me like it should not be in the same location as these disposables! Can anyone set this straight?
 
 
Here is a snippet...
 
 
046     buff_in
 
047     buff_out
 
048     intee_write_long.offset
 
048     intee_read_long.offset
 
048     set_disp_mode.mode
 
048     draw_mode_menu.mode_number
 
048     show_data.mode_number
 
048     serial_handler.temp
 
048     main.@SCRATCH
 
049     lcd_init.i
 
049-04A intee_write_long.data
 
049-04A intee_read_long.data
 
 
Thanks, and merry Xmas to all.
 
Neil.
 
___________________________
 
This message was ported from CCS's old forum
 
	Original Post ID: 10090 | 
			 
		  | 
	 
	
		  | 
	 
	
		
			Pete Smith Guest
 
 
 
 
  
			
			
			
			
			
			
			
			
			
			
  
		  | 
		
			
				| Re: CCS RAM allocation - problem? | 
			 
			
				 Posted: Tue Dec 17, 2002 12:15 pm     | 
				     | 
			 
			
				
  | 
			 
			
				:=Hello all, anyone familiar with the way CCS allocates RAM to functions should be able to explain this...
 
:=
 
:=My code crashes occasionally, which most probably IS my code! But... I had a look at the Symbol listing and found amongst the various disposable variables belonging to functions at address 048, there is a scratch variable belonging to main(). This looks to me like it should not be in the same location as these disposables! 
 
 
If the two memory locations are temporary in both functions, _and_ (looking at the .lst file), the one in main is used & finished with before the function is called, then this is sensible behaviour, and shows a high degree of efficiency, re-using memory locations to save RAM.
 
 
OTOH, if main() uses the location, then calls your function, then comes back & uses it again, then there's something a bit wrong somewhere!
 
 
HTH
 
 
Pete.
 
___________________________
 
This message was ported from CCS's old forum
 
	Original Post ID: 10097 | 
			 
		  | 
	 
	
		  | 
	 
	
		
			neil
 
 
  Joined: 08 Sep 2003 Posts: 128
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				| Re: CCS RAM allocation - problem? | 
			 
			
				 Posted: Wed Dec 18, 2002 7:04 am     | 
				     | 
			 
			
				
  | 
			 
			
				Hi Pete, thanks for the reply on the memory allocation problem. What a small world it is though, just read your profile. I am in S.Wales at the moment, but will be going North on the weekend (to Amlwch) to spend xmas with the family. I went to school in LlanfairPG!
 
Just thought that little detail would amuse you!
 
 
Have a Merry Xmas and happy new year.
 
Neil.
 
___________________________
 
This message was ported from CCS's old forum
 
	Original Post ID: 10114 | 
			 
		  | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
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
  
		 |