home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / MAXONC3_6OF8.DMS / in.adf / LIBSRC.LHA / LIBSRC / putstr.asm < prev    next >
Encoding:
Assembly Source File  |  1994-12-15  |  721 b   |  45 lines

  1.  
  2.     ; Himpelsoft C++ Projekt
  3.     ; Library-Modul "putstr"
  4.     ; Jens Gelhar 19.03.93, 15.12.94
  5.  
  6.     xdef    _puts,puts__PCc
  7.     xdef    _fputs,fputs__PCcP06stream
  8.  
  9.     xref    _std__out,__Writefile
  10.  
  11. _puts:
  12. puts__PCc:
  13.     movem.l    d2/d3/a6,-(a7)
  14.     pea    _std__out
  15.     move.l    4+3*4+4(a7),-(a7)
  16.     bsr.b    _fputs
  17.     ; Linefeed schreiben
  18.     addq.l    #4,a7
  19.     move.l    (a7)+,a0
  20.     move.l    #lfstr,d2
  21.     moveq    #1,d3
  22.     tst.l    d0
  23.     bmi.b    .err
  24.     jsr    __Writefile
  25. .err    movem.l    (a7)+,d2/d3/a6
  26.     rts
  27.  
  28. _fputs:
  29. fputs__PCcP06stream:    ; Stack-Parameter: char*, stream*
  30.     movem.l    d2/d3/a6,-(a7)
  31.     move.l    3*4+4(a7),d2        ; Zeiger auf String
  32.     move.l    d2,a0
  33.     moveq    #-1,d3
  34. count:    addq.l    #1,d3
  35.     tst.b    (a0)+
  36.     bne.b    count
  37.     move.l    3*4+8(a7),a0
  38.     jsr    __Writefile
  39.     movem.l    (a7)+,d2/d3/a6
  40.     rts
  41.  
  42. lfstr:    dc.b    10,0
  43.  
  44.     end
  45.