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

Load/Store and Arrays in MIPS Assembly ***** PLEASE ANSWER ALL QUESTIONS OR I WI

ID: 3821520 • Letter: L

Question

Load/Store and Arrays in MIPS Assembly

*****PLEASE ANSWER ALL QUESTIONS OR I WILL REPORT YOUR ANSWER AS SPAM AND THUMB DOWN*****

Sum of three integers stored in the memory
(a) Specify memory location (la)
(b) Load immediate Integer-1 to reg. ($t1)
(c) Load immediate Integer-2 to reg. ($t2)
(d) Load Immediate Integer-3 to reg. ($t3)
(e) Store Integer-1 to Memory
(f) Store Integer-2 to Memory
(g) Store Integer-3 to Memory
(h) Load Integer-1 from memory to Register ($t4)
(i) Load Integer-1 from memory to Register ($t5)
(j) Load Integer-1 from memory to Register ($t6)
(k) add: Integer-1 + Integer-2 + Integer-3 ($t7)
(l) Store the result of the addition again to memory
(m) Load the result of the addition to register ($t8)....(DONE)

Explanation / Answer

(a) .data

array: .space 16 # defining array of size 4

.text

la $t0,array # loading starting address of array

li $t1,7

li $t2,8

sw $t2,4($t0) # storing second number

li $t3,3

sw $t3,8($t0) # storing third number

lw $t4,($t0) #loading first integer from memory to reg t4

lw $t5,4($t0) #loading second integer from memory to reg t5

lw $t6,8($t0) #loading third integer from memory to reg t6

add $t7,$t4,$t5

add $t7,$t7,$t6 # adding contents of 3 registers and storing in reg t7

sw $t7,12($t0) # storing sum in memory

move $t8,$t7 # loading sum in reg t8

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