home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-18.59-src.tgz / emacs-18.59-src.tar / fsf / emacs18 / amiga / unix / src / sprintf.asm < prev    next >
Assembly Source File  |  1996-09-28  |  427b  |  30 lines

  1.     XDEF __sprintf
  2.     XREF _AbsExecBase
  3.     XREF _LVORawDoFmt
  4.  
  5.     csect    text,0,,2,2
  6.  
  7. __sprintf
  8. save    equ    16
  9.     movem.l    a2/a3/a6/d2,-(a7)    ; save bytes copied to stack
  10.  
  11.     move.l    save+8(a7),a0
  12.     lea    save+12(a7),a1
  13.     lea    copychar(pc),a2
  14.     move.l    save+4(a7),a3
  15.     move.l    a3,d2
  16.  
  17.     move.l    _AbsExecBase,a6
  18.     jsr    _LVORawDoFmt(a6)
  19.     move.l    a3,d0            ; # of characters printed
  20.     sub.l    d2,d0
  21.  
  22.     movem.l    (a7)+,a2/a3/a6/d2
  23.     rts
  24.     
  25. copychar
  26.     move.b    d0,(a3)+
  27.     rts
  28.  
  29.     end
  30.