.model tiny
.code
	org     100h
start:  jmp     ini

int21:  cmp     ah,30h
	jne     to_old
	mov     al,3
	mov     ah,30
	xor     cx,cx
	xor     bx,bx
	iret

to_old:	db	0eah	;jmp	far
old21	dw	?,?

ini:	push	cs
	pop	ds

	mov	ax,3521h
	int	21h
	cmp	word ptr es:[bx+7],0b003h	; Installed ?
	je	exit

	mov	word ptr [old21],bx
	mov	word ptr [old21+2],es

	mov     dx,offset int21
	push    cs
	pop     ds
	mov     ax,2521h
	int     21h

	mov	dx,offset Copyright
	mov	ah,9h
	int	21h

	mov     dx,offset ini
	int     27h

Exit:	mov	dx,offset Already
	mov	ah,9h
	int	21h

	int	20h

Copyright	db	13,10,'Set DOS version as DOS 3.30',13,10,'$'
Already		db	13,10,'DOS 3.30 already installed',13,10,'$'

end start
