Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

ARM/Thumb Mode Interworking in Keil

ARM/Thumb Mode Interworking in Keil

2005-02-07 by Richard

I am using the macros:

#define IENABLE                      /* Nested Interrupts Entry */ \
__asm { MRS     LR, SPSR      }    /* Copy SPSR_irq to LR     */   \    
__asm { STMFD   SP!, {LR}     }    /* Save SPSR_irq           */   \  
__asm { MSR     CPSR_c, #0x1F }    /* Enable IRQ (Sys Mode)   */   \
__asm { STMFD   SP!, {LR}     }    /* Save LR                 */   


#define IDISABLE                      /* Nested Interrupts Exit */    \ 
__asm { LDMFD   SP!, {LR}     }     /* Restore LR              */     \
__asm { MSR     CPSR_c, #0x92 }     /* Disable IRQ (IRQ Mode)  */     \
__asm { LDMFD   SP!, {LR}     }     /* Restore SPSR_irq to LR  */     \
__asm { MSR     SPSR_cxsf, LR }     /* Copy LR to SPSR_irq     */  

which work fine until I switch to thumb mode.  Does anyone know of a
thumb/ARM mode interworking switch which will allow these to work? 
The MSR op-code in particular seems to be the sticky wicket.

Richard

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.