Replace `jalr x0 x1 0` with psuedo-op `jr x1` in examples
MODIFY
examples/assembly/Complex multiplication
examples/assembly/Complex multiplication
@@ -52,7 +52,7 @@ myMult:
addi t0, t0, -1 # decrement loop index
bnez t0, start # branch if loop index is not 0
mv a0, t3 # move final product to result register
- jalr x0, x1 0
+ jr x1
complexMul:
# Place the 4 input arguments and return address on the stack
@@ -101,6 +101,6 @@ complexMul:
lw ra, 16(sp) # Reload return address from stack
addi sp, sp, 28 # Restore stack pointer
- jalr x0, x1, 0
+ jr x1
end:nop

MODIFY
examples/assembly/Console printing
examples/assembly/Console printing
@@ -46,7 +46,7 @@ printNewline:
la a0, newline
li a7, 4
ecall
- jalr x0, x1, 0
+ jr x1
# --- LoopPrint ---
# Loops in the range [a0;a1] and prints the loop invariant to console
@@ -68,7 +68,7 @@ loop:
# Increment
addi t0, t0, 1
ble t0, t1, loop
- jalr x0, x1, 0
+ jr x1
exit:
li a7, 10

MODIFY
examples/assembly/Factorial function
examples/assembly/Factorial function
@@ -29,7 +29,7 @@ fact:
addi a0, zero, 1
addi sp, sp, 16
- jalr x0, x1, 0
+ jr x1
nfact:
addi a0, a0, -1

Replace `jalr x0 x1 0` with psuedo-op `jr x1` in examples