	title	FILL
	subttl	Module from library C_1 : FILL
	maclib	SYSEQU.LIB

; FILE:	FILL.MAC
; DATE: 820818:1326
; FOR:	Fill BC bytes from <HL> with A

; ENTRY	: Reg HL points to area to fill
;	  Reg BC contains number of bytes
;	  Accu contains byte to write
; EXIT	: Reg HL points past area filled
;	  Reg BC contains 0

	entry	fill

fill:
	push	de		; E is preserved
	ld	e,a		; Save A
ml0:
	ld	a,b		; While count <> 0
	or	c
	jr	z,ml1		; ..do begin
	ld	(hl),e		; fill 1 byte
	inc	hl		; next to fill
	dec	bc		; count down
	jr	ml0		; end do
ml1:
	ld	a,e
	pop	de
	ret

	end

