mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
22 lines
367 B
Zig
22 lines
367 B
Zig
pub fn main() void {
|
|
foo() catch print();
|
|
}
|
|
|
|
fn foo() anyerror!void {}
|
|
|
|
fn print() void {
|
|
asm volatile ("svc #0"
|
|
:
|
|
: [number] "{r7}" (4),
|
|
[arg1] "{r0}" (1),
|
|
[arg2] "{r1}" (@ptrToInt("Hello, World!\n")),
|
|
[arg3] "{r2}" ("Hello, World!\n".len),
|
|
: "memory"
|
|
);
|
|
return;
|
|
}
|
|
|
|
// run
|
|
// target=arm-linux
|
|
//
|