Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!uflorida!webb.psych.ufl.edu!fryman From: fryman@webb.psych.ufl.edu (Josh Fryman) Newsgroups: comp.lang.pascal Subject: Interrupts on PS/2 Model 50 Message-ID: <26158@uflorida.cis.ufl.EDU> Date: 4 Jan 91 16:55:33 GMT Sender: news@uflorida.cis.ufl.EDU Reply-To: fryman@webb.psych.ufl.edu (Josh Fryman) Distribution: na Organization: University of Florida Psychology Department Lines: 95 Greetings. I find that I am in... a rather interesting situation; one which is causing me premature hair loss, actually. Since I'm having this problem which is so baffling, it was recommended that I post a message asking any gurus to see if they might lend me a hand. I seem to be having a bit of a nasty problem with _some_ interrupts but _not_ others. I'm writing a psychology experiment program for the professors here at UF, and I need to do several things. Most of the special features are, naturally, based on interrupts, and this merely compounds my problem. I'm programming for a plain vanilla PS/2 50 (w/ mouse). I'm also using TP 5.0. I'm _trying_ to get the alarm features of the 286 to work, something they're not very keen on. Also, I am trying to install my own mouse handler (via the option in interrupt 33h, function 0Ch). The only thing I can notice it doing is: nothing. It doesn't respond. I check the values I pass into the the alarm "setter" procedure, and they check as fine. But, the program apparently would rather ignore anything that does seem to happen. The alarm features are listed below. I would MOST appreciate someone pointing out what glaring error I have made. This not the real code (ok, quite far from it), but a real watered down all-in-one program to just set the alarm and be done with it. I use the same (similar) code in my program, and it's beyond me as to what the problem is. program test; uses dos, crt; var hour, min, sec, sec100: word; regs: registers; beeper: pointer; procedure alarm; interrupt; begin sound(250); delay(250); nosound; end; begin clrscr; getintvec($4a, beeper); setintvec($4a, @alarm); fillchar(regs,sizeof(regs),0); gettime(hour,min,sec,sec100); with regs do begin ah := $06; ch := hour; cl := min + 1; dl := sec; Intr($1a, regs); end; setintvec($4a, beeper); repeat until keypressed; end. And yes, I am aware that if I run this at the wrong time, it will not function because I didn't program it (here) to do a minute roll-over. The real program has these safety features. As I mentioned before, the other problem I have is the mouse event handler. The code I wrote works great on my XT (gag) at home (with a LogiTech mouse that responds fine to Intr 33h functions). It goes something like this: Force far calls on (since it's an event handler); declare the handler as an interrupt so TP will save the necessary DS registers so I can access my globals; read ALL CPU registers and STORE them in a local array; perform functions; move CPU registers BACK onto the stack; exit. The problem here is a little more straightforward. It wedges the system. As in power off and power back on. But that's NOT all. If I do this, in conjunction with my alarm interrupts, my keyboard interrupt (which works fine), and my time interrupts, it's nice enough to reset the computer for me. As in RESET. As in go back to square zero, do the tedious memory check, etc, etc. Neat! I would list the code, but it's rather long. As I recall, some people have been asking around for a mouse unit in TP. I guess I'm willing to resign on this and use the same thing if someone can point out where I can grab one. This big questions are: these things work fine on my machine (well, I can't try the alarm features since it's an XT), so are the interrupts different on a PS/2? If not, what IS the problem? I use similar convention for polling the interrupts (specifically, the time interrupts; replacing the system timer and monitoring the real time clock) and these features work great. Why do these work, but not others? My reference (one of the better ones I have) for the interrupts came from "PC System Programming" by Abacus books. thanks for any information that can be offered and for reading this far, Josh