struct StringsBase *StringsBase=0L; /*#define RUN*/ #ifdef RUN char *StrCat(dest,source) register char *dest,*source; { char *p=dest; do ; while(*dest++); dest--; do ; while(*dest++=*source++); return p; }; /* strcat $VER: FEB06 0.2 */ #endif long test(d,s) char *d,*s; { long el=0; char *p,os[64]; p=(char *)StrCat(d,s); sprintf(os,"<%s>",s); printf("%17s <%s> p = %x len = %ld\n",os,p,p,StrLen(d)); return el; } int main() { /* MAIN */ long el=0; char s[256],*p; StringsBase=(struct StringsBase *)OpenLibrary("Strings.library",0); test(s,""); test(s,"Die "); test(s,""); test(s,"strings.library "); test(s,"umfasst ca 90 "); test(s,"Funktionen "); test(s,"bei ca 8k"); printf("<%s> len = %ld\n",s,StrLen(s)); if(StringsBase) CloseLibrary(StringsBase); return el; } /* END */ #ifdef COMMENT _StrCat: move.l 8(a5),a0 move.l 12(a5),a1 move.l a0,d0 StrCatLoop1: tst.b (a0)+ bne StrCatLoop1 subq.l #1,a0 StrCatLoop2: move.b (a1)+,(a0)+ bne StrCatLoop2 rts <> <> p = 2BA7D9 len = 0 p = 2BA7DD len = 4 <> p = 2BA7DD len = 4 p = 2BA7ED len = 20 p = 2BA7FB len = 34 p = 2BA806 len = 45 p = 2BA80F len = 54 len = 54 #endif