本帖最后由 Cloudprogram 于 2024-04-20 21:20 编辑
回复 12# xzko
ARM7TDMI-SData Sheet ARM7DI Data Sheet R15 not in list and S bit set (User bank transfer) For both LDM and STM instructions, the User bank registers aretransferred rather than theregister bank corresponding to the current mode. This is useful for saving theuser state on process switches.Base write-back should not be used when this mechanism is employed. When the instruction is LDM, care must be taken not to read from abanked register during thefollowing cycle (inserting a dummy instruction such as MOV R0, R0 after the LDM will ensure safety). 官方手册 说明ldm 操作用户模式寄存器的时候后面要注意不要访问寄存器,一般加nop语句。 arm体系结构与编程 P99页 LDM(2)用户模式的批量内存字数据读取指令 指令的使用 在本指令的后面不能紧跟访问备份寄存器(bankedregisters)的指令,最好跟一条NOP指令。 在用户模式和系统模式下使用本指令会产生不可预知的结果。
|