; WriteF(a0:fmt:PTR TO CHAR,a1:lst:PTR TO LONG)

	xdef	_WriteF

_WriteF:	movem.l	d2-d3/a2-a3,-(a7)
	tst.l	_stdout
	beq.s	.nostd
.havestd	lea	(.copychar,pc),a2
	movea.l	4.w,a6
	lea	(-512,a7),a7
	movea.l	a7,a3
	move.l	a3,d2
	jsr	-522(a6)			; RawDoFmt()
	move.l	_stdout,d1
	move.l	d2,a0
.loop	tst.b	(a0)+
	bne.s	.loop
	sub.l	d2,a0
	move.l	a0,d3
	subq.l	#1,d3
	move.l	_DOSBase,a6
	jsr	(-48,a6)			; Write()
	move.l	d3,d0
	lea	(512,a7),a7
	movem.l	(a7)+,d2-d3/a2-a3
	rts
.copychar	move.b	d0,(a3)+
	rts
.nostd	lea	(.con,pc),a0
	move.l	a0,d1
	move.l	#1006,d2
	move.l	_DOSBase,a6
	jsr	-30(a6)			; Open()
	move.l	d0,_stdin
	move.l	d0,_stdout
	tst.l	d0
	bne.s	.havestd
	moveq	#20,d1
	jsr	(-144,a6)			; Exit()
	movem.l	(a7)+,d2-d3/a2-a3
	rts
.con	dc.b	"con:0/11/640/80/output",0,0,0,0,0
	even

	xref	_DOSBase
	xref	_stdin
	xref	_stdout
