struct StringsBase *StringsBase=0L; /*#define RUN*/ #ifdef RUN char StrRotCpy(d,s) register char *d,*s; { /* */ register char *pt=s,c=*pt++; if(c) { do { } while(*d++=*pt++); *--d=c; } return c; }; /* $VER: StrRot mrz06 0.2 */ #endif int main() { /* MAIN */ long el=0,il,l=11; char s[1024],as[1024]; el--; StringsBase=(struct StringsBase *)OpenLibrary("Strings.library",0); if(StringsBase) { StrCpy(as,"Dies ist ein Teststring von StrRotCpy"); StrCpy(s,as); printf(" <%s> \n",s); for(il=1; il<8; il++) { StrRotCpy(s,as); StrCpy(as,s); printf(" <%s> \n",as); } CloseLibrary(StringsBase); } return el; } /* END */ #ifdef COMMENT _StrRotCpy: link a5,#0 move.l 8(a5),a0 move.l 12(a5),a1 moveq.l #0,D0 CMP.l #(0),A0 BEQ StrRotCpyEnd move.b (A1)+,D0 tst.b D0 beq StrRotCpyEnd StrRotCpyLoop: move.b (A1)+,(A0)+ bne StrRotCpyLoop move.b #0,(A0) subq.l #$01,A0 move.b D0,(A0) StrRotCpyEnd: unlk a5 RTS < ist ein Teststring von StrRotCpyDies> #endif