Post Reply 
FORTH for the SHARP PC-E500 (S)
11-08-2021, 04:22 AM
Post: #52
RE: FORTH for the SHARP PC-E500 (S)
(09-15-2021 11:51 PM)xerxes Wrote:  
(09-12-2021 02:00 AM)robve Wrote:  - improved execution speed and reduced code size

I'm really impressed. I no longer expected the project to be completed.
Would be nice to have Forth500 in the n-queens benchmark list too.

Forth500 n-queens benchmark on the PC-E500S: 4.15s

A little over 4 seconds on a standard PC-E500S machine with no enhancements.

By comparison, BASIC takes 1:19 minute and assembly code is of course the best at 0.114s.

I ran NQUEENS four times to get 16.6s repeatedly with +/- 0.2s deviation in the 16.6s stopwatch timing. The value S=876 is displayed.

The n-queens code in standard Forth using VALUEs instead of VARIABLEs:



  0 TO SS
  0 TO XX
      1 +TO SS
      XX TO YY
      BEGIN YY 1 > WHILE
        -1 +TO YY
        0= SWAP ABS XX YY - = OR IF
          0 TO YY
            -1 +TO XX
    YY 1 = UNTIL

  ." S=" SS .

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
FORTH for the SHARP PC-E500 (S) - Helix - 09-06-2021, 11:41 PM
RE: FORTH for the SHARP PC-E500 (S) - robve - 11-08-2021 04:22 AM

User(s) browsing this thread: 1 Guest(s)