
	SECTION "Sprintf",CODE

	XDEF _Sprintf

_LVORawDoFmt	equ	-$20a

*
* Call like this:  Sprintf (buffer, fmt, ...);
*
*           e.g.:  Sprintf (str, "%s : %ld\n", name, number);
*
* NOTE: ALWAYS use %ld and %lx etc. instead of %d and %x !
*
* Put this at the start of your Lattice C code:
*
*   extern void __stdargs Sprintf (char *, char *,...);
*

_Sprintf:
	movem.l  a2/a3,-(a7)
	movea.l  8+8(a7),a0
	lea      8+12(a7),a1
	lea      PutCharInBuff(PC),a2
	move.l   8+4(a7),a3
	move.l   ($4).w,a6
	jsr      _LVORawDoFmt(a6)
	movem.l  (a7)+,a2/a3
	rts

PutCharInBuff:
	move.b d0,(a3)+
	rts

	END

