Article View: comp.os.msdos.programmer
Article #1730Re: Programming the Mouse
From: David M. Read
Date: Tue, 31 Jul 1990 05:54
Date: Tue, 31 Jul 1990 05:54
35 lines
1591 bytes
1591 bytes
In article [abridged] gene@uokmax.uucp (Gene E. Johannsen) writes:
!>
!> 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
!>
!> [...]
!>
!>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
>
I may be wrong here, but shouldn't this be an 'iret' instruction? After
all, the routine *is* an interrupt service routine, called by a hardware
interrupt...If you return with a regular 'ret' call, none of the registers
are popped off the stack and restored to their state before the interrupt,
and the CPU doesn't know where to pick up, so it *should* freeze!
-Dave
Technical Details
Message-ID:
<34725@ut-emx.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!ut-emx!walt.cc.utexas.edu!readdmReferences:
<1990Jul30.182430.7493@uokmax.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!ut-emx!walt.cc.utexas.edu!readdm From: readdm@walt.cc.utexas.edu (David M. Read) Newsgroups: comp.os.msdos.programmer Subject: Re: Programming the Mouse Message-ID: <34725@ut-emx.UUCP> Date: 31 Jul 90 05:54:46 GMT References: <1990Jul30.182430.7493@uokmax.uucp> Sender: news@ut-emx.UUCP Reply-To: readdm@walt.cc.utexas.edu (David M. Read) Organization: UT-Austin / Jerry's Kids Lines: 35