Sign in to follow this  
Followers 0
IamJon

Two pointers for indirect addressing?

2 posts in this topic

Is there a way to use two pointers for indirect addressing? I tried it using AR1 and AR2 as separate pointers, but it screwed up my data. I had to define AR1 before each indirect address. For example, if I wanted to load and transfer to and from an indirect address I had to: Define pointer AR1 Load from IA Redefine pointer AR1 Transfer to IA This is with two IA's that have different offsets. Like the first is an array of a udt that's 50 bytes long, and the second is an array of a udt that's 10 bytes long.

Share this post


Link to post
Share on other sites
You can use AR1 and AR2, but if you use AR2 within a FB there are rules to follow. AR2 is used by the system to point to the start of data of the FB's instance DB, therefore once you alter AR2 you cannot use any IN's, OUT's, IN_OUT's or STAT's. Therefore you can freely use AR1 and AR2 if in a FC, but if you are in a FB you must do the following. Create a TEMP DWORD to store AR2, then before placing the indirect address into AR2, save the current contents of AR2 into the TEMP you created. Then you can modify AR2 and do the block transfer or whatever you were doing, once complete recover AR2's original data from the TEMP. If you need access to data in the IDB area, after modifying AR2, then you should move that to TEMP addresses prior to modifying AR2.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0