blkcopy.s,v
来自「用TCP/IP进行网际互连这本书得源代码,偶得,希望大家喜欢.推荐下载」· S,V 代码 · 共 75 行
S,V
75 行
head 1.1;access;symbols;locks dls:1.1; strict;comment @# @;1.1date 97.09.21.19.27.40; author dls; state Dist;branches;next ;desc@@1.1log@pre-3e code@text@/* blkcopy.s - blkcopy *//*------------------------------------------------------------------------ * blkcopy - copy "count" bytes from "src" to "dst" * blkcopy(dst, src, count) *------------------------------------------------------------------------ */ .globl _blkcopy/* * NOTE: to handle overlapping buffers in the copy, blkcopy() copies * bytes back-to-front if src < dst, front-to-back otherwise */ .align 2_blkcopy: pushl %esi pushl %edi movl 12(%esp),%edi movl 16(%esp),%esi movl 20(%esp),%ecx cmpl %edi,%esi jle L100 sarl $2,%ecx /* long word count */ cld rep movsl movl 20(%esp),%ecx andl $3,%ecx /* move residual bytes */ rep movsb popl %edi popl %esi retL100: /* backwards blkcopy */ decl %ecx addl %ecx,%esi /* set pointers to end */ addl %ecx,%edi incl %ecx std andl $3,%ecx /* move residual bytes */ rep movsb subl $3,%esi /* convert to long word pointer */ subl $3,%edi /* convert to long word pointer */ movl 20(%esp),%ecx sarl $2,%ecx /* long-word count */ rep movsl popl %edi popl %esi ret@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?