When I try to send the text to a file everything works correctly, but when I change the number 4 of RDX in "_edit", for the variable "counter" with the same value, instead of sending me the text to a file, it sends it to me through the linux terminal.
section .data
    file db "2file.asm", 0
    hola db 'hola'
    counter db 0
section .bss
    idfile resd 1
section .text
        global _start
_start:
    mov rax, 5
    mov rbx, file
    mov rcx, 0002h
    int 0x80
    cmp rax, 0
    jl _finalize
    mov [idfile], rax
_edit:
    mov qword[counter], 4
    mov rax, 4
    mov rbx, [idfile]
    mov rcx, hola
    mov rdx, counter
    int 0x80
_finalize:
    mov rax, 1
    mov rbx, 0
    int 0x80
 
    