# An example of using nanosleep system calls
#
# 休眠5秒
#
.section .data
timespec:
.int 5, 0 # 初始赋值, timespec = 5
output:
.ascii "This is a test\n"
output_end:
.equ len, output_end - output
.section .bss
.lcomm rem, 8
.section .text
.globl main
main:
nop
movl $10, %ecx
loop1:
push %ecx
movl $4, %eax
movl $1, %ebx
movl $output, %ecx
movl $len, %edx
int $0x80
movl $162, %eax
movl $timespec, %ebx
movl $rem, %ecx
int $0x80
pop %ecx
loop loop1
movl $1, %eax
movl $0, %ebx
int $0x80
# gcc -g -o 04 04-nanosleep.s -m32
# ./04
# This is a test
# This is a test
# This is a test