Short answer: you can't. A single C statement will get lowered to multiple assembly instructions by the compiler
Two reasons
- Registers are only 1 word wide (see Registers video)
- You do not have access to those types of load instructions.
You can only operate on one word at a time.
See here for instrance.
Check out the copy function. I am saying record[0] = record[1], which means internally I need multiple lw and sw to copy from one location in memory to another one word at a time
Modify the code and see how that leads to different instruction sequences.
(Small correction: It is not registry. It is either registers or register file).
-----------------------------------
If you have not tried godbolt before then my videos should include a short description.
- Make sure you select the RISC-V compiler shown in my link if you reload the page.
if you select a different compiler then the assembly for a different processor will be generated
- Make sure you set the command line arg (like I have done) to -O1. This makes the code more readable.