Yes you have just two sets of main registers.Rink wrote: Is is just the EXX and EX AF,AF' instructions that can do anything with them?
The reason was that the founder of Zilog, Federico Faggin, changed from Intel and wanted to have a (software compatible) CPU of the 8080 but some more functionality, especially more registers. This was a luck of the 8080. To do that he just implemented a double set of the main registers AF, BC, DE, HL and implemented to instructions to simply change (or choose) the register set you are working with. The non active registers remain with there old contents.
So EX AF,AF' just toggle between AF and AF' (in fact there is no existing AF' it is just a naming convention for a so called shadow register or however you would name it).
The same is for BC,DE,HL which are toggled with just the EXX instruction.
All instructions for A,B,C,D,E,H,L,Flag register or BC,DE,HL just refer to the actual active register set.
Here you can see a list of improvements for the Z80 in comparison to the 8080:
http://en.wikipedia.org/wiki/Zilog_Z80
Anyway - be aware to trust this document too much.
http://www.zilog.com/docs/z80/um0080.pdf
I reported several errors to Zilog and they confirmed to change 6 month ago - but nothing changed.
Has wrong binary codes and lot of copy and paste errors inside. For example listed DD FD as code for POP IY but correct is FD E1. Has many more errors.
It is more readable than the old PDF but anyway many parts and codes not correct.
I would propose to use the attached PDF which is not very readerfriendly but has a correct instruction set.