1 XY1 (+5v) 2 Switch 1 3 X1 4 Switch 1 (GND) 5 Switch 2 (GND) 6 Y1 7 Switch 2 8 N.C. 9 XY2 (+5v) 10 Switch 4 11 X2 12 Switch 3&4 (GND) 13 Y2 14 Switch 3 15 N.C.To get button settings and joystick position you can call BIOS interrupt 15h, subfunction 84h:
INT 15 - BIOS - JOYSTICK SUPPORT (XT after 11/8/82,AT,XT286,PS) AH = 84h DX = subfunction 0000h read joystick switches Return: AL bits 7-4 = switch settings 0001h read positions of joysticks Return: AX = X position of joystick A BX = Y position of joystick A CX = X position of joystick B DX = Y position of joystick B Return: CF set on error AH = status 80h invalid command (PC,PCjr) 86h function not supported (other) CF clear if successful Notes: if no game port is installed, subfunction 0000h returns AL=00h (all switches open) and subfunction 0001h returns AX=BX=CX=DX=0000h a 250kOhm joystick typically returns 0000h-01A0h