About BBC Basic 4

bbc micro/electron/atom/risc os coding queries and routines
drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

About BBC Basic 4

Post by drfloyd » Fri Jun 12, 2020 8:24 am

Hi folks :)

As you perhaps know, I am discovering BBC computers (i am french)

Is it true that BBC basic 4 was perhaps the fastest 8bit basic ? I tried it with emulator, and yes, it seems faster than Locomotive Amstrad Basic

Can ye compile BBC basic program into .EXEcutable ?

What is your opinion about this basic compare to Amstrad & Spectrum basic ? Capacities, advantages, speed....

Thanks

User avatar
Andrew_Waite
Posts: 239
Joined: Tue Aug 30, 2016 3:58 pm
Contact:

Re: About BBC Basic 4

Post by Andrew_Waite » Fri Jun 12, 2020 2:05 pm

The Wikipedia article (below) on the Rugg/Feldman benchmarks (used by PCW magazine back in the day) found that BBC BASIC was the fastest of the 8-bit BASICs. The reference does not give a figure for Locomotive BASIC and I guess this figure for BBC BASIC is for BASIC2 rather than BASIC4. It would be interesting to generate comparative figures for Locomotive BASIC and BBC BASIC4.

https://en.wikipedia.org/wiki/Rugg/Feldman_benchmarks

There are another set of benchmark results here :

http://www.geocities.ws/peterochocki/co ... pcwbm.html

Locomotive BASIC is fast and well featured. It was developed from Locomotive Software's BASIC for the the BBC Micro's Z80 Second processor.

I learnt to program in Sinclair BASIC on my ZX81. It was slow and did not have the features of BBC BASIC, but because the Sinclair machines were so affordable millions of us cut our programming teeth using this language.

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Fri Jun 12, 2020 3:04 pm

These benchmark confirm that BBC basic is the fastest ! But version 2 I suppose... apparently V 4 is fastest !

i just try the test 7 on Amstrad CPC (21sec on BBC) :

about 29sec !!!!!

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

Re: About BBC Basic 4

Post by BigEd » Fri Jun 12, 2020 4:38 pm

(I wouldn't want to take away from BBC Basic, but in this test Mallard Basic puts up a good showing.)

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Fri Jun 12, 2020 4:50 pm

I have tested with Basic 4, it is more fast !

and then with Basic 4 + co pro 6502... more more fast !!!

It's betwen x3 and x6 more fast than Amstrad Commodore,Atari basics !

Impressive veru impressive 8bit basic

Naomasa298
Posts: 391
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: About BBC Basic 4

Post by Naomasa298 » Fri Jun 12, 2020 5:00 pm

drfloyd wrote:
Fri Jun 12, 2020 4:50 pm
I have tested with Basic 4, it is more fast !

and then with Basic 4 + co pro 6502... more more fast !!!

It's betwen x3 and x6 more fast than Amstrad Commodore,Atari basics !

Impressive veru impressive 8bit basic
Yes, however, many games write directly to screen memory for speed and you can't do that with a co-processor. You have to use legal OS calls.

You can certainly write passable games in BASIC, and indeed, many have been - although these are usually things like text adventures. Even so, with a bit of creativity, you can do amazing things.

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

Re: About BBC Basic 4

Post by BigEd » Fri Jun 12, 2020 5:10 pm

Naomasa298 wrote:
Fri Jun 12, 2020 5:00 pm
... many games write directly to screen memory for speed and you can't do that with a co-processor.
True, but not as complete a barrier as it might seem - see RobC's emulations of Speccy and his Doom for example. (Code running on the second processor cannot directly access screen memory, but it's possible to add features to the communication channel to create some interesting and efficient protocols for sending updates.)

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Fri Jun 12, 2020 5:39 pm

i think about creating a pure basic space role game for BBC.... I need to think about that !

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: About BBC Basic 4

Post by Richard Russell » Fri Jun 12, 2020 10:49 pm

It may be worth noting that BBC BASIC (the language) isn't particularly fast, it's Sophie's interpreters that are fast! There's nothing about the syntax of the language that would be expected to make it faster than any other BASIC, if anything the opposite is the case. Indeed my versions of BBC BASIC never have been noted for their speed: my Z80 version was written with code compactness as a higher priority than execution time (the entire interpreter was ony 12K) and it ran significantly more slowly on a 4 MHz Z80 than Sophie's did on a 2 MHz 6502.

User avatar
helpful
Posts: 634
Joined: Tue Sep 22, 2009 1:18 pm
Location: London
Contact:

Re: About BBC Basic 4

Post by helpful » Fri Jun 12, 2020 11:44 pm

Not being quite as good as Sophie is something we can all aspire too! :)
RISC OS User Group Of London - http://www.rougol.jellybaby.net/
RISC OS London Show - http://www.riscoslondonshow.co.uk/

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sat Jun 13, 2020 7:48 am

Hello Richard, nice to "met" you. Anyway BBC Basic 4 on 6502 2mhz is incredibly FAST. (I have tried about all the basic 8bit)

Just for that reason, I want to buy a BBC Computer !!!! :mrgreen:

Great job Sophie.... but.... How is Sophie ?

I am french, and do not know the historic of BBC Computr & his Basic.

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

Re: About BBC Basic 4

Post by BigEd » Sat Jun 13, 2020 9:09 am

There are profiles of Sophie around the web, as she has various honours for engineering, but perhaps start with this one:
http://www.computinghistory.org.uk/det/ ... ie-Wilson/

Sophie and Steve Furber did a lot of the foundational work and have been generous with interviews, so you'll find lots by both of them about both of them. Perhaps start here
Some interesting Steve Furber observations

Some more good history in this thread
"Outline specification for the BBC MICROCOMPUTER system"

There's a thread elsewhere too, which I recommend (well, I started it...)
Acorn's BBC micro - some resources

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sat Jun 13, 2020 5:10 pm

thanks

I learn lot of things

I NEED A BBC COMPUTER !!!!!!!!!

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sun Jun 14, 2020 7:03 am

hi again

is Basic IV the best Basic version for BBC computers ?

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

Re: About BBC Basic 4

Post by BigEd » Sun Jun 14, 2020 7:31 am

Pretty much. If you run a second processor then HIBASIC gives you more space. There was a third party Advanced Basic which might be like a Basic V, but I don't know much about it - it's certainly not widely used.

See
http://mdfs.net/Software/BBCBasic/BBC/

It's not a Basic question, as such, but the Graphics Extension ROM is an upgrade. Again, it's not very widely used. In fact there seem to be several:
http://mdfs.net/System/ROMs/Graphics/

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sun Jun 14, 2020 8:08 am

ok

Hi Basic is a Rom to add, it is not include ?

Second Processor 6502 is easy to find for a BBC Master ?

User avatar
danielj
Posts: 8445
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: About BBC Basic 4

Post by danielj » Sun Jun 14, 2020 9:26 am

If you get a Master it has BASIC 4 in it by default. You don't need to get it separately. The second processor, you can use PiTubeDirect with a Master either on the external socket, or using an internal adaptor. If you want a real one you might have to search a bit harder but they do crop up from time to time.

If you use MOS 3.5 in a Master 128 (the later but slightly less compatible version of the operating system), it will automatically relocate BASIC if you use a coprocessor so there is no need to source a separate Hi-BASIC.

You can't actually put BASIC 4 in a BBC Micro unless you change the processor to a CMOS one, and that's a whole different world of pain (and might introduce incompatibilities, as most software will assume that a BBC Micro will have BASIC 1 or 2).

d.

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: About BBC Basic 4

Post by richardtoohey » Sun Jun 14, 2020 9:30 am

drfloyd wrote:
Sun Jun 14, 2020 7:03 am
is Basic IV the best Basic version for BBC computers ?
"Best" for what? If you want the most compatible version, then BASIC 2, probably.

"Best" will depend on your use case and whatever it is that you want to achieve.

User avatar
danielj
Posts: 8445
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: About BBC Basic 4

Post by danielj » Sun Jun 14, 2020 9:45 am

richardtoohey wrote:
Sun Jun 14, 2020 9:30 am
"Best" for what? If you want the most compatible version, then BASIC 2, probably.

"Best" will depend on your use case and whatever it is that you want to achieve.
^^ This :)

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sun Jun 14, 2020 11:19 am

best in term of speed and instructions

I suppose is is possible to create a BBC Basic 2 compatible program with Basic 4 ?

There are tools to compile a basic program into an executable ?

(With Amstrad CPC, I can compile a .BAS into .BIN with a CP/M utility... and the program run 2 ou 3 faster)

User avatar
danielj
Posts: 8445
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: About BBC Basic 4

Post by danielj » Sun Jun 14, 2020 12:18 pm

No, BASIC is just interpreted. The maths functions are faster in BASIC 4, I doubt in practice you'd notice any difference. BASIC 2 programs should run on BASIC 4 for the most part, but if you use any of the newer functions in 4 they won't work in 2 (e.g. the filled plotting routines etc).

Have a look at the wikipedia article, it gives a good overview. If you're writing stuff for the BBC and want maximum compatibility, aim for BASIC 1, if you want more functionality and still good compatibility, BASIC 2. If you're just working on something on the Master you can take advantage of the BASIC 4 features.

All in all, in my humble opinion, it's not worth getting too hung up on the differences between 2 and 4.

d.

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: About BBC Basic 4

Post by Richard Russell » Sun Jun 14, 2020 1:06 pm

danielj wrote:
Sun Jun 14, 2020 12:18 pm
if you use any of the newer functions in 4 they won't work in 2 (e.g. the filled plotting routines etc).
Plotting is done by the OS, not by BASIC, so as long as you use the PLOT syntax (not shortcut keywords like RECTANGLE or CIRCLE) BASIC 1 or 2 running on a Master should have full access to the newer plotting capabilities.

Naomasa298
Posts: 391
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: About BBC Basic 4

Post by Naomasa298 » Sun Jun 14, 2020 1:08 pm

It sounds to me like you're looking to try and write a fast game in BASIC.

Am I right in saying that? To a degree, it's possible but as the BBC has no in-built support for sprites, you'd be very limited in what you could do (you could use redefined text characters, but they have major limits), unless you used something like the GXR, which isn't widespread and you'd be limited in how many people could run it, and this sentence has gone on for far too long. :D

User avatar
danielj
Posts: 8445
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: About BBC Basic 4

Post by danielj » Sun Jun 14, 2020 1:26 pm

Richard Russell wrote:
Sun Jun 14, 2020 1:06 pm
danielj wrote:
Sun Jun 14, 2020 12:18 pm
if you use any of the newer functions in 4 they won't work in 2 (e.g. the filled plotting routines etc).
Plotting is done by the OS, not by BASIC, so as long as you use the PLOT syntax (not shortcut keywords like RECTANGLE or CIRCLE) BASIC 1 or 2 running on a Master should have full access to the newer plotting capabilities.
Of course! #-o

But the more general point still stands, if you want compatibility, don't rely on a machine having BASIC 4.

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sun Jun 14, 2020 3:30 pm

Naomasa298 wrote:
Sun Jun 14, 2020 1:08 pm
It sounds to me like you're looking to try and write a fast game in BASIC.

Am I right in saying that? To a degree, it's possible but as the BBC has no in-built support for sprites, you'd be very limited in what you could do (you could use redefined text characters, but they have major limits), unless you used something like the GXR, which isn't widespread and you'd be limited in how many people could run it, and this sentence has gone on for far too long. :D
Yes, but not an action game with sprites, a space-adventure game... I love the challenge to release games in pure basic :)

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: About BBC Basic 4

Post by richardtoohey » Mon Jun 15, 2020 2:20 am

Have a look at the old magazines - Beebug and The Micro User and Acorn User - lots of well-done games in BBC BASIC shows what is possible.

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Mon Jun 15, 2020 7:43 am

In BBCBasic, is it possible to load pictures (several size) and display them where i want at screen at x,y without using assembler routines ?

User avatar
jms2
Posts: 2684
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: About BBC Basic 4

Post by jms2 » Mon Jun 15, 2020 7:53 am

No, that is not really possible.

You can easily load a whole screen of course. It would also be possible to write a BASIC routine to load bytes from a file and put them into screen addresses to form a small picture, but this would be slow and so in reality you would normally use assembler.

drfloyd
Posts: 381
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Mon Jun 15, 2020 10:43 am

ok, like on Amstrad CPC so.

I know nothng about Assembler, so it will be difficult :mrgreen:

Naomasa298
Posts: 391
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: About BBC Basic 4

Post by Naomasa298 » Mon Jun 15, 2020 10:53 am

You can find sprite routines in various publications with instructions on how to use them.

This book has some (for MODE2):
http://8bs.com/othrdnld/manuals/publica ... er_pdf.zip

There may be more in the books on this page:
http://8bs.com/othrdnld/manuals/publications.shtml

But most, if not all of these will be for the model B and won't use Shadow RAM.

You could also have a look at BeebSpriter from Retro Software:
http://www.retrosoftware.co.uk/wiki/ind ... eebSpriter

Post Reply

Return to “programming”