Comment Re:Commodore BASIC (Score 1) 213
The integer math was way slower than floating-point in Commodore BASIC V2.0. It was basic interpreter fault, so no one really wanted to use integer variables in basic.
A lot more high level constructs were added on Commodore 128, but most of them were quite limiting.
Programing on 1MHz CPU using BASIC to do more than text input / output was hard, but one could toggle some sounds, sprites or graphic modes poking RAM. For anything more complicated was way to slow. Commodore 128 had built in assembler, unlike C64.
Basic commands were tokenized. Example:
hit SHIFT + C= to switch to lowercase mode. Following text is caps sensitive:
10 fO x= 0 to 15: pO 646,x: ? "Hello world.": nE
lI
10 for x= 0 to 15: poke 646,x: print "Hello world.": next
ready.
This example uses 46 bytes of RAM and some more for the x variable. If typed without spaces a lot more bytes could be freed, but it would make the program hard to read. Also the Commodore BASIC v2.0 offered some typing optimization, example one could type IF X=Y THEN 300 instead of THEN GOTO 300. I guess it all was an effort to save RAM. I did not consider BASIC v2.0 bad, I used to code in assembler when I needed speed.
A lot more high level constructs were added on Commodore 128, but most of them were quite limiting.
Programing on 1MHz CPU using BASIC to do more than text input / output was hard, but one could toggle some sounds, sprites or graphic modes poking RAM. For anything more complicated was way to slow. Commodore 128 had built in assembler, unlike C64.
Basic commands were tokenized. Example:
hit SHIFT + C= to switch to lowercase mode. Following text is caps sensitive:
10 fO x= 0 to 15: pO 646,x: ? "Hello world.": nE
lI
10 for x= 0 to 15: poke 646,x: print "Hello world.": next
ready.
This example uses 46 bytes of RAM and some more for the x variable. If typed without spaces a lot more bytes could be freed, but it would make the program hard to read. Also the Commodore BASIC v2.0 offered some typing optimization, example one could type IF X=Y THEN 300 instead of THEN GOTO 300. I guess it all was an effort to save RAM. I did not consider BASIC v2.0 bad, I used to code in assembler when I needed speed.