EASy68K  
It is currently Wed Dec 11, 2019 11:24 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Dec 16, 2011 11:40 pm 
Offline

Joined: Fri Dec 16, 2011 12:32 am
Posts: 17
Hello everyone. I was wondering if someone could explain to me when it would be useful to use the Address Register Indirect with displacement/offset addressing mode and also when it would be useful to use Address Register Indirect with displacement/offset and Index.

One example I know of is if we have a look up table. Then we put the address at which the table starts first and we load the address register with the address of the value we want to fetch. Ex. 9 byte table that starts at the address $2000 would be 2000(a0),d0 correct?

But when would the other address mode be useful? At first I thought if we have another table directly after the first one. But in that case wouldn't we just be easier to figure out where the second table starts and use the same addressing mode? ex 2010(a0),d0.

Are these two addressing modes only used when we are dealing with tables?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 17, 2011 11:24 am 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
There are all sorts of uses for address register indirect with a fixed displacement.

Subroutines and functions can be passed parameters on the stack and use a fixed displacement from the stack pointer to access them. This can allow you to write black box routines that you can use without having to remember internal register or memory use.

Libraries of subroutines and functions can be called by knowing the library address and the offset to the required routine entry point.

Fixed displacements can also be used with an index to access elements of an object within a table of objects.

Lee.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2012 1:45 pm 
Offline

Joined: Fri Dec 16, 2011 12:32 am
Posts: 17
lee wrote:
There are all sorts of uses for address register indirect with a fixed displacement.

Subroutines and functions can be passed parameters on the stack and use a fixed displacement from the stack pointer to access them. This can allow you to write black box routines that you can use without having to remember internal register or memory use.

Libraries of subroutines and functions can be called by knowing the library address and the offset to the required routine entry point.

Fixed displacements can also be used with an index to access elements of an object within a table of objects.

Lee.


I see, I haven't gotten around to subroutines yet. Thank you.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 6 guests


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