!GW_BBC

Translates GW-BASIC to BBC Basic.

October, 2005

Martin Carradus


Copyright © 2005 Leaf Mindcraft



Downloading, Unpacking and Using !GW_BBC


Return to Home Page...

Link to Next in Home Page Table...

Link to Previous in Home Page Table...

This is an Acorn RISC OS software application that converts/translates from GW-BASIC Program Files to equivalent BBC Basic Program Files, and is available for free download.

After having downloaded and unzipped the !GW_BBC Application, drag the application to a suitable directory on your hard disc. Double click on the !GW_BBC icon to load it onto the icon bar.

Double click on a GW-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 GW-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 BBC Basic file is offered for saving in the same directory as the GW-BASIC file, but with the file name prefixed by "BBC".

Additional Help is available from the bar icon menu, or by using the Acorn facility !Help, present in the 'Apps' directory.

The translated file then should duplicate the effect of the GW-BASIC program within the BBC Basic environment.


Known Bugs
==========

GW-BASIC will not run a FOR loop when its index initially exceeds its final value, unlike BBC Basic, which always executes a FOR loop at least once, so there is a problem there. Also GW-BASIC initialises all variables to zero. BBC Basic does not automatically initialise variables. The BBC Basic interpreter message 'Unknown or missing variable' means that you have not initialised a variable before the point at which its value is required to be known. An output listing of all the identifiers used in the program can be produced that attempts to detect and mark those variables that are used before their point of initilisation.

GW-BASIC also will handle small unDIMmed arrays. The message 'Unknown array' means that an array has not been DIMmed.

There could be numerical analysis problems to do with the accuracy of the representation of numbers. GW-BASIC has a word of 16 bits, whereas BBC Basic uses 32 bits.

Many GW-BASIC constructs were found to be untranslatable to BBC Basic. A message appears either within a special PROC or FN call in the translated file when this occurs. In the case of some errors, the resulting actual BBC Basic line length may not agree with the line length given in the file and BBC Basic editors will not accept it, giving out the message: 'Bad Basic program'. However if only simple constructs are being used e.g. DO, WHILE and FOR loops, GOTO, GOSUB, ON... GOTO, ON ... GOSUB, SELECT, IF ... THEN ... ELSE ... ,EVAL, numerical calculations, logical conditions and PRINT and INPUT, then the GW-BASIC should perform exactly the same in BBC Basic.

Unfortunately the commands DRAW, PLAY, PUT and GET have not been translated. Also other graphics commands suffer from the fact that BBC Basic graphic co-ordinates are measured from the lower left hand corner of the screen, whereas GW-BASIC graphics are measured from the upper left hand corner. The author has attempted to deal with this appropriately. Also the scaling is different. IBM Screen modes were also found to be difficult to match with equivalent Acorn Screen modes. The IBM colouring system is also not the same as the Acorn scheme.

In addition, PEEK, POKE and random access files could not be mimicked in BBC Basic.

Extra PROCs and FNs, which were needed to mimic certain constructs in both GW-BASIC and GW-BASIC, are present in the supplied 'BBCLib', which is called in via an injected LIBRARY command. 'BBCLib' should be in when the BBC Basic is running or an error is generated. It is also present within the !GW_BBC application. One function attempts to translate from IBM file names to equivalent Acorn file names.

!GW_BBC attempts to detect non- GW-BASIC programs and complains.

Every attempt has been made to test out the translator, but the author was unable to obtain live code and just had to devise test programs, so bugs could still exist undetected.


Click on Icon to DownLoad Zipped !GW_BBC Version 1.00 Dated April 6th 2004. Now 32-bit compatible.


This document was generated on 18th October 2004 for Acorn Applications distributed by Melotech for Martin Carradus.