
		include	std
		include	exec/vmemory.i

BUFSIZE		equ	7495680

START:		move.l	4.w,a6
		lea	dosname,a1
		moveq	#0,d0
		EXEC	OpenLibrary		;get DOS
		move.l	d0,DOS_LIB_PTR

		move.l	#BUFSIZE,d0
		move.l	#MEMF_VM,d1
		EXEC	AllocMem		;get buffer
		move.l	d0,a4

		move.l	DOS_LIB_PTR,a6

		move.l	#fname,d1
		move.l	#MODE_OLDFILE,d2	;open file to checksum
		DOS	Open
		move.l	d0,fhandle

		move.l	fhandle,d1
		move.l	a4,d2
		move.l	#BUFSIZE,d3		;read whole file into VM
		DOS	Read

		moveq	#0,d0			;clear accum.
		move.l	#BUFSIZE/4,d1
		move.l	a4,a0
;---------------
accum_longs	add.l	(a0)+,d0		;add 'em up
		subq.l	#1,d1
		bne	accum_longs
;---------------
		move.l	fhandle,d1		;close file
		DOS	Close

		move.l	4.w,a6
		move.l	#BUFSIZE,d0
		move.l	a4,a1
		EXEC	FreeMem			;release buffer
		rts

DOS_LIB_PTR	ds.l	1
fhandle		ds.l	1

dosname		DOSNAME

fname		dc.b	"dh0:HUGE",0
