Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What exactly is effective address

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon Aug 21, 2006 6:52 pm    Post subject: What exactly is effective address
Reply with quote

All,

This might soud pretty primitve but I need to know what exactly do we mean when we code

D2(X2,B2)???

How is this resolved???
What is the use of Index Register here ???


Thanks
Back to top
View user's profile Send private message

Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Tue Aug 22, 2006 4:10 am    Post subject: Re: What exactly is effective address
Reply with quote

D2(X2,B2) : [D2] + X2 + B2 <== this forms a complete memory address where the Actual data is stored

In Breif,
Effective Address : an address formed using 2 registers, which will allow us to acces Virtual memory of a processor.

X2 : Index register : this are used to create memory address by adding to contents of a address register (in above ex : to the contents of D2). Few processors will have specific Index register (for ex MP 80x86[not sure] have SI/DI as Index register) whereas, few Porcessors like IBm 360/370 will use the 16 GPR registers as index registers.

D2: Addres Rgeister or BaseRegister: the contents of this registers are added to Index registers to form the complete physical address.

B2 : Displacement , some constant value I guess

For further details, go thru some manuals in forum.

guys, plz do correct me if I am wrong.
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Tue Aug 22, 2006 4:15 am    Post subject:
Reply with quote

You are right except that you wrote "D2:Addres Rgeister or BaseRegister" instead of "B2:Addres Rgeister or BaseRegister" and "B2:Displacement " instead of "D2:Displacement ".

Patrick
Back to top
View user's profile Send private message
Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Tue Aug 22, 2006 6:44 am    Post subject: Re: What exactly is effective address
Reply with quote

Thank you.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Tue Aug 22, 2006 8:58 am    Post subject:
Reply with quote

All,

Thanks for the reply.
But can you be more specific about Index Register here??
Why and where can I use Index register???
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Tue Aug 22, 2006 1:36 pm    Post subject:
Reply with quote

Lets says that you have a table of 10 entries of 80 bytes long and you would like to scan each entry to process a certain address field that is poistionned at an offset of 40 bytes.

Then B2 (base register) could be the address of the table, the I2 (index register) could containt the offset to the current entry (entries number x 80 bytes) and D2 would be the displacement within the entry ( 40 in our case).

So, the code would be:

LA R3,TABLE ---> R3 will be our base register - Initialize to the TABLE's address
LA R4,0 ---> R4 will be the index register - Start at 0 so it will point to the very first entry
LA R5,10 ---> R5 will contain the number of TABLE's entries...in our case it's 10.
LOOP DS 0H ---> Label
L R6,40(R4,R3) ---> Take the content of bytes 40 for 4 bytes long and put it into reg R6
.....
.....
..... ---> Process the R6 register as you want
.....
LA R4,80(R4) ---> Skip to the next entry : Add 80 to the contents of R80
BCTR R5,LOOP ---> Loop until all the entries are process...

Does it answer your question?

Patrick
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Aug 24, 2006 10:18 am    Post subject:
Reply with quote

Thanks Pat, yes it answers my question.

However i get one more doubt here.
Why do we use Index register here ???
I can change me displacement from my base address to get to that table entry ! Isnt it ??? Is it just another way of addressing ??

Thanks
ap
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Thu Aug 24, 2006 2:45 pm    Post subject:
Reply with quote

It is another way of addressing. In this case you could assume that the R3 is initialize at the beginning of the program and it is never re-initialized. So if you would need to scan the table agin, you would only have to set the Index regs....

The same example with the move instruction (MVC), you would have to use the base register to scan the table because there is no Index register supplied...

Patrick
Back to top
View user's profile Send private message
Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Fri Aug 25, 2006 6:09 pm    Post subject: Re: What exactly is effective address
Reply with quote

Whoa, something is nagging me. How can you 'change' your displacement from your base reg, say for a number of times in a loop? You either have to damage the base reg, which may not be desirable, or must use index reg. In the previous example:
L R6,40(R4,R3)
Can you accomplish this without using index reg or without damaging R3? I don't think we can.
Back to top
View user's profile Send private message
phetu

New User


Joined: 19 Aug 2006
Posts: 13
Location: Canada

PostPosted: Fri Aug 25, 2006 11:29 pm    Post subject:
Reply with quote

No, for use we can't do that without using index reg or without damaging R. In that case I used R4 as my index register

Patrick
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IP Address of workstation martin9 CICS 3 Fri Jun 23, 2017 7:39 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts execute APP if they are not ADDRESS T... italo_pm CLIST & REXX 3 Fri Aug 12, 2016 2:15 am
This topic is locked: you cannot edit posts or make replies. Get and display content of an address... lind sh CICS 1 Mon Aug 08, 2016 9:18 am
No new posts READQ TS returning inconsistent addre... moezbud CICS 14 Wed May 04, 2016 1:09 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us