I got here backwards
It was my interest with hobby programming which led me to CNC…and then on to lathe work.
This is a program which will show you
BASIC counting to 9,999,999
ASM counting to 999,999,999
The difference in raw power is mind boggling
BBC Basic for windows is the only “easy” programming language I know of which allows you to put machine code instructions into a higher level language
this is the code:
———————————–
REM count to a billion
DIM P% 70
A%=1
[
mov eax,1
.addup
inc eax
cmp eax,999999999
jb addup
ret
]
PRINT “ASM is counting to 999,999,999”
PRINT ~ USR(addup)
PRINT “Finished”
A%=1
B%=0
PRINT “Basic is counting to 9,999,999”
10
B%=B%+A%
IF B% < 9999999 THEN GOTO 10
PRINT “Finished”
———————————
You can download the compiled program here.
I’m just an enthusiastic amateur btw, groping in the dark, so don’t get too technical if there are any questions
The choice is quite stark
If you need raw number crunching power and pure speed then you really have no choice because ASM can count to a billion up to 100 times faster than BASIC can count to 10 million.
In this example program BASIC is only doing 1% of the work that ASM has achieved
Edited By ady on 09/12/2011 05:57:33