【发布时间】:2021-02-11 04:51:53
【问题描述】:
CopyMemory 函数必须将部分内存复制到另一个位置。
CopyMemory
; The CopyMemory function receives the following parameters:
; R0: Address of the first 32-bit word to copy
; R1: Address of the last 32-bit word to copy
; R2: Destination address
ADD R4, R1, #4
Loop
CMP R4, R1
BEQ EndLoop
LDR R3, [R0]
STR R3, [R2]
ADD R0, R0, #4
ADD R2, R2, #4
B Loop
EndLoop
EndCopyMemory
BX LR
我的代码有一个错误,但我看不到它是什么。我是不是做错了什么?
【问题讨论】:
-
请评论每一行你认为它做了什么,这样我才能理解你的流程。我想您的
CMP指令的操作数不正确。
标签: assembly memory arm cpu-registers