/* This C language subroutine copies one range of memory into another. 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 *memcpy(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 ___memcpyPD; ___memcpyPD: copy_core: R12=PASS R12, pm_ptr=R4; IF EQ JUMP (PC, restore_state) (DB); pm_to_dm_copy: dm_ptr=R8; /*Point to output*/ R12=R12-1, R2=DM(dm_ptr,1); /*preread */ LCNTR=R12, DO pm_dm UNTIL LCE; /*Loop n-1 times*/ pm_dm: R2=DM(dm_ptr,dm_1), PM(pm_ptr,pm_1)=R2; PM(pm_ptr,pm_1)=R2; /*postwrite */ restore_state: R0=PASS R4, FETCH_RETURN RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;