Game Under - Debugging Arcade Game Designer's Compiler

Поділитися
Вставка
  • Опубліковано 31 лип 2024
  • See how I go about identifying problems in the code generated by the new compiler, what code is actually generated, what code should be generated and the extra code added to the compiler to fix the problem.
  • Ігри

КОМЕНТАРІ • 3

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

    Interesting! I'm assuming there was another reason I missed why you didn't want to change the EX DE,HL for a LD DE,(varc) or something? Compilers are fascinating things

    • @jonathancauldwell9822
      @jonathancauldwell9822  9 місяців тому +1

      The expression evaluator creates code to put 8-bit values in the accumulator and 16-bit values in HL as the Z80 is pretty much geared that way. There's really no other way of doing it because other registers and register pairs don't have the instructions that HL and the accumulator have. With this rule in place I can swap registers and register pairs around and still be efficient. EX DE,HL or LD C,A are only 1 byte and (if memory serves) 4 clock cycles. The result is efficient target code and a compiler that's easier to debug

    • @balorprice
      @balorprice 9 місяців тому

      @@jonathancauldwell9822, thanks! I'm tinkering with creating a compiler and this is useful to know.. And yes, LD r,r and EX DE,HL are only 4-tstates, no big deal really