Question: Write a RISC - V OTTER assembly language subroutine that reformats a section of memory and does some outputting as necessary. The start of the

Write a RISC-V OTTER assembly language subroutine that reformats a section of memory and does some outputting as necessary. The start of the section of memory is passed to the subroutine in x25 and contains unsigned halfwords. If a given halfword is non-zero, that halfword is written to port address 0x1100F000; the data at that address is then cleared (written with a zero). This reformatting ends after the subroutine encounters 40 non-zero values. The subroutine passes back the number of halfwords examined in x31.
Minimize the number of instructions in your program
Comment your code appropriately
Don't permanently change any register other than x31

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!