13

I was researching the BBC Micro when I found the Sideways address space: a 16KiB memory space allowing access to up to 16 16KiB external blocks of ROM (or RAM).

But 16 blocks of 16KiB is 256KiB, which is larger than the memory space itself! How did this work?

23

Sideways ROM (also RAM in later models) was paged into the processor's address space.

Sideways memory sat in the address range from $8000 to $BFFF. The BBC Model B had four slots on the motherboard into which EPROMs could be put to occupy this space. One of the slots was reserved for BBC Basic. Expansion boards could be purchased to expand this to 16 slots.

A hardware register at address $FE30 (mirrored on Page 0 address $00F4) would switch one of the 16 EPROMs into the address space of the processor.

Each of the 16 slots was allocated a section of non-paged memory in which it could keep its own status.

The 16 blocks were used primarily for language ROMs. As stated, one was the main BBC Basic ROM, others such as LISP, FORTH, etc were available. The other use was for filing systems. The Acorn DFS (Disk Filing System) for example would sit in one of these slots. Only one language could be active at a time but there could be multiple filing systems active.

On boot, the OS would interrogate each of the slots to see if it was occupied and would call an initialisation routine within each slot. A table of populated slots was set up at $02A1 - $02B0.

To identify itself to this interrogation, the first few bytes of the ROM had to comply with a set format:

00-02 - Language entry (initialisation)  
03-05 - Service entry  
06 - ROM Type (Language / Filing System / Second Processor)  
07 - Offset to copyright statement  
08 - Version number  
09-xx - Title

Sideways ROMs could intercept software interrupts and post callback handlers.
At initialisation, they could reserve a section of the main RAM for their own use. This would be reserved for the ROM by the OS, starting at address $0E00. raising the OSHWM (Operating System High Water Mark) and reducing the working RAM available for the loading and operating of programs.

Calls into the ROMs executed a jump to the Service Entry with an entry code in the Accumulator.

The sideways memory concept enabled the 64k addressing capability of the 6502 processor to be greatly expanded.

  • 3
    This is an excellent answer. The key concept here is that even though 16 16KiB blocks adds up to 256KiB, only 1 16KiB block is ever enabled at any given moment, which means that only 16KiB of memory space is needed. – Ken Gober May 20 '16 at 14:20
  • This is... a lot more of an answer than I expected. I knew the first two paragraphs, but didn't put them into the question because then answers would just be paragraph three... but you wrote a lot more paragraphs. +1! – wizzwizz4 May 20 '16 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.