I have written a code for example
.global _start
.data
str:
.long 0x1
.text
_start:
mov $1, %rax # system call 1 is write
mov $0x21, %rdx
mov %rdx, 4(%rax)
mov $60, %rax # system call 60 is exit
xor %rdi, %rdi # we want return code 0
syscall # invoke operating system to exit
why do I receive a segmentation fault? When do I use the memory location? How do I use the memory location?