include	clib.inc
include	conio.inc

PPROC	dlmemsize, dobj:dword
	les bx,dobj
	mov ch,0
	mov cl,es:[bx.dl_count]
	les bx,es:[bx.dl_object]
	xor ax,ax
	.while cx
	    add al,es:[bx.to_count]
	    add bx,16
	    dec cx
	.endw
	les bx,dobj
	mov dx,1
	add dl,es:[bx.dl_count]
	add ax,dx
	shl ax,4
	push ax
	invoke	rcmemsize, es:[bx.dl_rect], es:[bx.dl_flag]
	pop dx
	add ax,dx
	ret
PEND	dlmemsize

	END
