Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.tech Subject: Re: Lattice C : pragma? Whats all this then? Message-ID: Date: 27 Nov 90 22:10:40 GMT References: <1990Nov10.001056.9736@canterbury.ac.nz> <63@oregon.oacis.org> <26892.273fe53b@kuhub.cc.ukans.edu> Lines: 37 In article sie@fulcrum.bt.co.uk (Simon Raybould) writes: >In article <26892.273fe53b@kuhub.cc.ukans.edu> markv@kuhub.cc.ukans.edu writes: >>Lattice defines several bases in their libraries including DosBase, >>SysBase, MathBase, GfxBase, IntuitionBase, etc. DosBase and SysBase > ^^^^^^^ >>are always valid (the OS gives these to a program when it runs). The > >The OS doesn't open the Dos library, surely thats done by the startup code >LIB:c.o in the case of Lattice ? The only thing the OS gives to the executable when it starts it up is a pointer to the argument line and the length of that line, in registers. The startup code must retrieve SysBase (move.l 4.W,_SysBase), DOSBase (by using OpenLibrary("dos.library",0)), and everything else. Different compilers will open different things when you use the _main() entry point instead of the normal main() (unfortunately). Writing your own startup module can be dangerous, different compilers expect different things to be set up. Try to avoid writing your own startup module whenever possible. >If you don't link in the startup code then you have to set DosBase yourself! > >SJR -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA