Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/21/07 09:37
Read: times


 
#147301 - Register banks with functions returning value-Keil
Hi people,
I have the following piece of code:
static void isr_something(void) interrupt 3 using 1
{

 char ret;

 ... do stuff clear INT, check flags etc..
 //calling a big subroutine (only from this ISR nobody else calls it)
 
  ret = process_stuff();
  if ( ret != 0)
      SetErr(ret);   //this is just a macro writing somwhere in mem

}

char process_stuff using 1
{
  .... do stuff ....
}



Now Keil says in his guide:
http://www.keil.com/support/m...nkspec.htm

The using attribute may not be used in functions that return a value in registers.


My questions are:
I mean if I am sure that I don't switch the register banks when returning from function process_stuff why couldn't I use banks?

And if I can't use banks how could I force the function (with the help of pragmas and Keil C compiler) to return the char value through a memory address?

And according to avoid your discussion why to use a subroutine in the ISRL? The answer is: the code is cleaner, the software has modular structure, and it can happen that I want to call other subroutine.

thanx
Attila

List of 3 messages in thread
TopicAuthorDate
Register banks with functions returning value-Keil            01/01/70 00:00      
   In a meenwhile found the answers...            01/01/70 00:00      
      it's there            01/01/70 00:00      

Back to Subject List