2068 Tape Tutorial

See all articles from Sinc-Link v5 n6
Publication: Sinc-Link
Pub Details: Sinc-Link v5 n6 (Volume 5, Issue 6)
Date: November/December 1987
Pages: 9-10

Here is everything you ever wanted to know about saving to tape but didn’t know where to ask. Except for minor differences, like speed, much of it applies to the microdrive and to some disk files.

One important function is not immediately evident; the ability to SAVE code from one location to another.

INPUT MONITORING

For all tape playback operations, a message is displayed on the screen every time a leader is read. This happens during the gap between the leader and the record.

If the leader matches the data type and name specified, the record is read and acted upon. If not, the message remains and reading continues. Messages accumulate in a list until a match is found or no more data is left to read.

LOAD “bFWzVj” makes an index for a tape that has no program record named bFWzVj.

TAPE HEADER FORMATS

BYTES    TYPE   DESCRIPTION

1        All    Header identifier (value = 0)
2        All    Record type (value 0-3)
3-12     All    Record name
13-14    0      Length of program and variables
                   (E_LINE - PROG)
         1,2    Length field from data structure
         3      Specified length
15,16    0      Autostart line number, or 0080h
                   (LSB/MSB)
         1,2    Array I.D. Code
         3      Specified address
17,18    0      Length of program (VARS - PROG)
         1-3    N/A  (value = 0)
19       All    Checksum (XOR bytes)

RECORD TYPES

0    Program and variables
1    Numeric array
2    String array
3    Binary code

TAPE FORMAT

Tape format: Block #1 and Block #2, each beginning with SYNC
Tape format: Block #1 and Block #2, each beginning with SYNC

The tape recording consists of two blocks of data separated by a blank gap. (.835 sec.)

Each block begins with synchronizing cycles. These cycles are used by the 2068 to compensate for variation in tape speed from one recorder to another or due to other causes.

Gap, and optional audio.
Gap, and optional audio.
Block #1: 4032 synchronizing cycles (five seconds); 1.24 msec., Frequency = 806.5 Hz
Block #1: 4032 synchronizing cycles (five seconds); 1.24 msec., Frequency = 806.5 Hz
Block #2: 1612 synchronizing cycles. (two seconds); 1.24 msec, Frequency = 806.5 Hz
Block #2: 1612 synchronizing cycles. (two seconds); 1.24 msec, Frequency = 806.5 Hz
Leader. (Tape label) Signal "01100101" (example); 0.49 msec, 0.98 msec; Frequency = 2040 Hz for a "0", 1020 Hz for a "1"
Leader. (Tape label) Signal "01100101" (example); 0.49 msec, 0.98 msec; Frequency = 2040 Hz for a "0", 1020 Hz for a "1"
Record.
Record.

Record. The record identifier is a single cycle at 2400 Hz. The rest of the signal is the same type as for the leader. The record ends with a checksum byte. Both checksum bytes have an additional transition to assure a correct read from tape. It takes about 5 seconds per K/byte of record.

SAVE INSTRUCTIONS

SAVE "fox"
        Saves program and variables.
SAVE "fox" LINE auto
        As above but starts running from program line
        "auto" when reloaded.  (see leader format)
SAVE "fox" DATA v ()
        Saves numeric array v
SAVE "fox" DATA s$ ()
        Saves string array s$
SAVE "fox" CODE location, bytes.
        Saves bytes of binary data, starting at
            location.
SAVE "fox" STRING$
        (equivalent to:
SAVE "fox" CODE 16384,6912)
         Saves screen.
         (primary display file)

When SAVEing, the record name must be from 1 to 10 characters. It cannot be omitted.

For all other commands, only the first record having matching name and data type will be acted upon, with one exception.

If the record name is specified as the null string “”, the first encountered record of matching data type, regardless of name, will be acted upon. This option will be assumed in subsequent examples, but not shown.

Note that the same record name can be reused once for each data type without interference.

VERIFY INSTRUCTIONS

VERIFY "fox"
             Verifies program and variables.
VERIFY "fox" DATA v ()
             Verifies numeric array v.
VERIFY "fox" DATA s$
             Verifies string array s$
VERIFY "fox" CODE location,data
             Verifies bytes of binary data, starting
                    at location.
VERIFY "fox" CODE 16384,42288
         Verifies as much of SCREEN$ as possible.

The computer alters the lower 2 lines for reports. Because of the way D_FILE is organized, these bytes are intermixed with those for the bottom 8 lines. This is incomplete but quite effective.

LOAD INSTRUCTIONS

LOAD "fox"
           Loads new program and variables from tape,
           over any that were already present.
LOAD "fox" DATA v ()
           Loads numeric array v
LOAD "fox" CODE location, bytes
           Loads bytes of binary data, starting at
           location
LOAD "fox" CODE
           Loads back where it came from.
LOAD "fox" SCREEN$
           Loads from tape to screen, except for the
           bottom two lines.It is interesting to watch.

MERGE INSTRUCTIONS

MERGE "fox"
           Keeps old program and variables, then loads
           new program and variables from tape.
           New program lines are inserted, or overwrite
           old program lines. New variables are added,
           or replace old variables having the same name

MERGE requires free memory to provide a workspace. There is also no prompt to tell you to stop the recorder, other than a change in border pattern. The same is true when LOADing large arrays.

Taken from the March 1986 issue of L.I.S.T.ing, the newsletter of the LONG ISLAND SINCLAIR TIMEX GROUP.

Retyped by G.F. Chambers