Previous: Startup interface, Up: Startup codes


6.1.2 Startup code usage

There are currently 3 startup codes in this package (maybe there will be more in the future). Depending on the code and data model you use and some other things you should choose one of them:

ncrt0.o
This is the normal (i.e. large code, large data model) startup. It contains a ‘geta4()’ entry point to enable you to use one source for two code models. There is no other need for this function.
nbcrt0.o
This one is for compiling small data model (a4 relative) programs. There is a ‘geta4()’ entry that places the right information into a4. Use this startup code if you compiled with ‘-fbaserel’.
nrcrt0.o
This startup code allocates a new data area every time you call it. Even if you don't call it at all the data are is there once. This gives you multientrant and reentrant code. Therefore this startup code is for compiling resident (pure) programs. Resident programs are always small data model if you let the compiler do the work.

There is no ‘geta4()’ entry - I just don't know how this could be done. (If you start your code 10 times and want to access global data out of a hook you cannot tell which one of the 10 data areas to use because you want to access the data from a different task!)