BBC ROMs Next page:
    ROM Structure

ROMs in BBC micros have a very specific format and calling structure. The information contained in the following pages describes that structure providing information to help write ROMs (and also how to understand a disassembly of one).

This is of particular interest to owners of machines which have RAM installed in sideways ROM slots (the BBC Master comes with 4 such slots as standard) as code can then be compiled and stored into one of these slots. Various games distributed in the '80s worked like this.

First of all, I will describe the format of a ROM, explaining how the code is called by the OS. Following that will be a more detailed list of ROM entrance procedures and then a simple example of a ROM. Further examples will cover more advanced features.

Examples will mostly be for the 6502 with a few specific to the 65C02 (BBC Master series) and it will be made clear which is the target machine. The examples will just contain the assembly listing and will not be encapsulated in a BASIC program, however it is straight-forward to add the appropriate preamble and assembly loop around any of them if you intend entering them on a machine or emulator in that way. The examples have all been tested using my assembler to generate the code and run on the Xbeeb emulator as well as on a BBC Master.

The reader should be familiar with 6502/65C02 assembly language, however no in-depth knowledge is assumed. All examples will be fairly extensively commented, however please let me know if there is something unclear in any of the code segments which has not been adequately explained.

For some of the later examples, it may be useful to have a refresher course on the 6502/65C02 assembly language, addressing modes and memory map and information on these is available elsewhere on this site.

In all that follows, where we need to refer to bit positions within a byte, we shall refer to the least significant bit as bit 0 and the most significant bit as bit 7.

Most of the following examples are my own and you may use them, distribute them and alter those as you wish. Several of them will be useful starting points if you are intending on writing ROMs yourself. A few of the examples come from other sources and these will be attributed accordingly.


  BBC ROMs Next page:
    ROM Structure