View previous topic :: View next topic |
Author |
Message |
rnanavaty Beginner
Joined: 12 Apr 2006 Posts: 29 Topics: 20
|
Posted: Fri Oct 30, 2009 4:45 am Post subject: Assembler: Difference btn L and LA while using values |
|
|
Hi,
Can you tell me what is the difference between L and LA instructionin MVS assembely while using constant as second operand even though they perform the same operation ?
For example: L R3,5
and LA R3,5
Both will load value 5 in register R3
And what should be used at what time? |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Fri Oct 30, 2009 8:28 am Post subject: Re: Assembler: Difference btn L and LA while using values |
|
|
rnanavaty wrote: | Both will load value 5 in register R3 |
Why do you say this? Have you tested your theory? You need more study in the z/OS Principles of Operation. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
rnanavaty Beginner
Joined: 12 Apr 2006 Posts: 29 Topics: 20
|
|
Back to top |
|
 |
RonB Beginner
Joined: 02 Dec 2002 Posts: 93 Topics: 0 Location: Orlando, FL
|
Posted: Mon Nov 02, 2009 7:43 am Post subject: |
|
|
R7 is being initialized in preperation for the
BCT R7,LOOP1 Loop 8 times (Reg7 init to 8 )
instruction that follows.
The BCT ( Branch on Count ) instruction subtracts 1 from the indicated Register, and, if the resulting value in the Register is NOT zero, takes the indicated branch. So, in this case, since the instruction set following the LA R7,8 is performed 8 times - once before hitting the BCT, and seven more times following the BCT ( that is, when its execution results in values of 7,6,5,4,3,2, and 1 ). |
|
Back to top |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Nov 02, 2009 3:14 pm Post subject: |
|
|
You need to do as Bill suggested and spend some time doing the proper research.
The Load (L) and Load Address (LA) instructions are NOT the same - even though in some situations the same result happens. . .
As we said many years ago:
Rookie: What _________________ All the best,
di |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Mon Nov 02, 2009 3:29 pm Post subject: |
|
|
I think what people are referring to is that you should study how the the different instruction formats are represented in machine code and how assembler instructions get translated to machine code. Each instruction in the Principle of Operations has a description of the various parts of the machine code that is generated.
When you see how the instructions are represented in storage, you will see why this appears to work the same, but why it is a dangerous thing to assume. (hint : see how register 0 works in addressability). It will also be the 1st step in being able to read dumps without the original source code (if you ever care to do that -- most people don't ). _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
|
|