/* This C language subroutine concatenates one string to 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 - separated polymorphic functions #include
char *strcat(char *s1, const char *s2); */ #include "lib_glob.h" #include "str_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL _strcat; .GLOBAL ___strcatDD; _strcat: ___strcatDD: cat_core: R12=dma_i; dm_to_dm_cat: dma_i=R4; /*Point to output */ dm_ptr=R8; /*Pt to input */ R2=DM(dma_i,dm_1); /*Rd 1st sample */ R2=PASS R2; /*Check for \0*/ DO find_dm_dm_end UNTIL EQ; IF NE R2=DM(dma_i,1); IF NE R2=PASS R2; IF NE R2=DM(dma_i,1); /*Inc counter, read next*/ find_dm_dm_end: IF NE R2=PASS R2; /*Check for \0 */ R2=DM(dm_ptr,1); /*If input==NULL, no cat*/ R2=PASS R2, MODIFY(dma_i,dm_M1); DO dm_dm UNTIL EQ; /*cat 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: R0=PASS R4, FETCH_RETURN dma_i=R12; RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;