Beginner question on adressing modes
Page 1 of 1

Author:  bls [ Sat Mar 31, 2012 12:26 pm ]
Post subject:  Beginner question on adressing modes

Hi, I am starting to learn to program for the 68000 and I can't figure out some of the adessing modes.

What does A(PC) do in an instruction like MOVE.W A(PC) D0 and why is it different to MOVE.W A, D0.

Thanks for your help.

Author:  profkelly [ Sat Mar 31, 2012 1:12 pm ]
Post subject: 

When the Program Counter is used as part of the address, the assembler calculates the offset from the current program counter to the destination address and uses that offset in the code, instead of the actual destination address. This supports writing code that is position independent. That is, the code may be loaded into any address and it will still run, provided the data is also moved with the code.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group