*************************************************************************
*sprintf2：bufferにフォーマットデータを書込む				*
*	int		sprintf2(buffer,format,...);			*
*	char		*buffer;					*
*	const char	*format;					*
*vsprintf2：bufferにフォーマットデータを書込む				*
*	int		vsprintf2(buffer,format,arg);			*
*	char		*buffer;					*
*	const char	*format;					*
*	va_list		arg;						*
*************************************************************************
* Copyright 1990 SHARP/Hudson	(1990/05/05)
* Arranged 1993 AIG-SOFT	(1993/04/24)

	xdef	_sprintf2
	xdef	_vsprintf2

	xref	__fmtout2

	.offset	4
buffer	ds.l	1
format	ds.l	1
arg	ds.l	1

	.text
_vsprintf2:
	move.l	arg(sp),-(sp)
	bra	_sprint0
_sprintf2:
	pea	arg(sp)
_sprint0:
	move.l	format+4(sp),-(sp)
	pea	buffer+8(sp)		. buffer pointer
	pea	_soutput
	jsr	__fmtout2
	lea	16(sp),sp
	move.l	buffer(sp),a0
	clr.b	(a0)
	rts

	.offset	4
c	ds.l	1
buff	ds.l	1

	.text
_soutput:
	movem.l	c(sp),d0/a0
	move.l	(a0),a1
	move.b	d0,(a1)+
	move.l	a1,(a0)
_soutput_return:
	rts
