;++
;
; Show floppy drive types.
;
; By John Wilson.
;
; 08/23/96	JMBW	Created.
;
;--
code	segment	'code'
	assume	cs:code
	org	100h
start:	cld			;DF=0
	mov	al,10h		;CMOS address 10h
	out	70h,al		;set it
	jmp	short $+2	;hocus pocus these days
	in	al,71h		;get value
	; high nibble = A, low nibble = B
	mov	ah,'A'		;set drive name
	push	ax		;save
	call	show		;show A:
	pop	ax
	mov	cl,4		;bit count
	sal	al,cl		;shift drive type over
	inc	ah		;change to B
	call	show		;show B:
	int	20h		;later
;+
;
; Show drive type.
;
; ah	drive letter
; al	type in bits 7:4
;	0	none
;	1	360KB
;	2	1.2MB
;	3	720KB
;	4	1.44MB
;	5	2.88MB
;
;-
show:	mov	bl,al		;copy
	mov	ds:dname,ah	;save drive name
	mov	dx,offset dname	;point at string
	mov	ah,09h		;func=print
	int	21h
	mov	cl,3		;shift count
	shr	bl,cl		;get drive type *2
	and	bx,0Fh*2	;isolate
	mov	dx,ds:types[bx]	;look up type
	mov	ah,09h		;func=print
	int	21h
	mov	dx,offset crlf	;<CRLF>
	mov	ah,09h
	int	21h
	ret
;
dname	db	'x: $'
crlf	db	15q,12q,'$'
types	dw	tnone
	dw	t360
	dw	t12
	dw	t720
	dw	t144
	dw	t288
	dw	10d dup(tunk)
;
tnone	db	'NONE$'
t360	db	'360 KB$'
t12	db	'1.2 MB$'
t720	db	'720 KB$'
t144	db	'1.44 MB$'
t288	db	'2.88 MB$'
tunk	db	'UNKNOWN$'
;
code	ends
	end	start
