john@fornax.UUCP (special) (05/10/88)
I need some help in trying to write a C program to read the output of a Logitech 3-button mouse through the COM1 port of my IBM-PC clone. I CAN read the mouse by polling the COM1 port, but this is NOT satisfactory because any reasonbly long program to manipulate the input data and display it on the CRT ends up missing some of the data that the mouse is sending. So then I tried to write an interrupt-driven routine to put the output of the mouse into a buffer which the program could read at its own pace. This has NEVER worked at all; the interrupt never seems to ocurr????? FACTS: -I am using C86PLUS. -I am using propper DOS routines to establish the interrupt-handler (through the functions provided for doing so in C86PLUS). -I am using interrupt vector 0C(hex). -I have tried setting the 8259 PIC interrupt mask to every conceivable combination. -I enable interrupts on the serial card by setting the register addressed at 03F9(hex) to 1 and the register addressed at 03FC(hex) to 8. -IF I SEND SOFTWARE INTERRUPT INT(0C) FROM WITHIN THE PROGRAM, THE INTERRUPT-HANDLER IS CORRECTLY ENTERRED AND EXITED FROM. SO THE PROBLEM seems TO EXIST ON THE HARDWARE SIDE????? -I have tried this out on MORE THAN 1 PC and also an AT and the same (lack of) results. QUESTIONS: 1.) Can anybody tell me FOR SURE what I am doing wrong in the above? 2.) As an alternative to using interrupts, do mice respons to XON/XOFF or to RS232 "control" signals (like DSR, CTS,...) so that you can control WHEN they send out their data? 3.) Is there a reference that deals SPECIFICALLY with the control of a mouse ( I already have 5 or 6 books on DOS technical references, assembly language programming for the IBM-PC,... but NONE of them address the issue of MICE directly although some have information on interrupt-driven Serial Ports which I have followed religeously to no avail). PLEASE, HELP ME before I go crazy! Thanks, John