STACK_TOP EQU 0X20002000
AREA RESET,CODE,READONLY
DCD STACK_TOP
DCD START
DATA_SRC DCD 1,4,5,3,2,7,9,8,6,0
ENTRY
START
LDR R0,=DATA_SRC
LDR R1,=DATA_DST
LDR R12,=DATA_DST
BL sort
B .
sort
LDMIA R0!,{R2-R11}
STMIA R1!,{R2-R11}
MOV R2,#9
LOOP1
LDR R3,=DATA_DST
MOV R4,#0
LOOP2
LDR R5,[R3]
LDR R6,[R3,#4]
CMP R5,R6
STRLT R5,[R3,#4]
STRLT R6,[R3]
ADD R3,#4
ADD R4,#1
CMP R4,R2
BCC LOOP2
SUBS R2,#1
CMP R2,#0
BNE LOOP1
AREA NUM,DATA,READWRITE
DATA_DST SPACE 100
END
ARM汇编 用冒泡法排序
最新推荐文章于 2024-02-22 17:13:24 发布