An att compilation problem to be solved (coming soon)

Source: Internet
Author: User
A new att assembly problem (coming soon)-General Linux technology-Linux programming and kernel information. For more information, see the following. This is what I wrote. I want to use the bubble algorithm to arrange a group of data and then output the data. but I always feel a bit problematic. I hope the experts can help me ......


. Section. data
Output:
. Asciz "ni yao de shu shi % d \ n"
Msg:
. Long 55555555,33333, 53,56, 25, 52, 56,631,566 7
Len =.-msg
. Section. text
. Globl _ start
_ Start:

Movl $ len, % ecx
Decl % ecx
Cp1:
Movl $0, % eax
Pushl % ecx
Cp2:
Movl msg (, % eax, 4), % edx
Incl % eax
Cmpl msg (, % eax, 4), % edx

Jae next
Xorl % edx, % edi
Movl % edx, % edi
Xchg msg (, % eax, 4), % edx
Decl % eax
Movl % edi, msg (, % eax, 4)
Next:
Incl % eax
Loop cp2
Popl % ecx

Loop cp1
Pushl % edx // the part to be modified
Pushl $ output
Call printf
Addl $8, % esp

Movl $0, % ebx
Mov $1, % eax
Int $0x80

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.