aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
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),
+ );
}