;name: sleep.asm
;
;build: nasm -felf64 sleep.asm -o sleep.o
;
;description: running the program will pause execution s seconds.

bits 64

[list -]
    %include "unistd.inc"
[list +]

section .text

global sleep   
sleep:
    push    rbp
    mov     rbp,rsp
    push    0                           ;no nanosecs
    push    rdi                         ;seconds on stack
    syscall nanosleep,rsp,0
    mov     rsp,rbp
    pop     rbp
    ret
    

C test program

// sleep test program
// gcc -o sleep sleep.c sleep.o

#include <stdio.h>

extern void sleep(unsigned int seconds);

int main()
{
    unsigned int secs = 10;
    printf("sleeping %d seconds....\n",secs);
    sleep(secs);
    printf("awaken\n");
}