2000-02-18 03:39:52 +08:00
|
|
|
; h8/300 and h8/300h start up file.
|
|
|
|
|
2003-06-10 15:44:30 +08:00
|
|
|
#include "setarch.h"
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
#ifdef __H8300__
|
|
|
|
|
|
|
|
.section .text
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
mov.w #_stack,sp
|
|
|
|
mov.w #_edata,r0
|
|
|
|
mov.w #_end,r1
|
2000-08-31 06:17:17 +08:00
|
|
|
sub.w r2,r2
|
2003-02-01 04:35:24 +08:00
|
|
|
.Loop: mov.w r2,@r0
|
2000-02-18 03:39:52 +08:00
|
|
|
adds #2,r0
|
|
|
|
cmp r1,r0
|
2003-02-01 04:35:24 +08:00
|
|
|
blo .Loop
|
2001-09-05 03:05:44 +08:00
|
|
|
#ifdef __ELF__
|
2001-09-08 02:21:33 +08:00
|
|
|
mov.l #__fini,r0
|
2001-09-05 03:05:44 +08:00
|
|
|
jsr @_atexit
|
2003-03-19 04:38:04 +08:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2001-09-05 03:05:44 +08:00
|
|
|
jsr @__init
|
|
|
|
#else
|
2003-03-19 04:38:04 +08:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
jsr @___main
|
2001-09-05 03:05:44 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
jsr @_main
|
|
|
|
jsr @_exit
|
|
|
|
|
|
|
|
.section .stack
|
|
|
|
_stack: .word 1
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __H8300H__
|
|
|
|
|
|
|
|
.section .text
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
mov.l #_stack,sp
|
|
|
|
mov.l #_edata,er0
|
|
|
|
mov.l #_end,er1
|
2000-08-31 06:17:17 +08:00
|
|
|
sub.w r2,r2 ; not sure about alignment requirements
|
2003-02-01 04:35:24 +08:00
|
|
|
.Loop: mov.w r2,@er0 ; playing it safe for now
|
2000-02-18 03:39:52 +08:00
|
|
|
adds #2,er0
|
|
|
|
cmp.l er1,er0
|
2003-02-01 04:35:24 +08:00
|
|
|
blo .Loop
|
2001-09-05 03:05:44 +08:00
|
|
|
#ifdef __ELF__
|
2003-06-25 02:13:35 +08:00
|
|
|
mov.l #__fini,er0
|
2001-09-05 03:05:44 +08:00
|
|
|
jsr @_atexit
|
2003-03-19 04:38:04 +08:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2001-09-05 03:05:44 +08:00
|
|
|
jsr @__init
|
|
|
|
#else
|
2003-03-19 04:38:04 +08:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
jsr @___main
|
2001-09-05 03:05:44 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
jsr @_main
|
|
|
|
jsr @_exit
|
|
|
|
|
|
|
|
.section .stack
|
|
|
|
_stack: .long 1
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2004-06-23 05:54:52 +08:00
|
|
|
#if defined (__H8300S__) || defined (__H8300SX__)
|
2003-06-10 15:44:30 +08:00
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
.section .text
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
mov.l #_stack,sp
|
|
|
|
mov.l #_edata,er0
|
|
|
|
mov.l #_end,er1
|
2000-08-31 06:17:17 +08:00
|
|
|
sub.w r2,r2 ; not sure about alignment requirements
|
2003-02-01 04:35:24 +08:00
|
|
|
.Loop: mov.w r2,@er0 ; playing it safe for now
|
2000-02-18 03:39:52 +08:00
|
|
|
adds #2,er0
|
|
|
|
cmp.l er1,er0
|
2003-02-01 04:35:24 +08:00
|
|
|
blo .Loop
|
2001-09-05 03:05:44 +08:00
|
|
|
#ifdef __ELF__
|
2003-06-25 02:13:35 +08:00
|
|
|
mov.l #__fini,er0
|
2001-09-05 03:05:44 +08:00
|
|
|
jsr @_atexit
|
2003-03-19 04:38:04 +08:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2001-09-05 03:05:44 +08:00
|
|
|
jsr @__init
|
|
|
|
#else
|
2003-03-19 04:38:04 +08:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
jsr @___main
|
2001-09-05 03:05:44 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
jsr @_main
|
|
|
|
jsr @_exit
|
|
|
|
|
|
|
|
.section .stack
|
|
|
|
_stack: .long 1
|
|
|
|
|
|
|
|
#endif
|