.model FLAT
PUBLIC _fdc_IrqHandler
PUBLIC _fdc_IrqWait
_intend PROTO
.data
	__fdc_fire BYTE 0
.code
_fdc_IrqHandler:
	pushfd
	or [__fdc_fire], 1
	push eax ;This register is used in _intend.
	push 6
	call _intend
	add esp, 4
	pop eax
	popfd
	iretd
_fdc_IrqWait:
	xchg bx, bx
	mov eax, 10000
	_loop_ret:
		dec eax
		jz _loop_end
		hlt
		and [__fdc_fire], 1
		jz _loop_ret
	and [__fdc_fire], 0
	_loop_end:
	ret
END