<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 20 Apr 2015 19:51:32 +0100
From   : jgh@... (J.G.Harston)
Subject: BBC format BASIC files

Russell format BBC BASIC program files have the line headers slightly 
reordered compared to Acorn format BBC BASIC program files. See 
http://beebwiki.mdfs.net/Program_format

It is simple to swap between the two as long as you also take heed of 
the different tokenisation of BASIC V tokens. BasConv is a RISC OS 
command line and desktop conversion tool: 
http://mdfs.net/Software/BBCBasic/Tools.htm

If you are interchanging BBC BASIC program files on file media that has 
extensions, you should use the extension ".bbc", "/bbc" for Russell 
format BBC BASIC programs, the extension ".", "" for Acorn format BBC 
BASIC programs, and the extension ".bas", "/bas" for text format BBC 
BASIC programs.

Eg:
DOS/etc file "hello.bbc", RISC OS/BBC/etc file "hello/bbc" is Russell 
format
DOS/etc file "hello.", RISC OS/BBC/etc file "hello" is Acorn format
DOS/etc file "hello.bas", RISC OS/BBC/etc file "hello/bas" is text 
format
DOS/etc file "hello.txt", RISC OS/BBC/etc file "hello/txt" is 
documentation relating to "hello".

My modification of Z80 BASIC to run on the Z80 CoPro with BBC file I/O 
instead of CP/M file IO, and my PDP-11 BASIC are the only BBC BASIC that 
can natively LOAD/CHAIN both formats. I wrote some support code that 
allows a BASIC program running on either platform to load and run a 
BASIC program file in either format. I can't find where I've documented 
it, but the 'Hello' menu program on my Music disks use it: 
http://mdfs.net/Mirror/Archive/JGH/Music1.zip

A running program can find out what format the program in memory is by 
examining ?(TOP-3). IF ?(TOP-3)=0 THEN Russell format ELSE Acorn format. 
You will almost never need to know this unless you are writing code that 
modifies the program code in memory.

-- 
J.G.Harston - jgh@...      - mdfs.net/jgh
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>