Consider:
addi t0, zero, 3
addi a6, zero, 3
fast_multiply:
ADD a0, zero, zero
next_digit:
ANDI a1, a6, 1
SRAI a6, a6, 1
BEQ a1, zero, skip
ADD a0, a0, t0
skip:
SLLI t0, t0, 1
BNE a6, zero, next_digit
ADD t0, zero, a0
sw a0, 0x0(x0)
addi t1, zero, 5
addi a7, zero, 5
fast_multiply2:
ADD a2, zero, zero
next_digit2:
ANDI a3, a7, 1
SRAI a7, a7, 1
BEQ a3, zero, skip
ADD a2, a2, t1
skip2:
SLLI t1, t1, 1
BNE a7, zero, next_digit
ADD t1, zero, a2
sw a2, 0x4(x0)
When I try to move onto the next integer, it continues to run.