Write a risc-v assembly language program


Problem: Write a RISC-V assembly language program for counting the number of zeros ("0") bits in a 32-bit input.

Use the following information in writing your assembly code.

1. The function starts at memory location 0x204. Each instruction is 32 bits, thus the second instruction should start at 0x208 and the third at 0x20c, and so on. Use this information to correctly compute the offset for jump and branch instructions (you are not allowed to use labels).

2. The input is passed (stored) in register a0.

3. The return value, c, should be stored in a0.

4. The return address is stored in ra.

5. You are free to use saved and temporary registers (don't forget to save values if you are using saved registers).

6. You are allowed to use Pseudoinstructions (e.g., ret, call, etc.)

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a risc-v assembly language program
Reference No:- TGS03251905

Expected delivery within 24 Hours