mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
38 lines
588 B
Zig
38 lines
588 B
Zig
pub export fn _start() noreturn {
|
|
print();
|
|
print();
|
|
print();
|
|
print();
|
|
exit();
|
|
}
|
|
|
|
fn print() void {
|
|
asm volatile ("svc #0"
|
|
:
|
|
: [number] "{r7}" (4),
|
|
[arg1] "{r0}" (1),
|
|
[arg2] "{r1}" (@ptrToInt("Hello, World!\n")),
|
|
[arg3] "{r2}" (14),
|
|
: "memory"
|
|
);
|
|
return;
|
|
}
|
|
|
|
fn exit() noreturn {
|
|
asm volatile ("svc #0"
|
|
:
|
|
: [number] "{r7}" (1),
|
|
[arg1] "{r0}" (0),
|
|
: "memory"
|
|
);
|
|
unreachable;
|
|
}
|
|
|
|
// run
|
|
//
|
|
// Hello, World!
|
|
// Hello, World!
|
|
// Hello, World!
|
|
// Hello, World!
|
|
//
|