EASy68K
http://www.easy68k.com/EASy68Kforum/

Program Counter with Displacement/Relative
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1602
Page 1 of 1

Author:  unnamed [ Sun Oct 01, 2017 2:12 pm ]
Post subject:  Program Counter with Displacement/Relative

MOVE.B DATA(PC), D4
How to insert values into the DATA and PC registers?

Thanks to anyone that would help me.

Author:  profkelly [ Sun Oct 01, 2017 5:02 pm ]
Post subject:  Re: Program Counter with Displacement/Relative

The Program Counter (PC) register always contains the address of the currently executing instruction.

PC relative addressing uses the relative offset from the current PC to the desired destination. The machine code will contain the offset address instead of the absolute address of the destination.

Code:
000020A0  183A 000C                 52          move.b  LABEL(PC),D4
000020A4  1839 000020AE             53          move.b  LABEL,D4
000020AA                            54 
000020AA                            55 
000020AA  6000 FF54                 56          BRA     start

In the above code the move.b on line 52 contains the relative offset 000C in the machine code, whereas the
code from line 53 contains the absolute address of LABEL which is $000020AE.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/