Z80 Assembly Language for the ZX Spectrum Tutorial, Episode 1: The Basics

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 169

  • @Dunbar0740
    @Dunbar0740 3 роки тому +57

    Wish I'd seen this vid in 1983. Better late than never.

    • @oneheckofabanana2016
      @oneheckofabanana2016 3 роки тому +1

      This video did not exist back then. However, I am the best. So there is no need to worry. All in due time, my friend. Learn patience, and your key to success will lie within.

  • @ulysses_grant
    @ulysses_grant 5 місяців тому +3

    This playlist comes to the rescue. It's like seeing an old book of photographs of a dearest friend in a moment like this.
    Farewell, Z80.

  • @BinaryReader
    @BinaryReader 3 роки тому +34

    This is a hugely valuable resource! Modern processors are far too sophisticated to trivially jump into for beginners, so something like the Zilog Z80 is just the right balance of sophistication and approachability. Having a full series on this processor is something Im exceptionally keen on as i am looking to write my own Z80 emulator. Thank you so much!

  • @radiognome1971
    @radiognome1971 3 роки тому +23

    Oh, what a joy. Thanks for reviving these childhood memories of my school holidays in the '80-s, converting mnemonics to op-code with pencil and paper.

    • @michaelclift6849
      @michaelclift6849 3 роки тому +3

      Exactly this! Not on a ZX, I had a single board computer called a TEC1 by an Australian company called Talking Electronics. I went mad with it, making expansions, and hand assembling code to punch in opcodes on a 4x4 keypad.

    • @slithymatt
      @slithymatt  3 роки тому +3

      @@michaelclift6849 that is hard core! Wish I had a hex keypad today.

    • @dalixman2754
      @dalixman2754 Рік тому +1

      Exactly what I had to do until I saved enough to buy an Assembler :)

  • @mig7287
    @mig7287 3 роки тому +4

    Best memories.
    I loved assembly programming on my Spectrum.
    Dot Net on my PC is not as much fun.
    Starting now to do assembly on the PC.

    • @mrunixman1579
      @mrunixman1579 2 роки тому

      I never programmed in assembly on a Spectrum but I have on a PC and just passed a course on it. I came across this video due to interests in the Spectrum's programming languages when code appears on screen after crashing a game.

  • @dreznik
    @dreznik 3 роки тому +2

    this takes me back to Z80 assembly experiments on my ZX81... to go into assembly mode there we had to do smtg like
    RAND USR

  • @cnc-maker
    @cnc-maker 3 роки тому +33

    There are 2 things that made the Z80 the 8080 killer. The fact that it only needed +5v instead of +5v, +12V, and -5V was absolutely huge, as well as the fact that it only needed a simple oscillator for the clock as well. The 8080 required a weird 2 phase clock that was beyond bizarre.

    • @klave8511
      @klave8511 3 роки тому +1

      The 8085 sorted all that out in 1976.

    • @cnc-maker
      @cnc-maker 3 роки тому +3

      @@klave8511 that isn't quite accurate. While it did allow a single +5v power supply to be used, and a single phase oscillator to be used as well, it's touting of being 100% binary compatible was false. There were originally undocumented changes to flags that complicated code to support both processors. Plus, it had none of the additional functionality of the Z80, which eclipsed all use of the 8080 and 8085 combined. I will say that the 8032 line of microcontrollers was nice, but that was a completely different market, which the 8085 sort of entered.

    • @TheSulross
      @TheSulross 2 роки тому +1

      I have a vintage computer that uses the Intel 8085 - the Tandy TRS-80 Model 200. It's really a powerhouse of a portable computer with productivity programs that can be quickly sommoned from ROM - like the Multiplan spreadsheet. Probably safe to say that this line of portables from Tandy (Model 100 and follow-ons) were the most successful 8085 computers

    • @TSteffi
      @TSteffi Рік тому

      Also the LDIR/OTIR type opcodes make a big difference. Thanks to those opcodes, the Z80 could do copy and search operations much faster than the 8080.

  • @dodgydruid
    @dodgydruid 3 роки тому +4

    I cut my teeth on a ZX80 kit which was a lot of effort but the damned thing was too limited to do anything of consequence, the ZX81 improved things but the Spectrum took it all to a new level and because it was built upon the 80 and 81's core, was a breeze to migrate too. Another contender also entered the fray at this time, that of CP/M much favoured by the Amstrad machines and became cohabitable on the Spectrum 3's where many Amstrad games could work natively on Spectrum 3's and I used to create personalised Locoscript installs for companies which was a nice bit of extra money using CP/M. I used to have big notepads for setting up a programme, create its flowchart, break the flowchart down into modules then work on each module once I had set up the framework, I was working in a bank in the 90's and I sat there one lunchtime and knocked them up a far better database with decent sockets to talk with other bank systems, the programme was actually tiny and super robust and they stopped using it in early 2000's so it lasted pretty well, of course me being green around the gills I got a cheque for £500 for doing that but £500 in the eighties was not to be sniffed at and like any young lad I blew it on beer, parties and young ladies hehe I spotted this vid as I used to be pretty good at all of this but have lost my way the last 20 odd years, would love to relearn it all and all thru this vid I was thinking "Oh yes, that's how it went" lol

  • @jenny-c
    @jenny-c 3 роки тому +5

    Oooh that‘s so great! The Spectrum was my first computer and I loved to code in assembler (also later in M68000 assembler for the QL). Watching this video is like travelling back in time and all the memories coming back. Thank you!

  • @rjy8960
    @rjy8960 3 роки тому +3

    I'll be following this - I'm 54 and cut my teeth on creating assembly code and hardware design for various different 4- and 8-bit processors. The first machine I programmed was an 8085 in hex - I remember cheating and using absolute addressing rather than relative addressing to make life easier. Assemblers make life so much easier.
    Good luck with the series! :)

  • @axelBr1
    @axelBr1 3 роки тому +2

    My first computer was a ZX81 with 1K of memory. And although I wanted to program the Z80 in Assembler, and asked my dad for the book "Programming the Z80" for Christmas, but never got round to actually doing it.
    Great to see something for the Z80, I've been following Ben Eater's 6502 projects, but it's not the same.

  • @darrellsturdivant7912
    @darrellsturdivant7912 2 роки тому +4

    Bravo!! Loved every minute of this. Early micro computers, assembly language, emulators, Mac’s and even Atom. Wow. It does not get much better than that. I wrote tons of z80 code back in the day. I even wrote most of my code and compiled it on the mainframe z80 cross assembler. ah, the days of single threaded programming. A simpler time.

  • @Dandema
    @Dandema 3 місяці тому

    Reading books and saw this videos several times. Awesome ❤

  • @stupossibleify
    @stupossibleify 3 роки тому +6

    Fantastic tutorial. As a C64 owner I always wondered about programming the Speccy. Looking forward to the next episode!

  • @euphoricmonkey8409
    @euphoricmonkey8409 Рік тому

    Thanks for this series. I had a spectrum as a kid and just wasn’t smart enough to understand assembly. Now I’m a LOT older it’s fun to look back now I’m a BIT wiser. The Z80 is such a manageable cpu to understand.

  • @TheAgent4125
    @TheAgent4125 3 роки тому +7

    Great start - looking forward to the next one.

  • @DanielImmanuel2143
    @DanielImmanuel2143 2 роки тому +1

    You've made this video sound like child's play! Thank you. Z80 was always my best processor along with 6502 thank you, you made it easier to understand...better than some lecturers 😊

  • @trinitron40237
    @trinitron40237 3 роки тому +1

    I feel 25 years younger watching this video. I did a 3ph PWM inverter project based on Z80 back then.

  • @microdocker
    @microdocker 3 роки тому +2

    Clear explanation, nice and comprehensive infografics and pleasant narration! Thank you!

  • @adamjones6252
    @adamjones6252 2 роки тому +1

    just getting into Z80 programming - nice primer :) looking forward to working through the series.

  • @BigCar2
    @BigCar2 Місяць тому

    This was very useful. Thanks!

  • @curtisvaughan8955
    @curtisvaughan8955 2 роки тому +1

    OMG finally somebody doing everything on Linux! Thank you so much. I was so tired of emulating programs under wine to follow along with other tutorials.

  • @martinj.fowler6262
    @martinj.fowler6262 6 місяців тому

    The Latin and Classical Studies teacher at our school was a computer hobbyist. He gave me his copy of Picturesque Editor/Assembler/Monitor/Debugger and said "See if you can work out how to use it, I have no idea". It took me another year or so but I eventually worked it out with a little help from a friend :D I wrote a couple of little games for the Spectrum in Z80 but never fully finished for release. I've still got the tapes but don't think they'll work after all these years. I'd have to guess at the org address to run it and the source was created using Laser Genius Assembler Suite.

  • @kilianhekhuis
    @kilianhekhuis 3 роки тому +1

    Very nice video! Clearly explained, good pace, good information density. Can't wait for the next one!

  • @amiller112
    @amiller112 3 роки тому +1

    Good video. I have been interested in learning assembly for a while and as I still have my original spectrum +3 this series seems like a good place to start.

  • @PAS100170
    @PAS100170 Місяць тому

    Oh good heavens. My IT history, how it all began. At one point knew every command and everything going on in that little machine. Used to hack all the copy protection systems on the games.

  • @ArcangelOrtiz
    @ArcangelOrtiz 3 роки тому +5

    Thanks, it was informative

  • @HansBezemer
    @HansBezemer 3 роки тому

    Nothing new for me, but well explained! But it makes me remember a lot of good times. Gives me a very good reason to visit your next presentation!

  • @kychemclass5850
    @kychemclass5850 3 роки тому

    Great to see such a series begin!

  • @Theineluctable_SOME_CANT
    @Theineluctable_SOME_CANT 2 роки тому

    Great little tutorial. Thoroughly enjoyed it!
    Great channel...

  • @jurijzahn8985
    @jurijzahn8985 3 роки тому

    I am traveling back in time 😁. Very nice! Thanks!

  • @RufianEmbozado
    @RufianEmbozado 3 роки тому

    Awesome introduction! I wish I'd had this kind of resource back in the day (although that maybe would have killed some of the joy of discover things on my own, but anyway).

  • @richardturnnidge
    @richardturnnidge 3 роки тому

    Brilliant, looking forward to the series.

  • @005AGIMA
    @005AGIMA 3 роки тому +3

    oooooh I'm so in! Subbed. Perhaps I will finally write a game after all these years? :D

    • @rodoherty1
      @rodoherty1 3 роки тому +1

      I know that feeling! I've wanted to write a C64 game for so long. I'm working through Matt's X16 series and, so far, I'm hanging in there! Hope you get to realise that dream!

  • @qzorn4440
    @qzorn4440 3 роки тому

    gee this is wonderful info, i wished i had this when learning logic and the 8080, etc... thanks a lot...:)

  • @RockTo11
    @RockTo11 3 роки тому

    Oh yes. I'm really looking forward to this series. Specifically beca6ineant to make games for the Amstrad CPC and Gameboy.

    • @slithymatt
      @slithymatt  3 роки тому +3

      I won't be getting into the hardware specifics of those platforms in this series, but I hope it provides a good basis for understanding Z80 assembly, which you can then apply to systems besides the ZX Spectrum. Just be aware that the Game Boy CPU only has a subset of the Z80 instructions

  • @taldmd
    @taldmd 3 роки тому +2

    neat! for following episodes, could we expect an explanation of the ZX48 memory map, how did develop in asm back in the 80's, and what made the ZX48 a unique platform (ROM, graphics, sound and input subsystems, etc), different from other Z80 based microcomputers?

    • @ronvanderlee7298
      @ronvanderlee7298 3 роки тому

      Memory layout: ua-cam.com/video/_J4ahkWtNYw/v-deo.html 😉🙂

    • @slithymatt
      @slithymatt  3 роки тому

      Yes, we'll get into all of that

  • @AndrewHelgeCox
    @AndrewHelgeCox 2 роки тому

    UK game developers often worked on the Z80 Amstrad CPC when targeting the spectrum.

    • @slithymatt
      @slithymatt  2 роки тому +1

      I could see that. Definitely a better system for development on.

  • @TheBeeshSpweesh
    @TheBeeshSpweesh 3 роки тому +1

    7:32 - "(absolute), C" is an invalid LD operand combination on the Z80.
    13:27 - There are instructions that load an immediate to the memory byte pointed to by HL, IX+offset, and IY+offset, but not by a 16-bit absolute address. You can make the code clobber HL instead of A as a result.

    • @slithymatt
      @slithymatt  3 роки тому +1

      Good catch with the LD (xx),C. I'm not sure how I missed that! And yeah, you could use (hl), too, but I didn't want to get into indirect addressing in the first example

    • @TheBeeshSpweesh
      @TheBeeshSpweesh 3 роки тому

      There's a Z80 knockoff I'm kind of obsessed with that has that LD...

  • @croll_uk
    @croll_uk 3 роки тому

    Awesome. Used to have a Speccy in the late 80's. Would be nice to reminisce and finally write assembly instead of basic. 10 Print 'ME' . 20 GOTO 10 ... lol

  • @JimmWare
    @JimmWare Рік тому

    Well done!

  • @colonelbarker
    @colonelbarker 3 роки тому

    Thank you for making this!

  • @r_bilek
    @r_bilek 3 роки тому

    Very very very good !

  • @AdamSommer70
    @AdamSommer70 3 роки тому

    Great video, thanks for posting!

  • @hadireg
    @hadireg 3 роки тому

    👍👍awesome series!

  • @thedogwooddandy
    @thedogwooddandy 3 роки тому

    so grateful. thank you!

  • @idea1407
    @idea1407 3 роки тому

    Very awesome. Great tutorial.

    • @idea1407
      @idea1407 3 роки тому

      Yep, just got sjasmplus up and running on my raspberry pi zero w. Your code worked just fine.

  • @VasaMusic438
    @VasaMusic438 2 роки тому

    Fantastic !!!!!!!!

  • @kirill_bykov
    @kirill_bykov 3 роки тому

    16:36 AFAIK, $ sign means current compilation address in most assembly languages. And hexadecimal form is written as ####H, started with decimal number, so you have to prefix it with zero sometimes to obey the rule.

    • @slithymatt
      @slithymatt  3 роки тому

      No, it just means hex. Each assembler has different notation, but $ is very common for hex. Some assemblers allow multiple notation, including prepending # or postpending H

    • @kirill_bykov
      @kirill_bykov 3 роки тому

      @@slithymatt, M80 and GEN80 support H-suffixed and do not support $-prefixed hex notation, even Zeus does not. All three use $ as the current compliation address. I did not tell $ is not supported at all for this purpose, simply uncommon. Is common for Pascal though.

  • @annieworroll4373
    @annieworroll4373 Рік тому

    Just good enough, just cheap enough, just simple enough, and with a huge number of people who know how to work with them gave this thing a very long life in embedded applications after the 8 bit PC era faded. It's still being made! And being used for so long every tiny edge case has been figured out making its behavior incredibly predictable, which is crucial in a lot of embedded applications.

  • @heidirichter
    @heidirichter 3 роки тому

    This was great, thank you!

  • @iliasgkotsidis3204
    @iliasgkotsidis3204 2 роки тому

    Beautiful

  • @donaldklopper
    @donaldklopper 3 роки тому

    Pure gold, man!

    • @slithymatt
      @slithymatt  3 роки тому +1

      Thanks! I was shooting for at least 18K

    • @donaldklopper
      @donaldklopper 3 роки тому

      @@slithymatt 24K for sure. I just love the application to the Spectrum ecosystem. Even your narration is on point :-) Where were you in 1983 when I got my ZX81?

    • @slithymatt
      @slithymatt  3 роки тому +1

      @@donaldklopper learning how to code at school using Logo on an Apple II, naturally.

  • @HA7DN
    @HA7DN 3 роки тому +1

    Having just programmed 8085 I can already see this is waaaay friendlier, despite being closely related...

  • @pavloskairis9994
    @pavloskairis9994 Рік тому

    6502 was fun ... I wrote code for the BBC model B.

  • @Gruntos
    @Gruntos 3 роки тому

    If I remember the IX and IY registers could be addresses as 8 bit registers IX.L and IX.H my old assembler had this functionality. Not sure if it was common practice though.
    I did a lot with screen drawing on the specky. Most people used LDIR which would cause a screen flicker but it was faster to call LDI in a block 1024 blocks as the LDIR took 24 T states and the LDI 8 ( memory falling here).
    I think the fastest way was to move the SP to the top of screen memory and push the screen byte.
    Had a lot of fun with the z80 and 68000

    • @slithymatt
      @slithymatt  3 роки тому +1

      Yes, you can address ixh and ixl in the same ways you can h and l, for the most part. There are a few exceptions where you can't substitute index register halves, when h or l is one operand, but (hl) is the other. For example: ld (hl),h is valid, but you can't do ld (hl),ixh. What you can do is ld(ix+x),h, but again not ld(ix+x),ixh.

    • @nicadi2005
      @nicadi2005 Рік тому

      @Gruntos "I think the fastest way was to move the SP to the top of screen memory and push the screen byte." - Yes, I do recall hearing about that technique - fairly recently, as a matter of fact. But I haven't quite figured it out yet, to be honest...
      I do understand (to some extent) why this would be an attractive approach, though: i.e. using 16-bit transfers per opcode (rather than 8-bit ones), as well as the address decrement/increment being handled automatically. However, I keep seeing the fact that the stack is implemented 'upside-down' for the Z80 as a serious (potential) impediment to achieving high performance for this technique, in certain applications...
      (P.S. I can explain more thoroughly what I actually mean by all of that, however I would risk turning this post into an interminable essay - and I would rather NOT go that way... At least, not unless someone else here first manifests further interest in hearing more about my musings on the matter...)

  • @cprince10
    @cprince10 Рік тому

    Great video. If I draw a box using Plot and Draw, how do I fill in the box with colour?

  • @AlessandroGrussu
    @AlessandroGrussu 3 роки тому +1

    Interesting video, and a commendable effort to teach the basics of Z80 assembly to the masses. However, I have some reservations. I find the exclusive use of the hexadecimal system in a tutorial aimed at absolute beginners a questionable choice, more so if it is proposed without explaining anything about it. Also, ZesarUX is far too complex to use for a beginner: Spectaculator and SpecEmu would have been better choices in my opinion. Not that I am a Z80 Assembly expert - far from it - but if I had your experience and knowledge, I would have chosen a more "for dummies" approach, delving into details that I could genuinely believe not to need any explanation.

  • @natesherwood-cc3il
    @natesherwood-cc3il 20 днів тому

    Thanks!

  • @davidmarks509
    @davidmarks509 3 роки тому

    I liked it. TY

  • @fcf8269
    @fcf8269 3 роки тому

    Would love to see this when I got my spectrum :) Any plans to make a series for the 68K?

    • @slithymatt
      @slithymatt  3 роки тому +1

      I've definitely considered it. That was my first assembly language many years ago, and I still have my textbook. I would probably target the Amiga.

  • @thinking-laaf
    @thinking-laaf Рік тому

    The alternate registers are moderately useful. If zilog had added a means to find out which set is active, that would have increased their usefulness...

    • @slithymatt
      @slithymatt  Рік тому

      Indeed! Instead the alternate registers are always the ones not directly accessible. One of the unused status bits would be nice!

  • @andrewdunbar828
    @andrewdunbar828 3 роки тому +31

    I consider it respectful to pronounce the Z in Z-80 and ZX as "zed" when talking about British computers and "zee" when talking about American computers, at least in public (-:

    • @axelBr1
      @axelBr1 3 роки тому +7

      The trouble is that the Z80 is a yankee chip, so I guess it should be called the Zee 80, but Zed 80 sounds better

    • @StarsManny
      @StarsManny 3 роки тому +3

      Most native English speakers in the world are American. So let's use the American way. I'm sure most non Americans like me don't care much either way anyway.

    • @isyt1
      @isyt1 2 роки тому +8

      @@StarsManny that’s completely not true. If you add up Indian, Nigerians, British, Irish, Australian, New Zealand, South Africa, Germans then it’s far more than America and they all use real English, not American English.
      See Wikipedia article entitled “List of countries by English-speaking population”

    • @paulklasmann1218
      @paulklasmann1218 Рік тому +6

      @@StarsManny The language is English, not American. In English it is pronounced "zed". Anything else is wrong in an English exam.

    • @Just_lift_anyone
      @Just_lift_anyone Рік тому +1

      Some good points, one very bad point here. All of it respectful (maybe not mine 😂) but yes, it is Zed 😅

  • @Choober65
    @Choober65 2 роки тому

    ZX Spectrum, best computer EVER 🤣

  • @Dostofei44
    @Dostofei44 4 місяці тому

    Is this possible to write in BBC BASIC SDL?

  • @johnwilliams7999
    @johnwilliams7999 3 роки тому

    What a great video! Maybe a daft question but why would you use assembly if you can compile c to machine code.

    • @slithymatt
      @slithymatt  3 роки тому +1

      There are many reasons, but mostly when you are dealing with extremely tight constraints, like on a low-RAM system with a slow CPU and no operating system (which is pretty much all 8-bit home computers and game consoles), the code generated by C will be too bulky and inefficient. C was invented for Unix and systems capable of running it.

    • @cyberp0et
      @cyberp0et 3 роки тому

      Why not program in BASIC, since it comes with the system :)

    • @johnwilliams7999
      @johnwilliams7999 3 роки тому

      @@cyberp0et I used to program in basic a long time ago and ill probably tinker with it a little when I get around to it. I like to code in language like rust and probably c is the closest thing to that that u can code with on this machine.

    • @Michael75579
      @Michael75579 3 роки тому +1

      It's difficult to imagine how constrained the Spectrum and other machines of the time were unless you've used them. The ancient (2010) PC I'm running a Spectrum emulator on to follow these tutorials has a quad-core Intel CPU running at 2.66Ghz and 4G of memory; that's around 750 times the CPU clock speed and over 85000 times the memory of my original Spectrum 48K.

  • @Veso266
    @Veso266 Рік тому

    How would I do this direcly on the spectrum?
    Were there any good asemblers back in the day?

    • @slithymatt
      @slithymatt  Рік тому

      I don't know about anything specific, but I'm sure it would be possible. There were several assemblers for Z80-based computers that ran CP/M

  • @alexandrugoia2982
    @alexandrugoia2982 10 місяців тому

    Have you some experience with gens-3 assembler directly on spectrum computer/emulator ?

    • @slithymatt
      @slithymatt  10 місяців тому

      No, never tried it.

  • @caphep
    @caphep Рік тому

    Atom has been discontinued and the Z80 language package for syntax is not available any more. Can anyone recommend an alternative editor for this tutorial?

    • @slithymatt
      @slithymatt  Рік тому +1

      VSCode is the closest, and if you don't want the Microsoft proprietary libraries you can install the fully FOSS version "Codium"

  • @DarrenLGoldsmith
    @DarrenLGoldsmith 5 місяців тому

    Back in the day, I dreamt of creating a program (game) such a Manic Miner, or Jet Set Willy... just like my hero Matthew Smith. It all seemed far too complicated though - indeed, almost magical - and I had no idea where to start. Now that I'm in my 50s, I'd really like to give it a proper go. Would this be a good series to get me off and running, or at least walking? Does anyone have any other recommendations? Bear in mind, when it comes to any kind of coding at all, I am a *complete* beginner!
    Cheers!

    • @slithymatt
      @slithymatt  5 місяців тому +1

      I would first recommend learning some basic programming first. Not literally BASIC per se, but something like Python just to get your feet wet before getting into assembly.

    • @DarrenLGoldsmith
      @DarrenLGoldsmith 5 місяців тому

      @@slithymatt Thanks!

  • @ian_b
    @ian_b 3 роки тому +1

    There will never again be a register pair as great as hl.

    • @slithymatt
      @slithymatt  3 роки тому +1

      HL' is just waiting in the wings, though...

    • @ian_b
      @ian_b 3 роки тому

      @@slithymatt Well I admit, I tend to flip-flop between the two.

  • @iliasgkotsidis3204
    @iliasgkotsidis3204 2 роки тому

    I need to ask a question the tutorial is very helpful but i am having a rough time finding an ide to make the .asm file work

    • @slithymatt
      @slithymatt  2 роки тому +1

      I don't use an IDE, all you need is a text editor and the sjasmplus assembler. See the GitHub link in the description for more info

    • @iliasgkotsidis3204
      @iliasgkotsidis3204 2 роки тому

      @@slithymatt thank you

  • @SteveInScotland
    @SteveInScotland 3 роки тому +1

    Speccy is an affectionate name often used in magazines back in the day but it kind of makes my skin crawl when it’s used too often or in inappropriate places. For me at least, I prefer just hearing the regular name of Spectrum. It’s kind of similar to if you kept saying Bro all the time, you could but in general you likely wouldn’t. No hate, just my opinion.

    • @slithymatt
      @slithymatt  3 роки тому

      I try to switch it up, because saying Zed-Ecks-Spectrum over and over can get monotonous.

    • @SteveInScotland
      @SteveInScotland 3 роки тому

      @@slithymatt absolutely it’s full name is far too long winded but just Spectrum is easy enough I think. I mean it’s your channel, do your thing.

  • @DAVIDGREGORYKERR
    @DAVIDGREGORYKERR 3 роки тому

    The MEMOTECH MTX512 can combine Assembly and BASIC together I.E.
    ASSEM 10
    10 CODE
    &H4000 LD HL,&H20
    &H4004 LD BC,AH32
    &H4008 ADD BC,HL
    &H400C LD (HL),BC
    &H4010 RET
    20 REM End of assembly.
    the MTX512 also has a proper keyboard which makes coding easier.
    What about storing you assembly language in the REM statements and do CALL RAND USER(16384) or you can do like in this example goto 10.

    • @slithymatt
      @slithymatt  3 роки тому

      I don't know anything about the Memotech computers. Looks like a nice feature!

    • @DAVIDGREGORYKERR
      @DAVIDGREGORYKERR 3 роки тому

      @@slithymatt if a special piece of hardware plugged into the back of the computer you can load and run SINCLAIR Spectrum games for both the 48K and 64K machines and it just happens that you can get the MEMOTECM HDX512 (Hard drive) or the MEMOTECH FDX512 (Dual floppy drive) and can run CPM/80.

    • @TheBeeshSpweesh
      @TheBeeshSpweesh 3 роки тому

      Are you sure the MTX512's assembler supports "ADD BC, HL" and "LD (HL), BC" as pseudo-instructions? The Z80 has neither.
      I'm gonna guess you reversed the operand order for those. The latter can be done via:
      LD C, (HL) ; Load low byte
      INC HL ; Advance to high byte
      LD B, (HL) ; Load high byte
      DEC HL ; Go back (may not be needed)
      Once again, I know nothing about the BASIC used by that machine.

    • @DAVIDGREGORYKERR
      @DAVIDGREGORYKERR 3 роки тому +1

      The processor is the ZILOG Z80A get the the MEMOTECH program book and have a look at the machine code for the Sound To Light programme

    • @TheBeeshSpweesh
      @TheBeeshSpweesh 3 роки тому

      @@DAVIDGREGORYKERR I know! I saw that it used the Z80.

  • @zembalu
    @zembalu 3 роки тому

    Thank you for that video! I have a ZX Spectrum since the 80ies, and programmed video games in assembler. I really would like to turn this thing on again, but there are two impediments: I have no old fashioned TV as a monitor, and I have no cassette drive, not to speak of the cassettes with the assembler and so on. Any clue, how to fix this?

    • @slithymatt
      @slithymatt  3 роки тому

      Any TV with an analog PAL tuner should work, assuming you have a PAL unit. Most modern TVs still support analog RF video, but it may be stretched out on the screen. As for a tape deck, you can use anything that can play a sound through a headphone jack. You just need a dubbing cable, with a 3.5mm plug on both ends. Then you can just play the sound file through the cable.

    • @zembalu
      @zembalu 3 роки тому

      @@slithymatt Thank you! That helps a lot.

    • @XXXXXX-dy5fs
      @XXXXXX-dy5fs 3 роки тому +2

      There is a simple mod to bypass the TV modulator and give a composite video output. As for storage there are several modern alternatives to tape. Some use SD cards to copy file images from your PC to the SD interface that plugs into the Spectrum.

    • @zembalu
      @zembalu 3 роки тому

      @@XXXXXX-dy5fs thank you!

  • @AhmadAlMutawa_abunoor
    @AhmadAlMutawa_abunoor 3 роки тому

    This is an excellent level of explanation. Even to a veteran programmer in different languages. My question is: will this code work for MSX computers?
    I am interested in writing programs for the MSX, but could not find enough information and videos for it, since it was not very popular in the USA

    • @ped7g
      @ped7g 3 роки тому

      the video ram and other memory layout of MSX is very likely completely different (I don't know how MSX has it), so the code itself will still work the same, write value $D6 into memory at address $5800, but the MSX computer will not create blinking square on screen. (what will happen on MSX depends what is in that area of memory, probably nothing of significance/direct response). Also the output format SNA is ZX snapshot, so you will need to figure out how to produce binary which can be loaded by MSX emulator (or real MSX computer), AFAIK games for MSX are often produced as ROM-cartridge images, I know one huge MSX project does use sjasmplus for it, but it builds the whole file byte by byte manually, ie. any required "headers" of ROM cartridge and special values like checksum are part of the source code, and the source output is captured "as is" as raw stream of bytes (OUTPUT -> OUTEND directives of sjasmplus, or --raw command line option).
      in other words, it makes some sense to follow ZX tutorials (the Z80 assembly is still Z80 assembly, but [only] the machine-specific parts differ), and you can also use tools presented here, but you need to find some "glue" tutorial dedicated to MSX which will fill you on those machine-specific details, what's the memory layout of MSX, how to use it's HW features like graphics, sound, sprites, etc.... There's excellent web dedicated to MSX at msx dot org, where you can find also wiki with tips for programmers, and probably also some links to other tutorials or example projects and HW info.
      If you are completely new to assembly, and you really want to do MSX, it may make sense to start rather with MSX tutorials, and scavenge the ZX assembly tutorials a bit later, when you can somewhat tell which parts are machine specific features, and pick up the Z80 assembly tricks which do apply also for MSX.

    • @solhsa
      @solhsa 3 роки тому

      The z80 code itself will "work", but referring to anything outside it (like display memory) will differ from one z80 computer to another.

    • @solhsa
      @solhsa 3 роки тому

      Since even when writing for the speccy you'll probably want to have some kind of hardware reference in hand, writing for the msx shouldn't be much different - you just need a different reference =)

    • @cnc-maker
      @cnc-maker 3 роки тому

      Also be aware that this assembler does not use the original Z80 syntax. The “$” (dollar sign) used by this assembler is not a part of the Z80 assembly syntax. Also, by default, all numbers in Z80 assembly are considered to be hexadecimal, not decimal. There are other differences as well, but you get the jist.. If you are using a different assembler, you might need to tweak the assembly in order for it to work for you.

    • @andyleighton3616
      @andyleighton3616 3 роки тому +1

      The basic information about how the instructions work is the same. However MSX is totally different to the Spectrum. Anything to do with writing to screen, reading the keyboard, etc will be completely different. The MSX did not have an area of screen memory in the main 64K. It used dedicated VRAM accessed by a visual display processor chip (a Texas Instruments one for earlier MSX machines). The process for writing (and reading) the MSX VRAM (and VDP) require a few techniques Matt hasn't talked about. Basically using OUT and IN instructions (and also DI / EI to disable / enable interrupts). There were probably also MSX bios routines to do some of that too (just as we saw in the Hello World example program).

  • @kcinplatinumgaming2598
    @kcinplatinumgaming2598 3 роки тому

    takes me back not codedd any z80 since the 1990s, I dont think i done any assembly on spectrums mostly Amstrad CPC when i developed a text editor and some small projects on the PCW systems but mostly coding on low power stand alone chips systems hardware like controllers, io ect .. serial devices with Z80 logic.. but mostly other CP/M based systems .. mad really that Digital Research could have been instead of Microsoft .. Gary Kildall could have been instead of Bill Gates

  • @wlorenz65
    @wlorenz65 3 роки тому

    Why is it See-Eighty and Said-Ex-Eighty but not See-Ex-Eighty?

    • @slithymatt
      @slithymatt  3 роки тому +3

      The Z80 is an American chip, while the ZX80 is a British computer

  • @simonchilli2088
    @simonchilli2088 Місяць тому

    Why do computer programmers call brackets parenthesis?

    • @slithymatt
      @slithymatt  Місяць тому +1

      @@simonchilli2088 because [] are brackets, {} are braces, and () are parentheses.

    • @simonchilli2088
      @simonchilli2088 Місяць тому

      @@slithymatt Cheers for that. I've always thought that the parentheses were just called brackets. A meeting with my sister who's a phd in English required to correct me.

    • @simonchilli2088
      @simonchilli2088 Місяць тому

      @@slithymatt Apparently BODMAS is different in different parts of the world. My wife came across it on Google randomly today.

  • @1Rictec
    @1Rictec Рік тому

    "bro i cant pass this level on this game can you do something?" ok looking for DEC (HL) on the code , remove it and there you go infinity lives...oh the memories lol

  • @LarsHHoog
    @LarsHHoog 3 роки тому

    7:40 shows a LD (NN),C instruction that Z80 doesn't have.

    • @LarsHHoog
      @LarsHHoog 3 роки тому

      But the contents is promising and I hope many will learn lots.

    • @slithymatt
      @slithymatt  3 роки тому

      Yeah, someone else caught that already. Had a bit of a brain fart there. I'm to change it to A in the slides in the repo

    • @LarsHHoog
      @LarsHHoog 3 роки тому

      @@slithymatt There was no damage caused :)

  • @ped7g
    @ped7g 3 роки тому

    IMHO it's a bit better to end these early snapshot examples with `jr $` (infinite loop of self-jump). (and leave the "ret to basic" for later, when you will deal also with loader/sysvars/etc) It's also nice reminder for asm beginners, that the CPU doesn't stop where the source does, and keeps executing whatever it finds in memory further down, unless it is explicitly prevented.

  • @AndersJackson
    @AndersJackson 3 роки тому

    Emacs also have syntax highlightning.

    • @slithymatt
      @slithymatt  3 роки тому +2

      There's one in every crowd... 😉

    • @AndersJackson
      @AndersJackson 3 роки тому

      @@slithymatt yes, but it is plain better. :-)

  • @IngieKerr
    @IngieKerr 3 роки тому

    Inspired, I've now got a tiny blue stick-person rotating in a character cell... with a pause subroutine to slow it down enough to see it. I'd make it move around the screen but sprites on a spectrum memory map are beyond my brain for today :) I mean, it's easy-ish to move "sprites" sideways on a speccy screen, it's just the moving up and down that gets tricky :)
    As a child I had a language extension tape _"Fifth"_ (I'd link to it, but a product name like that wasn't built for legacy searching an internet :) , which was a library of sprite routines and such, and wasn't a derivative of Forth, despite its obvious pun. I recall it being quite nice - hacking around with its demos, but I think at the time I hadn't tuned into the delights of such things, or what I was doing.
    edit: found a reference, if anyone remembers this: worldofspectrum.org/archive/software/utilities/fifth-crl-group-plc
    ... I cite this, since when a 12yr old, I remember I found it fascinating, and looking back at the manual on this link, I can see why... but I can also see why it went over my head at the time :)

    • @slithymatt
      @slithymatt  3 роки тому

      Very cool! I never heard of this "Fifth" -- very cute name. Was it only for the Spectrum?

    • @IngieKerr
      @IngieKerr 3 роки тому

      @@slithymatt I believe so, aye...
      I can't recall why I bought it back then, but I imagine I read an advert in _Your Spectrum_ magazine saying "WRITE YOUR OWN GAMES, MAKE ££££", sent off naively, opened the box and realised I was lacking various other parts, namely those in my brain :)

  • @davidorama6690
    @davidorama6690 3 роки тому

    If you’d have posted these videos earlier I could of learnt assembly coding from you and would of been a hero in my High School and maybe Bill Gates instead of a geek who became an accountant. Thanks. 35 years too late. Try harder next time! 🤣

  • @toastyPredicament
    @toastyPredicament 2 роки тому

    Shut