Subversion Repositories tendra.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/ crt1.s version 1.0 for tcc/trans386_Solaris
2
 
3
.file "crt1.s"
4
.text
5
 
6
.type _start,@function
7
.globl _start
8
_start:
9
 pushl $0		/ null return address
10
 pushl $0		/ null return frame pointer
11
 movl %esp,%ebp		/ initial frame pointer
12
 
13
 pushl %edx
14
 call atexit		/ see System V ABI, p3-32
15
 popl %eax
16
 
17
 pushl $_fini
18
 call atexit		/ to call _fini at any sort of exit
19
 popl %eax
20
 
21
 call __fpstart		/ initialise FPU
22
 
23
 movl 8(%ebp),%eax	/ argc
24
 leal 16(%ebp,%eax,4),%edx	/ Environment pointers
25
 movl %edx,_environ	/ preserve for getenv etc
26
 pushl %edx		/ and 3rd main argument
27
 leal 12(%ebp),%edx
28
 pushl %edx		/ argv
29
 pushl %eax		/ argc
30
 call _init		/ preserve 3 arguments through _init
31
 call main
32
 addl $12,%esp
33
 
34
 pushl %eax
35
 call exit		/ program exit
36
 
37
 movl $1,%eax
38
 lcall $7,$0		/ catch-all, see System V ABI, p3-25
39
 
40
.size _start, .-_start