155682Smarkm# Copyright (c) KATO Takenori, 1999, 2000, 2007.
2233294Sstas#
3233294Sstas# All rights reserved.  Unpublished rights reserved under the copyright
4233294Sstas# laws of Japan.
555682Smarkm#
6233294Sstas# Redistribution and use in source and binary forms, with or without
7233294Sstas# modification, are permitted provided that the following conditions
8233294Sstas# are met:
955682Smarkm#
10233294Sstas# 1. Redistributions of source code must retain the above copyright
11233294Sstas#    notice, this list of conditions and the following disclaimer as
1255682Smarkm#    the first lines of this file unmodified.
13233294Sstas# 2. Redistributions in binary form must reproduce the above copyright
14233294Sstas#    notice, this list of conditions and the following disclaimer in the
15233294Sstas#    documentation and/or other materials provided with the distribution.
1655682Smarkm#
17233294Sstas# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18233294Sstas# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19233294Sstas# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2055682Smarkm# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21233294Sstas# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22233294Sstas# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23233294Sstas# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24233294Sstas# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25233294Sstas# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26233294Sstas# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27233294Sstas#
28233294Sstas# $FreeBSD$
29233294Sstas#
30233294Sstas	.global	start
31233294Sstas	.code16
3255682Smarkm
3355682Smarkm	.text
3455682Smarkmstart:
3555682Smarkm	jmp	start1
36233294Sstas
3755682Smarkm	# Magic
3855682Smarkm	.org	0x053, 0x20
3955682Smarkm	.byte	0x4e, 0x45, 0x43
4055682Smarkm
4155682Smarkm	.org	0x8f
4255682Smarkm	.byte	0x32, 0x2e, 0x37, 0x30
4355682Smarkm
4455682Smarkm	.org	0x2d4
45233294Sstasstart1:
46233294Sstas	# The instruction 'call 0x9ab' can be here.  See also selector.s.
47233294Sstas	nop
48233294Sstas	nop
49233294Sstas	nop
50178825Sdfr	cli
51178825Sdfr	movw	%cs, %ax
52178825Sdfr	movw	%ax, %ds
53178825Sdfr	movw	%ss, iniss
54178825Sdfr	movw	%sp, inisp
5555682Smarkm	movw	%ax, %ss
56178825Sdfr	movw	$0xfffe, %sp
5755682Smarkm	sti
5855682Smarkm	xorw	%ax, %ax
59233294Sstas	movw	%ax, %es
6055682Smarkm	call	main
61233294Sstas
62233294Sstas	cli
63233294Sstas	movw	%cs:iniss, %ss
64233294Sstas	movw	%cs:inisp, %sp
65233294Sstas	sti
66233294Sstas	int	$0x1e
67233294Sstas	# NOTREACHED
68178825Sdfr	lret
69233294Sstas
70178825Sdfr	.data
71233294Sstas	.global	iniss, inisp
72178825Sdfriniss:	.word	0
73233294Sstasinisp:	.word	0
74178825Sdfr