View Single Post
Old 25 January 2005, 15:53   #8
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
Very simple:
#: means a direct value
() means a location defined by the value in the parentheses
If there is an additional offset by a direct value it is outside or inside the parentheses depending on old or new style mnemonic syntax. Regardless the result is the sum of the values listed.

moveq #5,d0: move direct value 5 to register d0
Don't bother with the q thing, it is a cpu optimization that any decent assembler program will automatically add to it.

move.l d0,(a0): move the value of register d0 to the location stored in a0

move.l d0,(a0)+: same as above then increment a0 by the size of the operand in this case 4, as it is a longword

etc

You really should read some decent books on cpu architectures first.
A simple 8 bit cpu is a good start, to understand how and why 16 bit cpus are different.
Also 68k were designed to work nicely with compiled C code, many of the addressing modes are similar to typical C mechanisms so knowing C can help a lot.
IFW is offline  
 
Page generated in 0.04526 seconds with 11 queries