Copyright © 2009 Leaf Mindcraft
This is an Acorn RISC OS software application that converts from BBC Basic Program Files to Acorn ANSI C Text Files, and is available for free download.
After having downloaded and unzipped the !BBC_C32 Application, drag the application to a suitable directory on your hard disc. Double click on the !BBC_C32 icon to load it onto the icon bar.
Double click on a BBC Basic file or drag it to the bar icon to enter its file name into the main 'SetUp' panel slot. Alternatively clicking on the bar icon brings up the main 'SetUp' panel and the BBC Basic file can be dragged to this panel, or the file name can be typed manually into the slot at the top of this panel.
Select options from the 'SetUp' panel and then click on the 'Run' icon. After a while a translated C Text file is offered for saving in the same directory as the BBC Basic, with the same name as the Basic file but prefixed by a capital 'C'.
Additional Help is available from the bar icon menu, or by using the Acorn facility !Help, present in the 'Apps' directory.
For information on compilation, please consult either the on-line or Impression manual.
For more Technical Information, please consult the text file 'TechNote' within !BBC_C32.
There was a major bug in previous versions (to do with arrays), which only came to light in upgrading to RISC OS 4.
Now with versions 8, it has been further enhanced by offering the choices either that the BBC Basic is using a Library or forms a Library in its own right.
The buttons to make these choices will now be found just off the bottom of the main 'SetUp' panel.
Also within !BBC_C32, please read the text file '!ReadMe' for conditions of use and for cost and address to apply to for your own licensed version.
The versions previously supplied were rather 'buggy' - you are now advised to use the 32-bit compatible version 8.73 available for download by clicking on the icon below. I have now been working on this for fourteen years, right through a Mid-Life Crisis following redundancy, so if there are further bugs, I don't want to know any more!
Previous Versions 8.72 made procedure and function local variables available to sub-procedures and functions that share them. These versions were very memory hungry, and crashed with larger Basic programs. Version 8.73, that is much more conservative with memory, is now available for download.
Now Version 8.75 attempts to deal with GOTOs that are out of bounds of the calling PROCedure (C Function), that the C compiler doesn't seem to like (in most cases, where this isn't happening, you won't notice any difference), also slight bugs with logical equalities with MID$, LEFT$ and RIGHT$, and indirected control blocks in PROCedure and FN arguments cured.
Version 8.75c 'free's strings of their previous value when they are reassigned, and also selectively 'free's any Wimp Control blocks on exit from the converted C program. An additional option has been added to the 'SetUp' panel, to declare all global variables as 'static', for re-entrant Wimp programs.
Version 8.76 replaces the 'bbc_read' C Library Function, which mimics the BBC Basic construct 'READ', by inline code in the converted C source code, and attempts to cater for passing values from BBC Basic variable names embedded in DATA statements. Also, if there are variable names in array DIMs, where the actual values come from DATA statements, then these values are READ from the DATA statements, and result in these values being supplied to the '#define' statements, in the converted C source code, that are generated by !BBC_C32 to satisfy such variable DIM declarations.
Click on icon to DownLoad Zipped !BBC_C32 Version 8.76a, dated 1st November 2009, and Libraries 'LeafLib' and 'LeafLib32' dated 19th October 2009. One 26 and one 32 bit compatible Library. Both now include 'bbc_' and 'os_' specific C functions previously supplied by RISC_OSLib. Problems with C Functions 'bbc_restore' and 'bbc_read' cured.NB 1. IF YOU GET MESSAGES ABOUT S.W.I.s BEING OUT OF RANGE, YOU NEED TO SET THE SYSTEM VARIABLE 'C$Path' TO POINT TO YOUR SHARED C LIBRARY FILE.
e.g. Command Needed for a Path 'my_path.' is of the form 'Set C$Path my_path.', either on the command line (Press F12), or in an Obey File (e.g. !Run).
NB 2. There should be a System Variable 'SharedCLibrary$Path' that has the Path of the Shared C Library in it. To access this value enclose it in angle brackets (< and >).
Alternatively, if you have the Acorn C and C++ compiler, either 26-bit or 32-bit, ('AcornC_C++', or 'AcornC\C++'), then running, or just viewing, the included application '!SetPaths' seems to do the trick.
NB 3. If you get the message '!BBC_C32 needs at least 10240K to start up', then open up the !BBC_C32 application (Hold down 'Shift' and double click over its icon), then get the internal 'Desc' text file into a text editor. In the first group of items in this file, you will find a 'wimpslot 10240k' statement. Edit this initial WimpSlot allocation to a size acceptable to your computer's amount of RAM available.
NB 4. With large BBC Basic programs, !BBC_C32 sometimes claims large amounts of memory, runs out of memory, and crashes. If you then run the BBC Basic through again, then often this doesn't happen again. Try, try, try again!