global _main extern _start _main: xor rbp, rbp call _start global _userspace _userspace: mov rdi, 4000 ; 4000 ms / 4 seconds mov rax, 2 ; sys_sleep int 42h ; syscall mov rcx, 10 .loop: dec rcx mov rdi, .message mov rsi, 22 mov rax, 3 ; sys_write int 42h ; syscall mov rdi, 200 ; 200 ms / 0.2 seconds mov rax, 2 int 42h ; syscall cmp rcx, 0 jne .loop mov rax, 0 int 42h ; Exit current task .message: db "hello from userspace!", 0xA, 0