Specifications

ter, and then dial the sign-on codes, payee codes and amounts until I've paid my
bills. The key is to control the modem with an APL program. Note that the modem
expects ASCII (more exactly, the sequence of binary codes that correspond to the
ASCII characters). In APL mode, you need to check on the correspondence between
APL and ASCII characters before you decide which APL character to send; refer to
the character code tables in Appendix C, the APL manual. In APL, most keys send
the required ASCII binary codes if used "as if" they were still ASCII keys. But
not all! For example, while SHIFT 3 will send '//' in ASCII, the asterisk '** has
moved to the SHIFT 8 key! To assure correct translation, first find the ASCII
character you wish to send in Appendix Table C-3 (p. 107). Note its hexadecimal
code; then turn to Appendix Table C-1. Use the APL character with the same hex
code.
« r
The set of APL functions below will dial up a host computer from the APL WS. I
assume that the host needs only two items: (1) a log-on message and (2) a pass
word. The function LOGON sets up the serial port, using the functions listed
above, and opens the serial port. The first message sent to the serial port is
modem-specific; it tells the Hayes modem not to echo characters back to SPET.
(This isn't really needed unless in passthrough mode). Executed next are three
APL functions that dial the host computer and provide the log-on and the pass
word. I prefer to keep these as separate APL functions in the WS, but this is
largely a matter of taste; it is always useful when an "emergency" arises.
VLOGONLOlV
VOPENSERIALLOlV
c
0] LOGON ; I ; ANS;CMDS
[ 0]
OPENSERIAL
[ 1]
nROUTINE TO DIAL UP IPSA
[ 1]
'SERIAL' DC REATE 10
[
2]
SIOINIT 1200 VN0ECH0
[
3]
STIMEOUT 15+1-0
C 0] N0ECH0
c
4]
OPENSERIAL
C 1]
'a~ e0» PUT 10
c
5] N0ECH0
VDIALHOSTLOiV
[
6] CMDS-3 8p'DIALHOSTSIGNON PASSWORD'
[ 0]
DIALHOST
[
7] Sli'CMD: ' , REV ERSE CM DS U -I +1; ]
C 1]
'ct~ L-9991234’ []PUT 10
c
8]
(ENTER T TO SEND)'
VSIGNON[Q]V
[
9] ANS-0 [ 0] SIGNON
[
10] -+ ( 'Y'*liANS)/0
c i:
' LOGON ME' 0PUT 10
c
11]
iCMDSil i ]
VPASSWORDlD]7
[
12]
-K3>I)/S1 C o]
PASSWORD
C 1]
' CRYPTIC' PUT 10
These functions do not use the serial port interactively. As best I can deter
mine, you cannot write an APL function that is fast enough to use the port this
way. Ideally, I could send a message to the host and then "listen" to the serial
port and accumulate characters as they came back from the host, until a carriage
return or a long pause signified that my message was complete. The serial port
has no buffer, however, and characters are lost unless they are captured as they
arrive. While you may write an APL program that continually "gets" characters
from the serial port, checks to see if they are indeed characters, and adds them
to a string if they are, the program will be too slow; it will lose characters.
Some other APL implementations provide a system function to do the job (APL*PLUS
/PC, for example); it allows a message to be sent to the host, under a variety
of translation schemes; it then accumulates characters (to a maximum). The func
tion can be initialized so that control returns automatically to the APL pro
gram on receipt of any specific characters (such as BELL). This capability is
SuperPET Gazette, Vol.I No.11
-163-
December 1983/January 1984