Search found 3447 matches

by MichaelW
May 26, 2006 2:05
Forum: General
Topic: Division by zero
Replies: 6
Views: 1405

Or you could just temporarily enable the relevant exception in your code. Quick and dirty example: option explicit dim as double d1,d2 dim as ushort oldfpucw, fpucw, fpustatus asm fstsw [fpustatus] print "fpustatus = ";hex(fpustatus);"h" asm fstcw [oldfpucw] print "f...
by MichaelW
May 26, 2006 1:06
Forum: Windows
Topic: Compilation error using zlib.bi
Replies: 4
Views: 1330

For a small app where I needed only minimal functionality I just replaced zlib.bi with this: #inclib "z" declare function compress2 cdecl alias "compress2" ( _ byval dest as Byte ptr, _ byval destLen as uLong ptr, _ byval source as Byte ptr, _ byval sourceLen as uLong, _ byva...
by MichaelW
May 26, 2006 0:36
Forum: Beginners
Topic: Issue with Print #, Using when terminating with a semicolon.
Replies: 4
Views: 1062

QB will allow you to separate the printed items in a print statement with spaces or tabs, but IMO this was just another one of QB’s warts, and a feature that I think few programmers used.
by MichaelW
May 25, 2006 1:44
Forum: General
Topic: Where the Arrows are
Replies: 7
Views: 1117

Hi Jerry,

Row% and Col% are set regardless of the state of the mouse buttons. I think you need include the state of the mouse button in your “If Ke$ =” statement.
by MichaelW
May 22, 2006 22:51
Forum: Tips and Tricks
Topic: Code Timer Macros
Replies: 0
Views: 1134

Code Timer Macros

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' The TIMER_BEGIN and TIMER_END macros, along with the support code and ' data, provide a convenient method of measuring the execution time for ' a block of code. These macros must be called in pairs, and the block ' of code ...
by MichaelW
May 21, 2006 21:30
Forum: Beginners
Topic: Introduction and noob question
Replies: 3
Views: 1121

The Microsoft reference is here.
by MichaelW
May 21, 2006 20:36
Forum: Tips and Tricks
Topic: Clock Cycle Count Macros
Replies: 14
Views: 12925

Under Win i used SetPriorityClass (although i found if i run too long a test the machine hangs) The only hangs that I have encountered were with REALTIME_PRIORITY_CLASS, and this is why I use HIGH_PRIORITY_CLASS instead. REALTIME_PRIORITY_CLASS causes your process to preempt too many important syst...
by MichaelW
May 21, 2006 11:35
Forum: Tips and Tricks
Topic: Clock Cycle Count Macros
Replies: 14
Views: 12925

In [Multithreading OS]: Did you use a large enough sample run to elliminate the occasional spike due to task switchs? Using large samples is an effective method, but large samples mean long run times, and long run times mean that the results will include many interruptions. Another method is to col...
by MichaelW
May 21, 2006 0:24
Forum: Tips and Tricks
Topic: Clock Cycle Count Macros
Replies: 14
Views: 12925

If you did not control the eax value on input to cpuid then this could explain the variation under DOS. I have seen some Intel example code where the author neglected to do this. As an example (this code does not bother to determine which cpuid functions are supported): '============================...
by MichaelW
May 20, 2006 23:00
Forum: Tips and Tricks
Topic: Clock Cycle Count Macros
Replies: 14
Views: 12925

Clock Cycle Count Macros

Hello all, Here is a set of FB macros for benchmarking code. Instead of returning the elapsed time, these macros return the elapsed processor clock cycles. When benchmarking code for the purpose of optimizing/tuning it, I find the elapsed processor clock cycles to be generally more useful than the e...
by MichaelW
May 17, 2006 9:10
Forum: General
Topic: call INTERRUPT
Replies: 10
Views: 1954

For what little the information may be worth, there is a narrow range of interrupts, starting with interrupt 50h, than can, at least normally, be used from a Windows program running under Windows 98 SE (possibly all Windows 9x, but I tested only 98 SE). The call will not generate a fault, it will be...
by MichaelW
May 17, 2006 5:58
Forum: General
Topic: call INTERRUPT
Replies: 10
Views: 1954

With the DOS32 version of FreeBASIC you can call interrupts using an interface that is very similar to that of the InterruptX routine for QuickBASIC. This is one of the examples from Version 0.13 Beta: '' '' simple DOS graphics example to demonstrate DOS-specific features '' Option Explicit #include...

Go to advanced search