AT&T 冒泡程序

.section .data
values:
    .int 105,235,61,315,134,221,53,145,117,5
.section .text
.global _start
_start:
     movl $values ,%esi
     movl $9 ,%ecx
     movl $9 ,%ebx
loop:
     movl (%esi),%eax
     cmp %eax ,4(%esi)
     jge skip 
     xchg %eax,4(%esi)
     movl %eax, (%esi)
skip:
    add $4,%esi
    dec %ebx
    jnz loop
    dec %ecx
    jz end
end:
    movl $1,%eax
    movl $0,%ebx
    int $0x80
发布了234 篇原创文章 · 获赞 61 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/weixin_42528089/article/details/83548171