小编Ich*_*ier的帖子

如何在 x86 汇编中使用“nanosleep”?

我对 Linux 的 nanosleep 系统调用有一些问题。此代码应等待 2 秒才退出,但事实并非如此:

.text
.globl _start
_start:
pushq %rbp
movq %rsp,%rbp        

pushq $0    #0 nanoseconds
pushq $2    #2 seconds

leaq (%rbp),%rdi    #the time structure on the stack       
movq $35,%rax       #nanosleep syscall
movq $0,%rsi        #disable useless parameter           
syscall             
leave               
Run Code Online (Sandbox Code Playgroud)

linux x86 assembly

1
推荐指数
1
解决办法
1860
查看次数

标签 统计

assembly ×1

linux ×1

x86 ×1