linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* argc/argv
@ 2006-03-10  4:00 glburt
  2006-03-10  7:08 ` argc/argv Marcin Kościelnicki
  0 siblings, 1 reply; 2+ messages in thread
From: glburt @ 2006-03-10  4:00 UTC (permalink / raw)
  To: linux-assembly

I am trying to build a system that needs to pick up the command line arguments.  However, it seems there are two ways to do it.

The old way is that argc and argv elements are on the stack.

Using gcc 3.4.3, the argc is edi and the pointer for argv is in esi, according to the times that I have tried it.  

Is this correct????

Gary Burt

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: argc/argv
  2006-03-10  4:00 argc/argv glburt
@ 2006-03-10  7:08 ` Marcin Kościelnicki
  0 siblings, 0 replies; 2+ messages in thread
From: Marcin Kościelnicki @ 2006-03-10  7:08 UTC (permalink / raw)
  To: linux-assembly

> I am trying to build a system that needs to pick up the command line
> arguments.  However, it seems there are two ways to do it.

No, there's only one.

> The old way is that argc and argv elements are on the stack.

And that's the correct way.

> Using gcc 3.4.3, the argc is edi and the pointer for argv is in esi,
> according to the times that I have tried it.
>
> Is this correct????

No. Maybe argc really is in edi and argv in esi, but it can change anytime. 
Without warning. You shouldn't ever depend on it. Also, I believe this 
behavior should be attributed to both glibc and gcc (and therefore can change 
when version of either changes).

Marcin Ko≈õcielnicki




---------------------------------------------------------------------
Toshiba i FIFA World Cup
Wygraj bilety i notebooki z Intel Centrino Duo Mobile Technology
http://link.interia.pl/f1912

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-10  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-10  4:00 argc/argv glburt
2006-03-10  7:08 ` argc/argv Marcin Kościelnicki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).