How do you add a 16 and a 8 bit register with carry (for example, HL, and A)?
How do you add a 16 and a 8 bit register with carry (for example, HL, and A)?
You can't do it directly. You need to copy A into a 16-bit register pair and then do the add:
LD B, 0
LD C, A
ADC HL, BC
From http://nemesis.lonestar.org/computers/tandy/software/apps/m4/qd/opcodes.html
Add Byte with Carry-In Instructions
8080 Mnemonic Z80 Mnemonic Machine Code Operation
ADC M ADC A,(HL) 8E A <- A + (HL) + Carry