I'm new to assembly, so I do not quite understand why my program does not work. It crashes through SIGSEGV. Here code of my test.asm file:
section .text
global _start
_start:
push word 0x4f4b
mov al, 4
mov bl, 1
mov rcx, rsp
mov dl, 2
int 0x80 ; writes 'OK' message into STDOUT
mov al, 1
mov bl, 0
int 0x80 ; exit with code 0
Commands:
$ nasm -f elf64 test.asm
$ ld -s -o test test.o
$ ./test
OS: Ubuntu 17.10 x64