[LIP] syscall simulation!
sanjay panchal <sanjay_pec-/[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm trying to simulate the system call write().I'm
trying to print "hello world" on console thru this
program. Program compiles properly but doesn't give
any output.
Here's the code snippet.
main()
{
char hello[]="hello world\n";
__asm__ __volatile(
"xorl %%eax,%%eax\n\t"
"movl $4,%%eax\n\t" /*$4 SYS_write*/
"xorl %%ebx,%%ebx\n\t"
"movl $1,%%ebx\n\t" /*$1 fd for stdout*/
"movl %0,%%ecx\n\t" /*string */
"movl $12,%%edx\n\t" /*strlength*/
"int $0x80\n\t"
::"g" (hello)
);
printf("\n");
}
pls help!
regards
sanjay
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
-------------------------------------------------------
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