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

HW1-3: The goal of this part is for you to install MiSaSiM, modify a short assem

ID: 3880518 • Letter: H

Question

HW1-3: The goal of this part is for you to install MiSaSiM, modify a short assembly program HW1-3-shell.asm, simulate, test and debug it in MiSaSiM. The MiSaSiM simulator can be installed according to the instructions at http://lindawills ece.gatech edu/misasim/ Copy or rename the shell program to HW1-3.asm and modify it to compute the value of the element with maximum magnitude as in HW1-2. Store the element computed in the memory location labeled maxmag. The array A contain exactly 16 signed integers. Be sure to try multiple test cases by changing the initial values In order for your solution to be properly received and graded, there are a few requirements 1. The file must be named HW1-3.asm 2. Your name and the date should be included in the beginning of the file 3. The starting shell program should not be modified except for the replacement of the 4. Your program must store its result at the memory location labeled max when it returns. 5. Your program must return to the operating system via the jr $31 instruction. Programs 6. Your solution must include proper documentation. comment "# write your code here " This answer is used to check the correctness of your code that include infinite loops or produce simulator warnings or errors will receive zero credit

Explanation / Answer

.data
A: .word 1,-14,9,10,-11,6,56,-60,78,100,4,-5,0,3,-5,9

maxmag: .alloc 1

result_prompt: .asciiz " is the value of the element with maximum magnitude. "

.text
main:

li $t3,15
la $t1,A
lw $s0,0($t1)

addi $t1,$t1,4
addi $t3,$t3,-1

LOOP_START:

lw $t4,0($t1)

ble $t4,$s0,NEXT
lw $s0,0($t4)

NEXT:
addi $t3,$t3,-1
addi $t1,$t1,4
bnez $t3,LOOP_START

sw $s0,maxmag

li $v0,1

move $a0,$s0

syscall

la $a0,result_prompt

li $v0,4

syscall