; Assembly language subroutine to move bytes from one address to another
; for use within the data segment
; by George Leritte
; Copyright 1987 by Softdisk, Inc.
; Syntax:  call smove(source offset,dest offset,no_bytes)
; movsb moves from bytes from ds-si to es-di

dgroup  group   data

code    segment para public 'code' 
        assume cs:code, ds:dgroup

        public smove
smove   proc far
        push bp
        mov bp,sp
        push es         ;save es
        push ds         ;mov ds
        pop es          ;to es
        mov si,[bp+10]  ;get 1st parameter address
        mov ax,[si]     ;move into ax temporarily
        mov si,[bp+8]   ;get 2nd parameter address
        mov di,[si]     ;move into di
        mov si,[bp+6]   ;get 3rd parameter address
        mov cx,[si]     ;move into cx
        mov si,ax       ;move 1st parameter into si
        cld             ;clear direction flag
rep     movsb           ;do move
        pop es          ;restore es
        pop bp          ;restore bp
        ret 6           ;reset stack and return
smove   endp
code    ends

data    segment
data    ends
end

