Welcome to mirror list, hosted at ThFree Co, Russian Federation.

crt0.S « h8300hms « sys « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8d23bd4860adb23a05b5398e631d582131c48325 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
; h8/300 and h8/300h start up file.

#ifdef __H8300__

	.section .text
	.global	_start
_start:
	mov.w	#_stack,sp
	mov.w	#_edata,r0
	mov.w	#_end,r1
	sub.w   r2,r2
.loop:	mov.w	r2,@r0
	adds	#2,r0
	cmp	r1,r0
	blo	.loop
#ifdef __ELF__
	mov.l   #__fini,r0
	jsr     @_atexit
	jsr     @__init
#else
	jsr	@___main
#endif
	jsr	@_main
	jsr	@_exit

	.section .stack
_stack:	.word 	1

#endif

#ifdef __H8300H__

	.h8300h
	.section .text
	.global	_start
_start:
	mov.l	#_stack,sp
	mov.l	#_edata,er0
	mov.l	#_end,er1
	sub.w   r2,r2           ; not sure about alignment requirements
.loop:	mov.w	r2,@er0		; playing it safe for now
	adds	#2,er0
	cmp.l	er1,er0
	blo	.loop
#ifdef __ELF__
	mov.l   #__fini,r0
	jsr     @_atexit
	jsr     @__init
#else
	jsr	@___main
#endif
	jsr	@_main
	jsr	@_exit

	.section .stack
_stack:	.long 	1

#endif

#ifdef __H8300S__

	.h8300s
	.section .text
	.global	_start
_start:
	mov.l	#_stack,sp
	mov.l	#_edata,er0
	mov.l	#_end,er1
	sub.w   r2,r2           ; not sure about alignment requirements
.loop:	mov.w	r2,@er0		; playing it safe for now
	adds	#2,er0
	cmp.l	er1,er0
	blo	.loop
#ifdef __ELF__
	mov.l   #__fini,r0
	jsr     @_atexit
	jsr     @__init
#else
	jsr	@___main
#endif
	jsr	@_main
	jsr	@_exit

	.section .stack
_stack:	.long 	1

#endif