×   Main Menu ALL The 8BS News Manuals (New menu) Links Worth a Look Tools Disc and Basic Webring Site Map 8BS Guestbook Old Guest Book Me The Barnsley Rovers   
8-Bit Software

The BBC and Master Computer Public Domain Library



8000 BASIC ROM header

Submitted by Steve Fewell

Description:

The first 6 bytes contain code to jump to the BASIC ROM startup routine.
This code does the following:
      If Accumulator is 1 then jump to start of the language address (&802B);
      otherwise, exit (RTS) ('A=1' indicates a normal language entry).
      The NOP command in byte &8005 is just to fill space!

Any service address 'jump to startup' code is usually in bytes &8003 to &8005, but
as BASIC doesn't have a service address, this space is used to extend the jump to
the startup routine.

Byte &8006 = ROM Type. &60 indicates a language ROM (i.e. it has a language entry address
& a second processor relocation address).
ROM Type &60 [0110 0000] indicates that:
     * No Service entry point is present (Bit 7 is clear)
     * A Language entry point is present (Bit 6 is set)
     * A 2nd processor relocation address is present (Bit 5 is set)
     * ROM does not support Electron firmkeys (Bit 4 is clear)
Bits 0-3 provide an ID for the ROM - 0000 indicates that this is the 6502 or 65C12 BBC BASIC ROM

Byte &8007 = Pointer to the end of title address [minus &8000]. Therefore, as
the value in this byte is &0E, the end of the title is &800E.
Byte &8008 = Internal version number of the ROM = &4 indicating BASIC 4.

Bytes &8009 to &800E contain the title of the ROM ("BASIC"). Ending with a binary 0.
This binary zero (&800E) is the address pointed to by the byte in &8007.
Bytes &800F to &8011 contain the copyright symbol -> "(C)".
Bytes &8012 to &801E contain the copyright string. Ending with a binary 0.
This string contains "1984 Acorn" + chr$(10) [New Line] + chr$(13) [carriage return].
Bytes &801F to &8022 contain the Tube relocation address (32-bit number).
The Tube relocation address for the BASIC ROM is &00008000.

BASIC has no service entry routine.

On entry to the BASIC language, the title string ("BASIC") is automatically printed
(on ROM selection, as it is a language ROM).

Also on entry, the error message pointer (&FD, &FE) is setup to point to
the copyright message (as the BASIC command REPORT proves!) starting at byte &800E as
the error message (BRK) string begins with the Error Number (0 in this case!).


Disassembly for the BASIC ROM header routine

8000   201 001 C9 01 CMP#&01
8002 ' 240 039 F0 27 BEQ 39 --> &802B    BASIC ROM startup
8004 ` 096 60 RTS
8005   234 EA NOP
8006 ` 096 60 EQUB &60
8007 014 0E EQUB &E    Points to &800E
8008 004 04 EQUB &4
8009 BASIC 066 065 083 073 067 42 41 53 49 43 EQUS "BASIC"
800E   000 00 EQUB &0
800F (C) 040 067 041 28 43 29 EQUS "(C)"
8012 1984 Acorn 049 057 056 052 032 065 099 111 114 110 31 39 38 34 20 41 63 6F 72 6E EQUS "1984 Acorn"
801C   010 0A EQUB &0A
801D   013 0D EQUB &0D
801E   000 00 EQUB &00
801F   000 128 000 000 00 80 00 00 EQUD &00008000

 


 Back to 8BS
Or