home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / MAXONC3_6OF8.DMS / in.adf / LIBSRC.LHA / LIBSRC / filestream.asm < prev    next >
Encoding:
Assembly Source File  |  1994-04-17  |  1.7 KB  |  89 lines

  1.  
  2. * Maxon C++ Library:
  3. * Modul "filestream"
  4. * Jens Gelhar 08.06.92, 08.04.94
  5.  
  6.     xdef    _0ct__ostream__TP06stream,_0ct__istream__TP06stream
  7.     xdef    _0ct__ios__TP06stream
  8.     xdef    _0ct__fstreambase__TP06stream
  9.     xdef    eof__istream__T,putback__istream__Tc
  10.     xdef    getstream__ios__T
  11.     xdef    _0opPv__istream__T
  12.     xdef    _0opPv__ios__T
  13.  
  14.     xref    feof__P06stream,ferror__P06stream,ungetc__iP06stream
  15.  
  16. _0ct__fstreambase__TP06stream:
  17. _0ct__istream__TP06stream:    ; Stack-Parameter: istream*, stream*
  18. _0ct__ostream__TP06stream:    ; Stack-Parameter: ostream*, stream*
  19.     move.l a0,-(a7)
  20.     move.l 8(a7),a0        ; "this"
  21.     clr.b 5(a0)        ; istream.Errorflag bzw. ostream.Basis bzw _extstreamclass.Unused
  22.     btst #0,4(a0)
  23.     beq.s ct1
  24.     move.l (a0),a0        ; Basisklasse initialisieren
  25.     move.l 12(a7),(a0)
  26. ct1:    move.l (a7)+,a0
  27.     rts
  28.  
  29. _0ct__ios__TP06stream:
  30.     move.l    a0,-(a7)
  31.     move.l    8(a7),a0        ; "this"
  32.     move.l    12(a7),(a0)
  33.     bra.b    ct1
  34.  
  35. eof__istream__T:
  36.     move.l    4(a7),a0
  37.     move.l    (a0),a0            ; virtuelle Basisklasse "ios"
  38.     move.l    (a0),-(a7)        ; C-Filestruktur
  39.     jsr    feof__P06stream
  40.     addq.l    #4,a7
  41.     rts
  42.  
  43. putback__istream__Tc:
  44.     move.l    a0,-(a7)
  45.     moveq    #0,d0
  46.     move.l    8(a7),a0    ; istream
  47.     move.l    (a0),a0    ; baseclass
  48.     move.b    12(a7),d0
  49.     move.l    (a0),-(a7)
  50.     move.l    d0,-(a7)
  51.     jsr    ungetc__iP06stream
  52.     addq.l    #8,a7
  53.     move.l    (a7)+,a0
  54.     move.l    4(a7),d0
  55.     rts
  56.  
  57. getstream__ios__T:
  58.     move.l 4(a7),a0         ; _filebufclass
  59.     move.l (a0),a0
  60.     rts
  61.  
  62. _0opPv__ios__T:
  63.     move.l    4(a7),a0         ; _filebufclass
  64. conIn:    move.l    (a0),d0
  65.     beq.b    con0
  66.     move.l    d0,-(a7)
  67.     jsr    feof__P06stream
  68.     tst.l    d0
  69.     bne.b    conErr
  70.     jsr    ferror__P06stream
  71.     tst.l    d0
  72.     bne.b    conErr
  73.     move.l    (a7)+,d0
  74. con0    rts
  75. conErr    addq.l    #4,a7
  76.     moveq    #0,d0
  77.     rts
  78.  
  79. _0opPv__istream__T:
  80.     move.l    4(a7),a0
  81.     moveq    #0,d0
  82.     tst.b    5(a0)        ; noch ein Error-Flag
  83.     bne.b    con0
  84.     move.l    (a0),a0
  85.     bra.b    conIn
  86.  
  87.     end
  88.  
  89.