====== BBC BASIC ====== ===== Implementing BBC BASIC on Rienk Koolstar's sbc-2g-512 ===== Richard Russell maintains a [[http://www.bbcbasic.co.uk/index.html|website]] providing a number of different versions of BASIC which have compatibility with the original BBC Micro 6502 BASIC and Jonathon Harston has [[http://mdfs.net/Software/BBCBasic/|documented]] over 30 platforms which have implemented BBC BASIC on them. It was [[http://www.benryves.com/projects/z80computer/|Ben Ryve's homebew Z80 Computer ]]implementation that drew my attention to the existence of a Z80 version of BBC BASIC. A limiting factor around the BBC BASIC ROM is that no source code has been published. However, tools and documentation exists to relocate and expand this system. ==== Other versions of Z80 BASIC around the web: ==== Grant Searle's implementation of NASCOM BASIC 4.7 https://www.retrobrewcomputers.org/doku.php?id=builderpages:b1ackmai1er:sbc-2g-512#running_basic ZX Spectrum BASIC ROM Another version of BASIC that I found particularly interesting is Dr Andy Wright's ZX Spectrum BASIC ROM which has published source code and designed to work in a system with paged ROM addressing system. [[https://github.com/simonowen/samrom|Source code can be found here. ]]Other source code for Sinclair and Spectrum ROMs [[https://www.tablix.org/~avian/spectrum/rom/|can be found here. ]] Tiny BASIC Doug Gabbard at [[http://retrodepot.net/|retrodepot.net]] has updated and implemented Li-Chen Wangs' Tiny Basic and the source code is available [[http://retrodepot.net/?p=424|here.]] ===== Resources ===== R.T. Russell Z80 CPM: [[http://www.rtrussell.co.uk/bbcbasic/z80basic.html|http://www.rtrussell.co.uk/bbcbasic/z80basic.html]] Z80 CP/M Manual: [[http://www.bbcbasic.co.uk/bbcbasic/mancpm/index.html|http://www.bbcbasic.co.uk/bbcbasic/mancpm/index.html]] J.G Harston Z80 porting tool: [[http://mdfs.net/Software/BBCBasic/Z80/port.htm|http://mdfs.net/Software/BBCBasic/Z80/port.htm]] ===== Porting ===== Two versions of Z80 BBC BASIC are available as porting contenders ^ ^Advantages^Disadvantages| ^Z80 BBC BASIC|Can set ROM and RAM start address using relocation tool.|Hard coded reserved RAM area at FF80-FFFF for legacy BBC interface| ^CP/M Z80 BASIC|Set up to use CP/M calls for which code is already available.|Fixed, non-relocatable start address. Designed to be run in RAM.| J.G Harston port.zip contains the following files BBC0100 - Object code PortZ80 - Documentation Relocate - BASIC program to relocate the BBC0100 Object code NOTE: The Relocate program in this archive needs to be run under the windows trial version of BBC BASIC. Or use this ASCII text version: {{:playground:b1ackmai1er:bbcbasic:relocate.zip|:playground:b1ackmai1er:bbcbasic:relocate.zip}} Memory map: ^ ^Header^Prog Code^Scratch^Workspace^Lowest PAGE^highest HIMEM^OSCLI^BRKV| ^BBC BASIC|&0100|&0200-|&34EE|&3500-&37FF|&3800|?|&FFF7|&FFFA| ^SBC-2G-512|&0100|&0200-|&FF88|&4000-&42FF|&4300|&FF80|?|?| &0100-&01FF needs to contain the initialization for the board and a jump table for the minimum set of functions required for BBC BASIC to communicate. The Bbcdist.mac file provides the example code for this area. \\ ===== BBC BASIC Disassembly =====