* SPrintf and VSprintf * * dos.library for KS 2.0 comes with Printf and FPrintf routines, but is * sorely lacking SPrintf routines. Routines here remedy that situation. * CSECT text XDEF _SPrintf XDEF _VSPrintf _SPrintf: MOVEM.L a2/a3/a6,-(sp) ; save registers MOVE.L 4+12(sp),a3 ; put stack arguments into registers MOVE.L 8+12(sp),a0 LEA 12+12(sp),a1 LEA putchar(pc),a2 ; and putchar routine MOVE.L 4,a6 ; load SysBase JSR -522(a6) ; RawDoFmt MOVEM.L (sp)+,a2/a3/a6 ; restore registers RTS _VSPrintf: MOVEM.L a2/a3/a6,-(sp) ; save registers MOVE.L 4+12(sp),a3 ; put stack arguments into registers MOVE.L 8+12(sp),a0 MOVE.L 12+12(sp),a1 LEA putchar(pc),a2 ; and putchar routine MOVE.L 4,a6 ; load SysBase JSR -522(a6) ; RawDoFmt MOVEM.L (sp)+,a2/a3/a6 ; restore registers RTS putchar: MOVE.B d0,(a3)+ RTS END