Search found 3384 matches

by srvaldez
Jul 21, 2024 0:58
Forum: General
Topic: Pentacles
Replies: 155
Views: 20362

Re: Pentacles

clever blue screens :lol:
by srvaldez
Jul 16, 2024 14:10
Forum: Beginners
Topic: Elderly User
Replies: 10
Views: 631

Re: Elderly User

there's also DOSBox-X https://dosbox-x.com/ out of the box, that is, without any modification to the dosbox-x.conf, DOSBox-X supports the mode command to change the number of columns and rows of text, for example mode con cols=132 lines=60 changes the character display to 132x60, which is worlds bet...
by srvaldez
Jul 14, 2024 14:06
Forum: Beginners
Topic: Elderly User
Replies: 10
Views: 631

Re: Elderly User

perhaps FreeDOS would be agreeable to him? https://www.freedos.org/ you could then use QB45 or if you like, FreeBASIC although, if he uses certain libraries that could pose a problem I would explore the use of FreeDOS but I simply can't stand the 80x25 character screen, why hasn't anyone written a g...
by srvaldez
Jul 14, 2024 12:09
Forum: Community Discussion
Topic: ChatGPT
Replies: 31
Views: 5081

Re: ChatGPT

to be honest, I didn't think much of these so called AI chat-bots, but I found them to be useful at explaining certain things, for example, I came across some C code macro "do{ ... }while(0) " and was puzzled about it, ChatGPT explained that the do{ ... }while(0) construct is needed for sa...
by srvaldez
Jul 12, 2024 16:27
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

Code: Select all

Sub on_init( ) 'constructor
note that constructor is commented-out and nowhere is Sub on_init( ) called, so it's not executed as you say
but I agree with you that inline-asm is probably not as efficiently handled by the compiler as it could be or as one would like it to be
by srvaldez
Jul 12, 2024 13:26
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

@deltarho[1859] in the following code, carry and Q() are initialized to certain constants and the Sub on_init( ) is demoted to a simple sub the purpose is to show that your original and the asm-free version give the exact same result except for the times your original et = 0.363885799964464 sum = 21...
by srvaldez
Jul 12, 2024 12:11
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

I ran a very simple test in 32-bit Dim As long i dim as ulongint sum dim as double t t=timer sum=0 for i=1 to 100000000 sum+=CMWCdw next t=timer-t ? "et = ";t ? "sum = ";sum ? "press return to end" Sleep if I use the ms runtime __rdtsc() the time is .243 seconds if I us...
by srvaldez
Jul 12, 2024 11:27
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

@deltarho[1859]
the result of your original version and that of the asm-free version should be identical, if not, then I messed up somewhere in the translation
[edit] unless, using __rdtsc() differs from calling rdtsc from asm
by srvaldez
Jul 12, 2024 11:04
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

@deltarho[1859] would you post your benchmark code? as for uadd_overflow see https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html basically, it does what the name suggest, it adds the first 2 arguments into the third and returns false if no overflow occurred and true if overflow occurre...
by srvaldez
Jul 12, 2024 2:01
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

@deltarho[1859] for gas or gas64 you need the built_in library from https://www.freebasic.net/forum/viewtopic.php?p=302896#p302896 and replace extern "C" Declare Function __builtin_uadd_overflow (Byval As Ulong, Byval As Ulong, Byref As Ulong) As Boolean declare function __rdtsc() as ulong...
by srvaldez
Jul 11, 2024 22:39
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

hello deltarho[1859] please test the following adaptation, it should be functionally equivalent to your original except that no asm is used and compiles and runs ok in 64-bit extern "C" Declare Function __builtin_uadd_overflow (Byval As Ulong, Byval As Ulong, Byref As Ulong) As Boolean dec...
by srvaldez
Jul 11, 2024 18:58
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

thanks dodicat
"any mare comments" 🤣
by srvaldez
Jul 11, 2024 18:11
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

I thought that it was obvious, the point is to rewrite EngineCode in FB without asm, I am confident that it's simple enough to do
but I will refrain from making any mare comments
by srvaldez
Jul 11, 2024 17:17
Forum: General
Topic: CMWC8 PRNG
Replies: 30
Views: 1287

Re: CMWC8 PRNG

I ran the code temporarily making the HammingSeed32 function return reproducible numbers to make reverse engineering easier Function HammingSeed32() As Ulong Dim As Ulong CopySeed, numBits Static as ulong Seed=123456789 'While Not ((numBits > 14) And (numBits < 18)) While numbits <> 16 Asm 'rdtsc ' ...