News for hackers. Stuff that matters.
Re:Z80 arithmetic: also surprisingly terrible (2018) by jgrahamc on Monday January 14, 2019 @12:05PM (#18904458)
A good reference for Z80 programming is Rodnay Zaks' Programming the Z80. On page 94 at the start of the chapter Basic Programming Techniques there's a section on 8-bit addition. The program is as follows:

    LD   A,(ADR1)        LOAD OP1 INTO A
    LD   HL,ADR2         LOAD ADDRESS OF OP2 INTO HL
    ADD  A,(HL)          ADD OP2 TO OP1
    LD   (ADR3),A        SAVE RESULT RES AT ADR3
this is the idiomatic Z80 way. That book goes on to show how to do 16-bit and 32-bit arithmetic the Z80 way.

http://www.z80.info/zip/zaks_book.pdf

Re:Z80 arithmetic: also surprisingly terrible (2018) by stevekemp on Monday January 14, 2019 @03:03PM (#18905969)
Rodnay Zaks is a name I remember very well from my Spectrum-days. I have a small collection of Z80-books which I've carried around, across countries, for the past 30 years.

I should go dig out an emulator soon! (I usually have a game or two of "Chaos: The Battle of Wizards" every six months or so.)