[Original]linux simple Beauty (iii)

Source: Internet
Author: User

Original link: Linux simple Beauty (iii)

In Linux simple beauty (b) We try to use the C library function to complete the function, then can you use the syscall way to do it?

1 Section . Data2FT DB"Now is X",Ten3 4 Section . Text5 Global _start6 7 _start:8     movEdiTen9 again:Ten     DecEDI One     movEax,edi A     Addeax,0x30 -     movbyte [ft+7],al -  the     moveax4 -     movEbx1 -     movecx,ft -     movEdX9 +     int0x80 -  +     moveax162 A     Push 0 at     Push 1 -     movEbx,esp -     movEcx0 -     int0x80 -      -     CMPEdi0 in     jnzagain -      to     moveax4 +     movEbx1 -     movecx,msg the     movEdX the *     int0x80 $     Panax Notoginseng     moveax1 -     movEbx0 the     int0x80 +      A msg: theDb"Happy xxx day!",Ten

The compile link command is as follows:

Nasm-f elf Main.asm

Ld-m Elf_i386-o Main MAIN.O

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.