#include <cosc065.h>

.text
.globl main

main:
        /* Function prolog. */
        /* Sets up environment for user program to execute. */
        stwu    r1,-32(r1)  /* Make room on Stack for O/S values.  */
        mflr    r0          /* Store O/S return address on Stack.  */
        stw     r0,36(r1)
        stw     r31,28(r1)  /* Store O/S frame pointer on Stack.   */
        mr      r31,r1      /* new stack top is now frame pointer. */

        /* Start of your program. */


        /* End of your program. */

        /* Function epilogue. */
        /* Restores the environment from the O/S. */
	mr	r1, r31     /* Discard stack below frame pointer.  */
	lwz	r31,28(r1)  /* Restore O/S frame pointer.          */
	lwz	r0, 36(r1)
	mtlr	r0          /* Restore O/S return address.         */
	lwz	r1, 0(r1)   /* Restore O/S Stack pointer.          */
	li r3, 0            /* Return value of 0 (normal exit).    */
        blr                 /* Return to Operating System.         */
