Joystick STICK, STRIG Use BIOS Int 15 Hex, or Direct Hardware (65195)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System for MS-DOS 7.0
  • Microsoft Basic Professional Development System for MS-DOS 7.1

This article was previously published under Q65195

SUMMARY

The way in which Basic handles joystick commands, such as the STICK function, STRIG function, and STRIG statement, depends on which kind of Intel microprocessor chip the computer has.

If the computer has either an Intel 80286 or 80386 microprocessor, the joystick commands are handled by going through BIOS interrupt 15 hex. If the computer has an 8086/8088 or 80186/80188 microprocessor, the joystick commands talk directly to the hardware.

This information applies to Microsoft QuickBasic versions 3.00, 4.00, 4.00b, and 4.50 for MS-DOS; to Microsoft Basic Compiler versions 6.00 and 6.00b for MS-DOS; and to Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS.

MORE INFORMATION

This difference in joystick handling is due to the fact that the ROM BIOS routines for handling the joystick are not reliable on the first 8088- and 8086-based machines. QB.EXE and programs compiled with BC.EXE automatically check what type of processor the machine has and use that information to decide whether to go through the BIOS or to go directly to the port for the joystick.

This implies that if problems are encountered programming the joystick in QuickBasic on an 80286 or 80386 machine, it is probably due to the ROM BIOS functions not working correctly or consistently on that machine. On 80286 and 80386 machines, QuickBasic will make generic interrupt 15 hex calls. QuickBasic should work correctly if the BIOS is handling the joystick correctly on 80286 and 80386 machines.

For more information on how to use the CALL INTERRUPT statement to invoke BIOS interrupt 15 Hex to help diagnose game port (or joystick) problems, query on the following words:

STRIG and STICK and BIOS


Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB65195