/* 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 ___memcpyDP; ___memcpyDP: copy_core: R12=PASS R12, dm_ptr=R4; /*Test for zero input*/ /*Point to input*/ IF EQ JUMP (PC, restore_state) (DB); dm_to_pm_copy: pm_ptr=R8; /*Point to output*/ R12=R12-1, R2=PM(pm_ptr,pm_1); /*Do prefetch of 1st word*/ LCNTR=R12, DO dm_pm UNTIL LCE; /*Loop n times*/ dm_pm: DM(dm_ptr,dm_1)=R2, R2=PM(pm_ptr,pm_1); DM(dm_ptr,dm_1)=R2; /*Do post write of last word*/ restore_state: R0=PASS R4, FETCH_RETURN RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;