SpyderTL wrote:
I think we can all agree to putting a single register in a "category" by itself is missing the whole point of "categories"... in the same way that putting all registers in one category labeled "general purpose" doesn't make sense.
There could be many categories. This type of relation is called many-to-many. And it can be very useful. Not always, of course, but sometime it can simplify person's understanding of an instruction or even some algorithm involving categorized register.
Human's way to remember things is about making a network of entities using brain's neurons. The wider/richer network is the better understanding the person has. Many categories could add to the richness. But it should be a useful richness and not just some space filling information. It is possible to give some historic perspective of the register evolution and show that there was just one register for arithmetic operations and it was caller accumulator (short form - A, it was "accumulating" some result value until it finally moved somewhere else - in memory or port address), it was just 4 bit wide. Next there was some progress and the need for another register arrives. Next with another progress step the width was extended to 8 bits and so on. So we had A, next B, next BL and BX, next EBX was added and finally the RBX arrived along with R8-15. But even today we still have the same accumulator register in the form of the RAX/EAX registers. Today there are many registers, but the history (or the legacy?) plays it hard and insists on using the RAX/EAX for some operations. So, the "accumulator category" is alive and sound even today.
We can see something similar with the index registers, with pointer registers and with other "general purpose" registers. And from the other side we can use registers like ESP for calculations or as a temporary storage while treating it as a really general purpose thing. The only problem with it - it's too complex and error prone to use it in such a way. But the situation is different with another pointer register - the EBP. It can be used perfectly as a plain general purpose register with some minor exclusions. And only historical legacy of function call implementation remembers us about the role of the EBP. Would there be no legacy code there will be no need for EBP's special role (and it's the case for "legacy free" implementations of OSes).
So, I just think it's very useful to get the idea of why some registers exist and why they are the way they really are. But one note should be mandatory - it's about Intel's legacy. Other processors can have their own exciting history with special registers and many interesting design decisions.