URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [newlib/] [libgloss/] [sparc/] [erc32-crt0.S] - Rev 56
Go to most recent revision | Compare with Previous | Blame | View Log
/** This is based on the file srt0.s provided with the binary* distribution of the SPARC Instruction Simulator (SIS) found* at ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32.*/#include "asm.h".data.align 8SYM(environ):.long 0.text.globl SYM(start)SYM(start):sethi %hi(__stack), %g1or %g1,%lo(__stack),%g1mov %g1, %sp ! set the stack pointermov %sp, %fp/* clear the bss */sethi %hi(__bss_start),%g2or %g2,%lo(__bss_start),%g2 ! start of bsssethi %hi(_end),%g3or %g3,%lo(_end),%g3 ! end of bssmov %g0,%g1 ! so std has two zeroszerobss:std %g0,[%g2]add %g2,8,%g2cmp %g2,%g3bleu,a zerobssnop/* move data segment to proper location */#if 0relocd:set (_endtext),%g2 ! g2 = start of data in aout fileset (_environ),%g4 ! g4 = start of where data should goset (_edata),%g3 ! g3 = end of where data should gosubcc %g3, %g4, %g5 ! g5 = length of datasubcc %g4, %g2, %g0 ! need to relocate data ?ble initokld [%g4], %g6subcc %g6, 1, %g0be initokmvdata:subcc %g5, 8, %g5ldd [%g2 + %g5], %g6bg mvdatastd %g6, [%g4 + %g5]initok:#endifcall SYM(__fix_ctors)nopcall SYM(main)nop/* call exit from the C library so atexit gets called, and the* C++ destructors get run. This calls our exit routine below * when it's done.*/call SYM(exit)nop.globl SYM(_exit)SYM(_exit):set 0xdeadd00d, %o1 ! Magic number for simulator.ta 0 ! Halt if _main returns ...nop
Go to most recent revision | Compare with Previous | Blame | View Log
