diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-05-12 01:26:32 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-05-12 01:26:32 +0200 |
commit | b9dd0160640adcbb1b5a66247b274bf99a7de705 (patch) | |
tree | b94743ccc426ea7855c1185b2710ec9364090c9a /main.asm | |
parent | 7642349be93be4a1acf62e9c5ca831f918ba1c3c (diff) |
First real program running!
Diffstat (limited to 'main.asm')
-rw-r--r-- | main.asm | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -1,9 +1,22 @@ .section .text
.global _main
+
+print:
+ li t1, 0x80000000
+l0:
+ lb t0, 0(a0)
+ beqz t0, l1
+ sb t0, 0(t1)
+ addi a0, a0, 1
+ j l0
+l1:
+ ret
+
_main:
- li x1, 5
- addi x2, x1, 45
+ la a0, my_str
+ call print
+
+halt: j halt
-loop:
- addi x2, x2, 1
- j loop
+.section .rodata
+my_str: .string "Hello, world!\n"
|