Getting Started in BBC Basic
bbcmicrobot.com
bbcmicrobot.com
For example, you could declare something like this to move two bytes from F% to T%:
870 DEF FNMOVW(F%,T%)
880 [
890 OPT pass%
900 LDA F%
910 STA T%
920 LDA F%+&1
930 STA T%+&1
940 ]
950 =pass%
And then reference it from somewhere else like so: 220 OPT FNMOVW(&52,&4B)
And the resulting code would be inlined into your assembly. It made for shorter and more readable assembly.Being able to inline assembly would have made it so much easier to experiment and learn!
I might use such a thing for some projects I'd like to build.
SCREEN 1 CIRCLE 25, 25, 10
Then it seems that the framebuffer isn't enabled by default in some Linux distros, so you can't just write a command line tool that draws on the screen for whoever...
Still, maybe I'll experiment with it for a home slot machine project I'm working on.
#include <stdlib.h>
#include <vga.h>
int main(void)
{
vga_init();
vga_setmode(G320x200x256);
vga_setcolor(4);
vga_drawpixel(10, 10);
sleep(5);
vga_setmode(TEXT);
return EXIT_SUCCESS;
}
Sure, not quite as simple as a BASIC program, but very familiar to those of us who grew up with BGI in Pascal or C.I wonder if things would be different if every web browser came with a user-friendly (and beginner-friendly) programming environment.
Really? I think most Logo derivatives, Microsoft Small Basic (Windows only), SdlBasic, QB64, and lots of others have more convenient graphics than JS with the Canvas API.
Also had to unlearn BBC ADFS directories. True hierarchical directories were hard to comprehend because I had learned ADFS directories, where you have 26 of them, they are single letter prefixes to files and not hierarchical.
Any talk of BASIC being useful is nonsense. BASIC was pushed on to the home micro scene by Microsoft. This held us back.
The benefits of this initial learning/experimentation vastly outweighed any bad habits picked up or 'unlearning' required.
Microsoft got started as a language developer which made every thing a lot more accessible.
The idea they "pushed it" onto the home micro scene is nonsense - Microsoft was small enough to be pushed around by much larger vendors at the time, and were cheap.
Jack Tramiel at Commodore infamously received an offer for $3 per unit, and supposedly countered with a $25k offer for a perpetual license (they did end up negotiating a new agreement when releasing the C128, as the license only applied to versions of BASIC already released at the time it was entered into, but by then they'd shipped millions of units).
ADFS supported hierarchical directories with name limits the same as files (IIRC 10 characters?).
Sounds like you are thinking of the earlier DFS.
> hard to unlearn line numbers
That seems odd. Where was your sticking point with them?
I started out with BBC BASIC, eventually with a little 6502 assembly for a few bits & bobs, and had no trouble at all seeing the benefit of dropping that bit of structure when I started tinkering with QuickBasic and then C on a PC.
In fact if you had a BBC machine new enough to support ADFS, then you had one with a BBC BASIC version that supported procedures and functions in a way that allowed line numbers to be effectively ignored (no GOTO/GOSUB needed) in many cases. In fact there were methods to write without them (write the code in a text editor, like the one built in to the Master series, I forget its name, then TYPE it from the file to "add" the line numbers for the interpreter to like).
BASIC was invented at Dartmouth in the 1960s[1] as a simplified programming language for beginners, and was well-suited to microcomputers because of its interactive user friendliness and minimal resource requirements. Microsoft deserves credit for fitting a usable computer language into a few kilobytes (!) of memory.
Alternatives such as Forth or assembly language were not as beginner friendly, and languages like Pascal or C had higher RAM and storage requirements and were not interactive like BASIC.
BBC BASIC was a powerful and friendly environment that was neither written by nor "pushed" by Microsoft. Rather, it was pushed by the BBC, resulting in a generation of computer enthusiasts and professionals.
BASIC might very well have been the best choice for those casually interested in computers. Educators would have preferred others though (Pascal, Scheme and COMAL come to mind). FORTH would have scared away most customers, but amazed and inspired others (I sadly discovered it only after its prime).
Turbo Pascal didn't require (much) more memory than elaborate BASIC implementations and ran at reasonable speed even on a Z80. Not quite the same interactivity of an interpreter perhaps, but not much behind. It came late to the scene though.
BASIC worked out of ROM and a few kilobytes of RAM, and was easy to learn.
As you note, Turbo Pascal - a nice environment with a fast one-pass compiler - came out later. It does seem to have had a cassette version at some point, but it required more RAM than BASIC and was harder to learn. Nonetheless it was highly successful and its descendant Delphi is still used today.
It's hard to get Scheme to run in a few kilobytes, but it would be fun to try. Primitive LISPs did seem to exist on microcomputers but only gave you a few atoms and cons cells because of memory limits.
COMAL was largely based on BASIC but never caught on as widely.
In any case, I don't think Microsoft gets the credit or the blame for BBC BASIC. (There were also versions of microcomputer BASICs from companies other than Microsoft, dating to the early 1970s.)
disclaimer: I've only seen it running in an emulator like the BBC Micro bot; it looks cool though. ;-)
BBC Basic let you very easily write structured programs without a single GOTO if you wanted.
BASIC existed on many different platforms (including mainframe and minicomputers) long before MS got in on the act (see also the sibling comment here about when BASIC was invented).
> Any talk of BASIC being useful is nonsense.
Now, this is nonsense. I started with Apple BASIC in 1979, then simply due to curiosity learned many other languages (many have fallen by the wayside, 6502, FORTH, Pascal, COBOL) and it bootstrapped my career as a software developer which I still do to this day (like many others of my generation).
All your other comments about having to "unlearn" stuff was perhaps your problem; apropos directory representations, by 1987 due to work and college I worked with multiple different OS directory mechanisms including ADFS, RDOS, AOS, VMS, CP/M, MSDOS and UNIX. Not that big of a deal and just made the week more interesting.
The problem isn't learning BASIC, it's learning it (or anything else) exclusively for a long time. I learned 8-bit microcomputer BASIC first, too (several different dialects). And then, within a handful of years of being exposed to BASIC, I also learned some Logo, quite a lot of Turbo Pascal, DOS batch programming, and probably one or two other things I'm forgetting at the moment. None of them were really hard transitions, but I was learning them when I had a concept of programming but not a completely ossified one from long and exclusive exposure to a single language family.
> Any talk of BASIC being useful is nonsense.
Of all the many languages I learned before learning assembly, unstructured BASIC did the most to prepare me for assembly, so I think it was quite useful.