Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Doubts in LA

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

New User


Joined: 23 Aug 2010
Posts: 5
Location: Chennai

PostPosted: Wed Oct 06, 2010 6:45 pm    Post subject: Doubts in LA
Reply with quote

Hi,

Could anyone tell us what would be the output for the following in Assembler:

    LA R5,10(R0,R0)
    LA R5,10(R0)
    LA R5,10(R0,R2) where content in R2 is ‘1000’
    LA R13, SAVEAREA where SAVEAREA is the Label
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 06, 2010 7:03 pm    Post subject: Reply to: Doubts in LA
Reply with quote

In an LA instruction, (as well as an LH, L and others), R0 is never considered as an index-register and is considered as a value of 0. It would be the same as if you coded -

Code:

LA R5,10(,R0)

After this instruction, R5 should contain the value which was in R0 plus 10.

If you issue -

Code:

LA R5,10
AR R5,R0

Should yield the same results in R5.

Remember, R0 usage (in certain instructions) can result in unexpected results.

What have you tried?

Bill
Back to top
View user's profile Send private message
BhavaniV

New User


Joined: 23 Aug 2010
Posts: 5
Location: Chennai

PostPosted: Thu Oct 07, 2010 10:49 am    Post subject:
Reply with quote

Thank you Bill.

We are now trying to learn assembler for a project.

Ok for the first and the third, the register R0 is used as index register and is considered 0.

So the Answer for the fist and third query would be

R5 holds the 10 + 0 + Contents in R0
R5 holds 10 + 0 + 1000

What would be the output for this : LA R5,10(R0)

Thanks in Advance for your help.

Regards,
Bhavani V.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Oct 07, 2010 12:10 pm    Post subject: Reply to: Doubts in LA
Reply with quote

the manual ==> z/Architecture - Principles of Operation
doc number ==> SA22-7832-08

will tell all You want to know about machine instructions

08 is the latest version, for basic/common instruction any version will be enough

for assembler instructions or better directives(*) look at the appropriate manuals for the version of the assembler used

(*) I used both terms in order to make everybody happy
Back to top
View user's profile Send private message
BhavaniV

New User


Joined: 23 Aug 2010
Posts: 5
Location: Chennai

PostPosted: Thu Oct 07, 2010 1:40 pm    Post subject:
Reply with quote

Thanks a lot Enrico.

The links are really very useful and we have got the answer for our question as well.

Regards,
Bhavani V.
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 Doubts in MQ data Converstions Thamilselvi Java & MQSeries 3 Mon Jul 02, 2012 3:48 pm
No new posts Doubts related to insertion of table ... Vidya Kajale COBOL Programming 1 Tue Apr 24, 2012 11:54 am
No new posts Doubts regarding Merging Rahul_kumar JCL & VSAM 5 Wed Apr 27, 2011 4:41 pm
No new posts Need to Clarify some Doubts in Stream... Vigneshwaran S All Other Mainframe Topics 8 Mon Apr 12, 2010 12:34 pm
No new posts SOME BASIC QUESTIONS AND MESSY DOUBTS beruoist Java & MQSeries 1 Tue Feb 23, 2010 5:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us