1 ! bcmp
() Author
: Kees J. Bot
3 .sect .text; .sect .rom; .sect .data; .sect .bss
5 ! int bcmp
(const void
*s1
, const void
*s2
, size_t n
)
6 ! Compare two chunks of memory.
7 ! This is
a BSD routine that escaped from the kernel. Don
't use.
8 ! (Alas it is not without some use, it reports the number of bytes
9 ! after the bytes that are equal. So it can't be simply replaced.
)
19 call _memcmp
! Let memcmp do the work
23 sub dx
, 4(bp
) ! Memcmp was nice enough to leave
"si" in dx
24 dec dx
! Number of bytes that are equal
26 sub ax
, dx
! Number of bytes that are unequal