URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 207 |
Rev 345 |
; h8/300 and h8/300h start up file.
|
; h8/300 and h8/300h start up file.
|
|
|
#include "setarch.h"
|
#include "setarch.h"
|
|
|
#ifdef __H8300__
|
#ifdef __H8300__
|
|
|
.section .text
|
.section .text
|
.global _start
|
.global _start
|
_start:
|
_start:
|
mov.w #_stack,sp
|
mov.w #_stack,sp
|
mov.w #_edata,r0
|
mov.w #_edata,r0
|
mov.w #_end,r1
|
mov.w #_end,r1
|
sub.w r2,r2
|
sub.w r2,r2
|
.Loop: mov.w r2,@r0
|
.Loop: mov.w r2,@r0
|
adds #2,r0
|
adds #2,r0
|
cmp r1,r0
|
cmp r1,r0
|
blo .Loop
|
blo .Loop
|
#ifdef __ELF__
|
#ifdef __ELF__
|
mov.l #__fini,r0
|
mov.l #__fini,r0
|
jsr @_atexit
|
jsr @_atexit
|
#ifdef __SIMULATOR__
|
#ifdef __SIMULATOR__
|
jsr @0xcc
|
jsr @0xcc
|
#endif
|
#endif
|
jsr @__init
|
jsr @__init
|
#else
|
#else
|
#ifdef __SIMULATOR__
|
#ifdef __SIMULATOR__
|
jsr @0xcc
|
jsr @0xcc
|
#endif
|
#endif
|
jsr @___main
|
jsr @___main
|
#endif
|
#endif
|
jsr @_main
|
jsr @_main
|
jsr @_exit
|
jsr @_exit
|
|
|
.section .stack
|
.section .stack
|
_stack: .word 1
|
_stack: .word 1
|
|
|
#endif
|
#endif
|
|
|
#ifdef __H8300H__
|
#ifdef __H8300H__
|
|
|
.section .text
|
.section .text
|
.global _start
|
.global _start
|
_start:
|
_start:
|
mov.l #_stack,sp
|
mov.l #_stack,sp
|
mov.l #_edata,er0
|
mov.l #_edata,er0
|
mov.l #_end,er1
|
mov.l #_end,er1
|
sub.w r2,r2 ; not sure about alignment requirements
|
sub.w r2,r2 ; not sure about alignment requirements
|
.Loop: mov.w r2,@er0 ; playing it safe for now
|
.Loop: mov.w r2,@er0 ; playing it safe for now
|
adds #2,er0
|
adds #2,er0
|
cmp.l er1,er0
|
cmp.l er1,er0
|
blo .Loop
|
blo .Loop
|
#ifdef __ELF__
|
#ifdef __ELF__
|
mov.l #__fini,er0
|
mov.l #__fini,er0
|
jsr @_atexit
|
jsr @_atexit
|
#ifdef __SIMULATOR__
|
#ifdef __SIMULATOR__
|
jsr @0xcc
|
jsr @0xcc
|
#endif
|
#endif
|
jsr @__init
|
jsr @__init
|
#else
|
#else
|
#ifdef __SIMULATOR__
|
#ifdef __SIMULATOR__
|
jsr @0xcc
|
jsr @0xcc
|
#endif
|
#endif
|
jsr @___main
|
jsr @___main
|
#endif
|
#endif
|
jsr @_main
|
jsr @_main
|
jsr @_exit
|
jsr @_exit
|
|
|
.section .stack
|
.section .stack
|
_stack: .long 1
|
_stack: .long 1
|
|
|
#endif
|
#endif
|
|
|
#if defined (__H8300S__) || defined (__H8300SX__)
|
#if defined (__H8300S__) || defined (__H8300SX__)
|
|
|
.section .text
|
.section .text
|
.global _start
|
.global _start
|
_start:
|
_start:
|
mov.l #_stack,sp
|
mov.l #_stack,sp
|
mov.l #_edata,er0
|
mov.l #_edata,er0
|
mov.l #_end,er1
|
mov.l #_end,er1
|
sub.w r2,r2 ; not sure about alignment requirements
|
sub.w r2,r2 ; not sure about alignment requirements
|
.Loop: mov.w r2,@er0 ; playing it safe for now
|
.Loop: mov.w r2,@er0 ; playing it safe for now
|
adds #2,er0
|
adds #2,er0
|
cmp.l er1,er0
|
cmp.l er1,er0
|
blo .Loop
|
blo .Loop
|
#ifdef __ELF__
|
#ifdef __ELF__
|
mov.l #__fini,er0
|
mov.l #__fini,er0
|
jsr @_atexit
|
jsr @_atexit
|
#ifdef __SIMULATOR__
|
#ifdef __SIMULATOR__
|
jsr @0xcc
|
jsr @0xcc
|
#endif
|
#endif
|
jsr @__init
|
jsr @__init
|
#else
|
#else
|
#ifdef __SIMULATOR__
|
#ifdef __SIMULATOR__
|
jsr @0xcc
|
jsr @0xcc
|
#endif
|
#endif
|
jsr @___main
|
jsr @___main
|
#endif
|
#endif
|
jsr @_main
|
jsr @_main
|
jsr @_exit
|
jsr @_exit
|
|
|
.section .stack
|
.section .stack
|
_stack: .long 1
|
_stack: .long 1
|
|
|
#endif
|
#endif
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.