;       Static Name Aliases
;
        TITLE   memmov
;       NAME    memmov.C

;   memmov(dst, src, len)
;   moves len bytes from src to dst.  The result is dst+len.
;   This is to memcpy as str[n]mov is to str[n]cpy, that is, it moves
;   exactly the same bytes but returns a pointer to just after the
;   the last changed byte.  You can concatenate blocks pa for la,
;   pb for lb, pc for lc into area pd by doing
;       memmov(memmov(memmov(pd, pa, la), pb, lb), pc, lc);
;   Unlike strnmov, memmov does not stop when it hits a NUL byte.

        .287
_TEXT   SEGMENT  BYTE PUBLIC 'CODE'
_TEXT   ENDS
_DATA   SEGMENT  WORD PUBLIC 'DATA'
_DATA   ENDS
CONST   SEGMENT  WORD PUBLIC 'CONST'
CONST   ENDS
_BSS    SEGMENT  WORD PUBLIC 'BSS'
_BSS    ENDS
DGROUP  GROUP   CONST,  _BSS,   _DATA
        ASSUME  CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
EXTRN   __chkstk:NEAR
_TEXT      SEGMENT
; Line 22
        PUBLIC  _memmov
_memmov PROC NEAR
        push    bp
        mov     bp,sp
        xor     ax,ax
        call    __chkstk
        push    di
        push    si

;       dst = 4
;       register si = dst
;       src = 6
;       register di = src
;       len = 8

        mov     di,[bp+4]       ;dst
        mov     si,[bp+6]       ;src
        mov     cx,[bp+8]
        repnz   movsb

        mov     ax,di
        pop     si
        pop     di
        mov     sp,bp
        pop     bp
        ret

_memmov ENDP
_TEXT   ENDS
END
