Geek Fight!

The London Review of Books recently published a lovely, loving piece on the BBC Micro. I enjoyed it immensely - but being an unreconstructed Beeb nerd I had to highlight one small error:

Thomas Jones writes that ‘the limitations of a 32K memory revealed themselves most bluntly in the fact that our computer couldn’t count any higher than 32,767’ (LRB, 22 June). The BBC micro used 32 bit integer variables, so it had no problems with numbers far larger than 32,767 and, in any event, that limitation would have had nothing to do with the amount of memory.

They printed the letter in LRB 28/15. In LRB 28/17 they printed this response from Roddy Graham:

It’s not quite right to say, as Andy Armstrong does, that the BBC Micro used 32-bit integer variables (Letters, 3 August). Like nearly all modern computers, the 6502 central processing unit (CPU) that the Beeb was based on uses binary digits (bits). The 6502 has instructions built into its hardware to move bits around in groups of eight and to add and subtract 8-bit numbers: it is an 8-bit micro. For any other arithmetic operations (addition involving numbers bigger than 255, multiplication, division etc) someone would have to write software.

More modern CPUs move bits around in groups of 32 or 64, and have built-in instructions for a wide range of arithmetic operations. BBC BASIC has several built-in data types, including 32-bit integers. Different software running on the BBC Micro can manipulate much larger integers. BBC BASIC first ran on BBC microcomputers, but has since been made available on many other, newer computer systems. Armstrong seems to have confused the hardware (BBC Micro) and its inherent capabilities with the software (BBC BASIC), which could be run on a different computer, or be replaced by different software with better or different capabilities.

Thomas Jones got a ‘syntax error’ when he typed 32768 at the BBC BASIC command line because BBC BASIC assumes that any input which begins with a number is a line of a program. But its internal data structure allocated only 15 bits for storing line numbers, so the highest possible line number was 32767. My favourite BBC BASIC error message is line number related, too. Typing ‘RENUMBER 10, 0’ at the command line provokes the reply: ‘Silly’.

OK, so Roddy just wants to parade his geek credentials; nothing wrong with that - that’s why I wrote my letter in the first place. His facts are pretty much straight too. The only problem is that they don’t actually disagree with what I said - so he’s obliged to spin his letter as a correction of mine so that it’s worth printing. Unfortunately that necessarily involves implying that I don’t know what I’m talking about - in other words it involves flipping the big red switch in my head that has a sign hanging from it saying “Don’t touch this switch. Ever” and then in small print “Yes I know that the mere fact of this sign’s existence makes every fibre of your being yearn to find out what happens if you flip the switch - but trust me - you really, really don’t want to. Cubed.”

My first plan relied on LRB not actually having the ability to run a BBC BASIC program. I’d find an excuse to get them to print a short obfuscated program - innocent to the untrained eye but with a vicious payload. Perhaps when run it’d print “Roddy is a poop head” - or maybe something even stronger. I’m sure a certain small scale notoriety might ensue but I couldn’t run the risk of them not printing anything so instead I’ve just sent them this:

With reference to Roddy Graham’s letter published in LRB, 7th Sept 2006:

I’m amused to read that “Armstrong seems to have to have confused the hardware (BBC Micro) and its inherent capabilities with the software (BBC BASIC)…”. The BBC Micro did indeed use the 6502 processor - an eight-bit processor which only directly deals with numbers in the range 0 to 255. Having written at least three emulators and a number of floating point and integer maths packages for the 6502 I’m fairly intimate with its inner workings and the means by which greater arithmetic range and precision is synthesised from those eight-bit chunks.

Graham’s explanation of the reason why line numbers larger than 32,767 constitute a “Syntax Error” is completely accurate. I’m sure that between us we could provide your readers with many other similarly scintillating snippets over the coming weeks.

Presumably in order to secure an audience for this bravura display of BBC Micro trivia knowledge Graham presents his elaboration as a correction: “It’s not quite right to say, as Andy Armstrong does, that the BBC Micro used 32 bit integer variables”. I’m afraid it is precisely right to say just that. Every BBC Micro (apart perhaps from a few custom built systems) was supplied with BBC BASIC as the default programming language. BBC BASIC was an integral component of the BBC Micro and BBC BASIC - rather daringly - used 32 bit integers. Jones’ original article quite reasonably conflates the ideas of the BBC Micro and BBC BASIC as would all but the most desperate pedant.

One imagines that faced with the assertion that he was using his computer to send an email Graham would respond “Oh, no - you are quite mistaken! I am, in fact, using an email program that is running on my computer to send an email; the computer itself has no inherent email-sending capability”.

Wouldn’t it be terrible if the enduring legacy of the BBC Micro was an entire generation of nerds who confuse terminological precision for effective communication?

To that I’d just like to add that it’s a damn good job that somebody still cares about this stuff otherwise, well, who knows where we’d be? Apropos of which if anyone would like to have a debate about the relative merits of the 6502 and the Z80 I’m there - but I’d just like to start by saying that if you believe the Z80 was superior to the 6502 (hah! snort!) then you’re going down baby - down where the fishes don’t sing.

25 Responses to “Geek Fight!”

  1. Mark Alker Says:

    I had a ZX81… Opened it up… ripped out the innards..glued a hinge on and used it as a pencil case.

    I still have three BBCs in the loft, carefully stored away for when I might get the opportunity to play with them again and turn them into some fantastic data logging devices.

    BBCs rule baby! nuff said :-)

  2. Shaun Says:

    Well, I suppose it makes a change from the Mac intelligentsia v Windows sheep debate but back in the day I was more a 6510 fan personally. Being forced to use a BBC Micro for my A Levels was positively stone age.

    And the only computer I’ve ever owned with BBC Basic on it was Z80 based. :-)

  3. Andy Says:

    You can get a gizmo so you can use flash memory as a disk drive for them Mark :)

    6510? That must have been a C64 eh? I didn’t think the instruction set was much different from a 6502 though. Did it have the extra 65C02 instructions?

  4. Dirk Says:

    The trouble with these comparisons is that they always leave out the “for what?” part. The 6502 had its points, but so does (note the careful use of tense) does the Z80. A Z80 is easier to use in embedded systems because of external bus archecture it uses, less parts, less fiddling about. The original Z80’s instruction set was not nice, but later versions improved on it. It had more registers than a 6502 which you may or not regard as a good thing. When cross-compiling from C it seemed to produce less code on a Z80 then a 6502, again for what that is worth.

    I hate both chips nearly equally, BTW.

    I suppose the killer is that there are many things still out there, working today, with Z80 and their younger brothers in them. Some of them will be arranging ambulances to get to you after you have dialed 999 because this reply has brought on that incipient heart attack (or severe apoplexy) you’ve been waiting for.

  5. Andy Says:

    Of course they leave out the “for what” part - it’s a geek bitch slap about the relative beauty of the two designs - there’s no room for practicality in that kind of lofty debate.

  6. Shaun Says:

    On the 6510 you could switch out bits of ROM/RAM on the 64 and gain back memory by toggling bits in the first few locations in zero ram and IIRC it was used for querying what various ports were doing - like had the tape finished loading (invariably that was no).

    It was quite common to chuck BASIC or the Kernal out and use the 4K that took up to store your screen or sprite data. Oh, yeah, Sprites. The grief that caused me re-writing a mouse pointer routine for the Beeb that took like 3 lines of POKEs on the 64.

    I’m not sure I want to remember more. I’ll probably shove out something useful or the urge to play Iridis Alpha will return and I’ll get nothing done for days.

  7. Andy Says:

    Oh come on! C64s were horribly primitive compared with Beebs! :)

    Yeah, they had hardware sprites but they had shit display modes, a shit OS, shit Microsoft do-even-integer-maths-in-sloooooow-floating-point BASIC, shit keyboard, shit PSU, shit disk drives. All in all a bit shit.

    When I ported Mr Mephisto from the C64 to the Beeb the code size went down from 36k to 7.5k - although I don’t think that had very much to do with architectural differences - the guy who wrote the C64 version did the whole thing using the machine code monitor - no assembler. I don’t think he could maintain the code very easily :)

  8. Shaun Says:

    Even back then I knew not to use a Microsoft product.

    More shit graphics hardware being used here…

  9. Ian Says:

    The Z80 is clearly far superior to the 6502 for two incontrovertible truths -
    a) Z80 sounds far sexier than 6502
    b) I couldn’t get the 6502 board I made to work.
    c) Without the Z80 we wouldn’t have had the Z8671 - the coolest CPU of it’s era!
    d) I can’t count.

  10. Andy Says:

    That emulator’s nice Shaun :)

    Well you /do/ make a pretty strong case Ian… :)

  11. miketually Says:

    Next time someone accuses me of being a geek, I’m going to send them a link to this :)

  12. Vixen Says:

    Nerd. :)

    I love you.

  13. ginja andy Says:

    I still have one of these in the loft. BBC Model B, Tape Drive, PASCAL ROM chip and 6502 processor unit that sat next to it. All in original boxes, hopefully it’ll be worth something one day..

  14. Roddy Graham Says:

    Actually I was indulging in pedantry rather than geekery - where better than in the pages of the LRB. And they are so vague when it comes to tech issues, someone has to prod them from time to time.

    “It’s not quite right to say, as Andy Armstrong does, that the BBC Micro used 32 bit integer variables”. I’m afraid it is precisely right to say just that.

    Wrong, wrong wrongity wrong. More pedantry, I know, but you’re the one who used the word ‘precisely’.

    As for the Z80 - 6502 debate. 6502: uniform address space. Z80: sucky set of port addressing opcodes. I rest my case.

  15. Andy Says:

    Hi Roddy :)

    Glad you found me - I see they didn’t print my pissy response. Bastards eh?

    So how is that wrong? My reasoning is above - BBC Basic, always there, 32 bit integers, yada yada.

  16. Roddy Says:


    It’s geekery vs pedantry. Pretty much anywhere on the net, geeks rule, but in the pages of the LRB my 1337 p3d4nt sk1llz win.

    Yes, Beeb BASIC was always there (unless you had so many ROM chips you wanted to play with that you pulled it, as I did once or twice), but it’s software, not microcode. I think the distinction is worth making.

    I like the idea of the short obfuscated program. Reminds me of the One-Line Program section that Acorn User had.

  17. Andy Says:

    It was ‘firmware’ and it was part of a BBC Micro. We’re not talking about just the processor remember :)

  18. Roddy Says:


    ‘firmware’. Excellent. Truly you are my brother-pedant. The question is, who is gonna crack first and stop commenting on the comments.

    If you pulled the BASIC ROM, the Beeb would still boot up, but you would get the OSCLI star prompt. Ergo, the BASIC ROM ain’t part of the hardware.

    Is anybody else somehow reminded of the “I’d like to have an argument” sketch?

  19. Andy Says:

    The OS starts up the lowest numbered language ROM on startup. If there is none it displays the message ‘Language?’ and hangs. No * prompt.

    Clearly the Basic ROM - if fitted - is part of the hardware - it’s a little 28 PIN chip.

    And no, I’m not your brother pedant because I actually know what I’m talking about.

  20. Simon Says:

    > And no, I’m not your brother pedant because I actually know what I’m talking about

    Splendid :)

  21. Roddy Says:

    >The OS starts up the lowest numbered language ROM on startup. If there is none
    > it displays the message ‘Language?’ and hangs. No * prompt.

    Of course. Curse my crappy memory. But there was a hardware/software combination that did what I described. Perhaps an M128 runnning MOS 3.2? Anyone got such a set up?

    That aside, Andy, the BASIC ROM chip is software. ROM: Read only Memory. The differences between code stored on a ROM chip vs disc vs cassette are much less than the similarities.

    > And no, I’m not your brother pedant because I actually know what I’m talking
    > about.

    Dear brother pedant, here is my free gift to you. Use it wisely:


  22. Andy Says:

    So you’d say that a PC doesn’t initialise its hardware and try to boot from a variety of devices when you switch it on because actually it’s the BIOS that does that - and the BIOS is firmware?

  23. Roddy Says:

    I’d say several things.

    0: You are not comparing like with like. The BIOS initialisation routines are best compared with initialisation routines in the Acorn MOS ROM.

    1: You could take the BBC BASIC ROM out of a beeb and fit a BCPL ROM, or a FORTH ROM, or a Wordwise ROM, and expect useful things to happen, but not necessarily 32 bit integer arithmetic.

    2: PCs are the work of the devil. And also messed up silicon poop toasters.

  24. Andy Says:

    0: I was talking about firmware that’s supplied with the machine

    1: So? You can take the BIOS out of a PC and replace it with something that does something different

    2: Irrelevant.

  25. sad lonely man Says:

    I can’t believe I actually read the entire page including comments. o.0
    I took away less from this than I would have trying to fly using only my left ear.

    I would ask, but I assure you, I will NEVER be back to read the reply, what the hell is this whole web-page about?
    I was searching for how to fix the “No Room” error given by BBC BASIC for Windows and this unearthly site came up.

Leave a Reply

Copyright Andy Armstrong, 2005. Entries (RSS) and Comments (RSS).