📄 memmove386.asm
字号:
;+------------------------------------------------------------------; memmove386.asm;; Name; memmove - Copies characters between objects.;; Syntax;; void *memmove(dest, src, count); void *dest;; const void *src;; size_t count;;; Description; The memmove function copies count characters from src to; dest. If some regions of src and dest overlap, memmove; ensures that the original src bytes in the overlapping; region are copied before being overwritten.;; Return Value; The value of dest, the destination object.;;-------------------------------------------------------------------;+:EDITS:;:09-10-1992-13:59-wht@n4hgf-ECU release 3.20;:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA;:09-01-1991-23:15-wht@n4hgf-convert Chip's memmove.s TITLE $memmove .386DGROUP GROUP CONST, _BSS, _DATA_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'_DATA ENDS_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'_BSS ENDSCONST SEGMENT DWORD USE32 PUBLIC 'CONST'CONST ENDS ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP PUBLIC _memmove PUBLIC memmove_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'_memmove PROC NEARmemmove: push edi push esi mov edi,[esp+12] mov esi,[esp+16] mov ecx,[esp+20] mov eax,edi ; return value: dest jcxz mm_exit mov edx,edi sub edx,esi jb short mm_left_to_right cmp ecx,edx jb short mm_left_to_rightmm_right_to_left: add edi,ecx dec edi add esi,ecx dec esi std rep movsb cld jmp short mm_exitmm_left_to_right: cld mov edx,ecx shr ecx,2 rep movsw mov ecx,edx and ecx,3 rep movsbmm_exit: pop esi pop edi ret_memmove ENDP_TEXT ENDES end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -