aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-06-22 12:28:16 +0200
committerHimbeer <himbeer@disroot.org>2024-06-22 12:28:16 +0200
commit0141799541d286e205aa5aa1ae0552aeca6c672a (patch)
treedda96f93c1f05e9d23486da49ea82f8324f2ee8b /examples
parent3c37cdb7036cb40a51599ddfcbeabd9983b33edc (diff)
hello_world: Make use of uprint syscall to print hello message
Diffstat (limited to 'examples')
-rw-r--r--examples/hello_world/src/main.zig9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/hello_world/src/main.zig b/examples/hello_world/src/main.zig
index 2a9eb86..69e9813 100644
--- a/examples/hello_world/src/main.zig
+++ b/examples/hello_world/src/main.zig
@@ -7,5 +7,12 @@ export fn _start() void {
}
pub fn main() void {
- asm volatile ("ecall");
+ const s = "Hello from U-mode init";
+ asm volatile (
+ \\ li a7, 100000
+ \\ ecall
+ :
+ : [s] "{a0}" (s.ptr),
+ [n] "{a1}" (s.len),
+ );
}