Well, I did just want to run the comparable benchmark. I mean to compare with the original benchmark code. The STM8 benchmark code, seems to be comparable to the first FF code.
Well, I did just want to run the comparable benchmark,
I am using a 16 Mhz Arduino Uno. Note that the bench word has been modified to run gcd 40000 times during the test.
I am using a 16 Mhz Arduino Uno. Note that the bench word has been modified to run 40000 times during the test.
This code runs in 3898 milliseconds. Replacing u/mod drop with mod runs in 8440 milliseconds. : gcd ( a b -- gcd ) begin dup while swap over u/mod drop repeat drop ; : bench ( n -- ) ticks swap dup for r@ over for dup r@ gcd drop next drop next drop ticks swap - cr . ; 200 bench 3898 ok<#,ram>
Sorry for the late answer. I did not notice your message in the moderation queue until now. What code did you run ? With for..next and u/mod the test runs in 1.7 seconds. With for..next and mod the test runs in 3.8 seconds With do..loop and mod the test runs in 8 seconds. Same as Amforth. The word MOD is slow. It is defined using /MOD and SM/REM that then uses UM/MOD that is the basic division routine. In addition the original for..next code on that website only runs half as many iterations as the...
Sorry for the late answer. I did not notice your message in the moderation queue until now. What code did you run ? With for..next and u/mod the test runs in 1.7 seconds. With for..next and mod the test runs in 3.8 seconds With do..loop and mod the test runs in 8 seconds. Same as Amforth. The word MOD is slow. It is defined using /MOD and SM/REM that then uses UM/MOD that is the basic division routine.
You could try with LOW:0xf7 to use the full swing oscillator that has more gain. This could be a solution if the crystal is just marginally working in the low power mode(LOW:0xff).