This codepiece reminds me of some good old times...
At first sight your code has no serious errors that should cause a crash. maybe you compiled and/or linked it incorrectly. Your prgram should be compiled into an exe file, not a com file. Check if it has an exe header, open it with a binary viewer and check if the file starts with "MZ" or "ZM". If it doesn't have an exe header then you linked it incorrectly as a com file.
For string input I would use dos function 10 unless your task is write one using character input. The one using character input is useful when you want restrictions on the input (for example allowing only digits or maximize string length).
Some notes about the code:
- You are too paranoid and using too many PUSHs and POPs. Your getchar function could be inlined to your loop.
- You don't check for max string length, this can lead to buffer overrun if the user enters a very long string.
- You don't handle backspace but that would involve much more work.
- You don't specify the program exit code in al when you exit, for example zero: mov ax, 4c00h int 21h
- The correct name for the "newline character" (ascii 10) is Line Feed (aka LF) in DOS, CR is okay.