home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
programming
/
asm_programming
/
COPYMEM.RT
< prev
next >
Wrap
Text File
|
1993-01-09
|
679b
|
31 lines
public _copymem
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
; Copy a block of memory to another (possibly overlapping) location
; In:
; ECX - length of block
; ESI -> source
; EDI -> destination
; Out:
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
_copymem:
push ax
push ecx
push esi
push edi
cmp esi,edi
jae short copymemf0
add esi,ecx
add edi,ecx
dec esi
dec edi
std
copymemf0:
rep movsb
cld
pop edi
pop esi
pop ecx
pop ax
ret