so i'm building up a cable to load
a program into my zx spectrum at the
moment i've got a stereo jack to jack i
stole off dave's desk sorry dave um and
i'm just about to modify it to be mono
one of these will carry ground and we
need to work out which one it is there
we go so let's try loading this in now
nothing coming out there at all now
nope
let's make it louder
amplify
tape loading error
all right let's try again maybe not
quite so loud
there we go is that what we're looking
for yeah we've got a qr code yeah there
we are
so we end up going
to the fictional computer games company
and you can see the games
netflix released a special interactive
movie
of
their tv series black mirror that
started on channel 4 by charlie brooker
called bandersnatch and for people like
me and for people like sean who's
filming this it was set in the 1980s so
there's a real sense of nostalgia one
thing that was interesting is if you
selected one particular set of endings
you could get to a point where
the main character would be selecting a
tape put it into play and you would hear
a noise
like this
[Music]
and to some people they sort of think
that well i sound like modems starting
up but for people who sort of grew up in
the uk in the 80s
that was very much instantly
recognizable as the loading sound for
the zx spectrum which was a computer i
had as a child so we thought we'd try
and load that in and see what it did we
spent about two hours trying to actually
get that to actually load in basically
because the volume level coming out of
the apple laptop the world's most
expensive tape recorder for the zx
spectrum
um
wasn't loud enough for the zx spectrum
to lock on to the actual signal and load
the program in from tape
so we thought it'd be an interesting
thing because we haven't covered it
before we've looked at how disks worked
and things
to actually talk about how computers in
the late 70s early 80s used standard
audio cassette tapes
to store data so you would
it's certainly in the uk more perhaps
than the us but over here most people
will be buying the software on cassette
and loading it enough a domestic tape
recorder i mean something like the zx
spectrum you plug your standard tape
recorder in commodore 64 and some of the
amstrad ones were slightly different in
that they had dedicated data sets or
other data quarters i think they called
it on the spectrum plus two version um
which were built in or dedicated for
using on the machines which solved a few
issues as we
like we had here let's see how we'd
actually load something in i'm gonna use
this one with the built-in cassette
recorder purely because of the amount of
trouble that we had getting it to load
reliably i think using the built-in one
where we're loading off an actual tape
makes a bit more sense
um excuse the heath robinson-ness
of the setup here
um don't have the cables anymore so much
and i'm just going to rewind the tape
like that and so we now loaded up the
zx spectrum and we've covered that
before uh this is the more advanced 128k
model the zx spectrum 48k model
will just come up more or less
like this and so to load the program you
type load
quote quote hit return
and then you would start the tape and
the same procedure
would work on
something like the commodore 64 with a
few variations you type things slightly
differently depending on what machine it
was
so hopefully in a minute it'll start
getting some signal
so what's actually happening now not a
lot
as i say i haven't used this tape in
about 30 something years what do the
stripy lines mean the striping lines are
just a visualization of the data that's
coming off we then get a program title
and it's now loading in the program
these striped lines down here are
actually a representation of the data as
it's being loaded in off table stored as
an audio signal
and so that noise you can hear is the
data the bits that represent the program
converted into
audio tones which are then loaded in by
the computer
and so the program would then
load it and it would take
a while for these programs to load in
the speed these things worked wasn't
particularly
high and we could sort of see that so
take probably about three or four
minutes for your game to load or more
likely if you're using a domestic tape
recorder on some of the other things
you'd get to the end and it would say
ah tape loading error and you have to
rewind adjust the volume and start again
which is sort of the problems we were
having when trying to load the one
from the end of the band of snatch movie
into the system but we did get it
working there is that it loaded then is
it ready to play
no it's still loading so it took a while
to load the game in
but similar procedures and you've got
similar sort of screens under the
machine you didn't necessarily get the
sort of
weird graphics around the back of it
that was a spectrum thing although the
commodore 64 sometimes did
similar things when it was loading
software in as well but this was
definitely a
sort of
feature of the zx spectrum the game's
now loaded you can barely see what's
going on press the a key to start w to
increase angle q to decrease angle r p
to rotate the club enter to play the
shot
but it does have some sort of
resemblance to
what you might class as crazy golf so
let's have a think about what's going on
when we load something in so what's
happening is is actually very simple the
way that the spectrum generated the
signal that went out onto tape is that
it had an output part of its computer
which you could either take to be
plus five volts or we could have it
being zero volts and the computer could
change this to create
different patterns and if it oscillates
that between the two things it
effectively creates a square wave which
if you then played it would sound like a
tone
that sounds
familiar to anyone who was using a zx
spectrum
so what the computer could do is it
could alternate between
a positive value and a zero volts to
create a waveform which could create
sounds and so when it was saving the
data you've got a series of bits you can
lay out one after the other same way to
save about a thousand bytes that's eight
bits per byte that's eight thousand bits
yet one after the other
so we can write that and we need to
basically take that
and send it out as an audio signal
now you might think well okay
um
i will just
send the bits one zero one zero one zero
and send it out across there well if you
did that you would send the data across
and another computer could receive it
but when you wrote it out
onto an audio cassette
you probably wouldn't be able to receive
the data again so what you do is you
need to modulate it you need to convert
it into actual tones that are audio
tones like you would if you're recording
speech or music and so on you also need
to be able to sort of
get started and get into the actual
program know where it starts now it ends
now which how much data is going on on
the zx spectrum your program would begin
with a block all of the same frequency
if you look at the code for the
operating system you can see that this
works at around 810 hertz and when you
load a program the computer can see that
and it sees that oscillating signal
about that frequency and says okay i'm
now coming to the point where i'm going
to start loading in a program and it
locks onto that
knows that it's now expecting something
and at the very end of it there is a
very specially shaped pulse
which is a different shape than then
knows that
it's reached the end of the leader so
you get this leader and it knows it's
recent and they then know that the bits
that follow
are going to be
data and so we then get a very small
chunk if our memory service is about 17
bytes which is a header which describes
the program so if we go back to
rewind the cassette
first of all when it starts to flashing
between red and blue that's when it's
locked onto the leader so it knows that
it's found the thing and there we get
this bit here if we just pause it for a
second it's saying program goal so it's
loaded in the header and that header has
told the computer that this is a program
which means it's a basic program so it
tells you what type of file is is it a
program
which is a basic program is it machine
code or data is it specific type of data
so that's telling us
what it is it tells us how big it is and
where it's going to be loaded into
memory depending on what type of data
it is so it loads that's all in the
header and when you type load you can
either say load quote quote which will
load in any file or you can load a
specific file and if it doesn't match
that it'll wait until it finds the next
header that tells you what it is there
and there's another
byte here
hidden in the header which tells us
whether it's a header or whether it's
data and then we get another
bit of leader again
of the same tone but it's much shorter
and again that's exactly the same
purpose it enables the computer to get
into sync with this you get that synced
pulse at the end to say this is finished
so if we restart it it starts to load in
the leader and now it's loading in the
program and this bit of the section
could be of various length we don't know
and it's just the data or the program so
these two sections
here
they're not made up of one tone
but they're made up of two different
tones and so you either have a tone that
is sort of this length sort of shape or
you have one which is twice as long so
we send this if it's a zero we send this
if it's one and so we get one complete
waveform and what the computer can then
do is when it's loading it back if you
get the volume levels right it takes the
audio signal which isn't real which is
made up of lots of very small fragments
of different frequencies
either zero
or one to make up the progress it's
loading them back in
it can count the number of edges it sees
within a specific time and work out
whether there's enough edges for it to
be a zero
or if there's enough edges for it to be
a one
and then reconstruct the data
that's being loaded in and there's a few
bits of parity in there and other things
so that you can check whether it loaded
or correctly or not when it gets
to the end but it's unable to sort of
process the data as the signals coming
in saying right i've seen this edge i've
seen this interesting this edge that
means it should be zero i'll write a
zero into memory it should be a one
other one that has a one into memory and
load the data
back in
now
obviously when you're doing this you
want to make sure that your system is
stable and one of the problems with
cassette tape is as a recording medium
it wasn't that stable if your battery
started to
lose power
often the pitch of the music you were
listening to would drop because it was
linked to the power and so on and that
was fine for music because most of the
time was imperceptible you wouldn't
notice the wow and flutter as it's
called for a computer program that's a
real problem
so what people did well what sinclair
did when they designed this is they
chose values for how
long those pulses were going to be
whether it was a zero or one
to be such that
if there was wow and flutter the
computer would be able to cape if it was
slightly faster or slightly slower
and still be able to cope with the data
commodore actually went slightly further
if we turn on the c64 they actually
stored two copies of the program one
after the other one they recorded so
when you saved your program out it would
write out the program and then
immediately after that as a separate
block would write out the program again
similar technique using a series of long
pulses and short pauses to represent the
zeros and ones so when we load in a
program
on the commodore
using its um
data set and it will start loading in it
would load the program in and if there's
any errors in there it'd make a note of
where they were within the program and
then when the second copy is played
through it could load in hopefully
correctly from that point the bits that
had gone wrong
and sort of correct the errors and was
able to sort of recover your program you
mentioned that they're given a memory
address do then things just sequentially
follow on from there i mean it seems to
me that a memory address is a long bit
of data in its own right the memory
dress um describes where the first bite
goes and so what happened is you um get
a memory address and it would say load
it in here let's say it was a screen on
the zx spectrum it'd say load it in at
one six three eight four
in memory so the computer would load in
the first eight bits one after the other
form them into a byte in one of the
registers and then write that back byte
out into memory at one six three eight
four then load in the next eight bits
from tape and like that out into memory
bits one six three eight five and so on
until it loaded in
the whole bit of data and knew how many
bytes to work in the case of a screen
6912
and it could load them
in to the right places
interestingly
these loading and saving machines were
completely written in software and if
you actually look at the implementations
in the rom chips
each path that the program can go down
has been correctly sort of worked out to
take exactly the same number of cpu
cycles so that when it produces the
pulses between the two they're all of
exactly the same length so they're all
of exactly
the right frequency and you produce the
data that you need and when it's loading
it again it's counted so that it knows
exactly how many edges have been found
in a particular
point in time so you have to turn things
like interrupts off it's a bit like when
we talked about writing software for the
2600
these routines are very carefully
written the downside of them is both on
the c64 and on the zx spectrum is that
they took a long time
to load in the program and so what
people did
particularly commercial software houses
when they were writing software is that
it would write fast loaders or turbo
loaders and all they did was they
rewrote the routines that would load in
the program
to
write load the data faster so they use
shorter periods for a one shorter
periods for a zero which means you get
more in the same amount of time and so
you could then load the program in
faster the downside was is that
any sort of wow or flutter variations in
volume and so on would make the program
harder to load
now from the
commercial software house's point of
view that wasn't actually
a problem because
they could write these tapes out using
professional equipment that would write
a strong signal onto the tape which
would load
and work fine
you then try and copy that cassette by
connecting two cassette recorders
together
the copy wouldn't then load which is
great because it meant that you had to
go out and buy the real copy and so it
actually had a benefit in terms of
anti-piracy things but also made it so
the game loaded in say two minutes
rather than three minutes or whatever it
was i think the commodore's uh
given up doesn't it yeah well i mean
it's not zx spectrum is it going back to
the sort of file that was attached to
the end of bandersnatch after
lots of jiggery pokery twiddling wires
together and finding the right volume we
managed to get the program loaded into
the zx spectrum and when you run it
it's a program written by matt wescott
on behalf of netflix last year to
display a qr code on the screen so it
basically it runs the program it draws
the qr code there's lots of nice visual
effects to make it look like it's
playing off an old piece of videotape
with occasionally looking like it's on a
sony tv that's lost lock the amusing
thing is if you follow that qr code
you're taken to the tucker soft the
fictional website out of the
movie and you can actually download one
of the games that's mentioned in there
you can get a file
that you can then play into his lx
spectrum and actually play one of the
games so the amusing thing is when was
the last select spectrum game written
2018 it seems
now i've got the token so i can load a
value in add the value for merger into
it and store it back and hand the token
and now i've got the token again i can
load something into it into my register
add something onto it throw it back and
pass the token on and i've got it so i
can load the value in add the value for
my register store it back