Using BBC BASIC on a Homebrew Computer

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
DigitalDunc
Posts: 68
Joined: Fri Sep 02, 2016 6:27 pm
Location: Oadby, Leicster, UK.
Contact:

Using BBC BASIC on a Homebrew Computer

Post by DigitalDunc » Tue Jun 12, 2018 7:24 pm

Hello!

I'm giving some thought to using BBC BASIC on one of my homebrew 6502 computers. It currently uses EhBASIC but I have banked ROM and RAM support and as the memory map is quite flexibly reconfigured I started thinking it might not be all that hard...

Has anyone here done so and what is the minimum I need do to make it work?

User avatar
BigEd
Posts: 1814
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by BigEd » Tue Jun 12, 2018 8:42 pm

JGH has written a couple of helpful documents on the topic:
http://mdfs.net/Software/BBCBasic/Porting/

You need very little, I think, to just get character input and output working to see life.

User avatar
Elminster
Posts: 2000
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by Elminster » Tue Jun 12, 2018 9:25 pm

I am fairly sure someone did this, will see if I can find where.

Edit: memory misfire. I was thinking of this which is not quite the same

DigitalDunc
Posts: 68
Joined: Fri Sep 02, 2016 6:27 pm
Location: Oadby, Leicster, UK.
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by DigitalDunc » Tue Jun 12, 2018 9:48 pm

Now there's a good lead. dflat will have to come later even though it looks very interesting.

DigitalDunc
Posts: 68
Joined: Fri Sep 02, 2016 6:27 pm
Location: Oadby, Leicster, UK.
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by DigitalDunc » Wed Jun 13, 2018 7:43 pm

So from what I can gather, I only need re-implement a small subset of the MOS or modify the source and it should at the very least run? I hope I'm not missing something important...

User avatar
jgharston
Posts: 3053
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by jgharston » Wed Jun 13, 2018 9:37 pm

DigitalDunc wrote:
Wed Jun 13, 2018 7:43 pm
So from what I can gather, I only need re-implement a small subset of the MOS or modify the source and it should at the very least run? I hope I'm not missing something important...
Rather than modify the source, the simplest thing is to write a target-specific set of defines, particularly if you are controlling the implementation of the MOS API. The simplest API to use is the BBC MOS API, the source code I've made supports targetting the BBC API and the Atom/System API, and you can create a target that specifies:
* where the fixed workspace is (&400 on BBC)
* lets you move where LOMEM is stored (to avoid the 6510 I/O registers)
* how to find the bottom and top of user memory
* where FAULT and ESCFLG are
* where and what structure the OSFILE block is
* default code location
* where the MOS API is

For a version of BBC BASIC that uses the BBC MOS API the minimum you need to implement is:
* OSWRCH
* OSWORD 0 for reading a line of input
* OSBYTE &83,&84 for start and end of user memory
BRK and BRKV to receive errors
and ensure everything else just returns unchanged

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
roland
Posts: 2895
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by roland » Thu Jun 14, 2018 8:37 pm

You can start by modifying the Atom BBC MOS rom as this contains most functions (api calls)!for running BBC Basic. I was looking for the source but I could not find it. With a decent mod rom you can run BBC Bacis with no modifications at all.

That is the way Acorn implemented BBC Bacic on the Atom.
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
hoglet
Posts: 7113
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by hoglet » Thu Jun 14, 2018 9:15 pm

roland wrote:
Thu Jun 14, 2018 8:37 pm
You can start by modifying the Atom BBC MOS rom as this contains most functions (api calls)!for running BBC Basic. I was looking for the source but I could not find it.
The source is here:
https://github.com/hoglet67/AtomSoftwar ... /ATMOS.asm

Dave

DigitalDunc
Posts: 68
Joined: Fri Sep 02, 2016 6:27 pm
Location: Oadby, Leicster, UK.
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by DigitalDunc » Thu Jun 14, 2018 9:33 pm

Well, after finishing off getting my Repo sorted, I know what I'm doing this weekend. Getting familiar with the the code and making a start. I'd better post as I go.

DigitalDunc
Posts: 68
Joined: Fri Sep 02, 2016 6:27 pm
Location: Oadby, Leicster, UK.
Contact:

Re: Using BBC BASIC on a Homebrew Computer

Post by DigitalDunc » Fri Jun 15, 2018 5:12 pm

Hey, I've just been looking at the BBCBASIC source in your repo Hoglet. I take it you're using BeebAsm to build it in which case I guess life would be easier for me it I were too.

Post Reply