	;MASM MODE
	.386
	.MODEL use32 small


include  prints.ase 
include  input.ase 
include  mtrap.ase 

	PUBLIC fill


	.CODE
;
; fill command
;
fill	PROC
	call	WadeSpace
	jz	errx
	call	ReadAddress		; read start address
	jc	errx
	call	WadeSpace
	jz	errx
	call	ReadNumber    		; read length
	jc	errx
	mov	ecx,eax
	sub	ecx,ebx
	jc	errx
	call	WadeSpace
	mov	al,0           		; default fill = 0
	jz	gotfill
	call	ReadNumber		; else read a fill val
	jc	errx
	push	eax
	call	WadeSpace
	pop	eax
	jnz	errx
gotfill:
	mov	edi,ebx
	rep	stosb
	clc
	ret
errx:
	stc
	ret
fill	endp
end