??? 03/12/10 17:49 Modified: 03/12/10 17:49 Read: times |
#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? |
Topic | Author | Date |
How to control PUSHes & POPs in interrupt? | 01/01/70 00:00 | |
Don't know in Keil but | 01/01/70 00:00 | |
What is the Code in the interupt? | 01/01/70 00:00 | |
Code in Interrupt | 01/01/70 00:00 | |
Once you use ASM, the optimiser gives up | 01/01/70 00:00 | |
OR | 01/01/70 00:00 | |
Questions![]() | 01/01/70 00:00 | |
Use alternate register set... | 01/01/70 00:00 | |
Yes, That's it. | 01/01/70 00:00 | |
Using X | 01/01/70 00:00 | |
Just Remember | 01/01/70 00:00 | |
The cost... | 01/01/70 00:00 |