I just started learning computer organization and architecture. Computer organization by Carl Hamacher, Zaki... is my reference textbook. Currently, I am learning basic assembly instruction for adding two numbers A and B, and storing the result in C. What is the correct way to represent this basic operation;
Add A, B, C
Operation Source 1, Source 2, Destination
(Page 37 section 2.4.3 Computer Organization by Carl Hamacher 5th Edition ISBN:7-111-10346-7)
Or
Add C, A, B
Operation Destination, Source 1, Source 2
(Page 32 section 2.3 COMPUTER ORGANIZATION AND EMBEDDED SYSTEMS by Carl Hamacher 6th Edition ISBN 978–0–07–338065–0)
This is a dumb question I know, but it really confuses me. The first method is what I saw in the 5th edition of my reference book. But in the 6th edition, the same operation is represented like in the second method (Also many websites prefer the second method).
Is there any point in this 'order'?
Different assemblers use different syntax. e.g. AT&T and Intel syntax use opposite orders for the same ISA (x86). Use the order that matches the actual assembler (software) you're using, for your target machine.
Either way it's just syntax to represent machine code, no fundamental difference.
related:
Most of these operand-order Q&As focus on x86, primarily because there are multiple syntaxes in widespread use, and the one used by tools like gcc and GDB by default is opposite the one used in Intel's manuals.
On ISAs with only one syntax, but destination-last order, like M68K and PDP-11, it's just normal and doesn't get talked about.