Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the program in RISC V Take input of an integer and output how many times the inputted integer appears in the given array Example

Write the program in RISC V

Take input of an integer and output how many times the inputted integer appears in the given array

Example I/O

Initialized Array in code: 1,4,5,5

User Input: 5

Output: 2

My code so far, you can use if it's useful

ORG 0x100 A: DD 1, 2, 55, 4, 5, 6, 7, 8 ecall x9, x5, 5 ld x31, A+56(x0) addi x6, x0, 0 loop: ld x5, A(x6) bne x9, x5, iterate iterate: addi x6, x6, 8 beq x0, x0, loop addi x10, x10, 1 beq x5, x31, e

e: ecall x0, x10, 0

ebreak x0, x0, 0

d: DM 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago