Comment on each snippet with what the snippet does. Assume that there is an array, int arr [6] = {3, 1, 4, 1, 5, 9}, which starts at memory address 0xBFFFFF00. You may assume that each integer is stored in 4 bytes. Register a0 contains arr's address
Comment on each snippet with what the snippet does. Assume that there is an array, int arr [6] = {3, 1, 4, 1, 5, 9}, which starts at memory address 0xBFFFFF00. You may assume that each integer is stored in 4 bytes. Register a0 contains arr's address
Chapter3: Data Representation
Section: Chapter Questions
Problem 12VE
Related questions
Question
100%
- Comment on each snippet with what the snippet does. Assume that there is an array, int arr [6] = {3, 1, 4, 1, 5, 9}, which starts at memory address 0xBFFFFF00. You may assume that each integer is stored in 4 bytes. Register a0 contains arr's address
lw t0, 0(a0)
lw t1, 8(a0)
add t2, t0, t1
sw t2, 4(a0)
2.
add t0, x0, x0
loop: slti t1, t0, 6
beq t1, x0, end
slli t2, t0, 2
add t3, a0, t2
lw t4, 0(t3)
sub t4, x0, t4
sw t4, 0(t3)
addi t0, t0, 1
j loop
end:
pseudo-instructions are not allowed
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning