XLATE

Products: XLATE
Developer(s): Kurt A. Casby
Date: 1988
Type: Program
Platform(s): TS 2068
Tags: Terminal

Converts BASIC programs between the two upload formats used by TS2068 modem owners, so a program uploaded with either terminal package can be used by the other. TSXmodem (an MTERM II utility) sends a BASIC program as a CODE file with no header, while SPECTERM-64 sends it with a header attached. XLATE is 535 bytes of machine code loaded with CLEAR 64999: LOAD "XLATE"CODE 65000,535. Once it is in memory its four routines can be used as often as needed without reloading.

XLATE was written by Kurt Casby and released into the public domain. The documentation, included in the download as a text file, was written by Ed Grey. It says the code will not run on a Spectrum or on a TS2068 in Spectrum mode, though Spectrum files moved by either terminal program can be converted with XLATE on the TS2068.

Program Analysis

The four routines

All four are called with RANDOMIZE USR and work through a buffer at address 30000.

  • USR 65000: SPECTERM-64 to BASIC. Load the downloaded program, saved as CODE with its header, at 30000 (LOAD "name"CODE 30000), then call the routine. The header is removed and the program appears in the BASIC area, ready to RUN, LIST or SAVE.
  • USR 65100: BASIC to SPECTERM-64. With a BASIC program in memory, the routine builds a header and turns the program into a CODE block starting at 30000, and the BASIC program disappears. The header names the file “program!”. The docs give PRINT (PEEK 30011+256*PEEK 30012)+32 for the block length to use with SAVE "name"CODE 30000,length. Carl Forst’s public domain RENAMER program can change the name in the header.
  • USR 65200 and USR 65300: TSXmodem to BASIC. Call USR 65200, load the headerless TSXmodem file with LOAD "name"CODE 30000, then call USR 65300 and the BASIC program appears.

After a conversion to BASIC a flashing cursor is left in the first program line. The docs say it has no effect, and pressing ENTER clears it.

This release

The tape holds a short BASIC loader followed by the XLATE code. The loader was written for this release. It clears RAMTOP to 64999, loads the code at 65000, and lists the four routine addresses. The listing shown on this page is that loader, not part of Casby’s original. The zip also holds the two original transfer files, XLATE.TSX (TSXmodem format) and XLATE.SPX (SPECTERM-64 format, the same 535 bytes behind a 32-byte header), and Ed Grey’s documentation.

Notable Techniques

  • The code was distributed in both transfer formats, so users of either terminal could download it and save it to tape.
  • Placing the code at the top of memory, above CLEAR 64999, leaves it in place through NEW and lets the conversion routines replace the BASIC program freely.

Potential Issues

  • The conversion buffer starts at 30000, so it appears that a program has to fit between 30000 and 64999 to be converted.
  • USR 65100 replaces the BASIC program in memory, so save a copy first if you need it.

XLATE came from the CATUG_PDL_A Oliger (JLO SAFE) disk, where it existed only as the two transfer files and a documentation file. For tape, the code was taken from the transfer files and saved after the new loader, and the documentation was converted to text with the author’s home address removed. It was tested in ZEsarUX: USR 65100 converted a test program into a “program!” header and BASIC block at 30000.

Related Products

Public domain software; translates between all TS 2068 terminal programs.

Image Gallery

Source Code

10 REM XLATE by Kurt Casby (public domain); docs by Ed Grey
20 BORDER 7: PAPER 7: INK 0: CLS
30 PRINT AT 1,13;"XLATE": PRINT AT 2,4;"TSXmodem <-> SPECTERM-64"
40 PRINT AT 4,0;"Loading XLATE CODE 65000,535..."
50 CLEAR 64999: LOAD "XLATE"CODE 65000,535
60 CLS: PRINT AT 1,13;"XLATE": PRINT AT 3,0;"Code is at 65000. Routines:"
70 PRINT '"USR 65000  SPECTERM-64 CODE file"'"           (header, at 30000) to"'"           BASIC"
80 PRINT '"USR 65100  BASIC to SPECTERM-64"'"           CODE file at 30000"
90 PRINT '"USR 65200  then LOAD a TSXmodem"'"           BASIC CODE file"
100 PRINT '"USR 65300  TSXmodem to BASIC"
110 PRINT '"See the docs in the zip for"'"details. Use RANDOMIZE USR n."
120 STOP

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.