BBC BASIC for the MEGA65?

There are 210 replies in this Thread which has previously been viewed 42,979 times. The latest Post (August 30, 2021 at 4:47 PM) was by FeralChild.

  • Richard Hallas : I'm sure, compared to my experiences with it, you are clearly the expert in BBC BASIC II. ;)

    Do you have a recommendation for a BBC emulator in Linux? There are some of them, but is there a "one and only" emulator? I just want to test some BASIC II programs with it to get a closer feeling for the BBC BASIC in version II.

  • Do you have a recommendation for a BBC emulator in Linux? There are some of them, but is there a "one and only" emulator? I just want to test some BASIC II programs with it to get a closer feeling for the BBC BASIC in version II.

    There's Brandy Basic (sudo apt-get install -y brandy on ubuntu 18), and there is of course Richard Russell's BBC Basic for SDL which also runs on Linux (Please login to see this link.). Brandy Basic is not as full featured (and therefore a bit closer to the 8-bit-BBC BASIC), whereas Richard Russell's version contains everything including the kitchen sink :)

  • Do you have a recommendation for a BBC emulator in Linux? There are some of them, but is there a "one and only" emulator? I just want to test some BASIC II programs with it to get a closer feeling for the BBC BASIC in version II.

    There's Brandy Basic (sudo apt-get install -y brandy on ubuntu 18), and there is of course Richard Russell's BBC Basic for SDL which also runs on Linux (Please login to see this link.). Brandy Basic is not as full featured (and therefore a bit closer to the 8-bit-BBC BASIC), whereas Richard Russell's version contains everything including the kitchen sink :)

    Thanks, i have both of them installed yet. Are the compatible to version II? That's why I want to use a BBC emulator. Just the "real feeling". ;)

  • At least I don't know of a version of BASIC II for Linux... so maybe you'll have to try this... Please login to see this link. ;)

  • Do you have a recommendation for a BBC emulator in Linux? There are some of them, but is there a "one and only" emulator? I just want to test some BASIC II programs with it to get a closer feeling for the BBC BASIC in version II.

    As far as I'm aware, the BBC emulator that's generally considered best is BeebEm, which can be found here:

    Please login to see this link.

    I'm primarily a Mac user these days, and to my great frustration there isn't currently a really decent BeebEm port for the Mac. (There used to be, but no longer; I hope it comes back.) I rarely use Linux personally, but I think the Unix BeebEm is in line with the Windows version. There are others, of course, including a promising-looking new one called b2, but overall I think BeebEm is still top of the pile.

    To be fair, it's a little while since I looked at b2. If you want to investigate it, it lives here:

    Please login to see this link.

  • Do you have a recommendation for a BBC emulator in Linux? There are some of them, but is there a "one and only" emulator? I just want to test some BASIC II programs with it to get a closer feeling for the BBC BASIC in version II.

    As far as I'm aware, the BBC emulator that's generally considered best is BeebEm, which can be found here:

    Please login to see this link.

    Thanks! :thumbup:

    The latest Linux version of beebem Please login to see this link. and didn't run with my Linux version (Linux Lite 4.8).

    But I read Please login to see this link. that I can use the latest Please login to see this link. with Linux using wine. That works perfect for my use! :)

    Is this "BBC Model B" the correct one for using it with BBC BASIC II? Or are all model use version II?

    Please login to see this attachment.

  • The latest Linux version of beebem Please login to see this link. and didn't run with my Linux version (Linux Lite 4.8).

    But I read Please login to see this link. that I can use the latest Please login to see this link. with Linux using wine. That works perfect for my use! :)

    Ouch! Sorry about that! I read:

    "To run the latest Windows version of BeebEm you will need Windows XP or later (v4.03 runs on Windows 98). The UNIX version will run on most UNIX based systems and Linux."

    …and assumed that it meant that the Windows and Linux versions were in synch.

    It does annoy me how many things are written ONLY for Windows. Oh, I know the arguments… but it still annoys me. I hate Windows with a passion.

    Anyway, in that case you may well like to try b2. I should probably have recommended it more strongly in the first place, because (a) it's in active development, (b) it's available for Windows, Mac and Linux (as far as I know…!), and (c) the author is a well respected Acorn guy who knows what he's doing. I just don't really care for its user interface, personally; I like software that takes proper advantage of the host OS rather than providing its own menu system etc. But it's actually a very promising emulator. The core emulation is probably better than BeebEm, though it doesn't support as much optional hardware.

    Is this "BBC Model B" the correct one for using it with BBC BASIC II? Or are all model use version II?

    That'll be fine. To summarise the situation briefly…

    • Early BBCs from 1981 had BBC BASIC I; I don't imagine that emulators typically include this.
    • Later BBCs from 1982 onwards had BBC BASIC II, as did the Acorn Electron.
    • BASIC III may have appeared on B+ machines; I'm really not sure. However, it's essentially identical to BASIC II and just accommodated some alternative spellings for the US market, I think (notably COLOR and COLOUR).
    • BASIC IV is on the Master 128 series machines, and does contain a number of enhancements. In fact, the Master Compact had a further enhanced version of BASIC IV, better than that on the earlier Master machines (despite retaining the same number).
    • BASIC V was very significantly enhanced, but of course arrived on the Archimedes and was never available for the 8-bit BBC.

    As an intriguing aside, the Cambridge Z88 portable computer – which was the last machine made by Sinclair, after he'd sold his name to Amstrad – also included a Z80 version of BBC BASIC. And it also included a very good integrated software suite (word processor, spreadsheet, database etc.) called PipeDream, which had started life on the BBC Micro as the VIEW family, got built into the Master series and ended up as a powerful integrated package (again called PipeDream) on the Archimedes. And it's still available today, for free and with source… It's always rather intrigued me how the Z88 was launched as a Sinclair machine with lots of Acorn software built into it, in effect. Especially after all the rivalry in the early days!

    Anyway, I'm getting carried away! :smile:

    The bottom line is that any BBC will do for your BASIC testing. The BBC B runs BASIC versions I to III, but they're all essentially the same. And the Master runs BASIC IV, which is somewhat enhanced but (I think) a complete superset of the previous versions, so wholly compatible. Indeed, the backwards compatibility is retained in the later ARM versions too.

  • The bottom line is that any BBC will do for your BASIC testing.

    Thanks again for your time and your great explanations! :thumbup:

    I also think that the BeebEm running with wine is more than sufficient for my use of testing some BASIC II routines and commands. I just want to get more familiar with it, I don't have plans to write very big and complex BASIC II programs on the emulator. ;)

  • Do I understand it right, that e.g. a ?4000 = 25 equates a POKE 4000,25 and a PRINT ?4000 equates a PRINT PEEK(4000) in BBC BASIC II?

    Yes, that's right. ? in BBC BASIC is equivalent to both PEEK and POKE, but it's far more flexible and efficient, not least because you can use it in expressions more straightforwardly.

    Tonight I have played a little with the BeemEm and I needed some time to get used (again) to the BBC BASIC. I have played something with the "?" command and my first tries with it work fine.

    Please login to see this attachment.

    Please login to see this attachment.

    Some impressions from my first try with the BBC BASIC II:

    What is immediately noticeable when you have been to Commodore computers a lot lately is the lack of a full-screen editor. I have often caught myself simply moving the cursor up and trying to type or change the text directly. Until I remembered the COPY button, it went great again. However, the one command line is definitely a change if you haven't been there for a long time or never before. ;)

    Apart from that, the version II of the BBC BASIC is brilliant, especially for its age! Sure, in many ways different from the Commodore-BASIC, but with many advantages.

    For example, I wasn't aware that the BASIC II already knew procedures. Even recursively and with multiple call parameters. I entered the example listing from the BASIC document of the Please login to see this link. and I am thrilled at how elegantly this can be solved. We are talking about a BASIC from the year 1982! 8o

    Please login to see this attachment.

    Short conclusion: I don't want to type anything with the BASIC 10 anymore. :D

  • Short conclusion: I don't want to type anything with the BASIC 10 anymore.

    You Traitor ! Your sleeping time is taken !

    :biglach:
    :wink:

    PS:It is nice to follow this discussion !
    How would a modernized BBC BASIC on a modernised 8-bit machine look like ?

    Please login to see this link. <- here you can find all MEGA65 related files, games, etc.

    Please login to see this link. <- MEGA65 main Homepage. links to all important MEGA65 sites (links on top of the page to Files, Forum, GitHub, Manual,etc.)

    Please login to see this link. <-Pauls Blog - constant updates about current tasks, project status, etc.

    Please login to see this link.,Please login to see this link. <- All Open-Source information regarding MEGA65. Found Bugs ? create an issue there please!

    Please login to see this link. <- Join for live chat support and more --- The Future is 8-bit !!!

    Edited once, last by adtbm (February 4, 2021 at 2:47 AM).

  • What is immediately noticeable when you have been to Commodore computers a lot lately is the lack of a full-screen editor.

    Yes, that's my feeling, too.

    The immediate successor of the BBC Micro (the BBC Master 128) solved the problem by including a full screen editor you could launch with *EDIT (if you're using BeepEm, you can also try the Master emulator and try it for yourself)

    For example, I wasn't aware that the BASIC II already knew procedures.

    Not only that but also multiline functions (which work exactly the same way as procedures, they're defined with DEF FN, may span multiple lines of code and return the result with the "=" operator). And: local variables. Anything declared with LOCAL after a procedure or function definition is local to that procedure.

    Short conclusion: I don't want to type anything with the BASIC 10 anymore. :D

    That's exactly my problem, too :) As much as I love the feeling of hacking something together in BASIC10 (I mean, hey, look at Yaped32 and Eleven... ;)), it always feels like stepping back into the worst part of the dark ages, compared to BBC Basic.

    I can completely understand when people say "hey but we should keep it 'the commodore way' and I want to be compatible with all what went before", but at least for me all those sentiments went away once I started using BBC Basic for a few hours...

  • How would a modernized BBC BASIC on a modernised 8-bit machine look like ?

    I could very well imagine a version of BBC BASIC using the OPEN ROM kernal's screen editor, plus (optionally) an advanced port of Eleven's text editor if you want to skip using line numbers completely.

    That would make the "feeling" of entering programs no different than under BASIC10, yet give users all the advantages that BASIC10 has to offer.

    We could even offer a nice graphics package that uses VIC IV's Full Colour Text Mode without having to implement anything new in BBC BASIC itself, as all graphics commands are wrapped through the control codes (so for example when you type LINE x1,y2 TO x2,y2, BBC Basic simply generates the proper control code sequence and sends it to the BBC Micro's version of CHROUT...)

  • Short conclusion: I don't want to type anything with the BASIC 10 anymore.

    You Traitor ! Your sleeping time is taken !

    :biglach:

    Hey this is not fair! I only used my toilet time for this. ;)

    How would a modernized BBC BASIC on a modernised 8-bit machine look like ?

    To avoid copyright/legal issues we can rename the BBC BASIC to CBB (Commodores Better BASIC). :D

  • The immediate successor of the BBC Micro (the BBC Master 128) solved the problem by including a full screen editor you could launch with *EDIT (if you're using BeepEm, you can also try the Master emulator and try it for yourself)

    Thanks for the hint! Do you know how I can run a typed BASIC program out of the editor?

    Please login to see this attachment.

  • Thanks for the hint! Do you know how I can run a typed BASIC program out of the editor?

    Shift+F4 and then type "BASIC" when prompted for the language (and then 'RUN' ;))

  • Thanks for the hint! Do you know how I can run a typed BASIC program out of the editor?

    Shift+F4 and then type "BASIC" when prompted for the language (and then 'RUN' ;))

    Thanks! That works. :thumbup:

    Was it too easy for Acorn to use one if the twenty function key options for a simple "RUN program"? :D

    Edit: Oh, I have to load the program from disc after returning to the editor after doing a RUN? :(

  • What is immediately noticeable when you have been to Commodore computers a lot lately is the lack of a full-screen editor. I have often caught myself simply moving the cursor up and trying to type or change the text directly. Until I remembered the COPY button, it went great again. However, the one command line is definitely a change if you haven't been there for a long time or never before. ;)

    Apart from that, the version II of the BBC BASIC is brilliant, especially for its age! Sure, in many ways different from the Commodore-BASIC, but with many advantages.

    @ubik has beaten me to answering your points specifically! :smile: However, I wanted to say a couple of things anyway. I really enjoyed reading your message, seeing your little code snippets and how you enjoyed experiencing the power of BBC BASIC.

    Another point worth mentioning about BBC BASIC is that it's actually really fast. It typically outperforms other versions of the language because it's efficiently implemented as well as being well designed. Plus, it has an inline 6502 assembler… really, it would be ideal on the MEGA65.

    As has been mentioned, BBC BASIC has both DEF PROC and DEF FN (which exit with ENDPROC and = respectively), and of course they support local scope. In BASIC V (but unfortunately not earlier versions as far as I recall), you can also use RETURN with parameters passed to functions and procedures to update your choice of variables passed to the FN/PROC.

    BBC BASIC is an astonishingly full-featured, highly structured, fast and elegant version of the language… and actually it dates from 1981, not 1982! The BBC Micro actually dates from late 1981, and early ones came with BASIC I fitted; BASIC II is just the bug-fixed version that became standard. It was truly amazing for its time (and, as noted, BASIC V added a LOT of really useful new features).

    Concerning editors… of course, that's a matter of the OS itself rather than the version of BASIC, so the complaint about the single-line interface (and ability to copy characters from elsewhere on the screen) is an issue with Acorn MOS rather than BBC BASIC! :smile: But yes, I agree; I always found it rather slow and cumbersome myself.

    I started out on a Commodore PET 2001, and one of its most fun features was the full-screen editor. However, its version of BASIC was just unspeakably terrible. I'm sorry, but it really was. I didn't know that at the time, of course, because I was completely new to computers, so I loved the PET anyway. But all those control codes to move the cursor… All the gobbledegook characters… All that PEEKing and POKEing in order to do anything remotely useful… Hideous with hindsight!

    A couple of years after my first experience with the PET, I got a Sinclair ZX81, and even given what a cheap and cheerful low-powered machine it was, it actually had a really good version of BASIC on it (and a superb manual). It was on the ZX81 that I really learnt BASIC 'properly' with a decent version of the language. Then I got a Spectrum, and that was a very much improved version of the ZX81. These Sinclair machines had a rather unusual command-line interface that had some real shortcomings (notably how it slowed down, the longer the line got, and you couldn't move up/down between multiple wrapped lines either!). However, one really great feature was that it was absolutely impossible to enter a line with syntax errors in it. You had to write a line of coherent code before the machine would accept it, and that was great for learners.

    Then I got a BBC and BBC BASIC was clearly the best version yet. Actually, Sinclair BASIC's unusual, non-standard string handling was way better – the best approach to string handling I've ever seen, whereas BBC BASIC had the standard, and clumsy, LEFT$, RIGHT$ and MID$ – but in pretty much all other ways, BBC BASIC was clearly the best version. I did find the command line a little inefficient for editing listings, but it wasn't markedly worse than anything else, and of course most other computers worked in a very similar way. (Amstrad, notably, copied the BBC approach explicitly, as I recall.) Commodore was really unusual to have its full-screen editor. If only its version of BASIC had been half-decent! But it was easily the worst on the market by a huge margin, sadly.

    It was interesting that other machines got better inbuilt editors a generation later:

    • The Spectrum 128 got quite a nice full-screen editor, still with interactive syntax checking.

    • The BBC Master got its separate full-screen editor as seen above, invoked with *EDIT.

    • Interestingly, the BBC Master also got an enhanced editing command, EDIT (without the leading *) to provide some pretty powerful new editing features at the regular command line.

    I do think that BBC BASIC on the MEGA65 would work incredibly well in combination with the full-screen editor approach that's already present, though.

  • Edit: Oh, I have to load the program from disc after returning to the editor after doing a RUN? :(

    Ah, after reading Richard Hallas ' reply I realized, you need "EDIT", not "*EDIT". Oh well it's been a while.

    Asterisk+EDIT knows nothing about BASIC... :( But EDIT does and initializes with the current BASIC program...

  • I do think that BBC BASIC on the MEGA65 would work incredibly well in combination with the full-screen editor approach that's already present, though.

    The BBC BASIC II really impressed me. So far I only had experiences with version V on the Archimedes and I am surprised what version II can do. 8o

    I was so convinced and "hooked" that I will definitely dig a little deeper into this topic and try first of all to bring BBC BASIC II to the C65/MEGA65 so that it "just works". First of all without any frills, just the "core", pure BBC BASIC II.

    And if that works someday, then gradually expand with the editor, adaptations to the C65 and so on. It's no need to hurry, the C65 is old and the BBC BASIC II is more older ... :alt:

  • I was so convinced and "hooked" that I will definitely dig a little deeper into this topic and try first of all to bring BBC BASIC II to the C65/MEGA65 so that it "just works". First of all without any frills, just the "core", pure BBC BASIC II.

    In the meantime, the sources to BBC Basic IV have also surfaced:

    Please login to see this link.

    Maybe that's also worth looking into... ;)

    p.s.: and as I already said, if you need help, give me a ping. I'm a lousy 6502 programmer, but this stuff is definitely worth it.

    Edited once, last by ubik (February 4, 2021 at 6:36 PM).