Today you implement LD (HL+), A and its decrementing sibling LD (HL-), A, which store a byte through HL and then automatically advance the pointer - the single-instruction building block behind every memory-filling loop you will write later.
Implement LD (HL+), A and LD (HL-), A, which store through HL and then increment or decrement HL in the same instruction.
Copying a block of memory means “write a byte, move the pointer, repeat,” and
the Game Boy folds the first two steps into one instruction. LD (HL+), A
(opcode 0x22) stores A at the address in HL and then increments HL so
it points at the next slot. LD (HL-), A (0x32) does the same but decrements.
These auto-updating forms are everywhere in real code because the most common
loop on the machine is “fill a region of memory.” Clearing video RAM at startup
or copying a sprite table both lean on (HL+). It is a small convenience, but it
turns a two-instruction inner loop into a one-instruction one - and once you add
conditional jumps, you will write exactly that loop.
case 0x22: // LD (HL+), Ac.mem.Write(c.HL(), c.A)c.SetHL(c.HL() + 1)return 8case 0x32: // LD (HL-), A - same, but decrement
The HL+ and HL- load variants - store, then auto-advance the pointer.