# ;; syncd.s # replacement for old syncd daemon # # # # # #include .file "syncd.s" .data time: .quad 5 .quad 0 rem: .quad 0 .quad 0 start_msg: .string "syncd started\n" .text .globl syncd # first argument goes into %rdi == pointer to time # second argument goes into %rsi == pointer to rem (short for remainder, if we are interrupted) syncd: mov $__NR_sync, %rax # syscall is sync, needs no arguments syscall lea time,%rdi # lea rem,%rsi # mov $__NR_nanosleep,%rax # syscall is nanosleep, so 35 goes in %rax... syscall jmp syncd # and do it again mov $0, %rdi # and exit with a zero status mov $__NR_exit, %rax # syscall = 60 is exit syscall