4 ms·
I think because it's always in the same place and always first. That definitely emphasises it. Personally I think assembly should just have a little more synta
by IshKebab 2y ago
I think because it's always in the same place and always first. That definitely emphasises it.
Personally I think assembly should just have a little more syntax. If we wrote
dst = mv src
or
dst <- add src
it would just be obvious.
- kstenerud 2y agoPeople tried that (I forget the actual language now), and it just turns into a mess because now you have all these special cases (+, -, =, etc) and special syntaxes that don't transfer well to non-mathematical or multi-parameter instructions. This really is where AT&T fell over: Their syntax evolution feels bolted on for the most part, and not well thought out. The result can be quite confusing in a lot of cases.
- gergo_barany 2y agoKalray's MPPA does that, and it's really refreshing: https://gcc.godbolt.org/z/8Wch4MfMq https://gcc.godbolt.org/z/8Wch4MfMq
- NikkiA 2y agoThe operand order is because intel were flip flopping between load semantics and move semantics with the 4004, 8008, 8080, 8085, 8086 progression. Remember that when the 8080 engineers left to found Zilog, they changed the MVI instruction to LD, as it had been intended. (LD on 4004 and 8008, MOV on 8080, LD/ST and MOV on 8085, MOV on 8086)
- rep_lodsb 2y ago8080 and 8085 are basically the same, and have both MOV, MVI and LD/ST. The advantage is that the mnemonics directly correspond to the operations supported by the hardware, once you learn them you know what registers can be used where. Z80 is also highly unorthogonal (even more so than x86), but obscures this by using the same mnemonic with different operand combinations, not all of which are legal and some require prefix bytes.