Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

**Please show your output of this code. Thank you. Introduction: In this lab, yo

ID: 3834213 • Letter: #

Question

**Please show your output of this code. Thank you.

Introduction: In this lab, you will convert a C program with functions into a MIPS program while following all of the function calling, register management and activation record conventions that we have discussed. Feel free to do this lab (and all assembly programming labs) in Windows. You must use MARS Getting started: 1. In MARS, create a new assembly file with the name lab11.asm. 2. Use the following code to get started: Description Data segment data our data will go here Code segment text globl MAIN MAIN: our code will go here EXIT #End of file 3. Assemble the file (F3). You should receive no warnings or errors Requirements: 1. Consider the following C program (skeleton): #include "stdio.h" int x 1 void g

Explanation / Answer

I have developed the asm program by comparing the above C program and written the comments along with it.

Program:-

# ====================
# Description:
# ====== Data segment

.data

g:
mov   x,1
mov   y, mars  
ret

f:

mov y,1
add x,y
   call g
   add z,2
ret

.global MAIN

MAIN:

cmp x,1
jne x
add x,y
call f(6)
ret 0

EXIT:

#End of file