mouse port details


can anyone give me port address & mouse port details?

I want to build a program in mouse without using device driver or interrupts.

I just want to use 'in' & 'out' instructions.


  • I'm assuming you mean PS/2 since you said "mouse port".
    Keyboard controller:
    "Mouse" PS/2 port:
    Mouse details: and and links at bottom of

    The two mini-DIN PS/2 ports are exactly identical and I have used that fact for some of my programs. I wrote one that allows you to use two keyboards in DOS, one of course plugged into the auxillary (aka "mouse") port, and some that play with the LEDs on that extra keyboard. You can identify the device type by issuing a reset (0xFF) or identify device (0xF2) command.

    There are only a few differences between communicating with devices on each port. Each has a different IRQ and you can send to/receive from the primary port naturally. Receiving from the auxillary port is also fairly natural but sending requires you issue a command to the keyboard controller to override the default behavior of sending to the primary port (this must be done for every byte sent). The only complication is that modern keyboard controllers include the ability to automatically translate scancode sets from data received by the primary port ("keyboard port"). Some do not allow you to turn this feature off which gets in your way if you wish to have a mouse plugged in there, since they do not use scancodes and the translation would corrupt mouse packets. There are other possible things can can imaginably occur, like I bet somewhere out there that there's a keyboard controller that automatically responds to resets and get ID commands without querying the external device, things like that

    When you say that you do not want to use interrupts, I assume you mean no BIOS or driver APIs but I recommend that you use the hardware interrupts for the keyboard controller.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion