I am aware of the fact that we can pass values from JCL to the assembler program by using PARM parameter in JCL and can accept them in the program by R1 register. But, when I saw some of the code in my org. I was confused. As soon as, the program is starting, they are moving the values from R01 to some other register by using L e.g. L R10,0(R1)
In this case, what does R10 contains,
1) does it contain the actual parm values or
2) does it contain the address that points to the actual parm values?
I thought that it contained the actual parm values because LOAD instruction will copy the value in the memory pointed by second operand to the first operand register. In the above example, the displacement is 0 and hence its actual address = content of R1 + 0 = content of R1 = address of the location where parm is stored. Thus, the value at the actual address is taken and loaded into the register by the L instruction.
Please let me know if my understanding is correct or not.
At entry, R1 points to a LIST of ADDRESSES, each of which points to one of the parms passed to the program. In the case of EXEC parms being passed from JCL, there is only ONE parm - hence R1 points to a LIST which contains only one address: the address of the Exec Parm.
Thus, the instruction
loads the FIRST ( 0 offset ) address contained in the list into R10. So, after the Load, R10 will contain the address of the FIRST parm ( which, if passed from JCL is also the ONLY parm ).
As far as I recall, the length of the halfword (2) is not part of the overall parm-length. So, if there are 60-bytes of parm-data, the halfword would equal 60 (R15 is 59 for the EX) and the data would begain at 2-off R10.