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

ARI with offset/displacment VS. ARI with offset/d with Index
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1070
Page 1 of 1

Author:  assemlbey_dude [ Fri Dec 16, 2011 11:40 pm ]
Post subject:  ARI with offset/displacment VS. ARI with offset/d with Index

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?

Author:  lee [ Sat Dec 17, 2011 11:24 am ]
Post subject: 

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.

Author:  assemlbey_dude [ Tue Jan 03, 2012 1:45 pm ]
Post subject: 

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.

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