Agon Light 2 - Learning Assembly Language for the eZ80 Microprocessor

Following @AgonBits videos has been instrumental in my learning about this topic. Also the documentation found in GitHub.
So sit back and enjoy yourself!
Gracias
#basicprogramming #games #computer
github.com/AgonConsole8/agon-...

Пікірлер: 17

  • @TSteffi
    @TSteffiАй бұрын

    Someone already pointed out that RST stands for restart. But I'd like to elaborate a bit more on it. You see, the number after the RST is not really an address, but a reference. There are 8 total on the classic Z80 i believe. Each of those numbers has a specific memory address associated with it, and that association is etched into the silicon, hardwired. This is done for one reason: to allow the RST opcode and its operand to fit in a single byte. That's what makes them fast. Other opcodes for calling subroutines exist, but they require a memory address as operand. And a memory address on the Z80 is 16 bits, 2 bytes. Plus one for the opcode itself, makes it a 3 byte operation. So for the RST, the CPU needs only a single byte from memory. On the classic Z80, this can also be used for handling hardware interrupts, but I don't know if you want to go down that whole rabbit hole at this time. Now here comes the difference between the classic Z80 and the eZ80: The eZ80 has a classic mode with 16 bit addresses, and the new long mode with 24 bit addresses. This is also referred to as ADL (Address Data Long) mode. Because the address length is different in those two modes, extra caution is needed when calling subroutines. That comes in the form of a suffix to some commands. Like for example, the RST.lil means "long into long". Means it is calling a long-mode address from long mode. It could also be RST.sil for Short into Long. That would be used to call a long mode function from a program running in classic mode.

  • @MikePerigo
    @MikePerigoАй бұрын

    Just seen this new short video on assembly by breakit makeit channel. Not strictly relevant to the Agon but it is historically insightful and worth trying to follow how the code at the end is working. I’ll try to put a link in a reply if YT doesn’t delete it.

  • @MikePerigo
    @MikePerigoАй бұрын

    RST nn = Restart at address nn : equivalent to single byte JMP instructions. Think of GOTO in BASIC with built-in destination line numbers. They execute very fast and are usually used for the most commonly used routines. RST 00 is the first command executed by the Z80 processor when it is first powered up or a reset is performed and it starts at address 0000. I'm not sure what 'lil' is used for but it is an eZ80 extension to the original Z80 instruction. EQU = Equate : This is not a machine instruction but an assembler directive. It is used to define constants and tells the assembler what value to replace it with whenever it comes across it in the program. DB or DW (define byte or define word) are also assembler directives and are used to reserve/initialise memory space. Similar to DIM in BASIC. YES you should definitely have a Microprocessor Instruction reference manual to hand when learning assembly language. Understanding what code is doing requires an overall knowledge of every 'bit' that is affected by every instruction and what effect it has. Fortunately you quickly learn the most commonly used instructions and then only have to look up those you are unfamiliar with. Although different assemblers can use different syntax they all basically do the same thing but are written in different ways in order to avoid copyright lawsuits over proprietary programs.

  • @LearnAgon

    @LearnAgon

    Ай бұрын

    Ty ty Ty 🎉!!!

  • @LearnAgon

    @LearnAgon

    Ай бұрын

    This is pure gold!! Thanks

  • @TSteffi
    @TSteffiАй бұрын

    Someone already pointed out that RST stands for restart. But I'd like to elaborate a bit more on it. You see, the number after the RST is not really an address, but a reference. There are 8 total on the classic Z80 i believe. Each of those numbers has a specific memory address associated with it, and that association is etched into the silicon, hardwired. This is done for one reason: to allow the RST opcode and its operand to fit in a single byte. That's what makes them fast. Other opcodes for calling subroutines exist, but they require a memory address as operand. And a memory address on the Z80 is 16 bits, 2 bytes. Plus one for the opcode itself, makes it a 3 byte operation. So for the RST, the CPU needs only a single byte from memory. On the classic Z80, this can also be used for handling hardware interrupts, but I don't know if you want to go down that whole rabbit hole at this time. Now here comes the difference between the classic Z80 and the eZ80: The eZ80 has a classic mode with 16 bit addresses, and the new long mode with 24 bit addresses. This is also referred to as ADL (Address Data Long) mode. Because the address length is different in those two modes, extra caution is needed when calling subroutines. That comes in the form of a suffix to some commands. Like for example, the RST.lil means "long into long". Means it is calling a long-mode address from long mode. It could also be RST.sil for Short into Long. That would be used to call a long mode function from a program running in classic mode.

  • @LearnAgon

    @LearnAgon

    Ай бұрын

    This is invaluable information!!!! Much appreciated

  • @TSteffi

    @TSteffi

    Ай бұрын

    This is ridiculous. If I come here from the notification that you liked the comment, I can see it. But only this one. The counter under the comment shows one reply, but the reply doesn't show up. And when I go to the video directly, my comments are still invisible. Guess KZread shadow-banned me for some reason.

  • @LearnAgon

    @LearnAgon

    Ай бұрын

    @@TSteffi I’m as confused about the way comments are handled, so sorry

  • @LearnAgon

    @LearnAgon

    Ай бұрын

    @TSteffi I am as confused as can be about this too

  • @TSteffi

    @TSteffi

    Ай бұрын

    @@LearnAgon it is really weird. Coming here from the notification I can reply. This totally fits the pattern of a shadow ban. Probably something in my comment got flagged by some bot at KZread for some stupid reason.

  • @TSteffi
    @TSteffiАй бұрын

    Oh lol, KZread is hiding my comment for some reason. Maybe it is held back because it is too long, or something in it looks like a URL maybe?

  • @TSteffi

    @TSteffi

    Ай бұрын

    PS: I hope you can find it in your comments section and unlock it. I'll check back later and maybe add to it.