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

📄 int.s

📁 sharp触摸屏测试代码
💻 S
📖 第 1 页 / 共 3 页
字号:
;
;    /* Just return the loaded vectors flag.  */
;    return(INT_Loaded_Flag);
;
     LDR    a1,[pc, #Loaded_Flag_Ptr-.-8]   ; Get the address
     LDR    a1,[a1,#0]                      ; Load current value

     [ THUMB
     BX     lr                              ; Return to caller
     |
     MOV    pc,lr                           ; Return to caller
     ]
;}
;
;
;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Setup_Vector                                                 */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This function sets up the specified vector with the new vector   */
;/*      value.  The previous vector value is returned to the caller.     */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*                                                                       */
;/*      Gai, Feng, Watertek, Inc.                                        */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      Application                                                      */
;/*      TCC_Register_LISR                   Register LISR for vector     */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      vector                              Vector number to setup       */
;/*      new                                 Pointer to new assembly      */
;/*                                            language ISR               */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      old vector contents                                              */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*        F. Gai         2000-04-03      Created initial version 1.0     */
;/*                                                                       */
;/*************************************************************************/
;VOID  *INT_Setup_Vector(INT vector, VOID *new)
;{
	EXPORT  INT_Setup_Vector
INT_Setup_Vector
;
;VOID    *old_vector;                        /* Old interrupt vector      */
;VOID   **vector_table;                      /* Pointer to vector table   */
;
;    /* Calculate the starting address of the actual vector table.  */
;    vector_table =  (VOID **) 0;
;
;    /* Pickup the old interrupt vector.  */
;    old_vector =  vector_table[vector];
;    
;    /* Setup the new interrupt vector.  */
;    vector_table[vector] =  new;
;    
;    /* Return the old interrupt vector.  */
;    return(old_vector);
;

     MOV    a3,#0x20                        ; Get the address of our table
     LDR    a4,[a3,a1,LSL #2]               ; Make sure we are pointing to
                                            ; the right vector
     STR    a2,[a3,a1,LSL #2]               ; Store the new isr 
     MOV    a1,a4                           ; Setup return parameter
     [ THUMB
     BX     lr                              ; Return to caller
     |
     MOV    pc,lr                           ; Return to caller
     ]

;}
;
;
;
;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Retrieve_Shell                                               */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This function retrieves the pointer to the shell interrupt       */
;/*      service routine.  The shell interrupt service routine calls      */
;/*      the LISR dispatch routine.                                       */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*                                                                       */
;/*      Gai, Feng, Watertek, Inc.                                        */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      TCC_Register_LISR                   Register LISR for vector     */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      vector                              Vector number to setup       */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      shell pointer                                                    */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*        F. Gai         2000-04-03      Created initial version 1.0     */
;/*                                                                       */
;/*************************************************************************/
;VOID  *INT_Retrieve_Shell(INT vector)
;{
	EXPORT  INT_Retrieve_Shell
INT_Retrieve_Shell
;
;    /* Return the LISR Shell interrupt routine.  */
;    return(INT_Vectors[vector]);
;

    MOV    a2,#0x20               ; Get address of our table
    LDR    a1,[a2,a1,LSL #2]                ; Make sure we have correct isr

    [ THUMB
    BX     lr                               ; Return to caller
    |
    MOV    pc,lr                            ; Return to caller
    ]

;}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	EXPORT		INT_IRQ_PARSE
	EXPORT		INT_FIQ_PARSE
	EXPORT		INT_UNDEFINE
	EXPORT		INT_SWI_PARSE
	EXPORT		INT_PREF_ABORT
	EXPORT		INT_DATA_ABORT

INT_IRQ_PARSE
;
;    /* Call Prepare for IRQ interrupt processing by calling
;       TCT_Interrupt_Context_Save.  */
;
	STMDB	sp!,{a1-a4}					; Save a1-a4 on temporary IRQ stack
	SUB		a4,lr,#4					; Save IRQ's lr (return address)
	BL		TCT_Interrupt_Context_Save	; Call context save routine

	LDR		a2, =INTSR1
	LDR		a3,[a2]						; Get current IRQ No.

	TST		a3,#TICK_MASK				; Check for timer interrupt.
	BEQ		NOT_TIMER_IRQ
;
; /* Timer Interrupt */
;
	LDR		a2,=TC1EOI
	MOV		a1,#0
	STR		a1,[a2]						; send Timer1 EOI
	BL		TMT_Timer_Interrupt			; Call the timer interrupt processing.
	B		IRQ_PARSE_END

NOT_TIMER_IRQ
	BL		irq_entry

IRQ_PARSE_END
	B		TCT_Interrupt_Context_Restore

; end of IRQ_PARSE Routine

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

INT_FIQ_PARSE
;
;    /* Call Prepare for IRQ interrupt processing by calling
;       TCT_Interrupt_Context_Save.  */
;
	STMDB	sp!,{a1-a4}					; Save a1-a4 on temporary IRQ stack
	SUB		a4,lr,#4					; Save IRQ's lr (return address)
	BL		TCT_Interrupt_Context_Save	; Call context save routine
	BL		irq_entry
	B		TCT_Interrupt_Context_Restore

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

INT_UNDEFINE

INT_SWI_PARSE

INT_PREF_ABORT

INT_DATA_ABORT
		b		INT_DATA_ABORT

		END

⌨️ 快捷键说明

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