]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/boot/pc98/btx/lib/btxcsu.s
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / boot / pc98 / btx / lib / btxcsu.s
1 #
2 # Copyright (c) 1998 Robert Nordier
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms are freely
6 # permitted provided that the above copyright notice and this
7 # paragraph and the following disclaimer are duplicated in all
8 # such forms.
9 #
10 # This software is provided "AS IS" and without any express or
11 # implied warranties, including, without limitation, the implied
12 # warranties of merchantability and fitness for a particular
13 # purpose.
14 #
15
16 # $FreeBSD$
17
18 #
19 # BTX C startup code (ELF).
20 #
21
22 #
23 # Globals.
24 #
25                 .global _start
26 #
27 # Constants.
28 #
29                 .set ARGADJ,0xfa0               # Argument adjustment
30 #
31 # Client entry point.
32 #
33 _start:         cld
34                 pushl %eax
35                 movl $_edata,%edi 
36                 movl $_end,%ecx 
37                 subl %edi, %ecx
38                 xorb %al, %al
39                 rep
40                 stosb
41                 popl __base
42                 movl %esp,%eax                  # Set
43                 addl $ARGADJ,%eax               #  argument
44                 movl %eax,__args                #  pointer
45                 call main                       # Invoke client main()
46                 call exit                       # Invoke client exit()
47 #
48 # Data.
49 #
50                 .comm __base,4                  # Client base address
51                 .comm __args,4                  # Client arguments