本帖最后由 Cloudprogram 于 2024-04-20 21:20 編輯
回復(fù) 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 操作用戶模式寄存器的時(shí)候后面要注意不要訪問寄存器,一般加nop語句。 arm體系結(jié)構(gòu)與編程 P99頁 LDM(2)用戶模式的批量內(nèi)存字?jǐn)?shù)據(jù)讀取指令 指令的使用 在本指令的后面不能緊跟訪問備份寄存器(bankedregisters)的指令,最好跟一條NOP指令。 在用戶模式和系統(tǒng)模式下使用本指令會(huì)產(chǎn)生不可預(yù)知的結(jié)果。
|