Z80 Computer - Part 6 The Stack & Subroutine Calls

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 26

  • @melkiorwiseman5234
    @melkiorwiseman5234 Год назад +3

    At some point, I hope you'll mention the undocumented instructions which, on all Z80 CPUs I've seen or tested so far, will allow you to treat the IX and IY registers as two 8-bit registers each. The IX and IY instructions all use a prefix followed by the number used for the same operation on the HL register pair. It turns out that if you put the prefix before one of the 8-bit instructions for dealing with H or L separately, you can access the high and low sections of the IX and IY registers separately.
    Edit to add: It may have been worthwhile during the explanation of the stack "growing downwards" to have started the stack pointer at 0000 hex in order to demonstrate how the memory effectively "wraps around" as far as addressing is concerned.

  • @PE4Doers
    @PE4Doers Год назад +2

    Again - Excellent series. Thanks You Sir 😊

  • @nand3kudasai
    @nand3kudasai 10 месяцев назад

    awesome video and explantion.
    it might be worth nothing that the 'register pushin/popping inside the called sub' is sometimes specified as a 'calling convention' on systems that have multiple programs interoperating.
    what you've described is pretty similar to how desktop does it afaik (with the exception that you're passing a parameter in a registry (clarion) instead of the stack).
    but there are other conventions that are worth checking, since its fairly arbitrary convention.
    i personally prefer the clarion/pascal one.

  • @Philip8888888
    @Philip8888888 Год назад +4

    Could you please also show the back of the board and describe how you make the connections?

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад +4

      No. Well... ok then. I'll show this in the next part. I use wire-wrap wire, and it looks a bit like a rats nest. There would most likely be issues if we were running the clock a high speed, but at these low speeds it working fine for now. I will eventually move to a printed circuit board.

    • @Махачкала-б1э
      @Махачкала-б1э Год назад +2

      there are many wires there :)

    • @Philip8888888
      @Philip8888888 Год назад +2

      @@SteveRaynerMakes you use wire wrap method or do some kind of point to point soldering?

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад

      @@Philip8888888 No I don't use the wire wrap technique, I just solder the wires.

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад +1

      @@Philip8888888 I have added a photograph on the Community tab of my channel page.

  • @kdmq
    @kdmq 8 месяцев назад +1

    Just thinking outside the box, I would think "jr, FE" should technically function as a halt instruction, because it decrements the program counter by 2 and executes the same jr again. At least, that's how I understand it. The only difference is your red halt LED will not light up.

  • @boredfish80
    @boredfish80 5 месяцев назад +1

    I have a reasonable grasp of assembly so almost skipped over this one. Glad I didn’t; I wrote a Spectrum emulator and this made me check the stack handling logic. Turns out that I was decrementing the stack pointer AFTER each byte was added - which still works 99% of the time as my POP code matched, but now and again was clattering something when running larger programs.
    A quick change, one less bug to fix and at least two programs no longer freezing up!

    • @SteveRaynerMakes
      @SteveRaynerMakes  3 месяца назад

      awesome.

    • @cygil1
      @cygil1 3 месяца назад

      Ah, rookie mistake. The most dangerous things are the things you think you know, that ain't so. Naturally the stack post decrements, that's only sensible. Except it doesn't.

  • @ssalbach
    @ssalbach Год назад +1

    Which 7-Segement decoder Chip do you nuse? I bought old ones from ebay, because new ones don't have nice Symbols for A-F, but the Chips looks like newer ones than mine

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад

      I'm using the DM9368. I don't like it though because it uses a lot of current and I can't control the brightness of the LEDs. There might be a way of doing it, but I haven't figured it out yet. I think these chips.are pretty hard to get hold of.

    • @M0GLU
      @M0GLU Год назад

      @@SteveRaynerMakes Decreasing the LED display current, option one: add a serial resistor to each segment line
      option two adds one common resistor between the GND (not proper because the segment brightness continuously changes, depends how many segments are active)

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад

      @@M0GLU neither would work because the DM9368 is a constant current source. If you add more resistance the chip will just increase the voltage to keep the current constant.

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад

      i suppose the voltage must max out at some point though, as it can't really go above the 5v supply voltage

    • @M0GLU
      @M0GLU Год назад

      @@SteveRaynerMakes Ohh yess. It's logical. Can you tell me the proto-board size?

  • @abrahamjushua9491
    @abrahamjushua9491 Год назад

    It will be nice and very informative if you design some monitor program (just a primitive operating system) for this computer witch will make it more usable at some extent.

  • @Махачкала-б1э
    @Махачкала-б1э Год назад

    Hey Steve you forgot to mention variables

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад

      There is no concept of variables in assembly language.

    • @Махачкала-б1э
      @Махачкала-б1э Год назад

      @@SteveRaynerMakes Yes it is.I wanted to say about "place in memory with names"

    • @SteveRaynerMakes
      @SteveRaynerMakes  Год назад +1

      @@Махачкала-б1э Ok. You are referring to the db (define byte) assembler directive. This isn't something that really exists in Z80 instruction set, but rather something the assembler adds to make life a little easier for the developer. Should we move on to the assembler in the next video? Then I can cover a few of the available directives.

    • @Махачкала-б1э
      @Махачкала-б1э Год назад +1

      @@SteveRaynerMakes i would like to see.Thank you