Re: Re: Assembler Clarification

yvette hirth <yvette-RPrnXxQTqyxWk0Htik3J/[email protected]>
Newsgroups gmane.comp.emulators.turnkey-mvs
Organization The DBT Group, Inc.
Message-ID <[email protected]>
Ron Hudson wrote:

> The return address is stored in a register? No recursion... right?

for MVS, MVS/XA, MVS/ESA and z/OS, the addr to return to is indeed 
stored in GPR 14 when the program is given control.

if i understand what you mean by recursion, then no.  of course, if you 
fail to store the return addr when you get control, yes, you can easily 
mess up the return addr.

> Is there a stack?

for z/OS, there is no "heap"-type stack, but yes, there is a "mainframe" 
form of a stack, called the save area trace.  it is a noncontiguous 
doubly-linked (i.e., backwards and forwards) stack.

there is no pc-style "heap" wrt program linkage and register saving, but 
iirc there are heaps used in some areas of z/OS (advanced stuff; PC / PR 
instructions, etc).

for more information, you could read the Principles Of Operation (POPs) 
for z/OS and Assembler Language Reference / Macros.  POPs will explain 
the instructions; the ASM manuals should show you program linkage 
methodology (program linkage methodology remains basically unchanged 
since the 1960's).  it's not "light reading" (i used to read POPs when i 
had insomnia...)

try here:

http://www-03.ibm.com/systems/z/os/zos/bkserv/r11pdf/

also please note that while DOS/VS(E), (z/)VM, and z/OS all use pretty 
much the same instruction set, they all have different linkage 
methodologies.

hth
yvette hirth
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.