ReC98/libs/BorlandC/f_scopy.asm

47 lines
1.3 KiB
NASM

; *Not* the original file, but an edit to turn it into an includable slice.
; Changes include:
; * removal of RULES.ASI to eliminate redundancy
; * removal of the segment declarations (for obvious reasons)
; * addition of a PROC directive around the function
;[]-----------------------------------------------------------------[]
;| F_SCOPY.ASM -- far struct copy routine |
;[]-----------------------------------------------------------------[]
;
; C/C++ Run Time Library - Version 5.0
;
; Copyright (c) 1987, 1992 by Borland International
; All Rights Reserved.
;
; calls to this routine are generated by the compiler to copy
; one "struct" value to another
;
; On entry:
;
; CX = Number of bytes to copy
public SCOPY@
public F_SCOPY@
SCOPY@ proc far
F_SCOPY@:
push bp
mov bp,sp
push si
push di
push ds
lds si,dword ptr 6[bp]
les di,dword ptr 10[bp]
cld
shr cx, 1
rep movsw
adc cx, cx
rep movsb
pop ds
pop di
pop si
pop bp
retf 8
endp