home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog_c / suplib.lzh / SUPLIB / SRC / BCMP.ASM < prev    next >
Assembly Source File  |  1991-08-16  |  520b  |  32 lines

  1.  
  2.         section CODE
  3.  
  4.         ;   BCMP(src, dst, len)
  5.         ;      D0   D1   A0
  6.         ;     4(sp) 8(sp) 12(sp)
  7.         ;   warning: return code has changed.  Is now 0 on success
  8.         ;   and 1 on failure
  9.  
  10.         xdef    _BCmp
  11.  
  12. _BCmp:        move.l    4(sp),A0
  13.         move.l    8(sp),A1
  14.         move.l    12(sp),D0
  15.  
  16.         ;   BCMP(src:D0, dst:D1, len:A0)
  17.  
  18.         beq    .bcsucc
  19.         cmp.w    D0,D0        ;force Z bit
  20.         bra    .bc2
  21. .bc1        cmpm.b    (A0)+,(A1)+
  22. .bc2        dbne    D0,.bc1
  23.         bne    .bcfail
  24.         sub.l    #$10000,D0
  25.         bcc    .bc1
  26. .bcsucc     moveq.l #0,D0        ;success!
  27.         rts
  28. .bcfail     moveq.l #1,D0        ;failure!
  29.         rts
  30.  
  31.         END
  32.