Skip to content

Commit

Permalink
Input Assembly RISCV code
Browse files Browse the repository at this point in the history
  • Loading branch information
mnb27 authored Jun 13, 2020
1 parent 7498cbd commit 7945f40
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions assembly.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.text
addi x10 x0 5
jal x1 fact
jal x0 End
fact:
addi x2 x2 -8
sw x1 4(x2)
sw x10 0(x2)
addi x5 x10 -1
addi x7 x0 1
bge x5 x7 L1
addi x10 x0 1
addi x2 x2 8
jalr x0 0(x1)
L1:
addi x10 x10 -1
jal x1 fact
addi x6 x10 0
lw x10 0(x2)
lw x1 4(x2)
addi x2 x2 8
mul x10 x10 x6
jalr x0 0(x1)
End:

0 comments on commit 7945f40

Please sign in to comment.