/* This C language subroutine compares two ranges of memory. The Run Time Library for the C Language. Gordon A. Sterling (617) 461 - 3076 DSP Development Tools Engineering Created on 4/30/90 Updated on 5/94 by AS Updated on 2/95 by AS - separated polymorphic functions #include
int memcmp(const void *s1, const void *s2, size_t size); */ #include "lib_glob.h" #include "str_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL _memcmp; .GLOBAL ___memcmpDD; _memcmp: ___memcmpDD: compare_core: R12=PASS R12, R1=dma_i; /*Test for zero count*/ IF LE JUMP (PC, restore_state) (DB); R0=R0-R0, FETCH_RETURN /*Return a 0 if we jump*/ dma_i=R4; /*Point to s1 */ dm_ptr=R8; /*point to s2*/ DO dm_dm UNTIL NE; /*loop n-1 times or until != */ IF EQ R2=DM(dma_i,dm_1); IF EQ R12=R12-1, R4=DM(dm_ptr, dm_1); dm_dm: IF GE R0=R2-R4; restore_state: dma_i=R1; RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;