|
|
|
|
|
by jgrahamc
2709 days ago
|
|
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 |
|
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.)