/* 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 by 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 ___memcmpPP; ___memcmpPP: compare_core: R12=PASS R12, R1=pma_i; /*Test for zero count*/ IF LE JUMP (PC, restore_state) (DB); R0=R0-R0, pma_i=R4; /*Return a 0, pt to s1*/ pm_ptr=R8; /*point to s2*/ DO pm_pm UNTIL NE; /*loop n-1 times or until != */ IF EQ R2=PM(pma_i,pm_1); IF EQ R12=R12-1, R4=PM(pm_ptr, pm_1); pm_pm: IF GE R0=R2-R4; restore_state: FETCH_RETURN pma_i=R1; RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;