我对为什么这个函数在它应该返回时反复调用它自己感到困惑。
Initialize:
stmfd sp!, {R0-R4,lr}
mov R4, #0 @used for storing 0
mov R0, #2
mov R5, #0
ldr R1, =sieve
ldr R1, [R1]
ldr R2, =primes
ldr R2, [R2]
str R4, [R1], #4 @intialize first and second elements in sieve to 0
str R4, [R1]
mov R4, #1 @used for storing 1
setToOne:
str R4, [R1], #4
add R0, R0, #1
cmp R0, #MAX
blt setToOne
ldmfd sp!, {R0-R4,pc} @For somereason Initialize repeats as if lr points back to its begining (instead of where it's called from)
好的,我不能发布整个程序,因为它说“您的帖子没有太多上下文来解释代码部分;请更清楚地解释您的场景。”