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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Munish Kumar
03/12/10 11:49
Modified:
  03/12/10 11:49

Read: 408 times
Chandigarh
India


 
#174072 - How to control PUSHes & POPs in interrupt?
Hi,

I have written code for interrupt driven data capture in Keil (not serial communications). Since the timing requirements for the serial input data stream are very stringent, I am using #pragma asm i.e. inline assembly in the external interrupt 0 ISR. Rest of the code is in C.

On the most fundamental level, I need to sample a port pin on external interrupt 0 very quickly (~15-20us later).

Now my inline assebly code in ISR modifies & uses only two registers: ACC & R0. But the compiler is saving all the registers on entering the ISR & I am missing a major event between this:
CSEG	AT	00003H
AJMP	ext_int_0
RSEG  ?PR?ext_int_0?PS2_INTERR_C_ASM
	USING	0
ext_int_0:
	PUSH 	ACC
	PUSH 	B
	PUSH 	DPH
	PUSH 	DPL
	PUSH 	PSW
	MOV  	PSW,#00H
	PUSH 	AR0
	PUSH 	AR1    ;dont need this onwards
	PUSH 	AR2
	PUSH 	AR3
	PUSH 	AR4
	PUSH 	AR5
	PUSH 	AR6
	PUSH 	AR7    ;~30us wasted after ISR invocation
	USING	0

 

equal time is wasted POPing the unused registers before RETI.

What should I do in order to control which registers are PUSHed & POPed in ISR? Is there any directive I could use?

List of 12 messages in thread
TopicAuthorDate
How to control PUSHes & POPs in interrupt?      MUNISH KUMAR      03/12/10 11:49      
   Don't know in Keil but      Jez Smith      03/12/10 12:00      
   What is the Code in the interupt?      Neil Kurzman      03/12/10 12:54      
      Code in Interrupt      MUNISH KUMAR      03/12/10 14:56      
         Once you use ASM, the optimiser gives up      David Prentice      03/12/10 15:24      
            OR      Neil Kurzman      03/12/10 21:03      
         Questions      Maarten Brock      03/15/10 14:10      
   Use alternate register set...      Michael Karas      03/12/10 20:22      
      Yes, That's it.      MUNISH KUMAR      03/13/10 04:56      
         Using X      Michael Karas      03/13/10 05:12      
            Just Remember      Neil Kurzman      03/13/10 22:55      
               The cost...      Michael Karas      03/13/10 23:36      

Back to Subject List