.model medium, basic
.stack 20 
.386

.code
public gsdiv
gsdiv proc
;sub gsdiv(src, dest)
;bp+6   srcofs
;bp+4   destofs
;bp+2   retseg
;bp     retofs

mov cx, bp
mov bp, sp

mov si, [bp+6]
mov di, [bp+4]

mov ax, [si]
mov bx, [di]

cwd  

idiv bx

mov [si], ax
mov [di], dx

mov bp, cx
ret 4

gsdiv endp
end
