you can use the itoa C library function, it's not that complicated, basically you:
while (x){
buff[n]==x % 10;
x/=10;
n++;
}
and then invert the buffer (or print the character back)
void print_number (int x);
print_number:
buff db 15 dup(0)
mov ax,[esp+4]
mov bx,0
itoa_w1:
mov cx, ax
mod cx,10
add cx,30h;'0'
div ax,10
mov buff[bx],cl
cmp ax,0
jnz itoa_w1
itoa_w2:
push buff[bx]
call putchar
pop ax
cmp bx,0
jnz itoa_w2
ret