mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
C string literals (c'str'); bare builtin module; bare println()
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
.intel_syntax noprefix
|
||||
.text
|
||||
.globl _start, main__syscall5
|
||||
.globl _start, syscall5
|
||||
|
||||
_start:
|
||||
xor rbp,rbp
|
||||
@@ -16,7 +16,7 @@
|
||||
ret /* should never be reached, but if the OS somehow fails
|
||||
to kill us, it will cause a segmentation fault */
|
||||
|
||||
main__syscall5:
|
||||
syscall5:
|
||||
mov rax,rdi
|
||||
mov rdi,rsi
|
||||
mov rsi,rdx
|
||||
|
@@ -1,16 +1,4 @@
|
||||
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, "hallo\n", 6)
|
||||
write(1, c'Hello!\n', 7)
|
||||
println('println test\n')
|
||||
}
|
||||
|
Reference in New Issue
Block a user