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

Translate this function to an equivalent function in MIPS assembly. You need to

ID: 3668234 • Letter: T

Question

Translate this function to an equivalent function in MIPS assembly. You need to follow the MIPS calling convention and others should be able to call and use your function. In other words, the address of the array a should be passed in register $a0, the value of n in register $a1, and the value of v in register $a2 (in other words, the MIPS calling convention should be used).

Thank you for assistance :)

Problem 1 (20 points) Below is a C (C++) function int set (int a[l, int n, int v) int i; i=0; do t , while (i

Explanation / Answer

Ltext0: .cfi_sections .debug_frame .align 2 .global _Z3setPiii _Z3setPiii: .fnstart .LFB0: .cfi_startproc @ args = 0, pretend = 0, frame = 24 @ frame_needed = 1, uses_anonymous_args = 0 @ link register save eliminated. 0000 04B02DE5 str fp, [sp, #-4]! .LCFI0: .cfi_def_cfa_offset 4 .cfi_offset 11, -4 0004 00B08DE2 add fp, sp, #0 .LCFI1: .cfi_def_cfa_register 11 0008 1CD04DE2 sub sp, sp, #28 000c 10000BE5 str r0, [fp, #-16] 0010 14100BE5 str r1, [fp, #-20] 0014 18200BE5 str r2, [fp, #-24] .LBB2: 0018 0030A0E3 mov r3, #0 001c 08300BE5 str r3, [fp, #-8] .L2: 0044 08201BE5 ldr r2, [fp, #-8] 0048 14301BE5 ldr r3, [fp, #-20] 004c 030052E1 cmp r2, r3 0050 0030A0A3 movge r3, #0 0054 0130A0B3 movlt r3, #1

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