Mike,
More questions need to be answered to see if anything is available or how easy it might be to write a new one:
1) Is this intended to be a completely stand-alone program (e.g., read in using BIN Loader)? Or, is it intended to be a program that runs in the OS/8 environment? The reason this is important in that some of the functionality you are looking for is already built into the OS/8 TTY: device handler but that can only be used if the program is running in the OS/8 environment.
2) If stand-alone, i.e., outside of the OS/8 environment, does it matter if it's running with interrupts on or not? I know for a fact that I have written this kind of code in the past but it was in an interrupts on-based application. OS/8 does not itself play well with interrupts on.
3) The string that gets returned should be unpacked? i.e., one 8-bit character per memory word in the buffer? In many PDP-8 applications, to save memory, characters get compressed to 6 bits then packed two in one 12-bit word. OS/8, by the way, packs three 8-bit characters into two 12-bit words.
4) Behavior on a Teletype could be very different than on a VT-100 regarding backspace and rubout. Whereas the VT-100 can erase the last character and move the cursor left, the "standard" PDP-8 behavior on a Teletype is to print a slash on the first rubout/delete followed by the character deleted for each rubout/delete press followed by another slash when the next character is no longer a rubout/delete. For example, if the user typed the sequence ABCEF<rubout><rubout>DEF it would get printed on the Teletype as:
ABCEF/FE/DEF
5) The "standard" in PDP-8 land is to use Control/U to erase everything, not Control/X
6) It is generally good practice to separate input from output in a situation like this (AKA high cohesion & loose coupling / Single Responsibility in the SOLID sense). I mean, printing a prompt should not be a responsibility of this function because it limits its applicability. You should have a separate output routine that prints stuff. Call the output routine that prints the prompt, then call this routine to get the input.
Finally, how soon is this needed?
Cheers,
-- steve