Open Source BBC Micro In JavaScript
Thursday, 15 May 2014

The BBC Micro was a revolutionary computer that had a worldwide impact. Now you can try it out in JavaScript in your browser.

What can be done with JavaScript today is impressive, but is emulating a 32K BBC Micro an indication of how powerful JavaScript is or is it an indication of how feeble home computers were?

The BBC Micro is a special computer because it introduced a generation in the UK to programming and it led to the creation of the ARM processor that is almost universal in mobile devices. It was also the inspiratins for the amazingly successful Raspberry Pi - which has a model A and B just like the BBC Micro to show its roots. 

 

bbcmicroexpertguide

 

Matt Goodbolt has just created an open source emulation of a 32K BBC Micro model B, jsbeeb, using nothing but standard JavaScript and what is really noteworthy is that he has started to describe how it all works.  

So far we only have an account of how the CPU was emulated. There are a number of 6502 emulators including some in JavaScript. If you think that emulating a CPU is a big problem - it is, but you have to keep in mind that processors like the 6502 have only a single byte op code. This results in a total of 256 possible op codes and in practice most of these aren't used. So what you need is a big select to dispatch each op code to a routine that processes it. In practice, for efficiency reasons, it is better to use a dispatch table of 256 references to funcitons that implement each of the operations. 

The 6502 may be a simple CPU, but getting it right so that it can be used to run real software is still a big problem. There are bugs in the hardware that are often made use of by anti-copy and security code and these have to be emulated if you want commercial code to run unmodified.

Then there is the small matter of timing. The code running in the emulator might well check to see how long an instruction took as judged by the way other peripherals change state. Matt Goodbolt's article describes how attention to timing was all-important for most software protection - read the article for the fine detail.

Of course, a machine is a lot more than just its CPU and we are promised more about the screen and peripheral emulation in a future part. 

 

BBCMICROelite

 

You can try the emulation out at jsbeeb and once you have it running you can use all the BBC Micro commands and you need to know that F0 is F10, the Break Key is F12 and the "star" key is on the 2 key or the @ key. There is a disk image supplied with one of the most famous games on the BBC Micro - Elite. To run it enter *Elite3 and follow the instructions. 

Of course you could always download the code from GitHub and install it on your own server. 

Banner


ROI Survey
30/11/2014

What computer language repaid your investment in learning and can you thank your school, or any traditional educational establishment for the experience?



Google's New NoCaptcha Captcha
04/12/2014

We all hate them, but captcha's are a useful tool in keeping spam bots out of all sorts of opt-in lists. Now Google has offered us all a free captcha that, in most cases, doesn't ask the user anything [ ... ]


More News

 

blog comments powered by Disqus

 

<ASIN:0130031615>

Last Updated ( Thursday, 15 May 2014 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.