Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started