RISC-V Lab-8-1
RISC-V Lab-8-1
Branch instructions (bne, blt, bge, beq, etc.) to control when to jump back to the
loop.
Initialization
Condition check
Update/step
Loop body execution
Program to Print Numbers from 1 to 5
Loads the ASCII value of newline (10) into a0 so it can print a line break.
Loads the system call number 11 into a7, which corresponds to printing a character.
Checks if t0 is less than or equal to t1 (i.e., i <= 5). If true, it jumps back to the loop label
to repeat.
4: Write a loop that sums numbers from 1 to 10, then print the final sum.
5: Write a Program which Prints even number’s from 30-2
6: write a program which print’s odd number’s from 30-1