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

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 12VE
icon
Related questions
Question
100%
  1. 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
    1.  

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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Hash Table
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning