Archive for the 'Acorn' Category

BBC Micro TrueType font

Wednesday, June 11th, 2008

I’ve just used the excellent fontstruct to create a clone of the BBC Micro 8 x 8 bitmapped font:

(edit, deleted fontstruct embed which was breaking FireFox)

So now all you old Beeb fans can uninstall Comic Sans…

Posted in Acorn |

Steve Furber CBE

Saturday, December 29th, 2007

ARM designer Steve Furber has been given a CBE. I believe the appropriate response is “w00t!”.

Posted in Acorn | 3 Comments »

FizzBuzz in 6502 assembler

Monday, March 12th, 2007

FizzBuzz is an extremely basic competence test for programmers. So I thought I’d write a version extremely in BASIC. Here it is in BBC Basic’s embedded 6502 assembler. For added geek points I used a 6502 emulator written in Perl to develop it on.

Just don’t ask why.

   10 REM FizzBuzz in 6502 assembler
   20 DIM code% 1000
   30 OSWRCH = &FFEE
   40 OSNEWL = &FFE7
   50 work = &70
   60 DIM FizzM 4 : $FizzM = "zziF"
   70 DIM BuzzM 4 : $BuzzM = "zzuB"
   80 FOR pass% = 0 TO 3 STEP 3
   90 P%=code%
  100 [opt pass%
  110
  120 .FizzBuzz  LDA #1
  130            LDX #3
  140            LDY #5
  150 .FB1       SEC
  160            DEX
  170            BNE FB2
  180            JSR Fizz
  190            LDX #3
  200 .FB2       DEY
  210            BNE FB3
  220            JSR Buzz
  230            LDY #5
  240 .FB3       BCC FB4
  250            JSR PrDecimal
  260 .FB4       PHA
  270            JSR OSNEWL
  280            PLA
  290            CLC
  300            ADC #1
  310            CMP #101
  320            BCC FB1
  330            RTS
  340
  350 .Fizz      PHA
  360            LDX #3
  370 .Fizz1     LDA FizzM, X
  380            JSR OSWRCH
  390            DEX
  400            BPL Fizz1
  410            CLC
  420            PLA
  430            RTS
  440
  450 .Buzz      PHA
  460            LDY #3
  470 .Buzz1     LDA BuzzM, Y
  480            JSR OSWRCH
  490            DEY
  500            BPL Buzz1
  510            CLC
  520            PLA
  530            RTS
  540
  550 .PrDecimal STA work
  560            PHA
  570            TXA
  580            PHA
  590            LDA #0
  600            PHA
  610 .PrDec0    LDX #8
  620            LDA #0
  630 .PrDec1    ASL work
  640            ROL A
  650            CMP #10
  660            BCC PrDec2
  670            SBC #10
  680            INC work
  690 .PrDec2    DEX
  700            BNE PrDec1
  710            CLC
  720            ADC #ASC"0"
  730            PHA
  740            LDX work
  750            BNE PrDec0
  760 .PrDec3    PLA
  770            BEQ PrDec4
  780            JSR OSWRCH
  790            JMP PrDec3
  800 .PrDec4    PLA
  810            TAX
  820            PLA
  830            RTS
  840 ]
  850 NEXT

Posted in Acorn | 17 Comments »

Geek Fight!

Monday, September 18th, 2006

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.

Posted in Acorn, Humour | 25 Comments »

An Oral History of Acorn Computers?

Monday, November 28th, 2005

spacer I recently spent a happy afternoon over at folklore.org - Andy Hertzfeld’s superb oral history of the Apple Macintosh. The recent excitement about Xara’s decision to Open Source Xara and this interview with Charles Moir has got me thinking that there really should be a similar site to capture the early history of Acorn Computers.

Wikipedia has a fairly good outline of the Acorn story and quick Google throws up plenty of resources for but, as far as I’m aware, nobody has captured the anecdotes, the recollections of people who made it happen.

So if you were there - or you know somebody who was - please point them this way. I’ve set up a mailing list to kick off a discussion about how we might proceed.

Posted in Acorn | 2 Comments »

Total Control

Tuesday, September 20th, 2005

spacer Working on K8055Mac has got me thinking. A few years ago I worked on Total Control which was an educational product for Acorn RISC OS computers. It came with dedicated (and relatively expensive) hardware and was designed to be used in the teaching of control theory in UK schools. Changes in UK educational policy and our tardiness getting the software out meant that it never really found a market - although the few people who trialled it loved it.

I’m just wondering if there’s any interest in an updated version running on Mac OS… Mainly of interest to educationalists I imagine.

A couple more screenshots…

spacer

Posted in Acorn, Software | 5 Comments »


Copyright Andy Armstrong, 2005. Entries (RSS) and Comments (RSS).
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.