eekee wrote:Which 6? I was going to exclude even ECX because it's needed for string instructions, thus not completely general-purpose.
Well no, that is just x86 being its normal CISC-y self. Therefore some instructions have implicit operands, and sometimes you can't change them. Yes, ECX is an implicit operand of a prefix, which is its own kind of weirdness, but all of the string operations use EDI, ESI, or EAX as implicit operands, multiplication and division often use EAX and EDX, as do many of the operations accessing special registers, like RDTSC, RDMSR, and WRMSR, and let us not even speak of CPUID. X86 has 8 general-purpose registers (EAX, EBX, ECX, EDX, ESI, EDI, EBP, and ESP), but ESP is typically bound up to serve as stack pointer, and cannot be used for many other things. I mean, you can, if you block signals/interrupts and have a way to find the stack pointer again afterwards. Usually it's not worth it.
But then, that is usually the case with bound-up general purpose registers, isn't it? ARM has 16 GPRs, but one of them is the stack pointer, and one is the program counter, so if you exclude those since they are bound up, it is only 14, so one less than AMD64 has! And Thumb 1 only has access to 8 of them, with stack pointer and PC being included in them. So X86 is about as bad as Thumb 1.
BTW, PowerPC32 has had 32 GPRs since inception. Of these, typically R1 is used as stack pointer, and R2 and R13 are used as quasi-constant pointer registers (beats me why these particular ones, though), but that still leaves 29 registers to do whatever with.