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.
9 .register %g2, #scratch
10 .register %g3, #scratch
21 sethi %hi(__stack), %g1
22 or %g1,%lo(__stack),%g1
23 mov %g1, %sp ! set the stack pointer
27 sethi %hi(__bss_start),%g2
28 or %g2,%lo(__bss_start),%g2 ! start of bss
30 or %g3,%lo(_end),%g3 ! end of bss
31 mov %g0,%g1 ! so std has two zeros
39 /* move data segment to proper location */
43 set (_endtext),%g2 ! g2 = start of data in aout file
44 set (_environ),%g4 ! g4 = start of where data should go
45 set (_edata),%g3 ! g3 = end of where data should go
46 subcc %g3, %g4, %g5 ! g5 = length of data
48 subcc %g4, %g2, %g0 ! need to relocate data ?
67 /* call exit from the C library so atexit gets called, and the
68 * C++ destructors get run. This calls our exit routine below * when it's done.
75 set 0xdeadd00d, %o1 ! Magic number for simulator.
76 ta 0 ! Halt if _main returns ...