No.
This violates the idea of modularity.
Now if subX is revised
it might alter
T registers
and break main.
These rules are somewhat complicated. Here is a picture. The basic tasks of each section are:
Subroutine Call:
Put arguments in A registers.
jal to the subroutine.
Prolog:
Push $ra.
Push all S registers that the subroutine might alter.
Body: Normal code, except that it must follow these conventions if it calls a subroutine. T registers and A registers can be used freely, as can any S registers that were saved in the prolog.
Epilog: Put return values in V registers. Pop any S registers. Pop$ra.jr $raback to the caller.
Regaining Control: Use S registers as before the call. Don't assume T registers are the same.
Is there any limit in these rules about how many levels deep subroutine calls may be?