xref: /netbsd/sys/arch/x68k/stand/libdos/dos_procerr.S (revision 78d2e328)
1|	Writes Human68k DOS process error number to  dos_errno.
2|	Called on errors of DOS calls for processes.
3|
4|	written by ITOH Yasufumi
5|	public domain
6|
7|	$NetBSD: dos_procerr.S,v 1.2 2011/02/21 02:31:59 itohy Exp $
8
9#include "dos_asm.h"
10#include "dos_errno.h"
11
12ASENTRY_NOPROFILE(PRCERROR)
13	movel	%d0,%sp@-
14	cmpil	#0xffff0100,%d0
15	jcs	Lnoterrcode
16	negl	%d0
17Lwerr:
18	movel	%d0,_C_LABEL(dos_errno)
19	movel	%sp@+,%d0
20	rts
21
22Lnoterrcode:
23	swap	%d0
24	addqw	#1,%d0
25	jeq	Lillid
26
27	moveq	#DOS_EBUFOVER,%d0
28	jra	Lwerr
29
30Lillid:
31	moveq	#DOS_ESRCH,%d0
32	jra	Lwerr
33