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

  1.  
  2. * Maxon C++ Library:
  3. * Modul "stream_in"
  4. * Jens Gelhar 24.04.92, 31.08.93, 15.04.94, 17.04.94
  5.  
  6.     xdef    op__rightshift__istream__TPc,op__rightshift__istream__TRc
  7.     xdef    op__rightshift__istream__TPUc
  8.     xdef    get__istream__TRc,get__istream__T
  9.     xdef    get__istream__TRUc
  10.  
  11.     xref    fgetc__P06stream
  12.  
  13. op__rightshift__istream__TPc:    ; Stack-Parameter: istream&, char*
  14. op__rightshift__istream__TPUc:    ; Stack-Parameter: istream&, unsigned char*
  15.     move.l    a2,-(a7)
  16.     move.l    12(a7),d0
  17.     beq.b    oikeia
  18.     move.l    d0,a2
  19.     moveq    #79,d1
  20.     move.l    8(a7),-(a7)
  21. skipit    bsr.b    get__istream__T
  22.     bsr.b    Delim
  23.     beq.b    skipit
  24. readit    cmp.l    #-1,d0
  25.     beq.b    done
  26.     move.b    d0,(a2)+
  27.     subq.w    #1,d1
  28.     beq.b    done
  29.     bsr.b    get__istream__T
  30.     bsr.b    Delim
  31.     bne.b    readit
  32. done    clr.b    (a2)
  33.     addq.l    #4,a7
  34. oikeia    move.l    (a7)+,a2
  35.     move.l    4(a7),d0
  36.     rts
  37.  
  38. op__rightshift__istream__TRc:    ; Stack-Parameter: istream&, char&
  39.     move.l    4(a7),-(a7)
  40. again    bsr.b    get__istream__T
  41.     bsr.b    Delim
  42.     beq.b    again
  43.     addq.l    #4,a7
  44.     move.l    8(a7),a0
  45.     move.b    d0,(a0)
  46.     move.l    4(a7),d0
  47.     rts
  48.  
  49. Delim    cmp.b    #' ',d0
  50.     beq.b    .0
  51.     cmp.b    #10,d0
  52.     beq.b    .0
  53.     cmp.b    #9,d0
  54. .0    rts
  55.  
  56. get__istream__T:    ; Stack-Parameter: istream&
  57.     move.l    4(a7),a0
  58.     move.l    (a0),a0
  59.     move.l    (a0),-(a7)
  60.     jsr    fgetc__P06stream
  61.     addq.l    #4,a7
  62.     rts
  63.  
  64. get__istream__TRc:    ; Stack-Parameter: istream&, char&
  65. get__istream__TRUc:    ; Stack-Parameter: istream&, unsigned char&
  66.     move.l    4(a7),-(a7)
  67.     bsr.b    get__istream__T
  68.     addq.l    #4,a7
  69.     move.l    8(a7),a0
  70.     move.b    d0,(a0)
  71.     move.l    4(a7),d0
  72.     rts
  73.  
  74.     end
  75.  
  76.