; calculate kermit checksum, dptr has string start
chkl:	call	chksum
	call	blkchk
	ret
;	
; compute arithmetic sum
chksum:	mov	r2,#0
	mov	r3,#0ffh
	jnb	parity,cs1
	mov	r3,#07fh
cs1:	movx	a,@dptr
	jz	cs2
	anl	a,r3
	add	a,r2
	mov	r2,a
	inc	dptr
	sjmp	cs1
cs2:	mov	a,r2
	ret

