| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Eldert Besseling 
 
 
 Joined: 07 Oct 2003
 Posts: 7
 
 
 
			    
 
 | 
			
				| set functions at a predefined location |  
				|  Posted: Tue Jan 13, 2004 5:28 am |   |  
				| 
 |  
				| Hi, 
 What is the best way to set a function in a pre defined location in ROM
 i use #org statement but i have not a good result.
 
 My intention is:
 
 # set location in ROM
 void function( void )
 {
 ...
 }
 
 Can anyone help me?
 
 Regards Eldert
 |  | 
	
		|  | 
	
		| Mark 
 
 
 Joined: 07 Sep 2003
 Posts: 2838
 Location: Atlanta, GA
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Tue Jan 13, 2004 7:14 am |   |  
				| 
 |  
				| The answer: 
 #org
 
 Post an example and someone might be able to tell you what the problem is.
 |  | 
	
		|  | 
	
		| Guest 
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				|  |  
				|  Posted: Tue Jan 13, 2004 8:22 am |   |  
				| 
 |  
				| I try the following code 
 #separate
 void	Communications(void);
 
 #org 0x100, 0x150
 void Communications(void)
 {
 ....
 }
 
 my compiler generate an out of ROM error
 |  | 
	
		|  | 
	
		| Darren Rook 
 
 
 Joined: 06 Sep 2003
 Posts: 287
 Location: Milwaukee, WI
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Tue Jan 13, 2004 8:52 am |   |  
				| 
 |  
				|  	  | Anonymous wrote: |  	  | my compiler generate an out of ROM error
 | 
 
 Probably because Communications() is larger than 0x50 bytes.
 
 Also, if you're using an interrupt the compiler may be trying to use those ROM locations.
 
 Also, you don't have to use #separate with #org.  #separate is implied when using #org.
 |  | 
	
		|  | 
	
		| Eldert Besseling 
 
 
 Joined: 07 Oct 2003
 Posts: 7
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Tue Jan 13, 2004 9:04 am |   |  
				| 
 |  
				| Oke thanks all for your help it works 
 RGS Eldert
 |  | 
	
		|  | 
	
		|  |