Hi Tom,
Typically 360/370 subroutine calls are done with a what is called a
save area. This is 18 words allocated within the subroutine. On entry
the registers are saved into the previous routines save area. Then the
base register is set up and the save pointer is pointed to the current
save area. On exit the registers are restore, this will include the
previous save area.
This means that if you call a subroutine again it will wipe out the
previous calls information. To do this properly you will either need to
allocate a bunch of memory to save all the registers in and advance the
save pointer for each call. The other option is to allocate and free
save areas at each call.
Basically you will need to implement some sort of stack to handle
function calls if you want true recursive calls.
Rich