2000-02-17 19:39:52 +00:00
|
|
|
; h8/300 and h8/300h start up file.
|
|
|
|
|
2003-06-10 07:44:30 +00:00
|
|
|
#include "setarch.h"
|
|
|
|
|
2000-02-17 19:39:52 +00:00
|
|
|
#ifdef __H8300__
|
|
|
|
|
|
|
|
.section .text
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
mov.w #_stack,sp
|
|
|
|
mov.w #_edata,r0
|
2023-12-31 09:08:21 -07:00
|
|
|
mov.w #_end,r2
|
|
|
|
sub.w r1,r1
|
|
|
|
sub.w r0,r2
|
|
|
|
jsr @_memset
|
2001-09-04 19:05:44 +00:00
|
|
|
#ifdef __ELF__
|
2001-09-07 18:21:33 +00:00
|
|
|
mov.l #__fini,r0
|
2001-09-04 19:05:44 +00:00
|
|
|
jsr @_atexit
|
2003-03-18 20:38:04 +00:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2001-09-04 19:05:44 +00:00
|
|
|
jsr @__init
|
|
|
|
#else
|
2003-03-18 20:38:04 +00:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2000-02-17 19:39:52 +00:00
|
|
|
jsr @___main
|
2001-09-04 19:05:44 +00:00
|
|
|
#endif
|
2000-02-17 19:39:52 +00: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
|
2023-12-31 09:08:21 -07:00
|
|
|
mov.l #_end,er2
|
|
|
|
sub.w r1,r1
|
|
|
|
sub.l er0,er2
|
|
|
|
jsr @_memset
|
2001-09-04 19:05:44 +00:00
|
|
|
#ifdef __ELF__
|
2003-06-24 18:13:35 +00:00
|
|
|
mov.l #__fini,er0
|
2001-09-04 19:05:44 +00:00
|
|
|
jsr @_atexit
|
2003-03-18 20:38:04 +00:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2001-09-04 19:05:44 +00:00
|
|
|
jsr @__init
|
|
|
|
#else
|
2003-03-18 20:38:04 +00:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2000-02-17 19:39:52 +00:00
|
|
|
jsr @___main
|
2001-09-04 19:05:44 +00:00
|
|
|
#endif
|
2000-02-17 19:39:52 +00:00
|
|
|
jsr @_main
|
|
|
|
jsr @_exit
|
|
|
|
|
|
|
|
.section .stack
|
|
|
|
_stack: .long 1
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2004-06-22 21:54:52 +00:00
|
|
|
#if defined (__H8300S__) || defined (__H8300SX__)
|
2003-06-10 07:44:30 +00:00
|
|
|
|
2000-02-17 19:39:52 +00:00
|
|
|
.section .text
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
mov.l #_stack,sp
|
|
|
|
mov.l #_edata,er0
|
2023-12-31 09:08:21 -07:00
|
|
|
mov.l #_end,er2
|
|
|
|
sub.w r1,r1
|
|
|
|
sub.l er0,er2
|
|
|
|
jsr @_memset
|
2001-09-04 19:05:44 +00:00
|
|
|
#ifdef __ELF__
|
2003-06-24 18:13:35 +00:00
|
|
|
mov.l #__fini,er0
|
2001-09-04 19:05:44 +00:00
|
|
|
jsr @_atexit
|
2003-03-18 20:38:04 +00:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2001-09-04 19:05:44 +00:00
|
|
|
jsr @__init
|
|
|
|
#else
|
2003-03-18 20:38:04 +00:00
|
|
|
#ifdef __SIMULATOR__
|
|
|
|
jsr @0xcc
|
|
|
|
#endif
|
2000-02-17 19:39:52 +00:00
|
|
|
jsr @___main
|
2001-09-04 19:05:44 +00:00
|
|
|
#endif
|
2000-02-17 19:39:52 +00:00
|
|
|
jsr @_main
|
|
|
|
jsr @_exit
|
|
|
|
|
|
|
|
.section .stack
|
|
|
|
_stack: .long 1
|
|
|
|
|
|
|
|
#endif
|