aboutsummaryrefslogtreecommitdiff
path: root/prog/main.s
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-08 10:55:45 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-08 10:55:45 +0200
commitaa005bc8b667668eb43c0ae62e00aefd1c3c1af5 (patch)
treea491b20a750cf0dac413aa10deb2ead3b6266fc3 /prog/main.s
parent80fee7a2db703f029989c40e823c2ccdeb078fca (diff)
downloadriscv_cpu-aa005bc8b667668eb43c0ae62e00aefd1c3c1af5.tar.gz
riscv_cpu-aa005bc8b667668eb43c0ae62e00aefd1c3c1af5.zip
assemble simple rom
Diffstat (limited to 'prog/main.s')
-rw-r--r--prog/main.s24
1 files changed, 24 insertions, 0 deletions
diff --git a/prog/main.s b/prog/main.s
new file mode 100644
index 0000000..bbae5bb
--- /dev/null
+++ b/prog/main.s
@@ -0,0 +1,24 @@
+.section .text
+.globl _start
+
+_start:
+ #la sp, stack_top
+
+ #li a0, 10
+ #li a1, 20
+ #add a2, a0, a1
+ addi t0, zero, 5
+ addi t1, zero, 3
+ add t2, t0, t1
+
+halt_loop:
+ j halt_loop
+
+.section .data
+
+
+.section .bss
+
+.section .stack
+ .space 0x1000 # Allocate stack space
+stack_top: