‹ BackHN Continuity

Thread

A graphical desktop for the ZX Spectrum

131 points · 130 comments · graemep

  1. shevy-java · · focus · HN ↗
    Assembly seems overkill though.
    1. djmips · · focus · HN ↗
      For an 8 bit Z80 based hardware project like this, assembly is a valid choice. The reason is performance. You'll lose significant performance with a compiler or interpreter.
    2. flohofwoe · · focus · HN ↗
      There is practically no other choice on a Z80. C compilers really don't like the Z80 ISA and create both slow and bloated output, at least compared to manually written asm. And on top, you can do many optimization tricks in assembly that simply are not possible in a high level language (self-modifying code, jumping into the middle of an instruction, etc...).

      Forth might work better than C, but tbh, assembly code is more straightforward and easier to read than Forth ;)

      1. whobre · · focus · HN ↗
        PL/M ?
        1. flohofwoe · · focus · HN ↗
          Don't know, but AFAIK this wasn't a popular programming language on home computers in the 1980s (from what I've seen, the popular non-asm languages were usually BASIC, Forth and Pascal, even C was kinda rare).
    3. MobiusHorizons · · focus · HN ↗
      I believe most of the 8bit microcontrollers from this era have no good optimizing compilers that get close to what competent practitioners achieve with assembly. I think it has to do with having complex addressing modes making the C stack fairly inefficient.
    4. varjag · · focus · HN ↗
      The quickest way to redraw a screen or otherwise copy a memory region on Spectrum of is to use POP/PUSH instructions while flipping the stack pointer. Good luck getting that with C.
    5. Marazan · · focus · HN ↗
      assembly is the only choice. The Z80 processor is a twisty collection of registers, none alike. It is pretty much the opposite of what a, for example, C compiler is looking for.

      In fact C compilers are _notoriously_ bad at producing code for the Z80.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.