Okay, another problem... you're putting the address of "array" in ebx and converting it to hex ascii. Is that what you want to do? I changed a couple of things...
SECTION .bss
array: resq 10
result: resb 16
count: resb 3
num: resb 9
SECTION .data
msg: db "enter string",10
len: equ $-msg
%macro read 2
mov rax,0
mov rdi,0
mov rsi,%1
mov rdx,%2
syscall
%endmacro
%macro write 2
mov rax,1
mov rdi,1
mov rsi,%1
mov rdx,%2
syscall
%endmacro
SECTION .text
global _start
_start:
mov rcx,array ; syscall trashes ecx - I changed it to ebx
mov byte[count],02h
l1:
dec byte[count]
write msg,len
read rcx,9 ; and here
add rcx,8 ; and here.
cmp byte[count],00h
jne l1
mov rbx,array ; changed to [array]
call convascii
write result,16
mov rax,60
mov rdi,0
syscall
convascii:
mov rsi,result
mov rcx,10h
l3:
rol rbx,04
mov al,bl
and al,0Fh
cmp al,09h
jbe add30
add al,07h
add30:
add al,30h
mov [rsi],al
inc rsi
loop l3
ret
At this point, it reads two strings and displays the ascii codes of the first string (only) in reverse order. That is, if the pesky user (me) types "1234"(enter), it displays "00000A34333231". Maybe you wanted address of array after all...
If the pesky user types more characters than are allowed in rdx, the "excess" remains in the "keyboard buffer" to be read on the next sys_read or ends up on the command prompt, as expected. You might want to flush the buffer to make it a little more "user-proof", but it's okay for a well-behaved user.
You ask about moving strings from one place to another...
mov rsi, source_buffer ; address
mov rdi, dest_buffer ;address
mov rcx, length_to_move (might want "[contents]" here)
rep movsb
But it might suit your purposes better to swap pointers to the strings rather than moving the bytes around. I'm not entirely sure what you're trying to do.
Best,
Frank