🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1723

Programming the Mouse

#1723
From: Gene E. Johannsen
Date: Mon, 30 Jul 1990 18:24
55 lines
1592 bytes
	I am writing a program that I want to use the mouse with.  I don't
have a reference work to the mouse so I am using a list of interrupts.  Below
is a small program I writing to learn how to use the mouse.  All it will do is
set up and turn on the mouse and then print an '*' when I press the left
button.  It prints the '*' but freezes immediately afterwards:

.MODEL	SMALL

.CODE

;-----------------------------
;Initializes a Hardware mouse
;-----------------------------
	mov ax,0009h	;
	mov bx,0001h	;define text cursor
	mov cx,0000h	;
	mov dx,0008h	;
	int 33h		;
	
	mov ax,000ch	;
	mov cx,0002h	;define interrupt subroutine parameters
	es:		;
	lea dx,BUTTON	;
	int 33h		;
	
	mov ax,0001h	;show mouse cursor
	int 33h		;

	mov ah,08h	;pause until a key is pressed
	int 21h		;

	int 20h		;exit program


;------------------------------------------------------
;BUTTON
;Prints an '*' when the left button is pressed.
;------------------------------------------------------


BUTTON		PROC	FAR
	push ax		;This is where the problem comes.  It prints 
	push dx		;the '*' okay, but then it freezes.
	mov ah,02h	
	mov dl,2ah
	int 21h
	pop dx
	pop ax
	ret
BUTTON		ENDP

	END

gene@uokmax.ecn.uoknor.edu
Technical Details
Message-ID: <1990Jul30.182430.7493@uokmax.uucp>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ogicse!unmvax!uokmax!gene

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ogicse!unmvax!uokmax!gene
From: gene@uokmax.uucp (Gene E. Johannsen)
Newsgroups: comp.os.msdos.programmer
Subject: Programming the Mouse
Message-ID: <1990Jul30.182430.7493@uokmax.uucp>
Date: 30 Jul 90 18:24:30 GMT
Organization: Engineering Computer Network, University of Oklahoma, Norman, OK
Lines: 55