EASy68K  
It is currently Sun Oct 22, 2017 1:53 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Oct 01, 2017 2:12 pm 
Offline

Joined: Sun Oct 01, 2017 2:04 pm
Posts: 1
MOVE.B DATA(PC), D4
How to insert values into the DATA and PC registers?

Thanks to anyone that would help me.


Top
 Profile  
 
PostPosted: Sun Oct 01, 2017 5:02 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1048
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.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group