Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: global star...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 4574 of 4728
Post > Topic >>

Re: global start, global main or anything I want?

by phoenix <spamtrap@[EMAIL PROTECTED] > Mar 17, 2008 at 03:25 AM

Thank you guys for your responses. They' ve been very useful.

I' ve made some tests today, the result is that if I leave "prog" as
the label name and then I use the GCC "-nostdlib " parameter, a
warning message stating that there's no _stat function appears but the
program (or function) is correctly linked. Using "-nostdlib "
parameter, the executable file is just 744 byte, without "-nostdlib "
parameter the executable file is about 7 kB!

My last question is: what is the best way to write simple (addition,
subtraction,...) STAND-ALONE assembly programs, without C libraries or
external stuff (just pure assembly)? What about writing the code of
the program with a _start label in it, then assembling and linking it,
using the "-nostdlib " parameter (or using directly ld)? Or is there a
better (or easier) way?


P.S.: why the executable stops with a segmentation fault? Am I forced
to use the syscall exit?

thank you
 




 8 Posts in Topic:
global start, global main or anything I want?
phoenix <spamtrap@[EM  2008-03-16 10:51:20 
Re: global start, global main or anything I want?
Tim Roberts <spamtrap  2008-03-16 21:25:30 
Re: global start, global main or anything I want?
Terence <spamtrap@[EM  2008-03-16 14:19:02 
Re: global start, global main or anything I want?
Frank Kotler <spamtra  2008-03-16 21:58:37 
Re: global start, global main or anything I want?
Robert Redelmeier <red  2008-03-16 22:32:37 
Re: global start, global main or anything I want?
phoenix <spamtrap@[EM  2008-03-17 03:25:33 
Re: global start, global main or anything I want?
Frank Kotler <spamtra  2008-03-17 21:27:21 
Re: global start, global main or anything I want?
phoenix <spamtrap@[EM  2008-03-19 01:01:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 0:36:56 CDT 2008.