Deciphering Basicode


hobbyscoop

Page from 'Z-80', discussed below

To unpack and run a program from 'The Best of Basicode 5', take the following steps. Some of the 32 CD-tracks are provided here [1] as WAV-files.
Note: the various auxiliary programs run in command-line mode in the terminal window of a Mac or Linux computer. GW-Basic is a desktop application, downloadable from the internet.
  1. Choose a CD track (nrs 1-30; tracks 0 and 31 are normal stereo sound). Each track is a WAV-file containing 2 Basic programs.
    For instance, on track29.wav are 'Gaia' (left) and 'Z-80' (right). In this example I'll be interested in the
    'Z-80' program.
  2. Split off the right channel from track29, using sox [2]. Call this file hs.wav:
    sox track29.wav hs.wav remix 2
    (with remix 1 you would get the left channel).
  3. Convert hs.wav into a bytestream using
    minimodem --rx 1200 -q -S 1200 -M 2400 --stopbits 2 -f hs.wav > hsbytes. [3]
  4. Running
    ./strip7
    will strip bit 7 from all bytes. It may be necessary to remove (with a text editor) some leading and trailing nuisance bytes from the resulting textfile hs.bas.
  5. In hs.bas it appears that in most cases the reserved Basic words ('keywords') are not separated by spaces. This was apparently not required by the Basic interpreters of the 1980s, but the keywords have to be set free at least for the GW-Basic emulator I'm using on the Mac. Run
    ./freekeys
    for this purpose. The resulting file is hsbody.bas, which may need some manual editing as well, because (this version of) the freekeys.p program cannot always discriminate between keywords, and parts of remarks or printable text.
  6. Finally, use a text editor to complete hsbody.bas with the snippet converter.bas: the lines 10 to 200 needed to adapt the program for the particular Basic-processor used, in this case a GW-Basic emulator. (Unfortunately converters were not included in the Hobbyscoop CD, this one I found on the internet). The completed file, in this example renamed Z80.bas, can be loaded and run in GW-Basic, which expects the file to be in the user home directory (~/).
[1] Selected Basicode tracks, together with two auxiliary FreePascal programs (strip7.p, freekeys.p) and two complete Basic programs are in this zip-package. The Pascal codes can be adapted or rewritten easily (although freekeys.p includes some sophisticated string handling).
[2] SoX (Sound eXchange, 'the Swiss Army knife of audio manipulation'): sox.sourceforge.net.
[3] minimodem - general-purpose software audio FSK modem: www.whence.com/minimodem.

EHD, February 2017

CM_homepage