8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


BASIC IV ROM Routines
Page Last Altered:


8000 BASIC ROM header

Submitted by Steve Fewell

Description:

The first 3 bytes contain code to jump to the BASIC language entry startup routine.

The next 3 bytes contain code to jump to the BASIC ROM service entry startup routine.

Byte &8006 = ROM Type. &E2 indicates a language & a service ROM (i.e. it has a language entry address
& a service entry address & a second processor relocation address).
ROM Type &E2 [1110 0010] indicates that:
     * A Service entry point is present (Bit 7 is set)
     * 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 - 0010 indicates that this is 6502 or 65C12 code

Byte &8007 = Pointer to the end of title address [minus &8000]. Therefore, as
the value in this byte is &13, the end of the title is &8013.
Byte &8008 = Internal version number of the ROM = &7.

Bytes &8009 to &800E contain the title of the ROM ("BASIC"). Ending with a binary 0.
Bytes &800F to &8013 contain the release number of the ROM ("4r32"). Ending with a binary 0.
This binary zero (&8013) is the address pointed to by the byte in &8007.
Bytes &8014 to &8016 contain the copyright symbol -> "(C)".
Bytes &8017 to &8023 contain the copyright string. Ending with a binary 0.
This string contains "1988 Acorn" + chr$(10) [New Line] + chr$(13) [carriage return].
Bytes &8024 to &8025 contain the Tube relocation address (16-bit address).
The Tube relocation address for the BASIC ROM is &B800.
Bytes &8026 to &8027 contain a pointer to the bit-map descriptor table.
The Bit-map descriptor table is &8028.

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 &8013 as
the error message (BRK) string begins with the Error Number (0 in this case!).



The Bit-map descriptor table:
This table contains 4 bytes. The first 2 are a pointer to the byte after the bit-map - which is &C000.
The next byte is the relative ROM number that the bit-map is held in - which is &82 (130).
(note: the top bit is set which indicated that the ROM number is relative - not absolute).
So, after ignoring the top bit flag, the ROM number that contains the bit-map is in a slot 2 higher than the
BASIC ROM. So as BASIC is in ROM socket C, this refers to the VIEW ROM (in socket E).
The end of the [MOS 3.50's] VIEW ROM (location &BFFE, which is address &C000 minus 2) contains the required Bit-Map
marker characters: &C0 followed by &DE. Bytes &BFFC and &BFFD contain the length of the bit-map
which is &02D0. Further details of the bit-map are considered beyond the scope of this BASIC guide.

Changes from BASIC IV:
Added Service Address, version number and Bit-map desscriptor table.


Disassembly for the BASIC ROM header routine

8000 L 076 231 128 4C E7 80 JMP &80E7    BASIC Language Startup routine
8003 L, 076 044 128 4C 2C 80 JMP &802C    BASIC ROM Service startup address
8006   226 E2 EQUB &E2
8007 019 13 EQUB &13    Points to &8013
8008 007 07 EQUB &7
8009 BASIC 066 065 083 073 067 42 41 53 49 43 EQUS "BASIC"
800E   000 00 EQUB &0
800F 4r32 052 114 051 050 34 72 33 32 EQUS "4r32"
8013   000 00 EQUB &0
8014 (C) 040 067 041 28 43 29 EQUS "(C)"
8015 1988 Acorn 049 057 056 056 032 065 099 111 114 110 31 39 38 38 20 41 63 6F 72 6E EQUS "1988 Acorn"
8021   010 0A EQUB &0A
8022   013 0D EQUB &0D
8023   000 00 EQUB &00
8024   000 184 00 B8 EQUW &B800
8026   040 128 28 80 EQUW &8028
8028   000 192 00 C0 EQUW &C000
802A   130 82 EQUB &82
802B   000 00 EQUB &00

 


 Back to 8BS
Or