Introduction
The BBC Micro (Acorn's computer, the Model A, B and B+ with a 6502, the Master with a 65C02) has no file types.
A file is a run of bytes, and the facts about it live in the catalogue of the
disc or in the header of the tape block it is on:
a name, a load address (where *LOAD puts it), an execution address (where
*RUN starts it) and a length. Two kinds of file are common: a BBC BASIC program, saved as
tokenised lines, and machine code for the 6502, with the operating
system's entry points and hardware at fixed addresses.
There is no .bbc file on any BBC disc. The explorer gives the files it takes out of a disc or a tape the name
$.PROG [L1900 X8023].bbc: the file's name, then its load and execution address in hexadecimal, then the
extension that makes the explorer open it as a BBC file.
Structure
Nothing in the file says which kind it is. The viewer tries them in this order:
0BBC BASIC program lines of$0D, number, length and tokenised text, ending$0D $FF(BASIC)if the bytes read as such0Machine code bytes of a program, loaded at the load address (machine code)otherwise
In the explorer
Open a file from an .ssd or .dsd disc or a .uef tape, or drop a file named .bbc, or a BASIC program under any name (a file whose bytes read as one is taken for BASIC). You see:
- for BASIC, the tree (every line with its number, length and text) and a listing with the keywords written out; a GOTO or GOSUB to a line that is not there is marked;
- for machine code, a disassembly from the load address with the execution address marked
entry, every operating system call (JSR OSWRCH), vector and hardware register named, and undocumented opcodes highlighted as on the 6502 pages.
The options bar sets the processor (the 6502 of the A, B and B+, or the 65C02 of the Master) and, for a file with no addresses in its name, the load and execution address.
Not described
Known, not yet covered
- Viewer: machine code is disassembled from the first byte, as one block: it does not follow the code from the execution address, and data inside a program is decoded as instructions.
- Viewer: the BASIC listing uses the BASIC II keyword table for every program; BASIC I, BASIC III, the Master's BASIC 4 and BASIC V differences are not shown (versions).
- Viewer: sideways ROM images, relocatable code, and the 6502 Tube second-processor code are not recognised as such.
- Viewer: the OS calls are named, but their parameters (OSBYTE and OSWORD call numbers, OSFILE parameter blocks) are not.
Unknown
- Reference: the memory-mapped hardware names (hardware) are the standard BBC Micro map, not read from a document on this Mac; the operating system's own use of most of them was checked in the OS ROM image, but the user VIA (except one register), the 8271 disc controller, the ADLC and the Tube addresses were not.