How fast is 8-bit 6502 CPU on famicom clone (SB2000), check this out

Started by doctorlai, February 18, 2014, 04:06:51 am

Previous topic - Next topic

doctorlai

This posts uses the following F-BASIC to compute approximation of PI, however, when N=100, it takes even a couple of seconds.

http://helloacm.com/how-does-the-8-bit-basic-perform-on-famicom-clone-subor-sb2000-fbasic-compute-pi-approximation-using-monte-carlo-method/


10 N=100
20 C=0
30 FOR I=1 TO N
40 X=RND(1000)/1000.0
50 Y=RND(1000)/1000.0
60 IF X*X+Y*Y<=1.0 THEN C=C+1
70 NEXT I
80 PRINT 4.0*C/N


F-BASIC is really really slow, because of 1. it is 8-bit, 2, it is an interpret language (not assembly).