include	clib.inc
include	conio.inc

PPROC	wcpbutt, wcbuf:dword, lsize:word, xcount:word, string:dword
	push	ds
	push	si
	push	di
	cld
	mov	cx,xcount
	mov	ah,at_background[B_Title]
	mov	al,' '
	les	di,wcbuf
	mov	bx,di
	mov	dx,di
	rep	stosw
	mov	ax,es:[di]
	mov	al,'Ü'
	and	ah,11110000B
	stosw
	add	dx,lsize
	add	dx,lsize
	add	dx,2
	mov	di,dx
	mov	cx,xcount
	mov	al,'ß'
	rep	stosw
	mov	ah,at_background[B_Title]
	or	ah,at_foreground[F_TitleKey]
	lds	si,string
	mov	di,bx
	add	di,4
    wcpbutt_loop:
	lodsb
	or	al,al
	jz	wcpbutt_end
	cmp	al,'&'
	jz	wcpbutt_01
	stosb
	inc	di
	jmp	wcpbutt_loop
    wcpbutt_01:
	lodsb
	or	al,al
	jz	wcpbutt_end
	stosw
	jmp	wcpbutt_loop
    wcpbutt_end:
	mov	dx,es
	mov	ax,word ptr wcbuf
	pop	di
	pop	si
	pop	ds
	ret
PEND	wcpbutt

	END
