home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / MAXONC3_6OF8.DMS / in.adf / LIBSRC.LHA / LIBSRC / string_spn.asm < prev    next >
Encoding:
Assembly Source File  |  1994-04-16  |  804 b   |  59 lines

  1.  
  2. *    Maxon C++
  3. *    Library-Modul "string_spn"
  4. *    Jens Gelhar 11.09.91, 16.04,94
  5.  
  6.     xdef    _strspn,strspn__PCcPCc
  7.     xdef    _strcspn,strcspn__PCcPCc
  8.     xdef    _strpbrk,strpbrk__PCcPCc
  9.  
  10. _strspn:
  11. strspn__PCcPCc:
  12.     moveq    #0,d0
  13.     move.l    4(a7),a0
  14. .loop    move.l    8(a7),a1
  15.     move.b    (a0)+,d1
  16.     beq.b    .end
  17.     bsr.b    isinit
  18.     bne.b    .end
  19.     addq.l    #1,d0
  20.     bra.b    .loop
  21. .end    rts
  22.  
  23. isinit:    ; kommt d1 in a1 vor?
  24.     tst.b    (a1)
  25.     beq.b    .not
  26.     cmp.b    (a1)+,d1
  27.     bne.b    isinit
  28.     rts
  29. .not    cmp.w    #0,a7
  30.     rts
  31.  
  32. _strcspn:
  33. strcspn__PCcPCc:
  34.     moveq    #0,d0
  35.     move.l    4(a7),a0
  36. .loop    move.l    8(a7),a1
  37.     move.b    (a0)+,d1
  38.     beq.b    .end
  39.     bsr.b    isinit
  40.     beq.b    .end
  41.     addq.l    #1,d0
  42.     bra.b    .loop
  43. .end    rts
  44.  
  45. _strpbrk:
  46. strpbrk__PCcPCc:
  47.     move.l    4(a7),a0
  48. .loop    move.l    8(a7),a1
  49.     move.l    a0,d0
  50.     move.b    (a0)+,d1
  51.     beq.b    .end3
  52.     bsr.b    isinit
  53.     bne.b    .loop
  54.     bra.b    .end4
  55. .end3    moveq    #0,d0
  56. .end4    rts
  57.  
  58.     end
  59.