/* This C language subroutine copies one string 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 3/95 by AS - seperated polymorphic functions #include
char *strcpy(char *s1, const char *s2); */ #include "lib_glob.h" #include "str_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL _strcpy; .GLOBAL ___strcpyDD; _strcpy: ___strcpyDD: copy_core: R12=dma_i; R0=PASS R4, FETCH_RETURN R2=PASS R8, dm_ptr=R8; /*Point to input*/ dm_to_dm_copy: R2=DM(dm_ptr,1); /*Read first sample*/ R2=PASS R2, dma_i=R0; /*If input==NULL no copy, Point to output*/ DO dm_dm UNTIL EQ; /*Copy until \0*/ IF NE R2=PASS R2, DM(dma_i,1)=R2; IF NE R2=DM(dm_ptr,1); IF NE R2=PASS R2, DM(dma_i,1)=R2; /*Write to output*/ dm_dm: IF NE R2=DM(dm_ptr,1); /*Read sample*/ restore_state: dma_i=R12; RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;