mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 16:12:33 +00:00
c6fb798740
This reverts commit 67db2b85b7
.
29 lines
538 B
Zig
29 lines
538 B
Zig
pub fn main() void {
|
|
const str = "Hello World!\n";
|
|
asm volatile (
|
|
\\push $0
|
|
\\push %%r10
|
|
\\push %%r11
|
|
\\push $1
|
|
\\push $0
|
|
\\syscall
|
|
\\pop %%r11
|
|
\\pop %%r11
|
|
\\pop %%r11
|
|
\\pop %%r11
|
|
\\pop %%r11
|
|
:
|
|
// pwrite
|
|
: [syscall_number] "{rbp}" (51),
|
|
[hey] "{r11}" (@ptrToInt(str)),
|
|
[strlen] "{r10}" (str.len),
|
|
: "rcx", "rbp", "r11", "memory"
|
|
);
|
|
}
|
|
|
|
// run
|
|
// target=x86_64-plan9
|
|
//
|
|
// Hello World
|
|
//
|