问题
I have to reverse 20 numbers in a variable (src) and put te result in another variable (dst) in ARM 7 but I can't do it. I have src = 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4 and I want that dst = 4,3,2,1,8,7,6,5,4,3,2,1,8,7,6,5,4,3,2,1. Could someone help me please ? Here is my code:
AREA TP2, CODE, READONLY
ENTRY
start
LDR R0, =src
LDR R1, =dst
MOV R2, #20
reverse_function
end_reverse function
AREA data, DATA, READWRITE
src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4
dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
END
来源:https://stackoverflow.com/questions/65842571/reverse-numbers-in-a-variable