1
0
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:
Alexander Medvednikov
2019-11-15 02:04:40 +03:00
parent 0b3b241258
commit 96cde10696
7 changed files with 106 additions and 20 deletions

View File

@@ -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

View File

@@ -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')
}