A new ZX Spectrum is coming (time to learn Z80 machine code!)

Sdílet
Vložit
  • čas přidán 12. 05. 2017
  • PATREON | / darrylsloan
    PAYPAL | www.paypal.me/darrylsloan
    ZX Spectrum Next Kickstarter: www.kickstarter.com/projects/...
    ZX Spin emulator & assembler: emulationrealm.net/downloads/...
    I'm learning Z80 assembly language, in anticipation of the release of the Sinclair ZX Spectrum Next computer, February 2018.

Komentáře • 344

  • @darrylsloan
    @darrylsloan  Před 4 lety +20

    As a companion to this tutorial series, please avail yourself of my free Z80 ebook: ped.7gods.org/z80.pdf

    • @darrylsloan
      @darrylsloan  Před 3 lety

      @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.

    • @schismaticschematics
      @schismaticschematics Před 3 lety

      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.

    • @yVFIdqca
      @yVFIdqca Před 3 lety

      Are you planning any epub / mobi version?

    • @darrylsloan
      @darrylsloan  Před 3 lety +1

      @@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.

    • @vincentmiller6977
      @vincentmiller6977 Před 2 lety

      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.

  • @Daeve42
    @Daeve42 Před 7 lety +18

    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.

  • @sambrown9494
    @sambrown9494 Před 6 lety +4

    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! :)

  • @gnamp
    @gnamp Před 5 lety +11

    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.

    • @b213videoz
      @b213videoz Před 12 dny

      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)

  • @Havanacuba1985
    @Havanacuba1985 Před 3 lety

    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

  • @harrivayrynen
    @harrivayrynen Před 3 lety

    This is one of the best programming tutorial! From zero to one working program. Good work!

  • @edz
    @edz Před 7 lety

    Great video. My first step into the world of assembly. I've got until January to master it ready for my ZX Spectrum Next!

  • @viktororban5684
    @viktororban5684 Před 7 lety +25

    You have a really relaxed teaching style and a great voice, loving it.
    +subbed for more Z80 goodness

    • @GrahamDIY
      @GrahamDIY Před 5 lety

      You wrote, ok a year ago now :), what I was going to write. Completely agree 👍

  • @rebeccamacgregor549
    @rebeccamacgregor549 Před 4 měsíci

    Brilliantly explained. I look forward to watching more of your videos.

  • @Javier197y2
    @Javier197y2 Před 7 lety

    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 :-)

  • @DJFuZionDnB
    @DJFuZionDnB Před 7 lety +1

    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.

  • @nicks6649
    @nicks6649 Před 2 lety

    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

  • @fecheverria
    @fecheverria Před rokem

    I like the peace of how you explain all this. Thanks

  • @rebeccamacgregor549
    @rebeccamacgregor549 Před 5 lety +1

    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..

  • @tobobobo2842
    @tobobobo2842 Před 7 lety

    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.

  • @SwainyAtRetroAsylum
    @SwainyAtRetroAsylum Před 7 lety

    Just wanted to say thanks for this video. It's great to have this explained in such an understandable way.

  • @neilwright128
    @neilwright128 Před 6 lety

    This is amazing! I actually understand this! Thanks so much. Please keep these coming!

  • @F61Wolf
    @F61Wolf Před 7 lety

    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?

  • @RetroSteveUK
    @RetroSteveUK Před 5 lety +3

    Thanks for this. Assembler demystified! I feel motivated now, to go learn more.

  • @rodoherty1
    @rodoherty1 Před 7 lety

    Really nicely explained! I've never used a Spectrum, myself, but I still enjoyed that intro to Z80.

  • @petermirtitsch1235
    @petermirtitsch1235 Před 5 lety +1

    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.

  • @mikedench1110
    @mikedench1110 Před 7 lety

    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.

  • @tonybkent
    @tonybkent Před 5 lety

    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.

  • @Sabre_Wulf1
    @Sabre_Wulf1 Před 7 lety

    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 !

  • @James-fo8rf
    @James-fo8rf Před 3 lety

    Thanks for a great series. I understand assembly a lot more now. Thanks.

  • @solangoose8372
    @solangoose8372 Před 4 lety

    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!

    • @darrylsloan
      @darrylsloan  Před 4 lety +1

      Glad you found this helpful. I'm from '72.

  • @markretro3612
    @markretro3612 Před 2 lety

    great video, i have watched a few different starter guides and ended up more confused, this actually made sense to me .

  • @user-sw8vb2qo8y
    @user-sw8vb2qo8y Před 12 dny

    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 🙂

  • @74teppic
    @74teppic Před 7 lety +2

    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.

  • @erichobbs4042
    @erichobbs4042 Před 4 lety

    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.

  • @timrichter1980
    @timrichter1980 Před 6 lety

    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!

    • @timrichter1980
      @timrichter1980 Před 6 lety

      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!

  • @antonnym214
    @antonnym214 Před 5 lety +8

    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.

    • @refractedphoton
      @refractedphoton Před 5 lety

      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???

    • @ped7g
      @ped7g Před 5 lety +1

      @@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).

    • @antonnym214
      @antonnym214 Před 5 lety +1

      @@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.

  • @sdfsdghhjjf3880
    @sdfsdghhjjf3880 Před 5 lety

    Excellent !, nicely explained, tempted by the Spektrum Next :)

  • @jhonny1392
    @jhonny1392 Před 7 lety +5

    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.

    • @MarcKloos
      @MarcKloos Před 3 lety

      @jhonny1392 Have you got your Next already?

    • @jhonny1392
      @jhonny1392 Před 3 lety +1

      @@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.

    • @MarcKloos
      @MarcKloos Před 3 lety

      You can still get one on the current KickStarter. But it's more expensive now.

    • @blue552
      @blue552 Před 3 lety

      @@jhonny1392 An 'enhanced version'?! 🤪

  • @elektron2kim666
    @elektron2kim666 Před 7 lety

    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.

  • @petermirtitsch1235
    @petermirtitsch1235 Před 5 lety +1

    I used to use OCP Assembler. That was a great package on the Speccy.

  • @MattBaker1965
    @MattBaker1965 Před 6 lety +31

    OMG I'm 17 again :)

  • @londongaz2
    @londongaz2 Před 4 lety

    Thank you! I'm just putting together a home brew z80 project, so this is really useful.

  • @axtrifonov
    @axtrifonov Před 4 lety

    Thank You! I already did some stuff in x86 assembly, now i want to try Z80/Spectrum one.

  • @Javier197y2
    @Javier197y2 Před 6 lety

    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!

  • @makepool
    @makepool Před 3 lety +6

    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.

    • @spinnetti
      @spinnetti Před 3 lety

      assembly is an addiction. Having to count t-states and optimize ML is more rewarding than any other sort of coding.

  • @santiagotelemach8236
    @santiagotelemach8236 Před 7 lety

    Excellent tutorial! the pace is perfect for begginers...

  • @DonAmiga
    @DonAmiga Před 7 lety

    Great Stuff, the spectrum was my first computer back in the day and I'm also looking forward to the zx spectrum next so found your channel and new sub, looking forward to more videos :) Thanks

  • @TechRyze
    @TechRyze Před 6 lety

    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.

  • @pandoraefretum
    @pandoraefretum Před 7 lety

    I'm about the same as you : I am delving deeper into Forth, which I first came across on the Spectrum 35 years ago.

  • @retrogamer33
    @retrogamer33 Před 7 lety

    I'm getting a ZX Spectrum next, can't wait to get it and use it

  • @moozoo2589
    @moozoo2589 Před 2 lety

    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.

  • @chrismcauley4596
    @chrismcauley4596 Před 4 lety

    Great Video and has got me started into Spectrum Assembly after looking at C64 Assembly

  • @JamesT65
    @JamesT65 Před 6 lety

    thanks for doing this, I had the same challenges with machine code.

  • @newyoda
    @newyoda Před 7 lety

    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.

    • @newyoda
      @newyoda Před 7 lety

      Sold - to the man in the blue hat. Thank you Mr Sloan =)

  • @MrGradlet
    @MrGradlet Před 4 lety

    Exactly what I was looking for. Been wanting to scratch the assembler itch for more years than is probably healthy. Thanks for sharing.

    • @darrylsloan
      @darrylsloan  Před 4 lety +1

      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”.

    • @MrGradlet
      @MrGradlet Před 4 lety

      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!

  • @avrilcadabra
    @avrilcadabra Před 7 lety

    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

  • @stephenkelly6301
    @stephenkelly6301 Před 7 lety +2

    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.

  • @nickpearson1487
    @nickpearson1487 Před 3 lety

    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.

  • @domorewithsage
    @domorewithsage Před 7 lety

    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

    • @domorewithsage
      @domorewithsage Před 7 lety

      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

    • @domorewithsage
      @domorewithsage Před 7 lety

      Fantastic, silly me! Yes thats what it was, I'd remembered the keywords for the first word but not the second. Thanks Darryl!

  • @NickT6630
    @NickT6630 Před 5 lety

    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.

    • @darrylsloan
      @darrylsloan  Před 5 lety

      Ah yes, I saw somebody demoing one of those on CZcams once. Fascinating.

  • @Tom53Tech
    @Tom53Tech Před 6 lety

    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.

  • @VRBug
    @VRBug Před 5 měsíci

    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!

  • @nicadi2005
    @nicadi2005 Před 6 lety +3

    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!

    • @nicadi2005
      @nicadi2005 Před 6 lety

      +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.

  • @psycronizer
    @psycronizer Před 6 lety

    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....

  • @GrahamDIY
    @GrahamDIY Před 5 lety +1

    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:.. 👍

  • @ThePopeandrew
    @ThePopeandrew Před 3 lety

    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 :)

  • @Psycandy
    @Psycandy Před 11 měsíci

    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.

  • @bobzeepl
    @bobzeepl Před 5 lety

    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.

  • @Cp-71
    @Cp-71 Před 4 lety +15

    I feel strange here. I'm a fan of ZX Spectrum yet I don't have any nostalgia for it... because I'm 17.

    • @donaldklopper
      @donaldklopper Před 3 lety +3

      @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.

    • @frankx8739
      @frankx8739 Před 3 lety

      Well it's a year later now: feeling nostalgia yet?

    • @edmund-osborne
      @edmund-osborne Před 3 lety +4

      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.

    • @b213videoz
      @b213videoz Před 3 měsíci

      I'm the opposite: I have nostalgia for ZX but I'm not its fan 🤪

  • @niallmartin590
    @niallmartin590 Před 3 lety

    Sitting in front of a real +2 with Zeus loaded, this is brilliant, thank you

  • @Retrospective.
    @Retrospective. Před 7 lety +1

    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 :)

  • @TheMoonKingdom
    @TheMoonKingdom Před 7 lety

    Even though I'm not into programming beyond basic mel scripting for 3D; I appreciate how cool this is:)

  • @davidkmatthews
    @davidkmatthews Před 6 lety

    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)

  • @beakytwitch7905
    @beakytwitch7905 Před 4 měsíci

    The Spectrum was the first adequate and yet inexpensive computer. I did a lot of programming on it in both Basic and assembler.

  • @reset1974
    @reset1974 Před 6 lety

    Ver y clear explanation.thanks from Spain.

  • @psycronizer
    @psycronizer Před 6 lety

    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....

  • @darrenpearsall4523
    @darrenpearsall4523 Před 6 lety

    Nice intro to Z80, thanks.

  • @charleshawes9479
    @charleshawes9479 Před 7 lety +2

    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?

  • @JimGiant
    @JimGiant Před 6 lety

    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.

  •  Před 7 lety

    Excellent job!

  • @PP-bs3od
    @PP-bs3od Před 6 lety

    What a superb video

  • @ceeteeuk
    @ceeteeuk Před 7 lety

    great video!

  • @anthonychallis2472
    @anthonychallis2472 Před 6 lety

    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.

  • @krnlg
    @krnlg Před 5 lety

    Thank you, this is very useful :)

  • @juliegreen7604
    @juliegreen7604 Před 7 měsíci

    Djnz means Decrement [B], Jump , (if) Non-Zero.
    It takes 8 or 13 clock cycles depending upon the outcome.

  • @neo-frame9369
    @neo-frame9369 Před 7 lety

    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 ...

  • @StretchMasterP
    @StretchMasterP Před 6 lety

    fantastic tutorial keep it up

  • @RandyFortier
    @RandyFortier Před 3 lety +1

    FYI, djnz stands for "decrement and jump if non-zero"

  • @greenmotion2160
    @greenmotion2160 Před 5 lety

    thanks a lot you made me go back to 1983 souvenirs

  • @robertoZX64
    @robertoZX64 Před 7 lety

    great video! :)

  • @martinhollyer7110
    @martinhollyer7110 Před 6 lety

    A nice intro to Z80

  • @olejnizak
    @olejnizak Před 3 lety

    nice explanation, very clear, thanks!!!!!!!!!!!!!!!!!!!

  • @DOBEAGAIN
    @DOBEAGAIN Před 9 měsíci

    Darryl, we love this channel. What platform on windows are you using/recommend? Thanks!

    • @darrylsloan
      @darrylsloan  Před 9 měsíci

      Thanks! Do you mean for Spectrum emulation? I use the ZX Spin emulator, because it has a built-in assembler.

  • @royloveday4350
    @royloveday4350 Před 4 lety +1

    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. 👍

    • @darrylsloan
      @darrylsloan  Před 4 lety +1

      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

    • @royloveday4350
      @royloveday4350 Před 3 lety

      @@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.

    • @darrylsloan
      @darrylsloan  Před 3 lety +1

      @@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.

    • @royloveday4350
      @royloveday4350 Před 3 lety

      @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.

  • @TheFusedplug
    @TheFusedplug Před 7 lety

    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

  • @jackpret4547
    @jackpret4547 Před 5 lety

    I was obsessed with Spectrum Machine code!
    My first hacked program was Planetoids Dec hl!!
    The Manic miner! Merge then Poke xxx(cant remember)
    Also used "Assem P".

  • @YouTubeSupportTeams
    @YouTubeSupportTeams Před 4 lety +1

    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.

    • @darrylsloan
      @darrylsloan  Před 4 lety

      Thank you. Hope you enjoy the other videos.

  • @gdm413229
    @gdm413229 Před 5 lety

    Embedded systems engineers might use this machine (ZX Spectrum Next) as a test platform for their Z80 code in custom sandboxes.

  • @snotnosedlilkid
    @snotnosedlilkid Před 6 lety

    Interesting,thank you.

  • @jaseman
    @jaseman Před 4 lety +1

    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.

  • @richallenxbox1976
    @richallenxbox1976 Před 3 lety

    40 years ago I basically taught myself (at the age of nearly 5) Spectrum BASIC and wrote several text based quizzes and Adventure games.

  • @Inaflap
    @Inaflap Před 7 lety

    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

  • @JGRStudios
    @JGRStudios Před rokem

    thanks a lot

  • @rda6899
    @rda6899 Před 6 lety

    muy bueno, saludos desde Uruguay