.\" ENVIRONMENTS:  COHERENT, LC, TOS, ISIS
.TH "runtime startup" "" "" Overview
.XR startup
.PC
.PP
The C runtime startup is a routine that is linked with
a C program as the first part of an executable program.
It performs the tasks needed to start and terminate the C environment.
To begin the program,
it initializes the stack and calls
.BR main ;
to conclude the program, it calls
.B exit
with the return value from
.BR main .
.if \nX=1 \{\
.PP
\*(PN includes the following runtime startup routines:
.DS
.ta 0.4i 1.4i
	\fBcrts0xs.obj\fR	SMALL model
	\fBcrts0xl.obj\fR	LARGE model
.DE
.PP
The runtime startups used with the option \fB\-VCSD\fR generate executable
files that can be debugged with the Mark Williams C source debugger \fBcsd\fR.
.PP
All of the above routines call \fB_main\fR.
Depending upon which options you use to the \fBcc\fR command,
these routines in turn can call one or more of the following
object modules:
.XR csdxs.obj
.XR csdxl.obj
.XR fxl.obj
.XR fxs.obj
.XR fxl87.obj
.XR fxs87.obj
.XR naxl.obj
.XR naxs.obj
.XR nsxl.obj
.XR nsxs.obj
.XR wxl.obj
.XR wxs.obj
.DS
.ta 0.4i 1.2i
	\fBcsdxl.obj\fR	LARGE model, debug information for \fBcsd\fR
	\fBcsdxs.obj\fR	SMALL model, debug information for \fBcsd\fR
.sp \n(pDu
	\fBfxl.obj\fR	LARGE model, floating point/8087 sensing
	\fBfxs.obj\fR	SMALL model, floating point/8087 sensing
.sp \n(pDu
	\fBfxl87.obj\fR	LARGE model, floating point/8087 only
	\fBfxs87.obj\fR	SMALL model, floating point/8087 only
.sp \n(pDu
	\fBnaxl.obj\fR	LARGE model, no arguments to command line
	\fBnaxs.obj\fR	SMALL model, no arguments to command line
.sp \n(pDu
	\fBnsxl.obj\fR	LARGE model, no STDIO in executable
	\fBnsxs.obj\fR	SMALL model, no STDIO in executable
.sp \n(pDu
	\fBwxl.obj\fR	LARGE model, wildcards on command line
	\fBwxs.obj\fR	SMALL model, wildcards on command line
.DE
.PP
See the Lexicon entry for \fBcc\fR for more information on the
no STDIO (\fB\-ns\fR) and wildcards (\fB\-w\fR) options. \}
.if \nX=2 \{\
.PP
Three C runtime startup routines are available on \*(PN for the Atari ST:
\fBcrts0.o\fR, the normal runtime startup;
\fBcrtsg.o\fR, the runtime startup for the GEM environment; and
\fBcrtsd.o\fR, which is used to create a GEM desktop application.
The default is
.BR crts0.o ,
which is appropriate for most uses.
You can call
.B crtsg.o
on the
.B cc
command line
in either of two ways:
with the switch
.BR \-VGEM ,
or with the
.B name
option
.BR Nrcrtsg.o .
The
.B crtsd.o
start-up routine can be called with the option
.B \-VGEMACC
or with the
.B name
option
.BR Ncrtsd.o . \}
.SH "See Also"
.B
.if \nX=0 crts0.o, _main
.if \nX=1 Environment, exargs, execall, function call, _main
.if \nX=2 cc, crts0.o, crtsd.o, crtsg.o, Environment, function call, stack, _stksize
.if \nX=3 lqmain.\*(AE, lqmain.obj, sqmain.\*(AE, sqmain.obj
.R
.if \nX=1 \{\
.SH Notes
Source code is included for some of the runtime startup routines.
Note, however, that this code should be edited
only by experienced systems programmers. \}
.if \nX=3 \{\
.SH Notes
\*(PN has two runtime startup routines, one
each for SMALL and LARGE model.
Source code is included for each;
note, however, that this code should be edited
only by experienced systems programmers. \}
