| ▲ | kccqzy 8 hours ago | |
Even supporting just 8 registers that would take up 8/256=0.03125 of the instruction encoding space. | ||
| ▲ | GuB-42 an hour ago | parent [-] | |
They could have made a version just for (E)AX. "general purpose" registers in x86 are not the same. AX is the accumulator, for arithmetic, BX is for indexing, CX is the loop counter and DX is for data and extending AX in divisions. You don't have to use them for that purpose, but you will have access more optimized instructions if you do. Out of these 4, AX is the most likely you would want to set to zero. For loops, it is generally expected that you count down, with CX. The "LOOP" instruction is designed for this, so no special need to zero CX. SI and DI, the index registers may benefit from an optimized zeroing, for use with the "string" instructions. Here I think Intel engineers didn't see the need and not having a special instruction to zero AX must simplify the decoder. | ||