AREA EX, CODE, READONLY
ENTRY
START
LDR R0, =NUM
LDRB R0, [R0]
LDR R1, =ARRAY
MOV R2, R0
LOOP1
SUBS R2, R2, #1
BEQ STOP
SUB R3, R0, R2
SUB R3, R3, #1
LDRB R4, [R1, R3]
MOV R5, R3
ADD R5, R5, #1
LOOP2
LDRB R6, [R1, R5]
CMP R4, R6
STRHIB R4, [R1, R5]
MOVHI R4, R6
ADD R5, R5, #1
CMP R5, R0
BLO LOOP2
STRB R4, [R1, R3]
B LOOP1
STOP
MOV R0, #0X18
LDR R1, =0X20026
SWI 0X123456
SHOW DCB 0
AREA EXDATA, DATA, READONLY
NUM DCB 20
ARRAY DCB 0, 4, 1, 3, 5, 8, 10, 11, 12, 19
DCB 12, 14, 14, 15, 16, 15, 20, 21, 11
END
|