Thank you so much it works very good for untested code frank only one mistake but I fixed it for future reference if anyone looks at this page here it is:
.next:
; we do need to clear rdx here - "div" uses it
xor rdx, rdx
div rbx;divide by ten
; quotient in rax, remainder in rdx
add rdx, '0';convert to ASCII
; now we want to put it in our buffer...
mov byte [r8], dl
call print ; for every digit? okay...
test rax, rax ; or cmp rax, 0
jz .done
sub r8, 1
jmp .next;instead of jmp top but I got what you ment :)