Four bytes, for the single variable a.
main
Here
is the code for main and its translation into assembly language.
Fill in the blanks
(Look for the Rules for Main.)
Recall that a variable needs four bytes on the stack.
# main()
# {
# int a;
# a = mysub( 6 );
# print( a );
# }
.text
.globl main
main:
# prolog
# 1. when main gets control from QTSPIM
# the stack pointer points to the top
# of the stack.
# 2. $fp = $sp - space_for_variables
sub , ,
# 3. $sp = $fp
$sp,$fp
# subroutine call
. . . .
# return from subroutine
. . . .
# epilog
# return to OS
Fill in the blanks as the comments suggest.