xref: /netbsd-src/sys/arch/x68k/stand/libdos/dos_cerror.S (revision ed461fc193a34ff07bc68b0c28567cb8cfe199e5)
159c36c2cSitohy|	Writes Human68k DOS error number to  dos_errno.
259c36c2cSitohy|	Called on errors of DOS calls.
359c36c2cSitohy|
4*ed461fc1Sitohy|	written by ITOH Yasufumi
559c36c2cSitohy|	public domain
659c36c2cSitohy|
7*ed461fc1Sitohy|	$NetBSD: dos_cerror.S,v 1.2 2011/02/21 02:31:59 itohy Exp $
859c36c2cSitohy
959c36c2cSitohy#include "dos_asm.h"
1059c36c2cSitohy#include "dos_errno.h"
1159c36c2cSitohy
1259c36c2cSitohyASENTRY_NOPROFILE(CERROR)
1359c36c2cSitohy	movel	%d0,%sp@-
1459c36c2cSitohy	negl	%d0
1559c36c2cSitohy	cmpil	#_DOS_EEXIST,%d0
1659c36c2cSitohy	bnes	Lno_eexisists
1759c36c2cSitohy	moveq	#DOS_EEXIST,%d0
1859c36c2cSitohyLno_eexisists:
1959c36c2cSitohy	movel	%d0,_C_LABEL(dos_errno)
2059c36c2cSitohy	movel	%sp@+,%d0
2159c36c2cSitohy	rts
22