Re: [LIP] syscall simulation!

Arun Sharma <[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <[email protected]>
On Sun, Feb 20, 2005 at 08:02:22PM -0800, sanjay panchal wrote:
> Refering to ur code, isn't specifying constraint "c"
> (ie use ecx to hold a variable) same as moving
> argument %0 into ecx (which I was doing explicitly by
> using constraint "g") ? 

No. Try gcc -S file.c to see what it's generating.

> 
> What exactly is happening when we are executing
> movl %0,%%ecx 
> Is it moving the memory location of "hello world\n"
> using  disp(base,index,scale)?
> 

You need to use leal instead of movl (which moves the content, not the
address of hello).

	-Arun


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.