Using FPU and MMX registers as "general registers"
Why four? You can use all of these: eax
, ebx
, ecx
, edx
, esi
, edi
and ebp
. That's seven. Or is that not enough either?
FPU and MMX registers are somewhat awkward to work with since they can only be loaded from themselves and memory and stored only to themselves and memory. You cannot freely move data between them and general purpose registers, nor there are instructions capable of operating on both kinds of registers at the same time.
If seven general purpose registers aren't enough, use local/on-stack variables. For example, you can decrement a counter variable in memory directly and you can also directly compare it with a constant or another register. Chances are, this is going to be no slower (likely, faster) than using FPU or MMX registers in strange ways.