2 * This is based on the file srt0.s provided with the binary
3 * distribution of the SPARC Instruction Simulator (SIS) found
4 * at ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32.
18 sethi %hi(__stack), %g1
19 or %g1,%lo(__stack),%g1
20 mov %g1, %sp ! set the stack pointer
24 sethi %hi(__bss_start),%g2
25 or %g2,%lo(__bss_start),%g2 ! start of bss
27 or %g3,%lo(_end),%g3 ! end of bss
28 mov %g0,%g1 ! so std has two zeros
36 /* move data segment to proper location */
40 set (_endtext),%g2 ! g2 = start of data in aout file
41 set (_environ),%g4 ! g4 = start of where data should go
42 set (_edata),%g3 ! g3 = end of where data should go
43 subcc %g3, %g4, %g5 ! g5 = length of data
45 subcc %g4, %g2, %g0 ! need to relocate data ?
64 /* call exit from the C library so atexit gets called, and the
65 * C++ destructors get run. This calls our exit routine below * when it's done.
72 set 0xdeadd00d, %o1 ! Magic number for simulator.
73 ta 0 ! Halt if _main returns ...