bzero.s
来自「实现一个简单的单进程内核,。该内核启用二级虚拟页表映射」· S 代码 · 共 48 行
S
48 行
/* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. */#include <asm.h>#if defined(LIBC_SCCS) RCSID("$NetBSD: bzero.S,v 1.8 1995/04/28 22:57:58 jtc Exp $")#endifENTRY(bzero) pushl %edi movl S_ARG1,%edi movl S_ARG2,%edx cld /* set fill direction forward */ xorl %eax,%eax /* set fill data to 0 */ /* * 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 * unaligned set. */ cmpl $16,%edx jb L1 movl %edi,%ecx /* compute misalignment */ negl %ecx andl $3,%ecx subl %ecx,%edx rep /* zero until word aligned */ stosb movl %edx,%ecx /* zero by words */ shrl $2,%ecx andl $3,%edx rep stoslL1: movl %edx,%ecx /* zero remainder by bytes */ rep stosb popl %edi ret
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?