I'm writing a Z80 emulator in Swift for Mac OS and I have got as far as implementing the 16 bit pop instruction. The documentation I have found (i.e. The Z80 CPU User manual UM008011-0816 and also this document about undocumented Z80 instructions) says that the flags are not affected by
pop dd (where dd is a 16 byte register).
However, one of the pop instructions is
pop af (opcode
af is the flags register. Does the Z80 toss the low byte or does it set the flags in apparent contradiction to the documentation.