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

📄 asm_mips_ghs.arm

📁 ATMEL AT91RM9200开发板配套光盘上的全部示例程序
💻 ARM
字号:
;------------------------------------------------------------------------------
;-         ATMEL Microcontroller Software Support  -  ROUSSET  -
;------------------------------------------------------------------------------
; The software is delivered "AS IS" without warranty or condition of any
; kind, either express, implied or statutory. This includes without
; limitation any warranty or condition with respect to merchantability or
; fitness for any particular purpose, or against the infringements of
; intellectual property rights of others.
;------------------------------------------------------------------------------
;- File source          : asm_mpis_ghs.arm
;- Object               : External memory Infinite loop for measurement
;-
;- 1.0 14/Jan/03 JPP    : Creation
;------------------------------------------------------------------------------

// Include macro function
#include "mips_ghs.mac"

;------------------------------------------------------------------------------
;- Area Definition
;------------------------------------------------------------------------------
    .section ".external", .text
    .align  4

;------------------------------------------------------------------------------
;- Function             : asm_mips
;- C definition          : void asm_mips(void);
;- Treatments           : Infinite loop for measurement
;- Called Functions     : None
;- Called Macros        : MIPS_MEA
;------------------------------------------------------------------------------
           .globl	asm_mips
			MIPS_MEA	asm_mips

;------------------------------------------------------------------------------
;- Function             : asm_mips
;- C definition         : void asm_mips_th(void);
;- Treatments           : Thumb Infinite loop for measurement
;- Called Functions     : None
;- Called Macros        : MIPS_MEA
;------------------------------------------------------------------------------
           .globl	asm_mips_th
           .thumb
			MIPS_MEA	asm_mips_th
           .nothumb
           .align  4
;------------------------------------------------------------------------------
;- Function             : timer_mpis_irq_handler
;- Treatments           : TIMER  Controller Interrupt Handler.
;- Called Functions     : KeyBoard_timer0HandlerInt
;- Called Macros        : None
;------------------------------------------------------------------------------
           .globl	timer_mpis_irq_handler
           .import MipsTimerBase
AIC_BASE            EQU     0xFFFFF000
AIC_IVR             EQU     0x100                   ;- IRQ Vector Register
AIC_EOICR           EQU     0x130                   ;- of Interrupt Command Register
TC_SR               EQU     0x20                    ;- Status Register

timer_mpis_irq_handler:
;- Manage Exception Entry
;- Adjust and save LR_irq in IRQ stack
            sub         r14, r14, #4
            stmfd       sp!, {r14}
            stmfd       sp!, {r0}
;- Write in the IVR to support Protect Mode
;- No effect in Normal Mode
;- De-assert the NIRQ and clear the source in Protect Mode
            ldr     r14, =AIC_BASE
            str     r14, [r14, #AIC_IVR]
;- deassert the Mips loop interrupt
            ldr     r14, = cmpt_loop
            str     r14,[r14]
;- deassert the TIMER interrupt
            ldr     r14, = MipsTimerBase
            ldr     r14,[R14]
            ldr     r14,[r14,#TC_SR]        ; read: TC_SR
;- Stop TIMER
			mov		r0,AT91C_TC_CLKDIS
			str		r0,[r14]			    ; write: TC_CCR

;- Mark the End of Interrupt on the AIC
            ldr     r14, =AIC_BASE
            str     r14, [r14, #AIC_EOICR]
            ldmia   sp!, {r0}

;- Restore adjusted  LR_irq from IRQ stack directly in the PC
            ldmia       sp!, {pc}^
            .type	timer_mpis_irq_handler,$function
            .size	timer_mpis_irq_handler,.-timer_mpis_irq_handler

            END

⌨️ 快捷键说明

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