title DESQview Idle Function
name dvidle
include model.ash
include lattice.ash
;
;  Passes control to other DESQview tasks
;for two timer ticks. 
;
;	desqview();
;
cseg

dvflag db 80h		;-127 = unchecked, 
			;1 = installed,
			;0 = not installed
;
;Pass idle time to the other task.
;
func desqview
	cmp	cs:dvflag,0	;test it
	jz	dvz		;0=not present
	jg	dv1		;1=present

	mov	cs:dvflag,0	;assume not,
	mov	cx,'DE'		;check presence
	mov	dx,'SQ'
	mov	ax,2b01h	;"set date"
	int	21h
	cmp	al,0ffh		;FF means bad,
	je	dvz		;DV not there
	inc	cs:dvflag	;mark presence

dv1:	push	ds
	push	es
	mov	ax,101ah	;switch to
	int	15h		;DV stack,
	mov	ax,1000h	;do DV_PAUSE
	int	15h		;function,
	mov	ax,1025h	;switch stacks
	int	15h		;back
	pop	es
	pop	ds
dvz:
endf desqview

endc

	end
