Hi 

To supplement Charles Mills response to your question on why Entry and Exit
conventions are used in Assembler I will add the following.

Think single processor for a moment, as that was or starting point for
System/360. The Operating System was designed to sustain multiple operations
based on interrupts. When a program issues an I/O it relinquishes control of
the processor, and allows another program to execute on that processor. When
the I/O is complete an interrupt is issued to inform the program that lost
control, that it can now resume processing. It may not be a simple as that
but it conveys the general picture. If there are multiple programs
alternately using the processor without completing then they need to be able
to pick up where they left off, i.e. the state of the processor needs to be
preserved across interrupts. 

The General Purpose Registers are part of the processor, so therefore their
contents needs to be preserved. At a system level this is done by the
interrupt handlers, but within an application it is our responsibility. If a
program calls a subroutine, the main program looses control and the
sub-routine gains control until its logical end point. The sub-routine will
be using the same set of registers as its parent, so again they have to be
preserved and restored.

The process described above is also true for high level languages but it is
done under the covers.

The entry and exit sequence you listed are the historic ways of achieving
the preservation goal, although I would use BASR instead of BALR. Check out
the difference in the Principles of Operation. IBM provides SAVE and RETURN
to aid this common function.

There is now a stack capability to alternative Entry and Exit protocols
might be BAKR and PR.

Even with stacking the BALR or BASR followed by USING are still required to
establish the correct addressability of this routine.

I hope this is of some use.  

Kind Regards - Terry
 
Director
KMS-IT Limited
228 Abbeydale Road South
Dore
Sheffield
S17 3LA
UK
 
Reg : 3767263
 
Outgoing e-mails have been scanned, but it is the recipients responsibility
to ensure their anti-virus software is up to date.
 
 


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to