;
; *** Listing 10-9 ***
;
; Sets every element of a 1000-byte array to 1 by
; repeating STOSB 1000 times.
;
	jmp	Skip
;
ARRAY_LENGTH	equ	1000
ByteArray	db	ARRAY_LENGTH dup (?)
;
Skip:
	call	ZTimerOn
	mov	di,seg ByteArray
	mov	es,di	;point ES:DI to the array to fill
	mov	di,offset ByteArray
	mov	al,1	;we'll fill with the value 1
	mov	cx,ARRAY_LENGTH	;# of bytes to fill
	cld		;make STOSB increment DI after
			; each execution
	rep	stosb	;initialize the array
	call	ZTimerOff
