code1	segment 'code'
assume CS:code1,DS:code1;
org	100h
main	proc
	jmp	init
count	db	3
disk	db	0
int1c:	push	ax
	push	bx
	push	dx
	mov	dx,3f2h
	mov	al,00000000b
	out	dx,al
        mov	ax,1001h
	mov	bh,0
	int	10h
	cmp	disk,2
	je	diskB
diskA:	cmp	count,0
	je	run2A
	dec	count
	mov	al,00010000b
	out	dx,al
	mov	ax,1001h
	mov	bh,2
	int	10h
	jmp	fin
runB:	mov	count,3
	mov	disk,2
diskB:	cmp	count,0
	je	runA
	dec	count
	mov	al,11110001b
	out	dx,al
	mov	ax,1001h
	mov	bh,4
	int	10h
	jmp	fin
runA:	mov	count,3
	mov	disk,0
	jmp	diskA
run2A:	inc	disk
	mov	count,3
fin:	pop	dx
	pop	bx
	pop	ax	
	iret
main	endp
init	proc
	mov	ax,251ch
	mov	dx,offset int1c
	int	21h
	mov	dx,(init-main+10fh)/16
	mov	ax,3100h
	int	21h
init	endp
ends	code1
end	main