Posts from Snoopy in thread "BBC BASIC for the MEGA65?"

    Hi Snoopy, great that you are going forward with this mammoth project.

    I have a question out of interest (keep in mind that I know nothing about BBC Basic or the Mega 65):

    As far as I understand there are BBC Basic implementations for many systems. Now you say that you can't be compatible with BBC Basic (but will try to be compatible as much as you can). Is there something fundamentally different between the Mega65 and other computers that have BBC Basic implementations, that make BBC Basic implementations possible on those but not on the Mega65? Or would you consider most of those implementations as not real BBC Basics, just "compatible as much as possible", similar to your project?

    Is there even a specification of BBC Basic? Or would you only accept a Basic that runs any program that was written for Acorn computers as BBC Basic?

    Hello Freudentaumel, I probably expressed myself a little unhappily. I try to formulate it a little differently:

    BBC BASIC was actually programmed to be very portable back around 1980 by Please login to see this link.. Basically the BBC BASIC 2 runs on almost every 6502, if you provide a few - clearly defined - OS routines for input and output. But on a system with a maximum of 64 KB RAM!

    For the C64 there is for example such a Please login to see this link., which also runs in the C64 mode of the MEGA65:

    Please login to see this attachment.

    There are also many other implementations of the BBC BASIC (also on Z80 processors etc.), which I would call >99% BBC BASIC compatible. To my knowledge there is no "official" and generally valid language specification of the BBC BASIC.

    What I meant in my post and what is important to me, is to make an implementation as close as possible to the program code of the original BBC BASIC. I would like to write not a BASIC, which behaves "only" in such a way like the BBC BASIC (which is already compatible), but a BASIC, which uses - so far possible - also the original program routines, thus actually "is" like the BBC BASIC 2.

    But with the restriction that I want to use the extensions of the MEGA65 (at least theoretically). And that means that I want to "teach" the BBC BASIC to run on a computer which has a lot more as 64 KB RAM and also has a lot more to offer than the BBC computer on which it originally ran.

    And especially I find the memory handling of the C65/MEGA65 anything but "easy to maintain". This has also annoyed and frustrated me so much that I have already thought about a voluntary root canal treatment without anesthesia at the dentist - just for relaxing! ;(

    The entire concept of the C65/MEGA65 harmonizes relatively well with the BASIC 10 (or with the more advanced BASIC 65 in the case of MEGA65). After all, it was especially written for this machine. But unfortunately not so much with a "6502 - BBC BASIC" (out of the box). For this, the hardware is then nevertheless too different to the BBC computers.

    And this is where my ambition starts, to achieve a good compromise between "maximum original code" and "reasonably well adapted to the MEGA65".

    And if all fails, I know where my dentist is ... :D

    I would like to give a short sign of life here after a long time! :)

    I am still interested in a conversion of the BBC BASIC for the MEGA65 and also busy for some time with it. As it is so often, it does not run as straight as one has imagined it at first. From the - as so often - not too abundant free time were also "wrong ways" to cope with.

    My first attempt was to port the BBC BASIC IV, whose source code is available, 1:1 to the MEGA65. A wish, which showed up however still short time and some discussions with a few "BBC cracks" as "small nightmare". At least 20-25% of the source code would have to be changed, so that it would be theoretically executable at all. And then not a single bit is adapted to the hardware of the MEGA65. So a rather pointless plan. :/

    That was also mainly the reason, why my second plan was to port then the BBC BASIC 2 (6502), whose source code is also available. Also for this I had interesting exchange with people from the "BBC environment". I also started here first attempts of the conversion and was confronted then however also here with the fact that the hardware architecture of the C65/MEGA65 differs so quite from that of the BBC models. Just because the 6052 is "the same" doesn't mean anything for the rest of the architecture. The C65 is already a "challenge" for programming. More than once I have cursed this architecture (especially the memory handling). ;(

    But the C65/MEGA65 fits very well with the BASIC 10 from Commodore. The BASIC 10 was written on the hardware body of the C65 and fits therefore like the proverbial lid on the pot. The BBC BASIC 2 (6502) does not fit on it at all. Too much is simply different with the MEGA65 than with the BBC computer. My second plan is to be regarded therefore also rather as "failed". :(

    After a certain "frustration phase" concerning the conversion, however, the ambition seized me again and I thought to myself: "You know something about the C65 ROM and the BBC BASIC 2 ROM you have read through so to some extent with the appropriate books and also practically played around with it at the Acorn Electron. Why not try to combine this knowledge and write a BASIC for the MEGA65, which is as far as possible compatible to the BBC BASIC, but adapted to the peculiarities of the MEGA65?" :idea:

    I then used to sit down in my spare minutes and gradually unravel the BBC BASIC 2 ROM in such a way that I kept the routines that run without modification on the MEGA65 more or less as they were, and programmed those that had to be different for the MEGA65 accordingly. Always with the thought in mind to deviate from the BBC BASIC 2 ROM routines only as far as necessary. And so the days, weeks, months went by ... as said, the spare time is always "too little" anyway. :loet

    In the meantime, the interpreter routines are running reasonably well, so that I can now occupy myself more with the implementation of the individual BASIC commands. I baptized the BASIC on the name "B-BASIC". Combined somehow the "B" with the BBC BASIC, to which I want to keep maximum possible compatibility with the "B" for a second BASIC for the MEGA65.

    Most of the B-BASIC is so far "invisibly" hidden under the hood. So far, you can see rather little on the screen. The CLS command to clear the screen works and with PRINT I can print text.

    Please login to see this attachment.

    This was by far the most time consuming "Hello World!" I have programmed so far. :D

    But despite all the frustration on the way so far, it was also fun. And I learned a lot in the process. 8)

    Until the ROM with the B-BASIC can be used even halfway for programming, it will surely take more than a few weeks. In this respect I would commit myself with a statement to a release date at most to a concrete decade. :whistling:

    I just wanted to let you know that I'm still interested in it and that I'm working on it within the limits of time. Even if the thread here has been paused for a while now, the idea is still not "dead".

    Today three books arrived, which I had printed from the corresponding "remastered" PDF files from an online provider. This makes it easier for me to quickly look up something and also to enter my own notes with the pen. "Old fashion style" ... :)

    Please login to see this attachment.

    If you are interested in how ordering your own books, I have also created a post (in German): Please login to see this link.

    By the time I get more and more the idea that this two alternatives make much more sense to people who just want to start again with Basic programming

    I think no one who only wants to start with BASIC again would buy a MEGA65 for that. ;)

    There are many good BASICs for modern PCs (e.g. Please login to see this link.) and even some BBC-BASICs for it (e.g. Please login to see this link., a fork of that: Please login to see this link. or Please login to see this link.) all for free. So there is really no need to spent some money only for programming in (BBC) BASIC.

    And of course the MEGA65 is only "for fun". No one would use it in an actual productive way. It's a hobby project and will be used for hobby experiences. Everything (and I mean really everthing!) regarding to the MEGA65 was, is and will be only for fun. But at lot of fun! :)

    But is the aim to port 6502 BBC BASIC to the MEGA65 or to create a BBC-like BASIC for it?

    Originally my intention was to use the existing source codes for the BBC-BASIC IV and to transfer it as 1:1 as possible to the MEGA65. For this I have occupied myself more near with the BBC BASIC, read a lot about it and also led with some "BBC cracks" mails discussions about it. With the C65/MEGA65 I occupy myself already somewhat longer.

    Finally it turned out that the hardware of the BBC and the C65 are simply too different, in order to take over the BBC BASIC "identically". The source code of the BBC-BASIC IV for example would have to be adapted and reworked to at least 25% to be executable on the MEGA65 at all. And then you would have "only" a version which could neither recognize nor use the extended memory "banking". Not to mention graphics and sound. This would make little sense and the ratio of effort to benefit would be much too low.

    Since some time I follow a different approach and take the existing BBC-BASIC 2 sources and try to "rebuild" the BBC-BASIC for the MEGA65. So it should not be a 1:1 conversion with 100% conformity to "all memory addresses", but a BBC-BASIC for the MEGA65 which should be as compatible as possible to the BBC-BASIC, but should also be able to use some advantages of the MEGA65.

    I am here "still at the beginning", program first test attempts and read me still more detailed into the BBC-BASIC ROM, in order to be able to convert as exact a compatibility as possible. What goes and is meaningful take over, but also a few changes "accept". For example, using the full screen editor of the C65 instead of the line based input with COPY key. I see this for example as an advantage, which justifies for me a break to the 100%-BBC-BASIC.

    But - as written - there I am still "at the beginning" and it will surely take some time until something can be delivered on this. Family, homeschooling of the children and regular work slow this down unfortunately again and again. ;)

    One thing this thread has definitely done: There is now an Acorn Electron here. :D

    Hey, welcome to the Acorn party :)

    Thank you! You are the second "guilty" who infected me with the BBC virus. :)

    Yes, the Electron looks really nice. He is a "small one", but he can already do quite a lot. ^^

    (we should take care not to talk too much about these things, otherwise adtbm might cut the heating to our cabins and make us renumber 5000 lines of BASIC2 spaghetti code by hand as a disciplinary measure!! ;)))

    You are allowed to use BASIC 2? You lucky man! That's my working place in the cabin:

    Please login to see this attachment.

    Richard Hallas : Thank you very much! And again many thanks for your post with many background information to the topic. :thumbup:

    Your posts here in the thread are also significantly "guilty" that I deal more closely with the BBC BASIC of the 8bit generation. As written here before, my first contact with BBC BASIC was an used Acorn Archimedes 3000, which is still here. But I had nothing to do with BBC 8bit computers until recently.

    I had a lot to do with UK computers (besides the C64) in the 1980s (Sinclair ZX80, ZX81, Spectrum and QL, Please login to see this link. and Please login to see this link.), but never a BBC computer from Acorn.

    The more astonished I was and am, how good and well thought out these computers were at that time. You can see a coherent concept of hardware and software. Basically the opposite of the approach of Commodore. :D

    Alone before the BBC BASIC 2, I really take off my hat! What here - also "under the surface" - of really good thoughts are in it, all my greatest respect! I prefer to spare myself a comparison with BASIC 2 from the C64. ;(

    As a teenager I probably wouldn't have been able to appreciate it that much. Topics like "Who can I trade games with for this?" and similar thoughts had priority. But nowadays, looking back, I can only say "Wow!". Some people at Acorn really put a lot of thought into this! :thumbup:

    And this fascination awakened in me also led to the fact that I snapped up the Electron offer. Even without the Plus 1 expansion I have a lot of fun programming and testing on it. I still have an old cassette recorder and it is now connected to the Electron and reliably stores and loads my short programs. "Back to the roots" in its purest form!

    The keyboard of the Electron is really good for that time and it even offers 80 characters per line (mode 0). I dreamed of this when working on the Spectrum 48k.

    I also think that the Electron is the least powerful of the 8bit-BBCs, but to get a taste of "real" programming with BBC BASIC II it serves my intended purpose for now. I just enjoy typing on it and inserting a cassette to load and save and rewind properly. Breathing more "real" 8bit air is almost impossible. :)

    So thanks again for your great posts on this. I always enjoy reading them and take a lot from them on the subject. And who knows, maybe it really wasn't the last 8bit BBC acquisition I made. I find this topic exciting and interesting in any case. Many thanks for your great input! :thumbup:

    One thing this thread has definitely done: There is now an Acorn Electron here. :D

    I had a good opportunity to get one and grabbed it. The computer came with an introduction tape and a German manual.

    Please login to see this attachment.

    Being involved with BBC BASIC made me interested in looking at these computers "in real life". The BBC computers passed me by completely at that time. As it turns out, completely wrongly. The BASIC is from 1981 (the Electron from 1983) and really ahead of the other 8bit computers of that time.

    Please login to see this attachment.

    I love this old hardware: The computer has almost 40 years on the hump and was probably 30 years somewhere on an attic. It arrives, I plug it into the power supply, connect it to the monitor with video cable, turn on the power and it works. No need to "repair, install or register" anything. Just turn it on and begin to work. :thumbup:

    Now I can check even more "stylishly" if everything works as it should be "in the original". :D

    My only regret is that it hasn't been possible to get a definitive statement about the ownership of BBC BASIC. It's frustrating to be so close and yet unable to proceed as desired!

    After some research and mails it seems that most propably the current owner of the BBC BASIC (at least version 2) is a company named Please login to see this link.. And also most propably they don't know about having the rights. ;)

    In the year 2005 the rights of the Electron ROMs (which also includes BBC BASIC 2) were in the hands of "Pace Micro Technology plc", which was renamed 2008 to Please login to see this link.:

    The Electron system ROMs are copyright Pace Micro Technology PLC, Please login to see this link.. They do not fall under the GPL.

    2016 Pace got together with Arris:

    On 22 April 2015, the Boards of Pace and Arris Group announced that they had reached agreement on the terms of a recommended combination of Pace with Arris, [...]

    The company received the last of the regulatory clearances needed to allow the merger to proceed in December 2015. The acquisition was completed on 4 January 2016. The resultant combined group is incorporated in the United Kingdom, but operationally managed from the United States, and is owned 24% by Pace shareholders and 76% by Arris shareholders.

    And 2019 Arris was bought by CommScope:

    On April 4, 2019, CommScope completed the acquisition of Arris International, a telecommunications equipment manufacturing company and owner of Ruckus Networks. Both Arris and Ruckus were made brands of CommScope.

    You can see the results, if you want to call Please login to see this link. you will land at the site of Please login to see this link.

    And CommScope is still active with "network stuff".

    I don't want to ask them about the rights, but it's most propably, that they have them (and it's better they never know). ;)

    Here is a short post to the current status:

    I have been in exchange with Dave, who has provided the source code of the BBC BASIC 4r32, and there are still some major problems to handle.

    As e.g. mentioned Please login to see this link., there are some small but potentially "crucial" differences between the 65C02 processor for which the source code is intended and the 65CE02 processor in the C65/MEGA65.

    In addition, the C65/MEGA65 still has the "chaotic" memory management, which also makes the port more difficult.

    Summary: The C65/MEGA65 seems to be pretty much the inappropriate machine to run the BBC BASIC 4r32 as a "simple copy" of the sourcecode. That probably means a few special rounds to dig me through, why and what are causing the problems. So, I'm working on it, but please do not expect a result next week. ;)

    Richard Hallas : I'm always very careful in legal software stuff, so I ask you once again. It's just for getting sure. I hope that's okay for you. :whistling:

    So yes, it's true to say that BBC BASIC is not free of rights. BUT the people who own those rights (and they are known even without sight of the piece of paper that says so – there's no-one else to be accountable to!) have given us explicit permission to do what we want.

    You had with these people mail contact and you have informed them that there are considerations to port the BBC BASIC (6502) on the MEGA65? And they all did not contradict that?

    So at least in the hobby area here would not be feared of legal issues in your opinion?

    I make some progress with porting it, but sadly only very slow. Besides lack of enough sparetime - here, less the BBC BASIC (6502) is the problem, but rather the "really crazy" storage management of the C65/MEGA65. I can only explain that so that the developers have probably considered how to use this maximum awkward. :D

    If there's anything further I can do to help with this, please let me know.

    I have another question, if you don't mind. :whistling:

    I have read these two books about the BBC BASIC ROM:

    - "BASIC ROM User Guide" (1984) from Mark Plumbley

    - "The Advanced BASIC ROM User Guide" (1984) from Colin Pharo

    They are great and full of valuable infos, but sadly "only" for BASIC 1 and BASIC 2. Most of the infos are of course helpful also for the BASIC 4.32, but I'm also interested in such a book mainly about the BASIC 4.32 ROM.

    Have you ever heard or read something about such a book by chance? Does such a book exist for BASIC 4.32 ROM? Unfortunately, I haven't had any success with my search so far. :(

    In terms of workload, it makes a big difference whether you try to get the existing 6502 BBC BASIC to work on the MEGA65 or whether you implement a BASIC V from scratch. In addition to the open sources for BASIC V for the Archimedes, there are also some compatible versions that are also open source (e.g. Please login to see this link.).

    But they all have the common "problem" that they are not available in the 6502 code, but for the ARM2 ... or in C.

    In order to implement this on the MEGA65, you probably need a similar or even more time than creating your own BASIC from scratch.

    And then the question arises whether a native "BBC compatible" BASIC on the MEGA65 is really worth the effort of building a new BASIC from scratch? I would speak of years of work with, if this can only be done in free time!

    There is a BASIC 10 for the MEGA65, which is also continuously improved with the new ROM. Even if it will of course never be a BBC BASIC due to the concept.

    So it takes very good reasons for someone to start porting the BASIC V to the MEGA65. This is really a lot more effort compared to porting the BBC BASIC (6502).