Files
checker_gen1/source/core/cortex_m4.s
2023-06-10 11:52:00 +08:00

51 lines
721 B
ArmAsm
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

AREA |.text|, CODE, READONLY, ALIGN=2
THUMB
REQUIRE8
PRESERVE8
;指针调用会使用LDR指令通过解析这个指令使用的寄存器
;可以从这个寄存器得到类的基地址
;在调用这个函数之前调用者会压栈此时LR已经不是之前的值
;所以只能解析PHSH指令找到栈中存储的LR值
__self_pointer PROC
EXPORT __self_pointer
MOV R0,LR
LDRH R0,[R0,#-2]
BX LR
ENDP
__interrupt_disable PROC
EXPORT __interrupt_disable
MRS r0, PRIMASK
CPSID I
BX LR
ENDP
__interrupt_enable PROC
EXPORT __interrupt_enable
MSR PRIMASK, r0
BX LR
ENDP
__set_msp PROC
EXPORT __set_msp
MSR msp, r0
BX lr
ENDP
ALIGN 4
END