This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

inline assembler not permitted in thumb code

I am working with LPC1768 with Keil realview MDK ARM V4.01.
When iam using "__asm" keyword in my code for IENABLE,IDISABLE macros (to switch between sys mode and irq mode), it is generating a compilation error as "Inline assembler not permitted when generating Thumb code".
these two macros i wish to use.
#define IENABLE __asm { MRS sysreg, SPSR; MSR CPSR_c, #SYS32Mode }//__asm { MRS sysreg, SPSR; MSR CPSR_c, #SYS32Mode }
#define IDISABLE __asm { MSR CPSR_c, #(IRQ32Mode|I_Bit); MSR SPSR_cxsf, sysreg }

please suggest regarding this.