;
;	CyrWin protection
;

	.model MEDIUM,C
	.CODE
Chk	Proc USES ds si
	extrn	_F000H:FAR
	extrn	_C000H:FAR
	mov	ax, Offset _F000H
	mov	es, ax
	mov	si, 0e000h
	mov	cx, 0ffffh - 0e000h
	xor	bx, bx
	mov	dx, OFFSET FindAddBios
	push	dx
ChkLoop:
	add	bx, es:[si]
	dec	bx
	inc	si
	loop	ChkLoop
	retn

FindAddBios:
	jmp	short ChkSumm
	xor	dx, dx
	mov	ax, Offset  _C000H
	mov	es, ax
	xor	si, si

ChkAddBios:
	cmp	Word Ptr es:[si], 0AA55h
	jne	@F
	inc	dx
	mov	al, Byte Ptr es:[si+3]
	mov	cx, 2048
	push	si
	call	ChkLoop
	pop	si
@@:
	add	si, 2048
	cmp	si, 07fffh
	jb	ChkAddBios
	mov	ax, 1
	jmp	short ChkSumm
Label2:
	db	'O' 	; XOR 055h
	db	'l' 	; XOR 055h
	db	'e' 	; XOR 055h
ChkSumm:
	cmp	bx, 1234h
	je	@F
@@:
	mov	ax, 1
	ret
Chk	EndP
	end