The ZX Spectrum's display file occupies memory locations 16384-22527 (hex 4000-57FF), and horizontal scrolling can be achieved using machine code routines that manipulate this display file, with the display file divided into three sections of 256 character positions each, where each character consists of eight pixel rows.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
chilling with the ZX Spectrum LIVE Animated AL #zxspectrumAdded:
Mhm.
>> Mhm.
>> Mhm.
>> [music] [music] >> Mhm.
>> Oh dear.
Yes, exactly. Uh This is 128K, so >> [laughter] >> I'm using a 48K machine. We can't play this tonight. Shut up. Okay, let's stop it.
We can't play that one. It's 128K. I just Googled it.
Okay, sorry about the dog. Will you shut up? I'm I'm doing a live stream.
Don't be so rude.
So disrespectful.
Right.
Right.
>> [laughter] >> That's Okay, so Robocop Robococo Robocop 2 is 128K.
Uh so it's not going to work.
It doesn't tell me that on here that it was 128K. I quickly Googled it and it said, "No, it's not going to work."
So, what else have we got?
Um I'm using the SVI cars tonight.
Um it works really well on the ZX Spectrum. No problems at all. I have done some loading and and saving on it on the SD card and it works absolutely brilliantly.
Uh it play loads tapes in in real time so that you can't I don't think you can do a fast mode on it for the uh ZX Spectrum games.
So, let's have a look see what else we've got here.
Um See, I don't really play games as much.
I like making them programming. So, I'm a little a lot of these games on here I don't know what they what they are. Um Firestorm, what's that?
Let's have a look at that. That sounds good. I'm just going for ones that have got a nice name.
So, let's try Firestorm.
I've heard of it. I can't remember what it is though. Probably going to be something I can't play.
So, good good start to the stream. I was late getting on.
And also loading up a game which was 128K on a 48K machine. So, not a good start.
I better check this one isn't 128K as well. I don't know.
Uh Firestorm.
Let's just double-check.
Yes, apparently it we should be fine with this.
I'm just pulling up some images of it.
So, see if I recognize it.
I don't recognize the loading screen.
>> I'm not finding much information about it online, either.
I just Oh, well, we'll just let it load. See what it is.
Yeah, we're going out of school tonight.
We're doing it the old-fashioned way where we've got to wait minutes, 8 minutes per game usually, isn't it? I don't know.
Doesn't actually tell me how long I've got. Just a little um bar.
So, we're just under halfway.
Anyway, why I was late? Well, I was late because I was looking and reading and practicing some machine code routines in assembly language and just completely lost track of time.
I thought I'd have a break tonight from the ZX81 just to show you that the ZX Spectrum is still alive. I've just got to try and remember how to use it. It's been so long.
And I wanted to test the SPI cards as well. That's what I'm using tonight.
As soon as it's loaded, I'll put the camera on and for those of you don't know what it is, I'll show you.
Uh so, we're we're just just gone over the halfway mark now.
I'm about to unplug the uh earphone adapter from the ZX PJA Joy so I could plug this into load it.
So, that's why you can't really hear the loading sounds very clear.
Well, they should be able to hear them cuz they're coming through on my microphone, aren't they?
Yeah, give my fingers a rest, Frank.
I'll tell you what, that ZX81 man, I know I was moaning a lot last night about the uh the uh uh keyboard.
Oh my gosh.
I'm surprised it passed quality control all those years ago.
So, back in the day where nothing was a rush.
They had all the time in the world, didn't we, back then?
Now everything's fast-paced.
But then life was a bit more in the slow lane. So, you didn't you didn't mind. Oh, wait, it's nearly finished. We're about 90%.
95. Here we go.
Right, C to change controls. Well, we best do that because I haven't got a clue what this game is.
I've heard of it, but I What is it?
What was that bloody dog?
Oh, no. Have I just gone and Have I just gone and messed it up?
No, good.
Well, let me sort the dog out in a minute, guys.
>> Apologies for that. I don't know what's got into her. She's barking at everything tonight. Right, okay, let's get on with the game.
I haven't got the Kempston joystick plugged in, so I'm going to go for the keyboard.
I'm hoping you can hear the sounds now cuz I've plugged the uh the cable into the ear socket, so hopefully you'll be able to hear it.
That's why the border went white. I thought for a moment that I thought it was going to crash.
So, we've got two W and I O and bottom row.
Okay.
Uh C change controller, let's change the controls.
Um oh, sorry, I thought it was going to let me do define keys. Okay.
Uh press left for fire.
Fire start. What the hell's going on?
I'm not liking this.
Press fire to start.
I am.
Oh, there we go.
Can you actually hear the Spectrum? I don't think it's coming playing through there, is it?
Uh I don't think it is.
I always have a problem trying to get the audio to play on the Spectrum.
Right, come on.
I'm not liking this at all. What the hell's going on?
I can see why I never played it before because I couldn't couldn't work out how to.
>> [laughter] >> Oh.
All right, okay. Right.
And let's go up let's go up there this time. But it it won't go up up.
It's not the easiest thing to control.
Is that going to kill me?
Yes.
All right, let's have a look down. Oh, there's a little map down the bottom there.
I've got a clue what I'm I've got to do in this yet.
Oh, [ __ ] Just getting through this door is a bloody task. Right, okay.
All right, there was a little robot thing here.
I don't not I'm not keen on the scrolling with the the screen just Is it it doesn't scroll till you reach the end?
I'm not keen on that at all.
And I can Oh, [ __ ] >> [snorts] >> I thought I'd gone past him.
Uh if I There's nothing up there anyway.
Let's go.
Has anyone ever played this before?
I'm just walking so far and letting the screen catch up. I got past him.
Oh, he's Oh, [ __ ] There's a red thing.
All right.
Let's have a look up there. Maybe there's something up there I got to collect.
It does say it's a dead end, but maybe there's something up there.
Oh, yeah, there is.
There's a key.
Okay.
There's a key, but uh Let's get past this red moving block.
It won't open. Oh, [ __ ] It won't open.
I need I obviously need a key to open that.
Right. [snorts] Okay.
Uh, there's no sound coming through at all, is there, for the Spectrum?
Um I've got it plugged in.
It's always been a bit of a pain in the ass trying to get sound off this.
What the I don't know what happened then. I think I pushed the wrong button.
Oh, come on.
Oh, I've got a gun.
I didn't realize I had a gun.
Okay, we've got like a big Ah, that's why it's called firestorm. I blew like a massive great fire cloud.
Okay.
There we go.
Oh, that's not very It's not very good, is it?
I don't I have to be honest with you, I'm not enjoying this.
It's just um I'm finding it very hard to see the character. I'm not keen on the scrolling.
And the keys.
I mean, what's he doing now? He's just stood still.
With his Pinocchio nose out.
There he What the Let's give it one more go, and I'm I'm I don't want to give up on it too quickly, but I am not liking this one bit.
Just going to download it. You're going to download it.
It's called firestorm.
I'm not a great fan of it, to be honest.
It's not my type of game, anyway.
Let me [snorts] see if I can get some sound for you.
Sometimes if I unplug it, unplug it back in.
Oh, what's happened?
Ha ha, what have I done?
>> [laughter] [panting] >> I I didn't do nothing. Oh.
What the Oh, this.
Come on.
I might just get an old download an old magazine and and do a type type in tonight, I think.
Just type in something for a bit of fun.
I fire.
Right, if you don't mind, I I can't play that any longer. It's not doing anything for me. Not liking it.
So, let's have a look what else we've got. I'm going to have to unplug that.
It's not working, anyway, is it?
Maybe I should have left it in the in that one. Right, okay.
So, before I start, let's put the camera on so I can show you what this thing is.
For those who who weren't on the live stream last night, Uh where's me camera?
There we go.
There we are. There's me camera.
Okay. So, let's get myself centered.
There we are.
Okay. So, let me show you this first.
Uh let me unlock this box.
Let me make this a bit bigger so you can see it. Okay. So, there it is. This is my new toy.
All right?
Uh it's uh SVI CAS. That's what it's called.
And basically, >> [snorts] >> you got a little comes with a little touch pen like you like you would get on the old Nintendos like you know?
And you can go through the uh We go back. There's all the games. Loads of games on there.
Go back again.
I go to the beginning. That's That's your menu screen.
So, you've got automatic manual for your tape deck.
You got fast loader.
On the ZX Spectrum, the fast loader doesn't seem to work with the file format. It works for the ZX81.
You don't really need to worry about the rest for tonight.
That's We can mute it, turn it off, everything.
We can record record on it as well. And this is why I wanted this for this option here so I can record onto SD card for the ZX81 mainly.
Uh it wasn't that expensive, Franco.
Not very expensive at all. Take it this way. It was about 60 quid.
All right? So, not very expensive at all.
Cuz I was expecting it to be quite a lot of money, but um if you're interested anyone interested, send me an email and I'll send you the link to where I got it from.
It's got loads of options on there for different I'm trying to show you it without the light glaring in the screen.
Got lots of options on there. Lots of different computers you can use on it.
Just quickly I'll push the wrong one cuz I'm trying to So, there you go.
Lots of I don't know if you can see that.
I'm trying to show you that it's glaring.
There you go. There's the ZX Spectrum.
So, if I push the ZX Spectrum, it comes up the top.
And then we've got the files. Like I said, I will do a proper video on this at some point.
Uh and show you a bit more.
But, what I want to do tonight, in fact, if you don't mind, I want to try the record feature on this.
Okay, just to show you it recording.
So, let's just write something very quick.
Let's just write something very quick in two. Let's shrink that boxy down again, so you're not looking at me all night.
>> [sighs] >> All right. Let's just shrink that down.
Let's just write something very quick, and then I'll show you how it saves. So, Let's just move.
Obviously, what when I've got this plugged in, I've got to take the SIM card out of the divMMC so that it will work.
Cuz otherwise, the the divMMC will um take priority over that.
So, let's just do something very quick.
Um we're just going to move something around the screen.
I don't know what's happened to my screen, but the contrast has gone right down.
So, let's just cut let Y equal Oh, I'm so used to working on the ZX81, it's all going to [ __ ] here because I've got a keyboard that works and I'm not used to it.
Um 20 let Y1 = Y Oh, come on.
Okay, trying to get used to the keyboard again.
[ __ ] I'll set it up here tonight. Let Y = 10. Let's start again.
Right, take your time.
That's it.
Let Y1 = I forget. Now, I can put it all in a line, not like the like I've been used to for the last couple of weeks having to put it line by line.
But, we'll change that to 10 as well.
Okay.
So, we'll just do that.
30 let A strings = Um Let's just put a graphic block in there for now.
40 let K Oh, where's the string?
Where's the string? No, that's not a string. That's a dollar.
There it is, number four.
Okay, = Uh integer 10.
50 let X = X K strings = Oh uh plus key strings equals P Until I've been off it for a while.
Cuz I'm I'm not doing very well with the key pushing tonight on this.
I'll get used to it.
So, I'm just doing just want to do something quickly just a decent size program just to make sure it saves.
I know it saves cuz I did a test before I came on, but I only did like a hello world button like uh, you know, to fill the whole screen.
Um print at Y I know what I want. I got Y1.
Print at Y1 X1 and Where's the end?
I forgot.
It's There it is. It's It's on number four key, I think, for the ZX Z81.
No, two. Yeah, it's in a different place.
And uh Y1 is more or less than Y or X1 is more or less than X.
at Where's the at?
There it is.
Let Y = X A string.
7A Go to Uh 40.
And I know what I forgot to do.
Um 65 Let Y1 = Y Let X1 = X There we go.
So, just very quickly, just something to move around.
What's the screen looking like to you guys? It's very uh I don't know what mode I've got it on here.
Uh input. What have we got?
It's on the right one.
The contrast is really bad, by the way.
I think it's because I've I've messed around with it to get it to work.
And I haven't got the bloody I've lost the remote for this bloody telly. So.
I'm just going to have to put up with it. I think it looks all right your end, doesn't it?
Right, okay. So, there we go. So, let me save it.
So, let's go save.
I'm just going to call it move.
And let's have it start straight away.
So, we'll will to line 10.
So, we now go on to the Uh we need to plug it into the Spectrum. So, connect the mic up. I'll connect the ear up as well.
Unfortunately, I can't show you this, can I? Cuz I can't I I haven't got a camera that I can move around. So, on this, I will now um push record.
And you've got a little ABC button there.
You push that, and then you put the file name in of what you want to call it. So, let's call it move.
M Uh where are we? Um O V E And then I push the record button.
And enter.
Hopefully, I've done that right. Yes, it's Now, the image size now it's counting up a little um counter. But, like I said, I will do a proper video on this. I'll find another camera and actually film it. Probably film it with me phone. So, it's saying it's saved it already.
So, let's see if it has.
Yeah, it's saying it's in there.
So, let's go new, clear it.
Load.
Enter.
Play on this. Here we go. Is it going to work?
Have I done it a little bit too quick for it? So far, so good.
There you go. It's worked.
Brilliant.
So, there you go. That um No problems at all with that. Absolutely brilliant bit of kit, that's.
So, this will come in very handy. And apparently, I'll be able to use I may be able to use it on the next year. And we don't know whether it's going to work on the new next, but I can't see why it won't.
So, yeah, very impressed with that.
So, there we go.
All right.
Yeah, it's just I've just did a little test program, uh Jazzman.
Or is it Jet? Yeah. It's just a little test program cuz uh I'm testing I'm testing this.
My new gadget.
Okay, which will save for me and record.
So, I just wrote something quickly just to test it to see if it would work. And it has.
There you go. So, that's working fine.
>> [snorts] >> Yeah.
Just a black paw. I'm not going to you know, if I ever make a game, it's there ready for me, ain't it? If I don't delete it.
So, there you go.
Yeah, I wish I had a camera on it so I could show you what I was doing.
I don't have one. The only thing I've got is me phone, and I don't think I can link that up like a movable webcam.
Cuz that's what we want what I need really, ain't it? It's a movable webcam so I can have it looking at the keyboard and any new gadget that I've bought.
So, I mean, we've we've got a good setup here now. I mean, I purely bought that one for the ZX81 for when I'm doing stuff on that.
Although, I have got a cassette recorder, but I I wanted to be able to get the stuff onto the internet, you know, onto my itch account.
But, like I say, it will work on the Spectrum as well.
And it's working really well on the Spectrum. No problems whatsoever.
So, what should we do?
What do you fancy doing?
I did say I wouldn't mind writing in a type-in, but I haven't got anything at hand.
I'm going to get something pull something up quick.
Let's pull something up quick.
See what I can find. I've got the other laptop.
So, I'm just going to see if I can find anything very quickly on the spur. Nothing planned. Never I I never plan anything for these live streams, do I? I just jump on, see what see what I fancy doing, and just share what I'm doing. Uh I don't really want to play any games tonight. I'm not really Let's go to Sinclair User.
So, I'm I'm opening up the Sinclair User now. So, I don't want to Put them in They might be pretty big games on this. So, that's the only problem.
I don't want to be typing in all bloody night, do we?
There again, if I don't finish it, I can always continue it on the next stream.
So, let's go to um What about 1985? December 1985. Let's see what was going on in December 1985.
It's taking forever to open.
Come on.
Come on.
It's like it knows I'm doing a live stream, so it's just going to say, "You know what? I'm going to go slow tonight." It's probably because I'm you soaking up all the internet during the live stream.
Here we go. Right.
So, what typing did we have back in 1985?
I'm just waiting for the images to load up.
Right, let's have a scroll down.
Here we go. What have we got here?
Anything interesting? Nothing has come up yet.
Might have been better off going to Sinclair programs, actually.
Come on, where's the typing? It's got to be a typing here somewhere.
Here we go.
Program pullout. Here we go.
Let's try and find a short one. I don't want to be typing in all night.
And we've got a boxing game.
Kingfisher.
What's Kingfisher? What's that about?
Oh my god, it's very hard to read.
Let's have a look here at uh Sinclair programs.
Sinclair programs.
>> Right, okay. Sinclair programs.
I've been reading these magazines quite a lot, obviously cuz of the ZX81.
Here we go.
Sinclair programs. Um March 1985. Let's stick with the year.
And Here we go.
A smooth screen scroller in machine code.
Let's have a look at that.
So, what does that do?
Okay.
Program one. Uh right pixel scroller.
So, this is a pixel scroller. Should we just type this in?
And we got the assembly language here.
We got the hex.
So, we've already got the data there.
Let's see what it does.
So, this is I don't know if you can see it.
Probably not.
>> [laughter] >> But I'm kind of you Of course you're not going to see it.
[ __ ] me, I can hardly see it.
It's that small. I'm running out of desk. Okay, let's put the laptop down there.
And it's only a short program.
This program will um It's a a right pixel scroller.
So, let's clear the screen.
Let's have a look at it. Something to do in it. So, 10 REM And let me bring that around like that.
So, we got REM. It's uh Let's take me time with the keyboard cuz I'm not right pixel scroll.
It's only It's only a short program, that's why I've picked it.
In fact, let me just go to page two.
What I'll do is I'll just Oh, and we've got one that goes left as well. On the next page, we've got one that goes left. So, we've got a right and a left one.
So, it says here, "In the last issue, we introduced some of the background concepts of machine code programming. We are now ready to make a start on practical machine code by looking at two short routines by scrolling the screen to both sides of the screen."
Take a quick look at the two routines listed in this article. So, that's the one I'm about to type in, and the other one goes to the left.
So, what I'll do is I shall share this.
I'll put down the link.
It is World of Spectrum Sinclair programs 1985.
But, after I've got this working if I can type tonight. So, we've got S equals zero.
For Can I make that any bigger so I can see it? No.
Anyway, can I make it any bigger? That's better.
That's better. So, for I equal 64. Bear with me while I get used to the keyboard again. I've been so used to working on a a bone a finger basher. It's um it's made me fingers all numb. I'm looking for two. There it is.
6400264 023 All right.
And then we've got in fact pull that back down.
There's more on the end of that.
A symbol shift read N poke I comma N let S equal S plus N 1 I think that's a one.
I'm not sure if that's a a one or an I.
The print's not the best.
No, it's not. It's one of these.
It's just blurred together. That's how bad the print is cuz after it is next I, that's how I knew it was that.
Right.
So 30 read S U M sum if S is more or less than sum then uh where's then?
Oh, no. Come on, there it is. Then print Oh, this is good. So, it'll tell me if I've put the machine code in wrong.
It'll basically tell me which is good, rather than it crashing.
retype line 40 stop Oh, we don't want new.
Right. Okay.
So, line 40, this is where all the data is. So, like I said, it's not a very big program.
So, we've got six a zero one nine seven I think re- reading this, it's going to move the whole screen. So, I don't think there's a I don't think there's a great deal I'm going to be able to do it with with regards with making a game, unless I want the whole screen to scroll away, perhaps.
As a transition to the next stage of the game, maybe.
six 32 35 203 30 16 251 193. I'll just finish this line off and then I'll quickly look at the chat to see if anyone's written anything that I need to know.
24193 16 23 Is that a five or a nine?
Looks like a five. It's very blurred.
I'm going to go five. It'll tell me if it's wrong anyway. But I can't It's hard to see whether it's a nine or a five.
I'm looking at another five that's on the screen and it looks more like a five than it does.
And then we've got 2795 on the end of it. That's strange cuz we've got a 201 there and then we've got a 2795 on the end.
The 201 I've I've learned to be it's a return back to basic. Why have we got a 2795 on the end?
Maybe one of you guys in the chat can say.
Uh your fighting the system stream is hanging up. Oh no.
Alex, is it an assembly listing also?
Yes, it is. It has got an assembly listing also. What I'll try and do in a minute is um see if I can get it up on the screen.
I don't know what the idea of 2795 is. Anyone know why we've got that at the end?
So 50 print data entry Okay.
Now run machine code is basically saying.
55 + 100 60 clear 63 999 And it's going to list it. So, as a test, we're just going to list it and then we're going to scroll the listing across the screen as the test, yeah?
So, randomize user 64000 and then we stop. No, we don't go new.
Oh, it's dangerous.
Right, let's see if it's worked. See if I've got those numbers right.
Data entry okay. There we go, look.
It worked.
Pretty cool, huh?
So, that's scrolling it pixel by pixel.
Now, we're waiting for it to stop. Oh, there we go. Let's run it again.
>> One more time.
So, line 10 does most of the work by reading the machine code.
I think they've made a print print mistake there. That should be line 20.
Let's wait for it to stop and I'll read to you what it says.
What it says.
Right, okay. Let's list it.
List.
So, it says here line 10 does most of the work. Well, I think that's a print printer error. I think it should be 20.
So, we've got um line 20 then does most of the work by reading the machine code as decimal numbers and poking them into a part of the spare memory.
24 bytes of spare memory from locations 64,000 to 64,023 are used in this case.
What do we mean by set the Well, where where have we gone? What do we mean by set to the byte immediately preceding the part of the memory reserved for user-defined graphics? This can be found by print peek 237 3 0 plus 256 times peek 23731, which evaluates the system variable called RAMTOP.
See page 176 of the manual.
On power up, this will be 60 uh 65367 for 48K and 32599 for 16K.
How long can a spare byte be? This will depend mainly on the size of any basic program and variables.
And can be found by print peek 23653 plus 256 * peek 23654 which evaluates the system variable called STKEND.
Subtracting high and low bytes gives you the number of spare bytes, so you can change the numbers in line 20 to suit your own requirements.
And machine, i.e. 16K or 48K.
Line 30 checks your data entry in the data statement line 40 as an attempt to execute defective machine code will often cause the machine to crash.
Line 60 executes the routine following a clear command that lowers RAMTOP to ensure that the routine is not erased when new is pressed or another basic program is loaded. Remember that you will often want to use the same machine code routine with different basic programs.
The list is necessarily is necessarily it in uh to give you a display to be scrolled when the routine is executed by randomize USR 64000.
So, Australian scroll right assembler.
This has been prepared using one of the better commercial commercial Sorry, start again.
This has been prepared using one of the better commercially available assembler programs. To to reiterate, you do not have to enter this unless you have an assembler of your own and wish to experiment with different ways of doing the same job.
A good way uh to make learning machine code faster and more enjoyable If you do not like the idea of pre-cooked machine code and do not own a assembler, you can you may wish to use a hex loader. There are many such utility programs listed in this book and it just goes on to about assemblers and stuff like that now.
And what does it say about the actual assembly language?
Um Let me see I don't know how to how I can do a screen share on this.
I don't Yeah.
Like I wish I could show you the assembly uh breakdown of it, but I don't know >> [laughter] >> if you're going to be able to see it.
I I don't know how I can get it up on the screen. Um what I could do I suppose if I go REM So, we've got We've got LD. I'm going to write the assembly language in a in here so you guys can see it. I think for all you guys out there that are into your machine code.
All right, then we've got push BC And we've got LD HL 1 6 3 8 3 LD B Well, I say I've I don't want to try to attempt to do a screen share because if I mess it up push BC uh XOR.
It's not very big at all.
Very small routine. Not a lot there. LD INC HL I think that's double R.
So, you um machine code geeks out there will know exactly what all this means. I haven't got a bloody clue.
I know what a little bit of what it means, but I don't I've got a clue what some of these commands mean.
I'm just typing it in a REM because I can't show you the screen just so you can see the assembly language for it.
So, if you've just joined the stream thinking what the hell's he doing?
>> [laughter] >> What's that? P O P B C It also gives you the um the hexadecimal as well.
And then we've got R E T.
There you go.
So that there You want the link to the link to it. Let me let me see if I can get it for you.
But there there's all the assembly language in that realm. Let me see if I can get you the link.
I value you. I should be able to do it.
Let me see if I can do it.
Um Sinclair programs And let me see if I can let me just see if I can um Rather than piss about here, let's see if I can actually share the I'm not sure how I share the screen.
Uh plus I'm not sure I'm not sure how you do it.
I've done it before, but I cannot remember now. I'll just get you the link.
I don't want to lose the I don't want to lose the bloody screen. So um yeah, there it is. It's the one with the devil on it.
Let me get the link for you. There you go. It's World of Spectrum it's in. Copy that.
And let's get it in the chat room. Where are you?
paste There you go.
There's the link.
So, yeah, uh, destroyed there. He he's I've already looking at the code, look he's made a a comment there.
Read your window, Alex. I am I'm reading it. I'm reading it. I've done it. Oh, you've done it. He's already done it.
He's beat me to it. Will this work on the 48K Spectrum? It will indeed. That's what I'm using now.
All right. Let me, um, rather than delete all that, I'll just put that a line.
So, that's the assembly language. Look, see it's available in hex as well.
If I just run it again.
There you go.
And if you go on to the next page, two pages on, you got one to do it on the left as well.
So, you've got one that will go left and one that will go right.
So, I'm going to save that.
save Uh, right screw.
So, record.
It's not going to light all that in there, is it?
It'll be too long.
So, our scroll Push the back.
Okay, it's recording.
Hopefully. Yeah.
Yes, I am looking at machine code now.
Uh Uh will you will you will I code it?
Uh So, there you go. That's that's our little [snorts] right scroll. One more time. Do you want me to type in the one for the left as well?
Just so you can see it go the other side. In fact, we could probably just adapt that program.
If I wanted to add it in there, uh put the two together.
So, you might be a bit puzzled by line 30, LD B, {comma} O for 256.
What's that?
All right.
>> Great to see you doing ZX81 stuff. I need to catch up on the stream. I was too poor to have a Speccy back then, so the Zedi was my first. Don't worry, the ZX Spec the ZX81 will be featuring on the channel a lot more now, but tonight I'm having a rest because I was on it all weekend and the whole the fingers are killing me.
I'm not going to go on about it too much because I think I bored everyone last night moaning about it. But the keyboard is really is real hard work.
So, if I wanted this to go the other way, I'm just thinking it it I could I could I'm wondering whether I could add this into it. Problem is I would have to change the addresses and everything, wouldn't I?
At the moment it goes to 6 64,000.
Um oh [ __ ] I've lost the page.
Oh, I hate it when it does that. I've lost the page.
I'll just Let's have a look.
So, we got the one that we've just worked on. Let's just have a look at the code there.
Uh is it exactly the same? I think apart from goodness sake.
Keep losing it.
There we go.
I just want to see if I can combine the two.
So, we've got So, that's going from 64,000 to 64,023.
Surely I can just add onto that. So, 64 it'll be The other one is exactly the same size.
So, if I was just to double that up, surely I could just add the code.
No, I can't, can I?
Or can I?
Cuz that's randomized.
I'm trying to work out how I could do it.
64, 4,000 64,023.
It's randomized 64,000. So, that my You want to see it again?
Take out the 2795 from line 40. Do you know what that does, though, Franco? What is the purpose for that?
What is What is the reason for that number?
Did anyone mention it in the chat?
Check Samira. Check Samira. Check Samira.
Put the left scroll data at line 45.
Okay.
I will do.
Uh edit.
What is that number for?
I've never I don't know if What is the purpose for this? Why is that in there?
I know you're saying to take it out.
Let's take it out.
Out of data now.
Well, I'm going to carry on anyway. I'm going to put the 45. I'm going to put the left one in now.
Let's see if we can get them both working. And what I'll do is I'll put a little in keys in there so you push one button it go one way, push another way it go the other way.
Uh zero 197 33 Let's put that back up there.
All right. Bear with me while I just type all these numbers in.
So, we're now 88.
6 192 197 175 6 32 43 203 22 16 251 19 Oh, it's 193.
Yeah, 193 16 244 19 3 16 23 5201 and this is also got 2565 on the end of it. Now, do I need to pop that now that I've extended it?
I'm probably going to have to extend that um that range, aren't I?
So, I'll read the chat in a minute.
Yeah, something I'm going to have to extend the range.
Maybe you guys can help me out to combine the two into this.
Right, let me go to the chat room. See what you guys are saying.
Um let me scroll down.
Um it checks the sums said to say the code is correct.
Yeah, it scrolls the whole screen, basically. It's It's a screen scroller.
So, just screens Whatever's on the screen will scroll off. So, probably you could use it for a transition on a game, I expect.
What I want to do I've just put in the code so that it scrolls um cuz it goes left or right. Now, I want to be able to use them both together.
So, you need to change line 20 the num- change the number in line 20. Yeah, I thought so. List 20.
So, I'm assuming it'll be this number here, Franco, would need changing.
So, am I Am I right in saying because that is 64,000, would that have to be four six now?
Cuz we're basically doubling it.
Am I right in saying that?
No.
I got to get me sums right.
Yeah, that's what I just did. I just added 23 to it, but it didn't work.
Add the check some value together and combine the code with the new value at the end.
Um make change six six four five oh Yeah? Is that what you're saying?
Wait.
Out of data.
Let's just check I've put those numbers in right.
Don't forget I've taken those two big numbers out.
Because the other line as well had it.
Let me just check I've entered all that right. So, it's six zero one nine seven thr- We know the other ones, right? 0886 192 197 1756 32 43 203 22 16 251 Now, is that 19 always No, it is it's got to be 19 Yeah, it was 192 on the other one. So, it's 193.
193 I'm just trying to compare it to the other one which you did.
Yeah, it is 193.
16 244 193 16 235 201 Then, we had 256 5 on the end. I haven't put that on this time.
Make line 30 print the value of S.
It doesn't look like you removed that checksum number on line 40. It's Okay.
70 list randomize Ah, [ __ ] off. Excuse me.
randomize Randomize.
What's going on?
>> [sighs] >> Keep pushing the wrong damn key. That's what's going on.
You're all talking too much. The screen's scrolling up quicker than I can read you guys. Come on, slow down for me.
Stop.
Remove the stop in line 60.
And run 60.
It was saying it was out of data though.
So, what do you think? It's going to go back the other way in a minute. Is that what we're saying? Is it going to scroll back the other way?
Oh my god, it went up. What's going on?
It's Oh, wow. Look at that.
Well done, Franco.
That was pretty cool, wasn't it?
Let's do that again.
Oh, run 60.
Run 60.
Scroll. Enter. Off it goes.
I like this, Barry. It jumps back up in a minute. Watch it, look.
It's going to jump back up.
Bush. There it goes. And now it's going to go to the left after I push the enter key.
That's pretty cool. I like that.
Yes, save. Everyone's telling me to save it.
Well done, Frank.
So, let's save it.
That's worth saving, that is. That might come in handy for something.
>> [snorts] >> Right, okay. Let's save it again.
Uh, so we go home, push the home button, push record, ABC, let's call it um scroll.
Uh, where's the R? Can't find the R.
Where are you? There it is. Um, O L O I'll put scroll two.
Scroll two and it'll and it'll save when it loads. It will automatically run line 60.
Will that work?
I don't think it will, will it? Cuz it won't have loaded the machine code.
Let's just do it for now.
No, cuz it won't have run the machine code, would it?
>> Okay.
Yeah, it won't work. I realized that, that's why I deleted it because it wouldn't have generated the machine code, would it? So, as soon as I wrote it and looked at it, I thought that ain't going to work.
Okay.
Stop. One last go, eh? Let's have another look at it. Oh, I keep doing that.
Um How do we stop it from going out of data then?
Why does it keep going out of data? How can we stop it from doing that?
20. Do we just get rid of 20?
Let S So, we need to work out how we can stop it doing that cuz if you're going to run this program, you need it to read the machine code.
I'm just trying to see what it's going on here. It must Run the program and type print I.
64048. Is that the number that needs to be in there?
64048.
Out of data.
6064048.
64048 still doesn't like it.
Oh yeah, take it down one.
Um Still out of data.
Poke 23609 255.
Just remove line 30, don't need the checksum.
Okay.
There you go.
Good show, just remove it.
So, what about if we were to go rather than have a list there, so I don't have to push scroll.
Um list 60 If we do 800 uh four one um to do it 402 21 print F Common mistake of mine. Always forget to put the at in.
There. Hello, world.
What's going on?
zero Okay.
Let's put it in the Got to do 810.
return >> Don't know if this will work.
That's pretty cool, isn't it? I like that.
Oh, I put I just realized I put a zero instead of an O on the on the hello.
Never mind.
Oh, there's no ghost up there.
>> Just stop that for a minute.
So, someone just said about ink and paper. Let's see what happens because obviously it hasn't got an actual probably doesn't have the attributes in there, does it?
So, let's put uh paper.
Let's go paper one.
Just out of interest to see what it does.
No. So, it won't move the colors, look.
So, we would need to find a machine code program now to move the attribute.
Yeah.
It is quite a nice effect. I agree.
I'm going to save it again.
If you had the ink at the paper black, then the text would just appear from the middle.
Yeah, it's working well, Scott. Very well.
Like that, yeah? So, both the same color, just some sort of that give you some sort of a effect like, you know?
I don't know what else is in that magazine, whether or not there is a um a program later on in there. I don't know what else.
I think it was uh from memory cuz I've s- I think it might have been like a four-part uh four-part series. So, what was the next magazine after that?
So, next one's got the crocodile on it, and it's uh Let's see if they've There's any f- Sometimes they do like a series. I'm sure this was the four-part one that I was reading once before.
They've also got in these magazines something called You've Got It Licked.
And they give you pokes for games.
And for ZX 81, if you poke in a ZX 81, for instance, 165110 {comma} 0, it will prevent anyone from editing any part of your ZX 81 programs.
If anyone attempts to edit or alter a line after this has been entered, the program will crash. Cancel this command with poke 16511255.
Another one here, ZX81 owners.
Wants to stop people breaking into your machine code? There's also a little routine there to stop people from doing that.
Um what's this here? To print online 23 of yours 16K ZX81 poke 16418,0.
So you can print on line 30 on the ZX81 by poking 16418,0.
Anyway, I wasn't looking at ZX81.
Here we go. What we got here?
Okay, so in the next in the next version, we have got a vertical scroller.
What's this one do then?
Um uh where's it gone? So the next issue, we've got another scroller which scrolls vertically.
That's what we've just added, isn't it?
And one Oh no, that was horizontal, wasn't it?
Uh I've lost it. Where is it? There it is.
So Uh vertical scrolling is more involved than sideways scrolling because we require a clear understanding of of how the Spectrum display file works. To make the learning task easy easier, the problem is best tackled in two stages. In the first part, you will find out how the display file is set up and how to use a small machine code routine to set up the data required for the scroll routines themselves in in the next part.
For for sideways scrolling, all we had to know about All we had to know about the display file was that it occupies memory locations from 16384 to 22527, which hex is uh 4000 / uh 57FF.
The routines we used, which wrote uh wrote at the bit patterns of each consecutive byte of the display file may create may have created the illusion that computer was also working progressively up and down the screen.
You might like to go back to one of the two routines in the last issue and change line 60 to read LDB96 instead of LDB192.
List line This line sets the loop counter for the number of rows to be scrolled.
Halving the Halving this number of rows does not mean scrolling just does not mean scroll just the top half of the screen, as you will find out. The Spectrum translates the bits of the display file into dots on the screen by first dividing the screen into three sections from top to bottom.
Take each section in turn, each containing 256 character positions, and remembering that each character is made up of eight pixel rows, the computer begins by printing the top pixel row of all 256 characters.
Anyway, it goes on and on and on. I'm not going to read it all out. So, we have got the program here to go vertically.
Uh let me read Is this the right one before uh program >> And what's on the next page?
Oh.
So, what does it do?
Program one.
Program display fill addresses column zero.
Right. So, it was a note the hex Just trying to figure out what this program does. We don't want to type it in and it doesn't do nothing.
Um The program to set up the file of column zero addresses based on these rules is listed as program one basic and assembler.
First, the basic line 15 sets RAM top to 629999 so that for a 48K Spectrum, our file can be started at 63 63,000 and the machine code itself at 64,000. 16K allocate their own memory allowing 384 bytes for table and 38 bytes for machine code.
Lines 30 and 40 read the machine code into memory. Line 60 executes the code and sets up the file lines 65 and 80 eight allow you to pick the file just created and receive a table of column zero addresses either in this decimal or hex, it will give you a much better guide in screen locations than any published source.
If you type go to 90, the machine code will be saved to cassette. You can also save the file by typing blah blah blah.
The flowchart in figure two will help you understand the assembly listing encapsulates in 40 of of the basic line. 30 loads the start of the display file into the BC register pair, and line 40 loads the start of the file we wish to create into HL register pairs are obviously necessary because both numbers are two bytes.
There are only three registers pairs to choose from when setting the addresses in this way BC, DE, and HL HL is the favored register pair.
And and it's the best choice for two-byte numbers, which have to manipulate the most.
The pound sign pound sign in line 40 is is way I think there's a typo there. It's the way my assembler printer combination indicates a hex number.
I I have already said hex numbers Right, so I think I don't think this is the actual scroller then. This is the actual I think this is like an assembler.
I'm not too sure what that is. I'm not going to type it in, cuz I think it's an I think it's He provides an an actual program that's an assembler by the looks of it.
Yeah, I think that's what that is. I'm not sure.
I need to read it on a bit more. There's a lot of reading here to do. I'm not going to do it now.
Right, have a look though. That's the next magazine. That's the I'll put the link up for that one.
Oh, let me get the link up for that one.
You guys then can read it at your own leisure.
Cuz I've just noticed, I might type it in anyway, not tonight, but off off stream, just to see what it does.
There we go.
One last time.
Let me see what the other magazine is.
>> Oh, here we go. Here's Here's the Here's the one for the vertical scroll.
Vertical scroll, okay.
Let's type it in.
Okay, so let's list Let's go and Let's go new.
Let me quickly type this in.
So, this will do a vertical scroll.
This will scroll up the screen.
This is where I type it all out and realize the what what I've just been reading out to you needs to go in first, but I don't think it does.
I think that other one was for if you wanted to for assembly language. I think it's an assembler.
There again, I might be wrong.
4 I equal Uh in the mag where you got these scrollers on page 28, there are a host of color effects.
It's a big program. Yes, I've already shared that one um Franco, it was on my I shared it as a as a single video.
On my channel couple weeks back.
That's where I got it from.
So, I I have already done that.
This is the third magazine on now.
So, if you go on World of Spectrum, this is the second uh the third magazine.
I could have probably have just deleted the data lines actually rather than having to type all of this out again.
Never mind.
Poke I chunk N Can I get this any bigger? It's very hard to see.
Poke I N let S equal S plus N next I 30 read some if S is more or less than some then print I'm not going to type all of that out that message out.
We know we've got to redo 40.
We don't want new in there.
40 data 1192 0 197 8 62 0 1 2 4 124 246 8 10 95 3 10 I think that's 8873 197 10 uh 111 3 10103.
In these magazines, there is a breakdown of the assembly language explaining what the assembly language is doing as well, which is really useful cuz you know, it's great for learning.
So, you know [snorts] what all these numbers mean, basically.
I can't make out what that number is there. It looks It's very blurred. It's either an 8 or a 0.
I'm going to put 8. It'll soon tell me.
60 These old magazines, sometimes the print is terrible.
>> Okay, 50 print data Okay.
60 list randomize user 64 123 stop run It didn't do anything, did it?
That's probably cuz I got to write in that program that on the other page.
Mhm.
Let's just check them numbers again.
It didn't do nothing, did it?
Uh 1920 I wonder whether that's I wonder whether that is an eight then.
Mind you, wouldn't it have come up with a data error?
Maybe it's a zero. I don't know what this number is here. It's a really bad print. I can't make out whether it's an eight or a zero.
Mhm.
It must be an eight then.
193 It's really bad. I can't make it. I think it is an eight. It's got to be.
It's not doing anything.
It's not working.
>> [snorts and laughter] >> Uh print list randomize user 6400 Not doing it. Not working, is it?
Probably find I had to do something with program one.
That was disappointing.
I'm just checking I've got everything right here, I think.
Oh, well. Can't have it all working, can we?
Uh 124 246810 953 1087319710 31s 310 1031 320237 176193 8 6254191 56231193 16 221 and then 201 In part one of last month, I showed you how to set up a file of addresses to identify which location in the spectrum display file referred to column zero addresses for each pixel line of the screen display.
The leftmost character position in part two, you will learn how to use this file to execute the vertical scroll. I think that's what I need. I needed that part one program in there, which I didn't want to type out cuz it's quite big.
>> [laughter] >> First, it is important to understand how the problem setting line file serves the execution routine we will be developing here.
Why is a file of addresses needed when all the information is contained in the spectrum zone display file? In any case, you might also ask, "Why can't the problem be dealt with by simply rotating bit patterns vertically instead of horizontally?" Remember how the RL and the RR rotate left, rotate right instructions gave us such a compact solution to the problem of horizontal scrolling. Let's take the second question first. Rotation instructions, there are others beside RL and RR, as we shall see.
Are designed to work only Sorry.
Are designed to work only on the bits of the specific bytes or bytes transferred from display file to the screen are transferred horizontally, not vertically, so there is no way the eight byte the eight pixels on a vertical line can be identified and manipulated as a single byte of data.
As we must work with whole bytes of data.
A possible solution might be to work through consecutive bytes of the display file, though not consecutive of the screen from the second pixel row. Find out which byte of the display file corresponds to the location immediately above the screen and copy the byte from one location to the other. I'm already [ __ ] lost. This would be slightly long-winded, though.
Mainly because of the way the display file is configured. Fortunately, the ZX80 instruction set contains a powerful block handling instructions, which allows the machine code programmer to move a block of data from one location to the other.
Um memory to another. For this application, it it enables us to transfer a whole line of data as represented on the screen, 32 bytes to the line above by the display file in one go. To use this instruction, we need to know the addresses of the first byte of block to be copied and the first byte to be copied to destination to move whole lines then base and destination addresses will be the column zero address.
Um the program to execute an upward scroll is listed as program two. Program one being that listed program one being that listed in part one as usual.
Both basic and assembly are given.
First try running the basic.
Although you must have previously run program one to create the file.
Machine code for both programs loads into the same area of memory starting at location 64,000.
The important point though is that program one machine code has been executed to create the file at 63,000 before it gets overwritten by program two. So yeah, we do need program one then.
Which I didn't want to write in because it's quite a long-winded program.
So there you go.
My fault.
And then you carry on and you got the program to scroll down as well.
Uh program for list the scroll team print so it's actually the same as the scroll up.
Though now we start with BC pointing to the last location of the address.
Yeah.
>> Okay, never mind.
I'll save it cuz what I'll do is I will type that way in during the week sometime and see if I can get it to work and then perhaps showcase it on the channel.
Um so that would have been down.
scroll uh So it needs program one to make it work.
Yeah, I got I see it it's it's not a scroll in the um I need to type program one in.
It needs a look-up table in RAM from program one, yeah.
Yeah, so it needs program one.
And I'm looking at the time. I haven't got time tonight to Well, we've got this bit. I'll save this.
Um go back, record.
D scroll. And next time I come on the stream, I will have the other program already typed up and we'll give it a whirl and see if we can get it to work.
How about that? I can't do any fur uh I can't do any um more than that for you.
Well, rather than delete this, I'll save it and then see if I can get it to work.
Because there's a program to scroll down as well.
But we need the other We need that program one.
Oh, [ __ ] I started too soon.
There we go.
I raced ahead thinking it would work, but it wouldn't.
Never mind.
Anything else in this magazine worth looking at before we uh move on?
>> Just trying to find where we're at.
Right, let's have a look at this I know it was a four-part series, so I'm now on the fourth magazine. I just want to see what they give you for the fourth one.
Right, so we've got a two-tone display jazz up any game.
Uh spectrum colors are group of attributes, so called because they are only attribute to the main display of graphics. All right, what does this do? Machine code is often the only practical way of controlling attributes in arcade games.
So, what does it do then?
Um remember paper colors Oh, so it changes the colors of the screen by the looks of it.
All right, let's quickly type it in.
And I'll make this the last one tonight then.
This one here, it's uh So, in fact, we can we can actually get rid of we can actually keep what we've got, just get rid of line 40.
By the looks of it, um, do do do, we just got to change line 20. List 20.
It's 64,000 to six.
That's going to be 28.
Everything else can stay as it is. Just redo line 40. So, shouldn't take too long. It's not very long.
22 This does some sort of two-tone thing on the screen.
87 six 12 197 six 32 35 126 230 199 130 119 16 248 19 three 16 242 122 254 32 200 22 32 24 232 3162 And after there doesn't seem to be return to basic there.
Why is that then?
And it says 60 Need to put a clear in there.
Clear 63999 Then it lists it. Randomize user. So, yeah, we should be good to go then. Run.
Data are okay. What's it going to do?
Oh, look at that.
So, basically it just changes the color.
Boom.
Nice and quick.
And the next one just reverses it.
Okay, let me just uh let me look at the assembly language for this, and I shall try and answer some of the questions you've just asked about which part So, if I look at the assembly code, you'll have to bear with me.
So, program one, paper colors, top is cyan, bottom is green.
Cyan is code five, ignoring all other attributes to be masked. By this means that we will be masking in the binary 001 01000, which is hex 28. Green is code five, for which we mask in bin 001 uh six zeros, hex 20. Line 40 sets register D initially to hold cyan paper.
As usual, HL is a memory point pointer.
[snorts] So, in line 50, HL is set to point to the memory location immediately before the start of the attribute file.
As the screen is divided into two halves, we will be dealing with 384 character positions at the time using DJNZ loops.
This is best thought of as dealing with 12 * 32 character positions for each paper.
Line 60 loads register B for the outer D DJNZ loop in order to count 12 rows.
The row loop starts by stacking the value of B using push BC to avoid confusion with the inner loop counter, which is set up to count three columns, c o l in line 80.
The inner loop proper starts in line 90. The first time it is executed will int int i n c h l can't really say to point to the first attribute byte, which is then loaded into the A register in line 100. We can now consider the masking itself. A mask hides the bytes we do not want to change.
These are the first two and the first three bytes of the memory.
Okay.
So, I'll put the um I'll put the link up for you on that one if you want. I mean, that'd be useful for a game, you know, with the green and the blue at the side at the top, wouldn't it?
So, the link for that one is that magazine there. And I think that will be it for tonight now.
I've lost the chat box. Where's the chat box gone?
Oh, there you are.
There you go. Have a read of that. Which bits of the paper? Okay, let me let me uh uh, uh And as it says, says it's uh uh Uh, paper colors the last two bits, bits six and seven set bright and flash.
To determine ink colors is the second three bits, three, four, and five.
You're best off probably clicking on that link and having a read through.
It's on page 44.
But, uh Maybe you can carry on.
There's another program there which just reverses it.
So, swaps swaps the two colors over.
But, uh yeah.
There you go.
Anyway, guys, I am going to call it a night.
I think I've I've had enough tonight now, so I hope you've enjoyed what I've done tonight. Sorry it was a bit off the cuff, but I kind of like that when I just don't know what I'm going to do and just punch something in and see what it does.
I will return back to the up scroller and write in that other program, program one.
I'll try and do it during the week sometime. So, then it's ready for the next stream and we'll have a look and see if if I can get it to work. And if I can get it work, I'll put in the the data to scroll it down as well.
So, then we'll have a an up and a down, but there again, it's only scrolling the pixels, remember. It is not scrolling the attribute file.
So, there we go. Let's save this very quickly. It's worth saving it. You never know, it might come in handy. Let's call it colors.
I'm not going to type in the other one cuz I I don't think I'm going to use it for anything. So, if I want it, it's easy enough to find.
It's only in the magazine.
Uh record.
One last time.
We'll call it color.
c o l o u Um ah.
Checking card. Ready.
Waiting.
Push record. Enter.
The main thing is at least I know my new toy works. Working absolutely brilliant.
So, I'd highly recommend looking into one of these if you want an easier option if you're using Oh, excuse me. Original hardware like I like to use.
I can't recommend this enough. Very good. Very impressed with it.
So, good night everyone. Thank you for watching. Remember, hit the like button.
Hit the subscribe button. And share as well. If you know anyone who's interested in this sort of stuff, tell them about me.
>> [laughter] >> Tell them how awful I am and how unpredictable and unorganized I am at doing these videos.
Anyway, have a good one. Enjoy the rest of your week and I shall see you on the next one. Take care of yourselves.
Goodbye now.
Related Videos
OpenHuman VS Hermes AI: Who Wins?
JulianGoldieSEO
285 views•2026-05-29
Long-Running Agents — Build an Agent That Never Forgets with Google ADK
suryakunju
142 views•2026-05-30
This computer is made from real human brain cells. And you can buy it.
Talktmsmedia
3K views•2026-05-28
BREAKING: Microsoft’s New Image Generating Model Beat Out GPT 1.5 and Nano Banana 2
aimmediahouse
122 views•2026-06-03
I Made the Same Anime Fight Scene in Every AI Video Generator
NobleGooseAnime
295 views•2026-05-30
Nvidia Bets Big On AI PCs | New Chip To Power Windows Laptops | Technology | AI Updates | N18S
cnnnews18
3K views•2026-06-01
I Tested NEW Opus 4.8 on Four Projects (Updated LLM Leaderboard)
AICodingDaily
298 views•2026-05-29
3D Platformer Update - NO CAPES
SolarLune
294 views•2026-05-30











