[net.micro.trs-80] Model 100 Asynch I/O

jwt@atari.UUcp (Jim Tittsler) (04/16/86)

Does anyone have a good subroutine for transmitting/receiving characters
to/from the Model 100's serial port?  I have a BASIC program that can not
seem to handle high speed input (>~1200 baud) even with XON/XOFF enabled.
What would be nice to have would be something that would have arbitrary
sized transmit and receive buffers with flow control, and ideally the
ability to return the number of characters or lines available/waiting
to be sent.  What I would actually like is a more powerful INPUT LINE
command for the serial port.  It would be nice to be able to do a read call
and have it time out after a programmable number of mS without a character
or line, and maybe include string pattern matching (similar to the
"auto login" feature of TELCOM).

Thanks for the help,  Jim 	lll-crg!vecpyr!atari!jwt

moore@mit-eddie.UUCP (04/19/86)

You can use I$=INPUT$(1,1) [where MDM: or COM: is opened as file #1] to input
characters one at a time.  You can use this in conjunction with the status of
PEEK(65414) which holds the number of bytes pending in the modem receive
buffer.  Don't know if this will solve the problem of losing characters (it
probably won't) but it does give you a bit more control over the data
coming in through the MDM: and/or COM: ports.  Just for the record, a handy
line to clear the modem input buffer (receive buffer) is

   1000  IF PEEK(65414)>0 THEN I$=INPUT$(PEEK(65414),1)

	...where MDM:/COM: is opened as file #1.  This will clear the
input buffer if there are any characters there.  If no chars pending,
it does nothing.

-drew
 arpa: MOORE%MIT-EECS@MIT-MC.ARPA
 uucp: ...mit-eddie!moore
   us: Box 121, North Quincy, MA  02171