home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Name UTAMOVE -- Copy memory.
- ;
- ; Synopsis utamove (source, target, num, direction);
- ;
- ; const char far *source
- ; Where to copy memory from.
- ; char far *target Where to copy memory to.
- ; unsigned int num Amount of memory to copy (in bytes).
- ; int direction MVFORWARD (0) or MVBACKWARD (1)--
- ; these deal with the direction flag.
- ;
- ; Description This function copies memory from any place in memory to
- ; any other place in memory. This is NOT a smart move
- ; routine; it does not handle overlap gracefully--use
- ; UTMOVMEM for that capability.
- ;
- ; Returns Nothing.
- ;
- ; Version 6.00 (C)Copyright Blaise Computing Inc. 1987,1988,1989
-
- include beginasm.mac
- beginProg utamove
-
- MVFORWARD equ 0 ; Direction flag settings
- MVBACKWARD equ 1
-
- source equ dword ptr [bp + stkoff + 0]
- target equ dword ptr [bp + stkoff + 4]
- num equ word ptr [bp + stkoff + 8]
- direct equ word ptr [bp + stkoff + 10]
-
- push bp
- mov bp, sp
-
- push ds
- push es
- push si
- push di
-
- lds si, source
- les di, target
- mov cx, num
-
- cld
- cmp direct, MVFORWARD
- jz dset
- std
-
- dset:
- rep movsb
-
- cld
- pop di
- pop si
- pop es
- pop ds
- pop bp
- ret
-
- endProg utamove
- end