I need to get a string input from user but i don't know the size of the string he would enter and i need to prepare an array in the memory as the size of the string because I'm using the interrupt 21h, ah=0ah. So my question is how to get an input of string if I don't know the size of it? Is there any other interrupt I can use? I searched but I didn't find anything.
I suggest you create a buffer with a fixed size and use a loop with the interrupt 21h, ah=8 for direct character input.
That way you can check how many bytes the user enters and terminate if this number exceeds your buffer size.
In short:
And if you really need to read the whole string you can maybe find a way to reallocate your buffer dynamically.