go to previous page   go to home page   go to next page highlighting

Answer:

Of course, if linkage conventions are followed.


maxExp

The subroutine looks like this:

## maxExp -- compute the maximum of three expressions
##
## Input:
## $a0 -- a signed integer, x
## $a1 -- a signed integer, y
##           
##  Returns: 
## $v0 -- the maximum of x*x,  x*y, or 5*y

         .text
         .globl maxExp

maxExp:
         # prolog


         # body: compute x*x,  x*y, 5*y 

         # subroutine maxInt call
         # subroutine maxInt return

         # subroutine maxInt call
         # subroutine maxInt return

         # epilog

This subroutine has all four parts of the linkage convention.


QUESTION 16:

According to the rules of Stack-based Linkage Conventionstack-based linking, does this subroutine's prolog need to push the return address?


go to previous page   go to home page   go to next page