/*
 *	Perlin Production Co.Ltd.	October 1993 (c).
 *		SYSP.C runtime  library
 */

#include "bdos.h"

static unsigned int _A,_BC,_DE,_HL;

int	intdos(inregs,outregs)
union REGS* inregs;
union REGS* outregs;
{

	_A=inregs.x->psw;
	_BC=inregs.x->bc;
	_DE=inregs.x->de;
	_HL=inregs.x->hl;
#asm
	push	b
	lhld	$BC
	mov	b,h
	mov	c,l
	lhld	$DE
	xchg
	lda	$A
	lhld	$HL
	call	5
	shld	$HL
	sta	$A
	xchg
	shld	$DE
	mov	h,b
	mov	l,c
	shld	$BC
	pop	b
#endasm	
	outregs.x->bc=_BC;
	outregs.x->de=_DE;
	outregs.x->hl=_HL;
	return(outregs.x->psw=_A);
}
