Initial import from FreeBSD RELENG_4:
[games.git] / sys / boot / pc98 / boot0.5 / start.s
1 # Copyright (c) KATO Takenori, 1999, 2000.
2
3 # All rights reserved.  Unpublished rights reserved under the copyright
4 # laws of Japan.
5
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9
10 # 1. Redistributions of source code must retain the above copyright
11 #    notice, this list of conditions and the following disclaimer as
12 #    the first lines of this file unmodified.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 #    notice, this list of conditions and the following disclaimer in the
15 #    documentation and/or other materials provided with the distribution.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #
28 # $FreeBSD: src/sys/boot/pc98/boot0.5/start.s,v 1.1.2.1 2000/09/11 09:19:46 kato Exp $
29 #
30         .global start
31         .code16
32
33         .text
34 start:
35         cli
36         movw    %cs, %ax
37         movw    %ax, %ds
38         movw    %ss, iniss
39         movw    %sp, inisp
40         movw    %ax, %ss
41         movw    $0xfffe, %sp
42         sti     
43         xorw    %ax, %ax
44         movw    %ax, %es
45         call    main
46
47         cli
48         movw    %cs:iniss, %ss
49         movw    %cs:inisp, %sp
50         sti
51         int     $0x1e
52         # NOTREACHED
53         lret
54
55         .data
56         .global iniss, inisp
57 iniss:  .word   0
58 inisp:  .word   0