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

Introduction In this lab, you will convert a C program with functions into a MIP

ID: 3836819 • Letter: I

Question

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.

Explanation / Answer

.file 1 "" .section .mdebug.abi32 .previous .gnu_attribute 4, 1 .abicalls .text .align 2 .globl _Z1gv $LFB12 = . .set nomips16 .ent _Z1gv .type _Z1gv, @function _Z1gv: .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 .mask 0x00000000,0 .fmask 0x00000000,0 .set noreorder .set nomacro j $31 nop .set macro .set reorder .end _Z1gv $LFE12: .size _Z1gv, .-_Z1gv .align 2 .globl _Z1fi $LFB13 = . .set nomips16 .ent _Z1fi .type _Z1fi, @function _Z1fi: .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 .mask 0x00000000,0 .fmask 0x00000000,0 .set noreorder .set nomacro j $31 nop .set macro .set reorder .end _Z1fi $LFE13: .size _Z1fi, .-_Z1fi .align 2 .globl main $LFB14 = . .set nomips16 .ent main .type main, @function main: .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 .mask 0x00000000,0 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro lw $2,%got(x)($28) nop lw $2,0($2) nop blez $2,$L6 movz $31,$31,$0 li $3,5 # 0x5 lw $2,%got(x)($28) nop sw $3,0($2) $L6: j $31 move $2,$0 .set macro .set reorder .end main $LFE14: .size main, .-main .globl x .data .align 2 .type x, @object .size x, 4 x: .word 1 .ident "GCC: (Debian 4.4.5-8) 4.4.5"

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote