HW1-3: The goal of this part is for you to install MisaSiM, modify a short assem
ID: 3879468 • 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 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 Copy or in 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 creditExplanation / Answer
.data
A: .word 1,-14,9,10,-11,6,56,-60,78,100,4,-5,0,3,-5,9
maxmag: .alloc 1
.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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.