Linux ASM + C (INT 0x80)

Source: Internet
Author: User

Blog address from: http://blog.sina.com.cn/s/blog_79b802790100q8tt.html

 Finally, I tried to use ASM in Linux.AndC and generate the-ELF File.
 Functions in a program call each other using a stack.

And interruptInt0x80But it is not clear. It is clear that this is a BIOS interrupt and multiple functions can be implemented. The eax selection function is used. When eax = 4, it is the screen output, EBX is the number of outputs, and ECx is the character length, edX is the character content.

The parameter passing follows the following parameters first to the stack.

 Foo. ASM                                                                                                                                                   
Extern choose

[Section. Data]

   Num1  Dd3
   Num2  Dd4

[Section. text]

   Global _ start
   Global myprint

_ Start:

       Push  DWORD [Num1]
       Push  DWORD [Num2]
       Call  Choose
       Add   ESP, 8

       MoV   EBX, 0
       MoV   Eax, 

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.