The netwide Explorer (NASM) Assembly Language Notes (2)

Source: Internet
Author: User
Tags derick

The first simple compilation is explained in the previous article.ProgramNext, let's have a deeper understanding of the compilation.

3. processing parameters when running the program

Compared with DOS, it is simpler and more intuitive to call the input parameters when running the program. Because after the program starts running, all parameters are saved in oneStack, so you only need to use the pop command to obtain the required parameters. The following is an example (a program with three parameters ):



./Program Foo bar 42

The corresponding stack can be explained in the following figure.

4
Program
Foo
Bar
42
Number of parameters. Note that the program name is also treated as a parameter (argc)
Program name (argv [0])
The first parameter (argv [1])
Parameter 2 (argv [2])
Parameter 3 (argv [3]) (Note: Here is the string "42", not the number 42)

 

 

Http://www.cin.ufpe.br /~ If817/arquivos/asmtut/index.html # intro

Thanks to Derick Swanepoel (derick@maple.up.ac.za)

)

 

 

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.