Electronic – Why in some instruction the order of register is different between machine code and assemble code for MIPS

assemblermips

For example in assemble code we have /add rd rs rt/ but in machine code we have /opcode rs rt rd/, where the destination register is at last position. Why MIPS arrange their code like this ?
I know in machine code the rd is put at last position because some instruction does not have it, so why they don't write assemble code like add rs rt rd ?

Best Answer

The choice for the bit ordering in machine language (the binary representation) is made on technical grounds. In a sense, it is totally arbitrary, because only the assembler application and the CPU instruction decoder need to know it. The performance (speed) of the assembler is totally unimportant, so the dominant reason for a particular bit ordening is the ease at which it is implemented in hardware.

The choice for operand ordering in assembly language is made with readability in mind. Most programming languages work from right to left, with the leftmost position for the destination. This is an argument to put the destination register first, which is how it is done in most assembly languages (but alas, not in all, or worse: not for all instructions).