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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/18/04 09:48
Read: times


 
#66970 - RE: Selecting register banks
Responding to: ???'s previous message
The C compiler is not going to let you directly access registers like that. Only the SFR's can be directly accessed by name provided they are properly named in the processor dependent include file.

If you really really need to load R4 then it will be necessary to use either in line assembler or get rid
of C for this module and actually use assembly language.

The whole concept behind using C is that you let it manage the register allocations and how to generate the code. Also please note that in most cases the using of alternate register banks in interrupt routines which you can take care of with the USING attribute on the first line of the subroutine that is your interrupt service routine. Sometimes one will have other subroutines that are called from the interrupt service routine. By necessity these called routines must use the same register bank as the ISR so either tag these subroutines also with the USING attribute.

Use of the #pragma RB() syntax is normally left for some rather exotic types of programming and in my opinion should be avoided.

Michael Karas


List of 5 messages in thread
TopicAuthorDate
Selecting register banks            01/01/70 00:00      
   RE: Selecting register banks            01/01/70 00:00      
      RE: Selecting register banks            01/01/70 00:00      
         RE: Selecting register banks            01/01/70 00:00      
            RE: Selecting register banks            01/01/70 00:00      

Back to Subject List