⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isrshell.s79

📁 IAR 开发环境的Cirrus Logic的例程
💻 S79
字号:
;*****************************************************************************
;
; ISRSHELL.S - Assembly shell around the C IRQ and FIQ handlers
;
; Copyright (c) 1998-1999 Cirrus Logic, Inc.
;
;*****************************************************************************

        IMPORT IRQHandler
        IMPORT pfnOldIRQ
        IMPORT FIQHandler
        IMPORT pfnOldFIQ

#ifdef __IAR_SYSTEMS_ASM__
	RSEG	ICODE:CODE:NOROOT(2)
	CODE32
#else
        AREA |C$$code|, CODE
#endif

;*****************************************************************************
;
; IRQShell is a wrapper around the IRQ handler.  It saves registers to the
; stack, calls the C IRQ handler, and chains to the original IRQ handler.
;
;*****************************************************************************
        EXPORT IRQShell
IRQShell

        ;
        ; Save any registers which are not saved by APCS.
        ;
        stmdb   r13!, {r0}
        stmdb   r13!, {r1-r3, r9-r12, r14}

        ;
        ; Call the C IRQ handler.
        ;
        bl      IRQHandler

        ;
        ; Restore the saved registers (except for r0).
        ;
        ldmia   r13!, {r1-r3, r9-r12, r14}

        ;
        ; Branch to the original IRQ handler, being careful to make sure that
        ; registers r0-r14 all have the same values as when this routine was
        ; called.
        ;
        ldr     r0, =pfnOldIRQ
        ldr     r0, [r0, #0]
        swp     r0, r0, [r13]
        ldmia   r13!, {pc}

;*****************************************************************************
;
; FIQShell is a wrapper around the FIQ handler.  It saves registers to the
; stack, calls the C FIQ handler, and chains to the original FIQ handler.
;
;*****************************************************************************
        EXPORT FIQShell
FIQShell

        ;
        ; Save any registers which are not saved by APCS.
        ;
        stmdb   r13!, {r0}
        stmdb   r13!, {r1-r3, r9-r12, r14}

        ;
        ; Call the C FIQ handler.
        ;
        bl      FIQHandler

        ;
        ; Restore the saved registers (except for r0).
        ;
        ldmia   r13!, {r1-r3, r9-r12, r14}

        ;
        ; Branch to the original FIQ handler, being careful to make sure that
        ; registers r0-r14 all have the same values as when this routine was
        ; called.
        ;
        ldr     r0, =pfnOldFIQ
        ldr     r0, [r0, #0]
        swp     r0, r0, [r13]
        ldmia   r13!, {pc}

        END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -