Jump to page content

BBC Micro BogoIIPS

After encountering BogoIIPS (Irrelevant Instructions per Second) on Mark’s 30 watt, 33 MHz webserver website (now defunct), I decided to have a go at rating my BBC Microcomputer in BogoIIPS. BogoIIPS are calculated by timing a count from 1 to 10000 (or more) in seconds (using any loop construct, whichever is fastest), and dividing the iteration count by the time elapsed.

Which I found was not as straightforward as I imagined. Even if the figures for other machines on the CPU test page were real, there is no indication of what types of variables were used, or what types of loops were used. I don’t know about other BASIC dialects, but BBC BASIC has three different types of numeric variable: integer (32-bit signed), floating-point (40-bit) and resident integer (not cleared between program loads, and faster than standard integers). String variables are suffixed with $, integer variables with % and variables with no suffix are floats; if you forget to use a % suffix (as I often did) you will be using slower, wasteful floating-point maths.

So, my BogoIIPs benchmark program covers the four most important of the six tests: both loop types and both main numeric variable types. The full results for my own BBC Micro (including an extra resident integer variables test) are as follows:

Variable type
Integer Float Resident integer
Loop type FOR 5000.5 1666.8 5000.5
REPEAT 454.5 333.3 588.2

FOR loops and integer variables are clearly faster. I am not sure why switching to resident integer variables only speeded up REPEAT loops though.

Given that all the values for other machines in the “official” BogoIIPS info (a copy of which is on Mark’s CPU test page) are guesses, it would be nice to see some official figures for other machines. I should also test my Psion Revo Plus in OPL, see how well its 36 MHz RISC CPU fares.

BogoIIPS-BBC Micro

You can view the source code of my BogoIIPS for BBC BASIC benchmark program in plain text format; if you want an emulable copy of the code (in BBC BASIC binary format) you will need to find a BBC BASIC converter, or pester me to write one (and it sounds like fun; just need to find the file format specs).

In case anyone wonders about the purpose of @% in the source code, it is a special screen output formatting variable in BBC BASIC that controls how PRINT formats numbers and screen columns. It is a 18-bit number best explained as the following hex outline (and I shan’t get into the gritty bugs):

@% = &abbcc

a
Bits 16 to 17 select whether numbers are formatted automatically (0), are always shown in exponential notation (1) or shown to a fixed number of decimal places (2).
bb
Bits 8 to 15 set how many decimal places (a = 2) or mantissa figures (a = 1) are used for numbers; ignored for a = 0. The limit for any number is 10 figures (a = 0, a = 2) or 10 mantissa figures (a = 1).
cc
Bits 0 to 7 set the column width in characters; by default, numbers are right-aligned to the next available column, and a new column can be started with ,

The rest of the program should be reasonably straightforward.