call_int.s

来自「用于三星S3C44BOX ARM7芯片的Demon板测试」· S 代码 · 共 27 行

S
27
字号
/*
#------------------------------------------------------------------------------
#- Entry function:	void	user_irq(void)
#- Extern function:	void	user_handle(void)
#------------------------------------------------------------------------------
#		.INCLUDE	"include.x"
*/
          .macro IRQHandle user_handle:
            stmdb	sp!, {r0-r11, ip, lr}	/* save r0-r11, ip, lr */
            ldr		r0, =\user_handle
            mov		lr, pc
            bx		r0						/* jump to user_handle(void) */
            ldmia	sp!, {r0-r11, ip, lr}	/* restore r0, ip, lr */
			subs	pc, r14, #4				/* return from interrupt */
          .endm
          
/* Examples showed as following: */

       .extern TSInt	@ void TSInt (void);---> The interrupt handle function write as C program, it is user application func.
       .global user_irq1	@ ----------> It is the interrupt vactor entry function to jump here, call by INTERRUPT  VECTOR TABLE.
user_irq1: IRQHandle TSInt

       .extern KeyboardInt @ void KeyboardInt (void);
       .global user_irq2
user_irq2: IRQHandle KeyboardInt

⌨️ 快捷键说明

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