BASIC v2.0 / Commodore programming help. C128/64 hobby refinement
1 28 Feb 2017 04:54 by u/seeking_virtue
I have a beginner's grasp on linux, and have been seeing a large revival for the commodore systems stuff. When I was younger, I got to play around a bit on the C128, but never really got refined in BASIC 2...
Voaters with knowledge, please share. I am looking to start with some BASIC programming skills. I found an old C64 for sale, and am looking to purchase, but currently am running emulation. Thanks.
2 comments
2 u/svipbo 01 Mar 2017 21:26
A very thorough look at the C64. https://www.youtube.com/watch?v=ZsRRCnque2E
1 u/effusive_ermine 01 Mar 2017 07:26
Commodore BASIC 2.0 is a stripped down dialect of Microsoft BASIC. Much of it is quite similar to BASICA and GWBASIC. The C128 actually has a more powerful BASIC available in native mode. Programs may be developed interactively, in a manner similar to the REPL of modern interpreters.
It is a line numbered dialect, so entering a line number by itself without any code erases any existing line of that number. If you want a blank line for pretty formatting, you'll need to use a REM command or bare : (colon character) to store the line into memory.
There is no virtual memory, so your program text can't grow beyond the internal RAM of the computer. There is also a limit on variables because storage is allocated in static, linear blocks for each variable.
Variable names are limited to two characters. Don't worry about running out of names because you're much more likely to run out of RAM first. (You may actually use longer names, but only the first two characters are significant.)
Variables are typeful and postfix sigils distinguish types. Strings are distinguished by $ (dollar sign), integers by % (percent sign), and floats by no sigil.
There are user defined functions, but you have to write them in 6502 assembly language. There are specific rules for argument passing, but I can't remember them. Most peeps just store everything global variables and used subroutines to modularize the code.
Forget doing functional or OO: you're stuck with imperative.