home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC6.DMS / in.adf / libsrc.lha / LIBSRC / ungetchar.asm < prev    next >
Encoding:
Assembly Source File  |  1994-04-16  |  401 b   |  26 lines

  1.  
  2. *    Maxon C++ Projekt:
  3. *    Library-Modul "ungetchar"
  4. *    Jens Gelhar 18.09.91
  5.  
  6.     xdef    _ungetc,ungetc__iP06stream
  7.  
  8. str_ungetch    = 4
  9. str_ungetbuf    = 5
  10.  
  11. _ungetc:
  12. ungetc__iP06stream:
  13.     move.l a0,-(a7)
  14.     movem.l 8(a7),d0/a0
  15.     tst.b str_ungetch(a0)             ; Flag: Char gepuffert?
  16.     bne.b err
  17.     move.b d0,str_ungetbuf(a0)
  18.     move.b #1,str_ungetch(a0)
  19.     move.l (a7)+,a0
  20.     rts
  21. err    move.l (a7)+,a0
  22.     moveq #-1,d0
  23.     rts
  24.  
  25.     end
  26.