;
;
;	FM-TOWNS MX/MA 15K-31K CONVERT CHECK	Copyright(C) 1995 by AMU.
;
;		ret(al)   0 : 31K CONVERT ON
;			  1 : 31K CONVERT OFF
;			255 : NOT FM-TOWNS MX/MA

	.8086

CODE	segment
	assume	cs:CODE,ds:CODE,es:CODE,ss:CODE

	org	100h	; .COM model

CW	proc

	mov	dx,0030h
	in	al,dx
	cmp	al,02h
	jne	error255
	mov	dx,0031h
	in	al,dx
	cmp	al,0ch
	je      ok
	cmp	al,0bh
	je      ok
	jmp	error255
;
ok:
	mov	dx,0472h
	in	al,dx
	cmp	al,03h
	jne	offexit
;
	mov	dx,0474h
	in	al,dx
	cmp	al,03h
	jne	offexit
;
onexit:
	xor	al,al
	jmp	exit
offexit:
	mov	dx,0472h
	mov	al,03h
	out	dx,al
	mov	dx,0474h
	out	dx,al
	mov	al,01h
	jmp	exit
error255:
	mov	al,0ffh
exit:
	mov	ah,4ch
	int	21h

CODE	ends
	end	cw
