indirect indexed addressing

is_razi

Member
Join Date
Aug 2003
Location
tabriz
Posts
4
hi everybody,i have a problem as follow,
there is an array of data with a specific start address in a DB block,i want to read a byte from this array which the index of this byte is a byte in the same DB block and is variable.
for example consider the following DB:

address symbol type
0 index byte
1 A1 byte "base address"
2 A2 byte
3 A3 byte
4 A4 byte
5 A5 byte
6 A6 byte

now let index to be 3 ,i want to read the byte 1+3=4 which 3 is the variable index stored in the DB block and 1 is the address of the first variable in the array.
please guide me about this problem.
 
Hi there
See if this helps:

Code:
OPN   DB    15            //your array DB No.
      LAR1  P#DBX 0.0     // pointing to index byte

      L     B [AR1,P#0.0] //load data of index byte
      INC   1             //increment the value by 1
      SLD   3             //shift left for byte reference
      +AR1                //increment the AR1 by index byte value+1
      L     B [AR1,P#0.0] //load data of the referred byte  
      T     MB     7      //throw it to wherever u want
 
Last edited:

Similar Topics

I'm doing some MSG'ing with a few SLC 5/04's - I'm polling data in two SLC's with another one - once a minute(T4:1). I want to put the data...
Replies
29
Views
10,829
I have upgraded an old RS500 project to Studio 5000, it has thrown multiple errors which I am currently working through. I have looked through...
Replies
8
Views
1,722
Hello all. Just wondering if anybody can help me understand this instruction. MOV source= #N11:10 dest= #N14:[n7:7] length= 20 I...
Replies
3
Views
1,659
Could someone shed a little more light on the subject of indexed or indirect addressing? If I wanted to utilise the above method to enable recipe...
Replies
5
Views
4,579
Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
620
Back
Top Bottom