#INP/OUT
Bill, Since you wrote the INPOUT DLL, I figure you must have a lot of
insight into the handling of these routines.
I need a 1 msec (+/- 20%) timed loop independent of platform. In QBX Basic
with INP/OUT the following works perfectly on any machine using a timer
chip (1.193180 x 10^6 precison ticks per second).
SUB dly1000
x% = INP(&H61)
x% = (x% AND &HFC) OR &H1
OUT &H61, x% 'enable gate disable speaker
OUT &H43, &HB0 'set mode
OUT &H42, &H89 'set lo byte(1193 precision)
OUT &H42, &H4 'set hi byte(ticks in 1 msec)
WHILE ((INP(&H61) AND 32) = 0)
WEND END SUB
The problem is using the INP/OUT routines for VB. Supposedly, in the VB
environment, once a Sub is called it runs UNINTERRUPTED by any Windows or
VB background routines. Therefore this same routine should work equally
well in VB as in QBX, IT DOESN"T! In VB the time delay from my routine is
variable from machine to machine varying 300-400%!! IN QBX environment it
runs perfectly on a XT up to a fast 386 (+/- 10-20%).
How are Basic's or C's internal INP/OUT functions compiled so differently
than those in a VB DLL or VBX? The only thing I can see is that the call
to a DLL has a much bigger 'time' overhead. Are routines like INPOUT in a
DLL handled like an overlay? Is there anyway around my problem? Your help
would be greatly appreciated. Thanks.
There are 3 Replies.