.file	"dos2.S"
/*
 * Taken from <linux/unistd.h>, which doesnt like being included as it is
 * a C .h file....
 */

__NR_uselib	= 86
__NR_write	= 4
__NR_exit	= 1

	.org	0
	.data
/* .comm	_dummy,1114112 */
ELIB:	.asciz	"/lib/libemu.2d"
SLIB:	.asciz	"/lib/libc.so.4"
ERR:	.asciz	"Cannot load shared lib\12"
ERRe:
ERRsize		= ERRe - ERR

/*	.org	(1088*1024)+1	*/
/*	.text			*/
	.data
	.globl	_main
_main:	.data
	movl	$__NR_uselib,%eax
	movl	$ELIB,%ebx
	int	$0x80
	testl	%eax,%eax
	jnl	no_error
Error:
	movl	$__NR_write,%eax
	movl	$1,%ebx
	movl	$ERR,%ecx
	movl	$ERRsize,%edx
	int	$0x80
	movl	$__NR_exit,%eax
	movl	$1,%ebx
	int	$0x80
no_error:
	movl	$__NR_uselib,%eax
	movl	$SLIB,%ebx
	int	$0x80
	testl	%eax,%eax
	jl	Error
	movl	$0x400000,%ebx
	call	*%ebx
	leave
	ret
