Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
1) Parameters are passed, by convention, using register 1 (R1). R1 is set to the address of the first parameter. The last parameter in the parameter list has the high-order bit set 'on'.
Thus:
Code: |
L R1,=A(FIRST)
ST R1,PARM1
L R1,=A(SECOND)
ST R1,PARM2
L R1,=A(THIRD)
ST R1,PARM3
OI PARM3,X'80'
L R1,=A(PARMLIST)
CALL NEXTPROG
PARMLIST DS 0F
PARM1 DS F
PARM2 DS F
PARM3 DS F
|
NEXTPROG will have code to retrieve these parms - e.g.
Code: |
LM R2,R4,0(R1)
LA R4,0(R4) * lose high-order bit
|
Any changes made are visible to the calling program at the addresses specified.
2) A number of ways. For an array with multiple fields per array entry, provide a DSECT which describes those fields. Using registers, caclulate the offset to the array entry to require and align the DSECT before using the field names.
3) NOP is a "no operation". Its significance depends on the program context. It might be modified "on the fly" to a branch, though that's frowned upon these days.
4) If you don't link the program as static at linkedit time it should be called dynamically.
Regards,
Garry. |
|