ARM汇编伪指令 宏 基于STR71X
;******************************************************************************* ;* Macro Name : EIC_INIT ;* Description : This macro Initialize the EIC as following ://这个宏初始化 EIC 如下: ; - IRQ disabled ; - FIQ disabled ; - IVR contain the load PC opcode (0xE59FFXXX) ; - Current priority level equal to 0 ; - All channels are disabled ; - All channels priority equal to 0 ; - All SIR registers contain offset to the related IRQ ; table entry ;* Input : None. ;* Output : None. ;******************************************************************************* MACRO EIC_INIT LDR r3, =EIC_Base_addr MOV r0, #0 MVN r1, #0 MOV r2, #0x0c STR r0, [r3, #ICR_off_addr] STR r0, [r3, #IER_off_addr] STR r1, [r3, #IPR_off_addr] STR r2, [r3, #FIR_off_addr] STR r0, [r3, #CIPR_off_addr] LDR r4, =0xE59F0000 STR r4, [r3, #IVR_off_addr]; Write the LDR pc,[pc,#offset] ; instruction code in IVR[31:16] LDR r2, =32 ; 32 Channel to initialize LDR r0, =T0TIMI_Addr ; Read the address of the IRQs ; address table LDR r1, =0x00000FFF AND r0,r0,r1 LDR r5, =SIR0_off_addr ; Read SIR0 address SUB r4,r0,#8 ; Subtract 8 for prefetch LDR r1, =0xF7E8 ; Add the offset from IVR to 0x00000000 ; address(IVR address + 7E8 = 0x00000000) ; 0xF7E8 used to complete the ; LDR pc,[pc,#offset] opcode (0xE59FFXXX) ADD r1,r4,r1 ; Compute the jump offset from IVR to the ; IRQ table entry. EIC_INI MOV r4, r1, LSL #16 ; Left shift the result STR r4, [r3, r5] ; Store the result in SIRx register ADD r1, r1, #4 ; Next IRQ address ADD r5, r5, #4 ; Next SIR SUBS r2, r2, #1 ; Decrement the number of SIR registers ; to initialize BNE EIC_INI ; If more then continue MEND
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构