flat assembler
Message board for the users of flat assembler.

Index > Linux > Get Command Line

Author
Thread Post new topic Reply to topic
binary108



Joined: 03 Apr 2004
Posts: 7
Location: Russia
binary108 19 Apr 2004, 08:38
how can program get command line?
Post 19 Apr 2004, 08:38
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 19 Apr 2004, 09:36
The command line parameters are stored initially on stack. At the entry point of your program, the stack layout is as follows:

dword [esp] = n, count of command line arguments
dword [esp+4] = pointer to the first argument (the name of your executable)
dword [esp+4*2] = pointer to the second argument
...
dword [esp+4*n] = pointer to the last argument
dword [esp+4*n+4] = some NULL pointer
dword [esp+4*n+8] = pointer to environment variables
Post 19 Apr 2004, 09:36
View user's profile Send private message Visit poster's website Reply with quote
binary108



Joined: 03 Apr 2004
Posts: 7
Location: Russia
binary108 19 Apr 2004, 10:29
thank you!
Post 19 Apr 2004, 10:29
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.