home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / powerd / lib / PowerD / OStrCmp.ass < prev    next >
Encoding:
Text File  |  1999-09-21  |  352 b   |  24 lines

  1. ; (4,a7)  - str1
  2. ; (8,a7)  - str2
  3. ; (12,a7) - length=-1
  4.  
  5.     xdef    _OStrCmp
  6.  
  7. _OStrCmp    move.l    (4,a7),a0
  8.     move.l    (8,a7),a1
  9.     move.l    (12,a7),d0
  10. .loop    cmpm.b    (a1)+,(a0)+
  11.     bne.s    .nosame
  12.     tst.b    (-1,a0)
  13.     beq.s    .same
  14.     dbf.s    d0,.loop
  15. .same    moveq    #0,d0
  16.     rts
  17. .nosame    move.b    (-1,a0),d0
  18.     cmp.b    (-1,a1),d0
  19.     bgt.s    .higher
  20. .lower    moveq    #1,d0
  21.     rts
  22. .higher    moveq    #-1,d0
  23.     rts
  24.