Technical information

Aterm Serial Solutions
character received. If inxlat returns a non-empty string of
characters then readin prints them out.
Switchout polls the keyboard using kbdwait. A character, if
entered, is compared with zero. A zero byte indicates an
extended character code, used for the function keys, cursor and
edit keys and ALT key combinations. These are all taken to be
commands, and so the function subroutine is called to deal with
them. All other keys are echoed (if echo to screen has been set),
and then passed on to outxlat. Outxlat translates the characters
by calling xlt, and uses outstr to send them on to the serial port.
Outstr is examined in the section above.
Menuout deals with the function keys and the ALT-C key.
It reads the second byte of the extended key code and interprets
it as a request to perform a certain action, and calls cmdout for
help, quit and commands, and setup for the setup option.
Cmdout decodes a character string as a command (whether the
string is from the keyboard, a file or a literal in the program
does not matter), calling one of the command execution routines
to do the actual work. Setup present the user with a group of
menus to set up the serial port. It gets options from the user and
calls the command execution routines to perform them.
Note the use of the subroutines screen, screenewl and
screenchar throughout for output to the screen. These subroutines
at this time simply use DOS service 02H to send characters to
the screen (stdout), but are used so that future versions of
ATERM can easily use separate windows or a marking scheme
to separate the three type of text that appear on the screen-
characters from the serial port (’fromport’), echoed characters
from the keyboard (’fromecho’), and control information from
the program (’fromctrl’). A parameter of screen, screenewl etc
flags this. Figure 8-8 gives several examples of this.
Chapter 8 Page 139