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

writing assembly on Keil

I wanna write assembly code on Keil but program got errors about it , how can i write assembly code on Keil . here is my assembly code :

// Macros for Interrupt Nesting
#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 */ \

Parents
  • It doesn't look like you want to write in assembler. If you wanted to do tht, you would probably have been busy with assembler files instead of trying assembler in C source.

    It looks more like you want to enable/disable nested interrupts. So after getting into troubles, did you then try Google, to find working implementations of IENABLE, IDISABLE?

Reply
  • It doesn't look like you want to write in assembler. If you wanted to do tht, you would probably have been busy with assembler files instead of trying assembler in C source.

    It looks more like you want to enable/disable nested interrupts. So after getting into troubles, did you then try Google, to find working implementations of IENABLE, IDISABLE?

Children