/* This C language subroutine copies range of memory into another without overlap problems. 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
void *memmove(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 ___memmoveDP; ___memmoveDP: move_core: R2=PASS R12, dm_ptr=R4; /*Test for 0 length, point to input*/ IF EQ JUMP (PC, restore_state) (DB); R0=PASS R4, pm_ptr=R8; /*Point to output*/ R2=R2-1, R1=PM(pm_ptr,pm_1); /*preread */ LCNTR=R2, DO dm_pm UNTIL LCE; /*Loop n-1 times*/ dm_pm: DM(dm_ptr,dm_1)=R1, R1=PM(pm_ptr,pm_1); restore_state: FETCH_RETURN DM(dm_ptr,dm_1)=R1; /*post write */ RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;