September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
14
Task/Sleep/X86-Assembly/sleep.x86
Normal file
14
Task/Sleep/X86-Assembly/sleep.x86
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
; x86_64 linux nasm
|
||||
|
||||
section .text
|
||||
|
||||
Sleep:
|
||||
mov rsi, 0 ; we wont use the second sleep arg, pass null to syscall
|
||||
sub rsp, 16
|
||||
mov qword [rsp], rdi ; number of seconds the caller requested
|
||||
mov qword [rsp + 8], rsi ; we won't use the nanoseconds
|
||||
mov rdi, rsp ; pass the struct that's on the stack to
|
||||
mov rax, 35 ; sys_nanosleep
|
||||
syscall
|
||||
add rsp, 16 ; clean up stack
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue