/* 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 ___memcmpDP; ___memcmpDP: compare_core: R12=PASS R12, dm_ptr=R4; /*Test for zero count*/ /*Point to s1 */ IF LE JUMP (PC, restore_state) (DB); R0=R0-R0, pm_ptr=R8; /*Point to s2 */ nop; DO dm_pm UNTIL NE; /*loop n times or until !=*/ IF EQ R2=PM(pm_ptr,pm_1); IF EQ R12=R12-1, R4=DM(dm_ptr,dm_1); dm_pm: IF GE R0=R2-R4; restore_state: FETCH_RETURN RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;