;
; *** Listing 7-1 ***
;
; Calculates the 16-bit sum of all bytes in a 64Kb block.
;
; Time with LZTIME.BAT, since this takes more than
; 54 ms to run.
;
	call	ZTimerOn
	sub	bx,bx	;we'll just sum the data segment
	sub	cx,cx	;count 64K bytes
	mov	ax,cx	;set initial sum to 0
	mov	dh,ah	;set DH to 0 for summing later
SumLoop:
	mov	dl,[bx]	;get this byte
	add	ax,dx	;add the byte to the sum
	inc	bx	;point to the next byte
	loop	SumLoop
	call	ZTimerOff
