Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .global main
- .section .data
- myNumbers: .byte 183, 374, -113, -1, 10, 101, -3, -54, 9, 7
- myNumbersEnd:
- .section .text
- main:
- loop:
- mov r4, #0
- ldr r0, =myNumbers
- ldr r3, =myNumbersEnd
- inner_loop:
- ldrsb r1, [r0], #1
- ldrsb r2, [r0]
- cmp r1, r2
- strgtb r1, [r0]
- strgtb r2, [r0, #-1]
- movgt r4, #1 @ r4 = swapped = true
- cmp r0, r3
- bne inner_loop
- cmp r4, #1
- beq loop @ keep going
- exit:
- b exit
- .end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement