Differences between 'Wilson' and 'Russell' strands of BBC BASIC.

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
Richard Russell
Posts: 680
Joined: Tue 18 Jun 2024, 09:32

Differences between 'Wilson' and 'Russell' strands of BBC BASIC.

Post by Richard Russell »

The issue of the (many) differences between the 'Wilson' and 'Russell' strands of BBC BASIC has recently been aired at GitHub. Although it is quite well known that differences exist, I don't think a serious attempt has ever been made to list them, something that could be quite useful. Therefore to kick things off here are a few that immediately come to mind:
  • In Acorn versions INSTR("ABC", "") returns 1, in my versions it returns zero.
  • In Acorn versions variables with no suffix are floating-point numerics, in mine they are variant numerics.
  • In Acorn versions you can omit the list of variables entirely in a LOCAL statement, in my versions you can't.
  • In Acorn versions IF FALSE IF TRUE THEN causes the conditional clause to be executed, in mine it is not executed.
  • In Acorn versions A% = &80000000 + &80000000 sets A% to zero, in mine it results in a 'Number too big' error.
  • In Acorn versions a += 1 (where a did not previously exist) gives a 'Mistake' error, in mine it sets a equal to 1.
Please submit examples of other differences that you know about.
Richard Russell
Posts: 680
Joined: Tue 18 Jun 2024, 09:32

Re: Differences between 'Wilson' and 'Russell' strands of BBC BASIC.

Post by Richard Russell »

Richard Russell wrote: Thu 23 Apr 2026, 20:44 Please submit examples of other differences that you know about.
Don't be shy about submitting more differences - there must be many - even if they show my BASICs up in a bad light. I'm not embarrassed by that: Sophie had a background in Computer Science whilst I was completely self-taught, so you would expect her interpreters to be better (and faster) than mine.
jgharston
Posts: 55
Joined: Thu 05 Apr 2018, 14:08

Re: Differences between 'Wilson' and 'Russell' strands of BBC BASIC.

Post by jgharston »

Off the top of my head, in addition to the above:
* VDU <no params>:
Wilson: accepted
Russell: error
* In-memory layout:
Wilson: <cr>,<lo>,<hi>,<len>,<text>...<cr><ff>
Russell: <len>,<lo>,<hi>,<text>....<cr>,<00>,<ff>,<ff>
* Floating point numbers in memory:
6502: mantissa is hi,mid,mid,lo
Others: mantissa is lo,mid,mid,hi (haven't checked 6809)
* Floating point numbers in memory:
Wilson: exponent is excess &80
Russell: exponent is excess &7F
* Variants:
Acorn: only valid value with exponent=0 is mantissa=0 to represent 0
Russell, PDP11: if exponent=0, mantissa holds an integer (I think also 6809)
* PRINT#/INPUT# format
Acorn: uses type prefix:
00, len, reversed string - string
01, b3, b2, b1, b0 - integer &b3b2b1b0 written as a constant
40, b3, b2, b1, b0 - integer &b3b2b1b0
FF, m0, m1, m2, m3, ex - real: exponent ex, mantissa &m3m2m1m0
64-bit float similar
Russell: no prefix:
string, cr - string
lo, mid, mid, hi - 32-bit integer
mantissa lo, mid, mid, hi, exponent - 40-bit float
64-bit integer and 80-bit float similar
* DEF/DATA
Acorn: can have spaces before the token at the start of the line
Russell: must be first character on the line, typed program input ensures this by stripping leading spaces

In the above list, unless otherwise noted, "Wilson"/"Russell" is determined by the in-memory program layout.
jgharston
Posts: 55
Joined: Thu 05 Apr 2018, 14:08

Re: Differences between 'Wilson' and 'Russell' strands of BBC BASIC.

Post by jgharston »

In Acorn versions IF FALSE IF TRUE THEN causes the conditional clause to be executed, in mine it is not executed.

I've just tested 6502 BASIC 2 and ARM BASIC 1.02 and the conditional clause is not executed.
IF FALSE IF TRUE THEN PRINT "HELLO"
results in nothing printed.
IF <false> causes a scan-forward for the first ELSE or <cr>.
IF <not-false> causes execution to continue from that point.
THEN is a null, is just stepped over.
ELSE causes a scan-forward for the first <cr>.
Richard Russell
Posts: 680
Joined: Tue 18 Jun 2024, 09:32

Re: Differences between 'Wilson' and 'Russell' strands of BBC BASIC.

Post by Richard Russell »

jgharston wrote: Sat 25 Apr 2026, 00:16 Off the top of my head, in addition to the above:
Thank you for that, but there has been a misunderstanding. I was meaning (but didn't explicitly state, sorry) differences in the language, i.e. in its syntax and semantics, not differences in internal implementation detail such as memory layout or numeric range etc.

After all there are major differences in such detail between my own versions: e.g. between the Z80 and Windows versions, and between the 32-bit and 64-bit versions, and indeed even between the coded-in-assembler and coded-in-C versions! So including such differences would open Pandora's box and that wasn't my intention.
* VDU <no params>:
Wilson: accepted
I think this is related to the LOCAL case I included, i.e. that in general comma-delimited lists can be empty in Acorn versions, but must contain at least one item in my versions.
* DEF/DATA
Acorn: can have spaces before the token at the start of the line
That's not specific to DEF and DATA, it applies (I think) whenever the interpreter searches the program for a line starting with a specific token. So in addition to those it would include ENDIF, ENDCASE, OTHERWISE and possibly more. But again that's not a difference in syntax or semantics.
I've just tested 6502 BASIC 2 and ARM BASIC 1.02 and the conditional clause is not executed.
IF FALSE IF TRUE THEN PRINT "HELLO"
That's a single-line IF, I was talking about a multi-line IF (as I meant to imply by the trailing THEN):

Code: Select all

   10 IF FALSE IF TRUE THEN
   20   PRINT "Wilson BBC BASIC"
   30 ELSE
   40   PRINT "Russell BBC BASIC"
   50 ENDIF
Richard Russell
Posts: 680
Joined: Tue 18 Jun 2024, 09:32

Re: Differences between 'Wilson' and 'Russell' strands of BBC BASIC.

Post by Richard Russell »

I'm getting occasional notification emails from the discussion group at Groups.io which makes me suspect that somebody is trying to reply to this thread there.

As I stated recently, forum posts are visible at the discussion group only because of the automatic forwarding, and replies made there will not be seen by the OP.

Can I once again remind everybody that if they are seeing these posts at the discussion group and wish to reply, they must do so here (the forum) for their replies to be seen. Thank you.