title mickey.asm:	shows differential distance of mouse movement
; illustrating the use of int 33h, fn=0bh,
;	which returns the difference (CX,DX) between curr pos
;	and the position in the last call to this function, 
;	in units of mickeys.
;	This difference is the cumulative difference, so if
;	you first move far away, but returns to original position
;	just before this interrupt, the values of (CX,DX) will
; 	guite small.
; In this example, as long as you respond with 'y', the loop
; will continue, telling you the (CX,DX) as above.
;
; EXTERNAL PROCS
extrn set_mode:near
extrn mse_init:near
if1
	include ..\mac\basic.mac
endif
.model small
.stack 200h
.data
	x	dw 0
.code
main proc
  initdata	;macro
  mov al,12h	;mode 12h
  call set_mode
  call mse_init
 ; 
   zero:
	mov ax,0bh
	int 33h
	newline
	display_it 'mickey (x,y)=('
	outhex2 cx
	display_it ','
	outhex2 dx
	get_yes_no ').  Contd? (y=yes)'
	cmp ax,1
	jne out
	jmp zero
   out:
  ;
  mov al,03h	;mode 3
  call set_mode ; restore mode
  exitdos	;macro
main endp

end main
