Program for string length in x86
mov dl, byte [ecx]
cmp dl, 0; read byte and comp to 0 
je _exit



There are various alternatives, for example:

cmp byte [ecx], 0
je _exit


And:

mov dl, [ecx] ; note: BYTE would be redundant, but you can put it if you like
test dl, dl
jz _exit


For that loop overall,


_label:
    mov dl, byte [ecx]
    cmp dl, 0; read byte and comp to 0 
    je _exit
    add ecx, 1 
    jmp _label



This is a "2 jump loop", but it can be a "1 jump loop", for example:

_label:
    mov dl, [ecx]
    inc ecx
    test dl, dl
    jnz _label


Or:

    dec ecx
_label:
    inc ecx
    cmp byte [ecx], 0
    jne _label


(here are some details about inc vs add)

For fast loops like this, having two jumps in the loop can easily slow them down to half the speed.

repnz scasb is an option, but it's not that great. Small loops like this can run in 1 cycle per iteration on most CPUs anyway, and repnz scasb is not better than that (often worse, such as 2 cycles per byte on Ryzen and Haswel). The special optimizations for rep movs and rep stos don't apply to rep scas.

There are faster ways to implement strlen, that are not based on byte-by-byte loops but detect the presence of a zero inside a bigger block, using SIMD (example) or SWAR (example). That way speeds much higher than 1 byte per cycle can be reached. Perhaps some future processor would implement a "fast rep scas" feature in a similar way..


mov ecx, arg_err
mov edx, len_arg_err
call _print
int 0x80



This is mysterious, there is no _print function and there is a stray system call without selecting any particular entry point, or perhaps _print was meant to put a suitable value in eax?