As a companion to this tutorial series, please avail yourself of my free Z80 ebook: ped.7gods.org/z80.pdf
@darrylsloan4 жыл бұрын
@XXX XXX I dabbled in BASIC in the 1980s, in my teens. Pascal and COBOL were the languages I got to grips with during my A-levels. But I can't remember much about those today. My current coding interests are MicroPython, NextBASIC and Z80.
@schismaticschematics4 жыл бұрын
I'm on the same trip and found your pdf via the ZXSNext website. I've found the writing style and the way your presented the info really clear and easy to understand. Thanks for making it available.
@yVFIdqca4 жыл бұрын
Are you planning any epub / mobi version?
@darrylsloan4 жыл бұрын
@@yVFIdqca I'm not sure when I'll get around to doing that, but I'm a Kindle user, so I do like the idea.
@vincentmiller69773 жыл бұрын
you all probably dont give a shit but does someone know a tool to get back into an Instagram account? I somehow forgot the password. I appreciate any help you can offer me.
@reddie_zx3 жыл бұрын
LD HL, #5AFF ; end of attributes LD A, L ; for white, or XOR A for black row LD B, 32 LD (HL), A DEC HL CPL ; inversion, A=255 (white) or 0 (black) DJNZ row CPL ; inversion after each row BIT 3,H JR NZ, row ; if HL >= #5800 (attr start) RET original program: 29 bytes, optimized - 17 bytes =)
@gnamp5 жыл бұрын
For those struggling with using the Spectrum input/ compound tokens; when using a PC keyboard, for the 10 RANDOMIZE USR 50000 BASIC bit... Type 10 then the T key (to get randomize), then ctrl + shift to enter extended mode (E) and type L (which gives you USR)... enter then R (for run!) enter again and away you go.
@b213videoz6 ай бұрын
Ever since I was 11 I've been haunted by this question "Why must it be RANDOMIZE with USR ?" I mean USR is just a function returning a value (which we do not care about as the game once started has no return)
@Daeve427 жыл бұрын
Came from the ZX Spectrum Next Kickstarter page, stayed for the "wow". I've tried multiple times this week to get to grips with z80 assembly in preparation for my trip back to the early 80's and a re-investigation of the Speccy, I've failed everytime due to not knowing/having forgotten something the author skipped over or assumed the reader/listener should know. Your video is the first thing that has held my attention and been understandable. From a childhood background of Sinclair Basic, no machine code and the odd struggle with python and R nowadays, after watching your video I think I might just be able to make a breakthrough and give this a proper go. Thanks! Please keep up this series - I'd love to see it integrated into the Spectrum Next new website/home when it goes online.
@royloveday43504 жыл бұрын
You have just flipped me out. I taught myself to do that for my GCSE, it was an unbelievably intense moment in time. I reverse engineered from scraps of code, Input Magazine and the manual way back in the 80's without a compiler or the internet. I created a kind of cefax emulator that used machine code to write new pages rapidly to the screen because the means to do it in Basic was chuggingly slow. Everything was compiled by hand and calculated on paper. It took me an eternity to work out how to write to the screen memory in a way that didn't create a total mess and which didn't either hang or restart the machine all without any kind of real time feedback and then tape loading each time to get back up and running again. I got a C for my GCSE because they literally had no idea what I had achieved and probably also because I failed to 'show my working' . 30 years on and I'm feeling vindicated as if someone finally understood. 👍
@darrylsloan4 жыл бұрын
You did better than me, Roy. I was bamboozled by Z80 assembly in the 1980s. I learned it in my 40s for fun. I'm still blown away by how many views this tutorial gets. Check out my free Z80 ebook, too: ped.7gods.org/z80.pdf
@royloveday43504 жыл бұрын
@@darrylsloan I had little reference to anything other than Input magazine and the Spectrum Manual, nobody who could assist, it was essentially brute force and reason and the time I was allowed to use the family TV. I'll check out the stuff. It's been quite a trip seeing all this again.
@darrylsloan4 жыл бұрын
@@royloveday4350 I started off with my Spectrum attached to a little black and white portable TV in my bedroom. The irony of a computer called Spectrum running in greyscale! But we all had what we had, and we love it.
@royloveday43504 жыл бұрын
@Jamie McLaughlin I have to say it's wonderful even after all this time to find some kind of recognition. We are so affected by our world at that age and I couldn't share my achievement with anyone in a meaningful way at the time. Lockdown has allowed me to pursue a latent curiosity and I loved the skill of the educator.
@sambrown94947 жыл бұрын
Do you know, this is the best / simplest tutorial I've ever seen, after 30 years of books that make you give up after the first chapter. Bravo! Looking forward to watching the rest. Many thanks. Well worth doing! :)
@makepool4 жыл бұрын
I'm a software developer by trade but I've always regretted never having done any Assembly. This video was really instructive and has fired up my interest for sinking time into learning Z80. You're a good teacher.
@spinnetti3 жыл бұрын
assembly is an addiction. Having to count t-states and optimize ML is more rewarding than any other sort of coding.
@solangoose83725 жыл бұрын
I was born in 71 in the UK. The 48k Spectrum was my first real computer. I did lots of basic programming back in the day on the Spectrum and later Microsoft basic. I always wanted a crack at assembly language but never got round to it. I really want to have a go and this video is the perfect intro. You asked and answered all the questions I wanted as you were walking through this. Thank you!
@darrylsloan5 жыл бұрын
Glad you found this helpful. I'm from '72.
@antonnym2146 жыл бұрын
I was a Z-80 programmer. DJNZ stands for "Decrement B and Jump if Not Zero". It's important to note that it decrements and tests the B register only, which is why we often use register B for looping structures. An advanced note is that this instruction performs a relative jump only, so your destination must be within 128 bytes of the DJNZ instruction.
@refractedphoton6 жыл бұрын
Does that mean in the video at c.23min 55seconds where it seems to show the memory locations taken up by the code it is wrong as it seems to show the memory location to jump to taking up 2 bytes/2 memory locations (50012 and 50013)? If it is what you call a relative jump which has to be within 128 bytes then I assume that means it only takes up one byte???
@ped7g5 жыл бұрын
@@refractedphoton yes, there's mistake in the video, the `djnz` opcode takes only two bytes (jut like `jr` which stands for `Jump Relative`). `jp` (JumP) and `call` occupy three bytes, capable to address any byte in 64ki address space. Then there are also 1-byte shortcuts for `call` pointing to addresses 0, 8, 16, ..., 56, which all belong to the ROM area, so they are not very interesting for classic ZX 48k programmer (things may change on +3 model or extended clone models, where you can map RAM into the 0000 area, and place your own subroutines at those fixed entry points).
@antonnym2145 жыл бұрын
@@refractedphoton The destination address itself is a 2-byte address, but it's within a 128-byte range of where we are jumping FROM, so it's okay. Hope this helps.
@viktororban56847 жыл бұрын
You have a really relaxed teaching style and a great voice, loving it. +subbed for more Z80 goodness
@GeeTheBuilder5 жыл бұрын
You wrote, ok a year ago now :), what I was going to write. Completely agree 👍
@Javier197y27 жыл бұрын
Darryl, being an old time ZX BASIC programmer and assembler newbie, I have to say watching your video is a pure delight for all of us Speccy lovers :-)
@Sabre_Wulf17 жыл бұрын
Bang on mate...here's your first students.. I'm over 40 , had my speccy in 84 at 11 years old...too young to cope with assembly. So 35 years on and a Snext backer.. I have a notepad and subscribed to your channel. You have my ears sir !
@petermirtitsch12355 жыл бұрын
I still have my original Spectrum 48k (converted from a 16k) and a spectrum + and +128. Great machines, and loads of nostalgia. I might actually start coding again. Watching this video brought some of it back.
@nicks66492 жыл бұрын
I just managed to get hold of a second hand spectrum next, haven't written a line of z80 for nearly 40 years and this was a really good reintroduction - Thanks Darryl
@harrivayrynen4 жыл бұрын
This is one of the best programming tutorial! From zero to one working program. Good work!
@Psycandy Жыл бұрын
i got my speccy in 83, age 13, and also dabbled in assembly and likewise have an idea to finally learn it, almost as if actually doing what i promised myself i would do. Turns out speccy devs used emulaors and tools too.
@Havanacuba19853 жыл бұрын
Thank you for this and the book,it is really exciting ,I only ever had a very basic understanding of basic ,but this and your book is making sense,I found spectrum basic the best of the bunch at the time , so to find your guide to machine code and assembly is absolutely brilliant. I have just watched several minutes of the video and read the first pages of the book and it’s really making sense . Thank you so much . I got my first speccy in 84 and have just got myself a lovely refurbished one with an Divmmc sd card disk system
@moozoo25892 жыл бұрын
Back in 90's I made my own disassembler. The whole program fit in 4 kbytes and I was loading it into the screen memory to keep rest of the memory available for hacking/debugging games. The remaining one third of screen memory was used to display the debug window. Basically I had a custom ROM that allowed you to load a game, press reset and system would bring you to command prompt without wiping the game from RAM. Browsing the code helped me a lot to improve my programing skills.
@timrichter19806 жыл бұрын
The thing is, I came to your channel because of this cool Z80 assembly video, and stayed because there are even more interesting non-IT videos. Keep your style!
@timrichter19806 жыл бұрын
Odd in terms of different, yes! And I find it interesting, that I share some things with you, like programming, Amiga, ZX Spectrum and a little bit of spirituality. I have lost my way a bit, have problems with myself but your videos help me quite a bit and are entertaining at the same time! Edit: I forgot to say thank you!
@RolandAdams-h4m6 ай бұрын
I can't believe it's been 7 years since I signed up for the first ZX Next Kickstarter. I've been saving civilians and hunting for treasures in Cyclone ever since I received it 🙂
@Teppic117 жыл бұрын
Good overview. I'd probably have mentioned that when you write code in assembly it takes full and total control of the machine, it's not run under basic. So without the 'ret' the CPU would just keep running whatever values happened to be in memory, which locks the machine up.
@fecheverria2 жыл бұрын
I like the peace of how you explain all this. Thanks
@RetroSteveUK6 жыл бұрын
Thanks for this. Assembler demystified! I feel motivated now, to go learn more.
@F61Wolf7 жыл бұрын
Love the ZX Spectrum (first introduced to it through Rare Replay). Been struggling to wrap my head around assembly. I thought I was learning things, but I still couldn't do anything simple. So happy I found this video! Who knew making a checkerboard would be so interesting?
@edz7 жыл бұрын
Great video. My first step into the world of assembly. I've got until January to master it ready for my ZX Spectrum Next!
@mikedench11107 жыл бұрын
I've been struggling to get to grips with machine code on the Spectrum and this is the first tutorial that has been helpful. I'll have to play it several times and take notes but at least I can understand what you're saying.
@erichobbs40425 жыл бұрын
I've spent most of my career working with high level languages like C#, JavaScript, and Basic. I was surprised by just how logical and understandable the Z80 assembly code looks. Can't wait to try this out myself now.
@juliegreen7604 Жыл бұрын
Djnz means Decrement [B], Jump , (if) Non-Zero. It takes 8 or 13 clock cycles depending upon the outcome.
@Lord-Sméagol5 ай бұрын
It's so much easier for you using an emulator and assembler. My first computer was a Nascom 1 with 1K of screen RAM and 1K of user RAM (960 bytes free). I didn't have enough RAM for an assembler; I had to do that myself, looking up each instruction in the fat Mostek book! After a while, I got to remember the common instruction codes, but after LOTS of programming I memorized the codes for all the instruction groups. And all these years later, I can still assemble and disassemble Z80 without looking anything up!
@rebeccamacgregor54910 ай бұрын
Brilliantly explained. I look forward to watching more of your videos.
@NickT66306 жыл бұрын
I had a ZX Spectrum + back in its day. That was when I first learnt basic programming but I didn't understand machine code then. That changed in 1990 when I bought a Maplin electronics kit for a Z80 single board computer with hex keypad. You typed the code on the keypad into memory addresses and viewed it on LED seven segment displays and could run it directly. Shortly after that I built another z80 based computer based on the Microproffessor. In 2019 I'm still programming in z80 machine code on more advanced customized versions of the microproffessor that I've built over the years.
@darrylsloan6 жыл бұрын
Ah yes, I saw somebody demoing one of those on KZbin once. Fascinating.
@psycronizer6 жыл бұрын
22:18...talking about the working's of the DJNZ instruction....back when I was doing this I had no assembler program, did it all on paper, so I had to count the number of bytes BACKWARD for the number to enter into the field...and when you have hundred's of lines of code with lines and arrows trailing all over the paper to show where each jump goes to it get's messy and damn confusing..oh the headaches and the coffee...I remember it well....
@petermirtitsch12355 жыл бұрын
I used to use OCP Assembler. That was a great package on the Speccy.
@VRBug11 ай бұрын
I've got an N-go and have been a speccy fan since I was a kid. I've loved the games and dabbled in BASIC but it is time to take the programming seriously as its on my bucket list - thanks for this!
@psycronizer6 жыл бұрын
you just blew my mind ! another speccy is coming out ??!! WTF ??!! I got mine when I 15 in 1984....learnt the BASIC pretty quick and then delved into the assembly language just because I got curious about the codes for it in the back of the manual...the first book I got to learn from was specifically for the Spectrum but it helped...loved that little plastic thing.....I wrote a defender type game, nearly finished it but then I got into typical teen trouble etc...a lot of respect for the guys who wrote all those great games for us...so many awesome titles, guys who single handedly wrote titles like Jeff Minter and Matt Smith etc etc..they had some real talent....
@elektron2kim6667 жыл бұрын
Thanks for sharing this, Darryl Sloan. Might buy one in 2018 because I always miss the speccys basic programming. Wrote many games as a teenager between work and school for my friends and family to try out. It sparked off my english and a computer education later. I run a speccy app on my iPad sometimes, but it's hard to type as fast as I did on the original in the 80's. I had microdrive, microdrive tapes and printer in the end. The machine language speeds blew my mind and I managed to construct a little racing game with a preprogrammed road from basic coding where the machine code then looked at these stored numbers to recreate the road very quickly. It took 10-15 minutes to restart from audio tape on each human programming error.
@nicadi20057 жыл бұрын
Hi Darryl, DJNZ stands for "Decrement-(and)-Jump-(if)-Not-Zero" and it's classed as a jump instruction - although it's more of an oddball at that (meaning "one of a kind", really ;-) I should also point out that it only occupies 2 bytes in memory (1x opcode, 1x displacement), not 3 as you implied when showing the memory addresses alongside your code. The reason for that is because it does a RELATIVE jump, rather than an absolute one. The displacement is given as a SIGNED (two's complement) byte, limiting the range of the jump between -128 and +127 from the current address - which is the address for the instruction following immediately after DJNZ. I hope that helped you to better understand what's going on. Cheers!
@nicadi20057 жыл бұрын
+Darryl Sloan " It jumps in the fashion of JR instead of JP." - Yep, precisely. ;-) "So many subtleties to remember." - Ah, but wait till you hit the really nifty stuff: I/O operations, BCD arithmetic, interrupts, working with floats etc. etc.
@tonybkent5 жыл бұрын
Good video Darryl. I'm currently using it to remind myself how it all works and doing some comparisons in speed between BASIC and assembly language. I didn't realise quite how slow a BASIC for-next loop was to do the same as what your video does in assembly! I taught myself Z80 assembly language back in 1983 / 84 and used it eventually to write tape-to-microdrive conversion for some games and a little bit of code for a game that never came to anything. Nice and nostalgic messing around with this again.
@Javier197y27 жыл бұрын
Hey Darryl, another simple way to implement the main loop is by also using B register (LD B,12) plus DJNZ at the end and preserving B using the stack at beginning of each 2 rows....thanks for the video, great stuff!
@Tom53Tech6 жыл бұрын
In The Mid 80s I Owned The Sinclair 1000, A Cousin To The Original ZX models. I Loved Programming Machine Level On It; Something I Learned On My Tandy Model 1 Years Earlier. Now Retired And Still Code.
@newyoda7 жыл бұрын
I loved learning to code Basic on the 48k when I was a boy. My dad got some scripts of games like Bricks, it would take about an hour to write it and then the satisfaction of playing (after corrections) was great. Great to hear a new model is coming out, I will have to research it. Thanks for the assembly guide, good stuff.
@newyoda7 жыл бұрын
Sold - to the man in the blue hat. Thank you Mr Sloan =)
@beakytwitch790510 ай бұрын
The Spectrum was the first adequate and yet inexpensive computer. I did a lot of programming on it in both Basic and assembler.
@markretro36123 жыл бұрын
great video, i have watched a few different starter guides and ended up more confused, this actually made sense to me .
@RandyFortier3 жыл бұрын
FYI, djnz stands for "decrement and jump if non-zero"
@jhonny13927 жыл бұрын
Thank you so much for this great tutorial. be waiting for the next one !. Can´t wait to see ZX Spectrum Next in person !. Cheers, John from Chile, South America.
@MarcKloos4 жыл бұрын
@jhonny1392 Have you got your Next already?
@jhonny13924 жыл бұрын
@@MarcKloos No. At the end, never bought it, cos it was a partial versión of the original and for me this way, it was not worth it. Cheers.
@MarcKloos4 жыл бұрын
You can still get one on the current KickStarter. But it's more expensive now.
@blue5524 жыл бұрын
@@jhonny1392 An 'enhanced version'?! 🤪
@Cp-715 жыл бұрын
I feel strange here. I'm a fan of ZX Spectrum yet I don't have any nostalgia for it... because I'm 17.
@donaldklopper4 жыл бұрын
@MD now that's a comment ... I think there's a lot of fun to be had playing with the ZX Spectrum and various other 8-bit computers, and a lot to be learnt.
@frankx87393 жыл бұрын
Well it's a year later now: feeling nostalgia yet?
@edmund-osborne3 жыл бұрын
I was born in the 21st century and love the spectrum too! Computers in the 1980's were very different to what we have now and better in a few ways, like allowing the programmer complete access to the hardware and being simple enough to boot instantly and one person understand how the entire thing works.
@b213videoz9 ай бұрын
I'm the opposite: I have nostalgia for ZX but I'm not its fan 🤪
@MrGradlet5 жыл бұрын
Exactly what I was looking for. Been wanting to scratch the assembler itch for more years than is probably healthy. Thanks for sharing.
@darrylsloan5 жыл бұрын
Gareth Williams Great to year! I got as far as making my own Soectrum game. If you’d like to play it, or look at the ASM code, you can grab it from the Spectrum Computing site. It’s called “Knights”.
@MrGradlet5 жыл бұрын
Darryl Sloan I will definitely check it out. I’m up to part 3 of the video and my OCD forces me to complete them before moving on!
@rodoherty17 жыл бұрын
Really nicely explained! I've never used a Spectrum, myself, but I still enjoyed that intro to Z80.
@DJFuZionDnB7 жыл бұрын
Thank you for this. I'm here because of the Next too. Time is always tight, but looking forward to giving this all a try. Great explanations btw.
@rebeccamacgregor5495 жыл бұрын
Brilliant video. The first on machine code hat I have found to be really helpful. A brilliant visual example too. Thank you for making this video..
@niallmartin5904 жыл бұрын
You can use these tutorials with Linux, FUSE and Pasmo assembler, just add "end 50000" or whatever address you started with before the final "ret" instruction
@GeeTheBuilder5 жыл бұрын
I’ve only just started watching this video but it seems perfect. I had a Speccy 48 in the early 80’s and programmed in basic a lot. I tried assembler and failed I’m now someone whose been programming for 25y in C, Java, Ada and lots of others. All real time programming. But....But I still want to master Z80 assembler Video is looking perfect so far:.. 👍
@MattBaker19657 жыл бұрын
OMG I'm 17 again :)
@Lord-Sméagol5 ай бұрын
I still have a 48K ZX Spectrum! It was still working in 2018 when I used it in a YT video: Toccata & Fugue in D Minor (J. S. Bach) on the Sinclair ZX Spectrum (5 voices).
@bobzeepl5 жыл бұрын
I am an IT guy, but mostly into hardware and servers. Did learn assembly at school, but always hated it, and mostly cheated on exams. My father programmed a Minesweeper in assembly for he ZX. Really impressive to me.
@amigalemming5 жыл бұрын
5:15 You can write temporarily to ROM? Maybe in an emulator but not on the real machine.
@darrylsloan5 жыл бұрын
No, you're quite right. This was a mistake that I corrected in a later lesson.
@Metastate126 жыл бұрын
The JR NZ is a relative jump (+127/-128). Faster, as it only reads 8 bit for the (relative) address. But you can't use it for larger jumps. If you only use relative jumps, you can execute your code from any location (relocatable).
@ped7g5 жыл бұрын
`jp nz` is faster for "jump taken/condition true" case (`jp` is 10T/10T, while `jr` is 12T/7T, so `jr` is faster when condition is false)... so if you were optimizing for speed, you often did use `jp` in similar loops like in video (although most often one didn't need those 2T per loop that desperately, as any very intensive loop did end "unrolled" anyway, so the few remaining loops were of higher-level kind, and not that critical).
@nickpearson14874 жыл бұрын
Cheers for this Daryl - excellent vid, and book, you've made a 53 year old feel 15 again :) I'm looking forward to getting back to assembler - I used to love coding in it (z80,6502 and 68000). I'm an IT bloke by profession (c#, vb,c, SQL, shell script and many others - I started life with COBOL, C and Informix), so hope to pick this up relatively quickly (wishful thinking), and see what I can contribute to the excellent Spectrum Next community. Great vids, keep them coming.
@tobobobo28427 жыл бұрын
Thanks so much for these.m - devouring them all right now. You have a knack of getting the method across that all my books on Z80 can't. Keep it up pls.
@Jamesfo8rf4 жыл бұрын
Thanks for a great series. I understand assembly a lot more now. Thanks.
@oldmossystone5 жыл бұрын
JR is 'jump relative' which is a bit faster than JP because it uses fewer bytes to encode the instruction, but this also means it is limited in scope. I think it's limited to +127/-128 relative to it's own position in the code. Haven't checked a reference for that though so :)
@darrylsloan5 жыл бұрын
colb Your explanation is right, but I used JP in this instance because I didn’t want to overwhelm the listener with unfamiliar technical concepts in lesson 1.
@pandoraefretum7 жыл бұрын
I'm about the same as you : I am delving deeper into Forth, which I first came across on the Spectrum 35 years ago.
@Inaflap7 жыл бұрын
You can use the B register in the outer loop by utilising the stack. You have to push / pop the register pair BC (not just the B register you care about). Be sure that you always pop off anything you pushed on the stack before attempting to return to BASIC or you'll return to the wrong point in RAM (and crash the machine). ld b, 23 outer push bc ld b, 32 inner nop djnz inner pop bc djnz outer
@SwainyAtRetroAsylum7 жыл бұрын
Just wanted to say thanks for this video. It's great to have this explained in such an understandable way.
@axtrifonov5 жыл бұрын
Thank You! I already did some stuff in x86 assembly, now i want to try Z80/Spectrum one.
@JimGiant6 жыл бұрын
I'm in my early 30s but still have some nostagia for that generation. I bought an Amstrad cpc from a boot sale for £7.5 when I was about 6 with a bin bag full of games. I did a fair bit with basic for a kid that age. I'm learning assembler for Mega Drive now.
@Inaflap7 жыл бұрын
Here's another way you can do a checker board pattern on the Spectrum. After loading HL with the screen attribute start position, as you did, register A is set to zero using xor A. That's just a more efficient way of doing ld a,0 A loop (l2) of 32 columns is nested inside a loop (l1) of 25 rows by utilising the stack to preserve the value of B register. Instead of loading the value of 0 or 127, we can simply alternate using xor 127. We just need to initialising register A with zero (xor a). We want to offset the following row, so that calls for another xor 127 in the outer loop (l1). scrattr equ 0x57E0 org 50000 di ld hl, scrattr xor a ld b,25 l1 push bc ld b,32 l2 ld (hl),a inc hl xor 127 djnz l2 xor 127 pop bc djnz l1 ei ret ; to BASIC
@amigalemming5 жыл бұрын
What about using C for counting in the outer loop?
@niallmartin5904 жыл бұрын
Sitting in front of a real +2 with Zeus loaded, this is brilliant, thank you
@stephenkelly63017 жыл бұрын
Thanks for the interesting upload. The old Speccy 48k is probably the machine I look back on most fondly as well. In the past few months I seem to have been swept up with the whole retro computer thing, Z80 in particular. I've been building some RC2014 machines and a Spectrum Harlequin clone, which I have put in a RetroRadionics replica case. I haven't looked at Z80 assembly for pushing 30 years, but I have been meaning to for a few weeks. Your video has just given me another nudge, so thanks! I hope you do some more and make it a series. Looking at the backing that the Spectrum Next has been receiving (me included ) I'm sure there would be some interest.
@frankx87393 жыл бұрын
Used to be a big machine code programmr on my Speccy {yes I assembled by hand). One thing i could NEVER get to work were the interrupts.
@darrylsloan3 жыл бұрын
I don't understand interrupts either!
@HuntersMoon787 жыл бұрын
I'm getting a ZX Spectrum next, can't wait to get it and use it
@TechRyze7 жыл бұрын
This is excellent stuff. I can't wait until I have the time to sit down with this and get cracking. I want to write a few simple utilities, but with nice interfaces. I'll be back to run through this in the near future.
@londongaz24 жыл бұрын
Thank you! I'm just putting together a home brew z80 project, so this is really useful.
@darrylsloan4 жыл бұрын
Cool. Glad to help.
@davidkmatthews7 жыл бұрын
Quite a good intro to Z80 machine code programming for the Speccy - well done! However for those unfamiliar with SInclair BASIC, you could do with explaining what the utterly obscure "RANDOMIZE USR" command is for. (IIRC you can use "PRINT USR" instead)
@anthonychallis24727 жыл бұрын
Thank you, great memories, hours spent slaving over a hot Speccy writing machine code. It would have been good if you had written the program in basic and machine code and demonstrated the difference in speed to draw the chequer patten. That was the real benefit of using machine code, speed and efficiency. Great video, thanks.
@richallenxbox19764 жыл бұрын
40 years ago I basically taught myself (at the age of nearly 5) Spectrum BASIC and wrote several text based quizzes and Adventure games.
@neilwright1286 жыл бұрын
This is amazing! I actually understand this! Thanks so much. Please keep these coming!
@andrewtitcombe837812 күн бұрын
Back in the day I wrote z80 machine code to hack out games. The game designs towards the end were incredibly well space saving.leaving no room for my code to break theirs. I also started writing compression code to compress the graphics and expand them onto screen.
@ThePopeandrew4 жыл бұрын
Fantastic video once again Darryl. I'm all ready to take the plunge again. You could have chosen some music from 2 Tone records to accompany the lesson :)
@avrilcadabra7 жыл бұрын
Hi found this video after watching your microbit stuff, I am a c64 era kid (well was once upon time) have only tinkered in assembly really, you explained it very well. I never had a spectrum, but used to see them mentioned in the 80's magazines (commodore was king in australia) anyway great job found your video easy to follow. will sub incase you post more
@YouTubeSupportTeams5 жыл бұрын
greetings from BT39, just discovered your channel, some interesting video titles that took my interest. Like 'Jim Browning''s channel it's nice to hear a Northern Ireland accent spoken without sounding absolute cringe.
@darrylsloan5 жыл бұрын
Thank you. Hope you enjoy the other videos.
@stalepalemale7 жыл бұрын
Darryl this is an excellent video and you *must* do more! :) Very well explained concepts, I know some z80 and did 6502 back in the day but other stuff I've seen isn't basic enough to get you going. Well done
@stalepalemale7 жыл бұрын
Thank you when I try and use spin and follow the instructions I get a '2 variable not found, 10:1', assembled the code just fine not sure if I am missing something? imgur.com/a/B8Zp7
@stalepalemale7 жыл бұрын
Fantastic, silly me! Yes thats what it was, I'd remembered the keywords for the first word but not the second. Thanks Darryl!
@santiagotelemach82367 жыл бұрын
Excellent tutorial! the pace is perfect for begginers...
@chrismcauley45965 жыл бұрын
Great Video and has got me started into Spectrum Assembly after looking at C64 Assembly
@jaseman4 жыл бұрын
Thanks this was really interesting. However back in the days of my Spectrum - I have no idea how I would go about accessing a place where I can type in the assembly code. Your emulator has provided a tool for that - without it - how would you write the code? You would also need some method of saving it as well.
@EmmittBrownBTTF16 жыл бұрын
The ULA (outside the CPU) independently interrogates memory to provide the display signal.
@cthutu7 жыл бұрын
The ROM can't be written to ever actually. It's not even temporary like you suggested in your video.
@thundersos80873 жыл бұрын
Just some comments to help you along I hope you find them useful. ld is short for load or can sort of think of it as basic LET. djnz stands for decrease and jump if not zero. It only works with register B. ROM can't be written even temporarily on the real hardware, an emulator might allow it though. And it might be a better idea to use register C (the other half of B) for the outer loop. A is the accumulator so if you did any calculations in between writing the values to the screen then A would be changed.
@psycronizer4 жыл бұрын
21:56...DJNZ... it's decrement , jump non zero....yes, I did this too when i was 16 and head over heels in love with my speccy....did you write any routines for sprite control ?
@gdm4132295 жыл бұрын
Memory addresses from 16384 to 32767 are contended by the ULA chip in 48k Spectrums.
@Retrospective.7 жыл бұрын
Lovin your work! i gave up trying to learn 6502 code on the Oric years ago, but like you, with the advent of the next, i wanna learn code, and like you, i already have a very good understanding of higher level languages. But this is the first "idiots" guide, and i dont mean that unkindly, that actually explains it. you gotta do more videos fella, although having all the code on screen is good when you talk about it, it would be good to see the program run, to give some idea of speed over basic etc. looking forward to your next video thjough. great stuff, slainte :)
@Kamakazi_-tp2lb3 жыл бұрын
Decrement jump if not zero basicly makes a compare decrements and jumps if not equal to zero
@neo-frame93697 жыл бұрын
It's time to Z80 :) In 80-ties I programing my commodore 6510 in assembler but never learn and Z80. Now I fill it's perfect time . :D I also have two working Spectrums ...
@charleshawes94797 жыл бұрын
Great video explanation. I also want to try my hand at assembler for the first time. I was a keen Basic programmer and especially enjoyed MasterDOS for the Sam Coupe to create databases, screen animations etc. Assembler seemed too advanced back in the mid-80's, and I'd like to see if I can make some progress on some simple graphics routines and perhaps some simple games to help expand my assembler knowledge from zero to at least amateur. I am looking forward to the Spectrum Next being released to see what talented programmers can do with it. Good luck with your Assembler knowledge. Hope you may post another video showing your advancement of knowledge in a few months?
@psammiad7 жыл бұрын
I always wondered how Speccies were programmed, I knew it wasn't in Basic but wasn't sure how assembly code worked. Amazing that in fact only about 41K of memory was available for programs! How on earth did they debug these programs?
@alwaysnumb17 жыл бұрын
for small games you could write them in your bedroom but for bigger games you wrote and assembled your code on better computers then transferred it onto a speccy to test
@ped7g5 жыл бұрын
what do you mean "debug"? :D ... usually it crashed on any mistake in code, so you knew there was mistake... what more do you want to know, as programmer ;) :D ... I mean, it was super extra fun for me personally, as I didn't have Spectrum, so I was writing the machine code at paper, then once a week at Saturday I went to the computing club available for kids, typed the code into computer, watched it to reset instantly, had to leave the room because the allocated time was over, and I had another week of staring at paper, where is that bug and what mistake did I do... :D ... I guess I really desperately wanted to program computers, otherwise I have no other explanation why I kept doing it for couple of years like this...
@cprince10 Жыл бұрын
Great video. If I draw a box using Plot and Draw, how do I fill in the box with colour?
@darrylsloan Жыл бұрын
A fill routine would be quite complex to code, especially if it accomodated any shape. You can't actually "fill" with colour. Pixels are purely on or off, black or white, on the Spectrum. Colour exists in blocks of 8x8 pixel called attributes. All that would have to be taken into account in your code. Not easy.
@MGoolas7 жыл бұрын
For the first time in my life I understood something that has to do with assembly. How the hell did the programmers learn how to code with this alien language back then with little documentation ?
@michaelricketson13656 жыл бұрын
I have often wondered the same thing. I remember Anne Westfall saying how she taught herself assembly language, and wished I could do the same!
@sobakete6 жыл бұрын
Programming the Z80 by Rodnay Zaks. The absolute bible for Z80 programming. I have fond memories of reading that huge paper brick and playing around with assembly with my speccy. Those times were a lot of fun, and I miss the feeling of hacking around with that little beast :)
@Stabby6666 жыл бұрын
I used to code in ASM on the speccy back when I was in school after finding basic too slow to make games. I’ve spent the intervening years using all kinds of languages, but now find myself using assembler often for microcontroller programming :) I find it therapeutic.
@sobakete6 жыл бұрын
Indeed, ASM is fantastic if you enjoy, like I do, the attention to details, performance tuning and minimalistic approaches to any programming task. After a few years with the speccy I jumped to the Amiga, and fell in love with the Motorola 680x0 ASM and its sheer elegance and flexibility. Nowadays most programming jobs are boring like-playing-with-LEGOs chores, where everything is downloaded and joined toghether in unefficient and overengineered piles of crap. I miss that artisan feeling of the old ASM days ;)
@ian_b6 жыл бұрын
I learned Z80 from a few magazine articles and copying all the instructions from the Zaks book in my local library (it was in the reference section and you couldn't borrow it) into a notebook. I actually think assembler is quite simple once you get the idea. Compare that to modern languages with huge numbers of instructions to learn, and scads of boilerplate code. I then wrote my assembler in an A4 lined notebook (that's actually paper, not a "notebook computer") then converted the assembler to hex (after a while, I'd memorised the common hex codes) and then entered the hex into a little basic program, saved it to tape, and then it crashed, I reloaded it, tweaked it (notebook, hand assemble, type in, save) and eventually it wouldn't crash and I moved on to the next routine. And so on.
@TheFusedplug7 жыл бұрын
Going to learn ZX Speccy programming for exact same reasons I own a + 2 (grey) still from back in the day but never got around to programming properly
@jal05111 ай бұрын
I did this when I was 13. I didn't fully finish anything, but I got a 2d character to move in a simple platforms map. Only the character movement/animation was in machine code. The "map" loading was in basic. I had written in basic my little input program to introduce the hex codes that I earlier had written in a paper. I didn't know there were assembler programs 🤣 I wanted to make a game, but then I was 14 and girls started to matter more.
@RolandAdams-h4m6 ай бұрын
I used to translate my first assembler programs into machine code using pen, paper and a table of instructions from a magazine. I used DATA to store the code in a Basic program, and I used POKE commands to write into memory. When I first learned about the existence of assemblers, I considered it 'cheating'.