IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Doubts in LA


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 06, 2010 7:03 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Oct 07, 2010 12:10 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Doubts in MQ data Converstions Java & MQSeries 3
No new posts Doubts related to insertion of table ... COBOL Programming 1
No new posts Doubts regarding Merging JCL & VSAM 5
No new posts Need to Clarify some Doubts in Stream... All Other Mainframe Topics 8
No new posts SOME BASIC QUESTIONS AND MESSY DOUBTS Java & MQSeries 1
Search our Forums:

Back to Top