mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os_linux.v
This commit is contained in:
@@ -26,3 +26,14 @@
|
||||
syscall
|
||||
ret
|
||||
|
||||
syscall6:
|
||||
mov rax,rdi
|
||||
mov rdi,rsi
|
||||
mov rsi,rdx
|
||||
mov rdx,rcx
|
||||
mov r10,r8
|
||||
mov r8,r9
|
||||
mov r9, [rsp+8]
|
||||
syscall
|
||||
ret
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
fn main() {
|
||||
write(1, c'Hello!\n', 7)
|
||||
println('println test\n')
|
||||
}
|
||||
17
vlib/os/bare/bare_example_linux.v
Normal file
17
vlib/os/bare/bare_example_linux.v
Normal file
@@ -0,0 +1,17 @@
|
||||
fn syscall5(number, arg1, arg2, arg3, arg4, arg5 voidptr) voidptr
|
||||
|
||||
fn write(fd int, data voidptr, nbytes u64) int {
|
||||
return syscall5(
|
||||
1, // SYS_write
|
||||
fd,
|
||||
data,
|
||||
nbytes,
|
||||
0, // ignored
|
||||
0 // ignored
|
||||
)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
write(1, c'hallo\n', 6)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user