Using INTERRUPT 15 hex for Time Increments Less Than 1 Second (65927)
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 Q65927 SUMMARY
The resolution of the ON TIMER (n) GOSUB statement is limited to
increments of 1 second.
The following are three separate methods to work around this
limitation (to obtain a smaller time interval):
- Use BIOS INTERRUPT 15 hex, with function 86 hex (or, in decimal,
INTERRUPT 21 with function 134) for resolution at intervals of 976
microseconds (976 millionths, or .000976 of a second).
- Use BIOS INTERRUPT 1A hex (26 decimal) with function 0 for a
resolution at about 18.20648 ticks per second (or .05492549
seconds).
- Use the ON PLAY statement for resolution at 30 times per second
(or .0333333).
This article describes method 1 above. To find two additional
articles, which explain methods 2 and 3, search in this Knowledge Base
for the following exact words:
Basic and timer and increments and smaller and second
This information applies to Microsoft QuickBasic versions 4.00, 4.00b,
and 4.50, 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.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB65927 |
---|
|