aboutsummaryrefslogtreecommitdiff
path: root/tests/simple_riscv32/s.asm
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-05-05 23:13:42 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-05-05 23:13:42 +0300
commit1a2ff9a1e5b91b7e307246ed2f4b898f1e179806 (patch)
tree6da407851e3b01fadd1ffba64fbdffce71dab68a /tests/simple_riscv32/s.asm
parent79f67d5ca820b663e9e5682aaaad07118fdbfad8 (diff)
downloadgran-1a2ff9a1e5b91b7e307246ed2f4b898f1e179806.tar.gz
gran-1a2ff9a1e5b91b7e307246ed2f4b898f1e179806.zip
add async packets
Diffstat (limited to 'tests/simple_riscv32/s.asm')
-rw-r--r--tests/simple_riscv32/s.asm16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/simple_riscv32/s.asm b/tests/simple_riscv32/s.asm
new file mode 100644
index 0000000..d423dd9
--- /dev/null
+++ b/tests/simple_riscv32/s.asm
@@ -0,0 +1,16 @@
+.global _start
+_start:
+/* sum from 0 to 1000000 */
+
+li a0, 0 /* index */
+li a1, 1000000 /* top */
+li a2, 0 /* sum */
+
+top:
+beq a0, a1, done
+add a2, a2, a0
+addi a0, a0, 1
+j top
+
+done:
+ebreak