home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 634.lha / ppdata_v1.0 / src.LZH / src / sprintf.asm < prev    next >
Encoding:
Assembly Source File  |  1992-04-11  |  857 b   |  38 lines

  1. *    SPrintf and VSprintf
  2. *
  3. *    dos.library for KS 2.0 comes with Printf and FPrintf routines, but is
  4. *    sorely lacking SPrintf routines. Routines here remedy that situation.
  5. *
  6.     CSECT    text
  7.  
  8.     XDEF    _SPrintf
  9.     XDEF    _VSPrintf
  10.  
  11. _SPrintf:
  12.     MOVEM.L    a2/a3/a6,-(sp)        ; save registers
  13.     MOVE.L     4+12(sp),a3        ; put stack arguments into registers
  14.     MOVE.L     8+12(sp),a0
  15.     LEA    12+12(sp),a1
  16.     LEA    putchar(pc),a2        ; and putchar routine
  17.     MOVE.L    4,a6            ; load SysBase
  18.     JSR    -522(a6)        ; RawDoFmt
  19.     MOVEM.L    (sp)+,a2/a3/a6        ; restore registers
  20.     RTS
  21.  
  22. _VSPrintf:
  23.     MOVEM.L    a2/a3/a6,-(sp)        ; save registers
  24.     MOVE.L     4+12(sp),a3        ; put stack arguments into registers
  25.     MOVE.L     8+12(sp),a0
  26.     MOVE.L    12+12(sp),a1
  27.     LEA    putchar(pc),a2        ; and putchar routine
  28.     MOVE.L    4,a6            ; load SysBase
  29.     JSR    -522(a6)        ; RawDoFmt
  30.     MOVEM.L    (sp)+,a2/a3/a6        ; restore registers
  31.     RTS
  32.  
  33. putchar:
  34.     MOVE.B    d0,(a3)+
  35.     RTS
  36.  
  37.     END
  38.