Search found 3447 matches

by MichaelW
Jun 03, 2006 15:57
Forum: Beginners
Topic: beginner's questions
Replies: 25
Views: 4218

MSVCRT.DLL exports ~755 functions, and the v0.15b header files prototype ~565.
by MichaelW
Jun 03, 2006 15:27
Forum: General
Topic: extended random function
Replies: 11
Views: 1910

If you need numbers that are “more random” that what RND can produce, and you don’t mind using a slow generator, under Windows one easy method would be to get the numbers from the cryptographic service provider. #include once "windows.bi" #inclib "advapi32" ' Not in v0.15b wincry...
by MichaelW
Jun 03, 2006 13:19
Forum: General
Topic: ASM not working...[Solved]
Replies: 14
Views: 1441

Sorry, I meant to provide the link and forgot.

http://www.freebasic.net/forum/viewtopic.php?t=4221
by MichaelW
Jun 03, 2006 11:21
Forum: General
Topic: ASM not working...[Solved]
Replies: 14
Views: 1441

Depending on the processor, the instructions, and the arrangement of the instructions, it can make very large difference. For example, if you write to part of a register, and then later read from a larger part of the register, depending on the processor your code may incur a partial register stall t...
by MichaelW
Jun 03, 2006 10:12
Forum: General
Topic: Framerate control problem.
Replies: 12
Views: 1949

This is a quick and dirty app that measures the effective resolution of various timers. The code essentially determines the mean of the step changes in the return values. #include once "windows.bi" dim as integer i dim as ulongint pcfreq, count1, count2 dim as double t1, t2, accum SetPrior...
by MichaelW
Jun 03, 2006 9:33
Forum: Beginners
Topic: Question about data types.
Replies: 26
Views: 4045

To be more precise, -1.#IND would be the result of dividing zero by zero. If you were to divide a non-zero value by zero, the result would be 1.#INF or -1.#INF, depending on the sign of the non-zero value.

IND = INDEFINITE
INF = INFINITY
by MichaelW
Jun 02, 2006 20:03
Forum: Beginners
Topic: FreeBasic vs QuickBasic speed under DOS
Replies: 23
Views: 4689

The 32-bit protected-mode executables produced by the DOS-32 version of FB require a DPMI provider. Under Windows this is no problem, and for DOS you can download the recommended one (as csdpmi5b.zip) here: http://sunsite.utk.edu/ftp/pub/djgpp/djgpp/current/v2misc/ CWSDPMI.EXE can be installed as a ...
by MichaelW
Jun 02, 2006 17:24
Forum: Beginners
Topic: FreeBasic vs QuickBasic speed under DOS
Replies: 23
Views: 4689

Here are two quick examples, no graphics. The run times are for my Windows 2000 system - the QB45 EXE might do better under Windows 9x. Compiled with QB45 : 270ms Compiled with FB 0.15b: 219ms DECLARE SUB BubbleSortStr (stringArray$()) DEFINT A-Z DIM stringArray$(1 TO 1000) C...
by MichaelW
Jun 02, 2006 13:14
Forum: Linux
Topic: Computer languege Shootout does'nt like my n-sieve
Replies: 23
Views: 5265

I’m can’t recall ever needing to perform a mod on a negative value. This should work for demonstrating the speed difference between i+i and i shl 1 on a P4. option explicit #include once "windows.bi" #include "counter.bas" counter_begin asm shl eax, 1 shl ebx, 1 shl ecx, 1 shl ed...
by MichaelW
Jun 02, 2006 10:31
Forum: Linux
Topic: Computer languege Shootout does'nt like my n-sieve
Replies: 23
Views: 5265

Thanks for taking the time to point these things out, but...

For n mod m, when m is a power of two the FB compiler (or at least 0.15b) generates n and m-1.

For a P4, the target processor in this case, i+i is faster.

http://www.agner.org/assem/
by MichaelW
Jun 02, 2006 5:14
Forum: Linux
Topic: Computer languege Shootout does'nt like my n-sieve
Replies: 23
Views: 5265

Yes, I'm aware of that. Windows.bi is included so I can utilize the high resolution performance counter for timing.
by MichaelW
Jun 01, 2006 20:00
Forum: Linux
Topic: Computer languege Shootout does'nt like my n-sieve
Replies: 23
Views: 5265

This is the fastest version so far on a P3, running in ~67% of the time for my first version, but it might not be the fastest on a P4 because shifts are relatively slow on a P4 and the loops each have a shr reg,5 followed by a shl reg,2 of the same register. A byte array version would have only a si...
by MichaelW
Jun 01, 2006 1:18
Forum: Beginners
Topic: reading ascii file
Replies: 9
Views: 1769

Yes, thanks, I am aware of that. My statement should have been “To avoid dependence on the CRT strtok function and on crt.bi, this test app uses a FB version.”
by MichaelW
Jun 01, 2006 0:24
Forum: Linux
Topic: Computer languege Shootout does'nt like my n-sieve
Replies: 23
Views: 5265

This I believe is a straightforward implementation of the specified algorithm, patterned after the C gcc version. #include "windows.bi" #include "timer.bas" #include "crt.bi" option explicit '************************************************* function nsieve( m as ui...
by MichaelW
May 31, 2006 21:53
Forum: Beginners
Topic: reading ascii file
Replies: 9
Views: 1769

Torsten, If you used the strtok function to extract the coordinates you could easily handle any reasonable separator. The strtok function is a normal component of the CRT. To avoid dependence on the CRT this test app uses a FB version. option explicit '***********************************************...

Go to advanced search