i960 Processor Compiler User's Guide
10-2
10
• Set the arithmetic controls (AC) register to 0x3B001000. For library
functions to execute correctly, the rounding mode bits of the AC must
be set to round-to-nearest, the floating-point normalizing bit must be
set, and the following faults must be masked:
integer overflow
floating-point overflow
floating-point underflow
floating-point inexact
• Since the i960 C-series and J-series processors' AC register does not
allow setting of floating-point bits, use
_setac in the setup. The
_setac and _getac routines are independent of architecture and
work correctly for all i960 architectures. Startup routines for KA, KB,
SA, and SB processors can also use the
modac instruction as an
alternative.
When writing code to initialize the C runtime environment, you must
address the following issues:
• The startup code provides the bias value for position-independent data
sections. If the program contains position-independent data (PID),
startup code must initialize register
g12 to the data-address bias. The
g12 register is the data address bias register. The compiler generates
references to statically allocated variables relative to
g12. The
contents of
g12 must be divisible by 16 (i.e., the address must be on a
quad-word boundary). After initialization,
g12 must be considered
read-only; user code should not modify it.
• If the gcc960 command line specifies
mpid or the ic960 command line
contains the Generate option with the PID argument (
-G pd), the
compiler does not use
g12 as a general purpose register. However, it
does use
g12 to offset static variables, as explained above.
If the target environment includes the MON960 monitor, startup must
provide a global entry point called
start, used by debug monitors as the
entry point to the new program. Startup code must call
__LL_init to
perform all initializations specific to the processor and to the board.