| /* $OpenBSD: memset.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */ |
| * Written by J.T. Conklin <jtc@netbsd.org>. |
| movzbl 16(%esp),%eax /* unsigned char, zero extend */ |
| pushl %edi /* push address of buffer */ |
| cld /* set fill direction forward */ |
| * if the string is too short, it's really not worth the overhead |
| * of aligning to word boundries, etc. So we jump to a plain |
| movb %al,%ah /* copy char to all bytes in word */ |
| movl %edi,%edx /* compute misalignment */ |
| movl %edx,%ecx /* set until word aligned */ |
| shrl $2,%ecx /* set by words */ |
| movl %ebx,%ecx /* set remainder by bytes */ |
| popl %eax /* pop address of buffer */ |