Im reading the documentation or whatever the term is for the instruction definitions and I'm confused as to what a lot of it means.
"Operation: source destination -> destination" what does that mean. What does that tell me?
"Assembler Syntax: ADD , Dn ADD Dn, " Does that mean I can put the destination in either place? That ADD D0,#33 would do the same thing as ADD #33,D0?
This information is taken from the "M68000 Family Programmer's Reference Manual". I assume that you're using this manual, or other documentation that contains a subset of it. In that document, the reference for
ADDis on pages 4-4 through 4-6, and the Instruction Summary starts on page 3-1.For the first question about:
That's telling you the operation that's being done. The value in the source and is added to the current value in the destination, and that sum is stored in the destination.
For the second question, this concerns the two types of instructions that exist for
ADD:What you say is incorrect, this is not telling you that you can write it either way, and it have the same effect. This is specifying what types of parameters can be given to the instruction.
Specifically, while one argument can be any (sensible) effective address, at least one of the two arguments (either the source or the destination) must be a data register.
One apparent point of confusion you have is on identifying the source vs. the destination. It's important to read the Instruction Summary (Section 3.1 of the PRM) to understand how assembly instructions are written.
Importantly, that section has a table describing the various symbols used in instructions. It also states the following:
So, writing
ADD #33, D0means that the number33is added to the value in registerD0, and then the result of that addition is stored back in registerD0.With the two options for writing the instruction, either the source or the destination must be a data register, with the other being an effective address. That effective address could be an address register, the value in memory pointed-to by an address register (possibly pre-decremented, post-incremented, offset, etc.), an integer value, etc.
For example, you might add the value in
D3to the value stored at the address held inA2(represented as(A2)). In that case, the processor will read the memory at the address inA2, add the value inD3to that, and then store it back at that same address. This would be written asADD D3, (A2).However, not all effective address types are sensible in all places. For example, the
ADD D0, #33you give isn't a valid assembly instruction, since an immediate value isn't a valid destination. You can't store a value in the number 33.You can see that the effective address destination operation tables for
ADDhave several entries that are shown as invalid, compared to the equivalent source effective address tables.