From: "A.Appleyard" To: DJGPP AT sun DOT soe DOT clarkson DOT edu Date: Tue, 21 Mar 1995 16:39:04 GMT Subject: A quick way to copy n bytes /*-----*//* fast move s[0:n-1]=t[0:n-1] */ void str_cpy(void*s,void*t,int n){ asm("pushl %esi"); asm("pushl %edi"); asm("cld"); asm("movl 8(%ebp),%edi"); asm("movl 12(%ebp),%esi"); asm("movl 16(%ebp),%ecx"); asm("rep"); asm("movsb"); asm("popl %edi"); asm("popl %esi");} /*-----*/ /* This has given me good service and should run a bit quicker than a C */ /* version, as it uses the `rep' repeat instruction */