home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
110_01
/
yamdoc.fin
< prev
next >
Wrap
Text File
|
1984-03-03
|
25KB
|
661 lines
YAM (Yet Another Modem program)
by Chuck Forsberg
Manual Revised 9-6-81
YAM performs a number of "Super-Terminal" functions. It may be
regarded as a (not proper) superset of MODEM7. Commands and
subcommands are listed below.
XYAM is a version of yam which corresponds to XMODEM.
Glossary
)
FUNCTION An operation supported by yam, such as DIR, TYPE, S,
R, or T(term). A command may set or reset a MODE, or
perform 0 or more FUNCTIONS.
MODE Many modes affect the way the term function handles
data.
OPTION Option(s) apply to the S and R commands only.
Commands
a: Change to a: disk (or b, etc.)
a1: Change to a: disk user 1
bm Set baudrate to m. Example: "b19200"
bye Drop any call in progress and prepare to make/answer
another.
call name Enable Data Terminal Ready (DTR), and set baudrate
to the value (if present) corresponding to name. If
autodial is supported, dial the telephone number.
If autodial is not supported, the telephone number
is displayed. It is not necessary to type the
entire name as it appears in the file. Example:
"call tcbbs" or "call tc"
close Dump cpature buffer if a recrive file is open, close
files.
dir [pattern ...] Display pathnames matching pattern alphabetized
across the page. The usual ambiguous filenames are
allowed under CP/M provided a correct version of
setfcb() is used. Since dir or any other commands
which accept a pattern use the circular buffer for
filename expansion, be sure to write out any
- 1 -
captured data first! Example: "dir" "dir *.c" "dir
*.c *.h"
dirr [pattern ...]
Displays the directory with the number of sectors in
each file. The number of files matched, number of
blocks, number of kb allocated to those files, and
estimated transmission time at the current baudrate
for all files listed are displayed. Transmission
time estimate is based on batch transmission from a
Z89 with 700kb Tandon drives to a Cromenco 4mHz 4fdc
system with Persci 277 drive. Time includes file
i/o but not error correction.
d{mode} Disable mode(s) affecting file transmission or
reception with the term function. (The "s" and"r"
commands always send data transparently.)
e{mode} Disable mode(s) affecting file
transmission/reception with the term function. (The
"s" and"r" commands always send data
transparently.)
f[mode] name Send file 'name' in the term function. The optional
mode enables one or modes. If squelch is enabled,
preface with ^R and append with ^T. See also
type/list command.
help Displays a command summary. This command closes any
open send file.
initialize Initializes yam to all its default values. Does not
reset the disk system (see "reset").
kill Kill all data in the capture buffer. Restores the
pointers to their initial positions.
list pattern [...]
Display the files specified by the possibly
ambiguous pattern(s). This command closes any open
send file. List stops/resumes printing with ^S.
Typing ^C cancels, and any other character skips to
the next file.
mn Change modem data port to (decimal) n. Example:
"m224"
o Disable the modem by turning off DTR.
off Disable modem and return to operating system.
pxm Set Parameter x to value m.
reset [size] Dump the capture buffer (if on), close all files,
and reset the disk system (this allows swapping
diskettes). The optional argument size becomes the
size of the circular capture buffer, useful for
debugging.
replot [m] Redisplay the last m lines received from the modem.
- 2 -
If m is 0 or absent, redisplay starting with the
earliest data. A screenful is displayed at a time.
The commands accepted in replot mode are listed
below.
rewind Rewind the buffer pointers for the display, printer,
and file dump from the term function. The effect of
this command is the same as if the data had been
sent another time.
r[options] [file ...]
Receive with options 1 or more files using the Wayne
Christensen protocol. If no filename is given,
batch mode is assumed. (Note: batch mode is not
compatible with MODEM7.) If more than one filename
is given, a single file transfer will be made for
each.
s Displays status information.
s[options] pattern ...
If batch mode is specified with the b option, 0 or
more files are sent according to the ambiguous
pathname(s). If batch mode is not specified, the
named unambiguous file(s) are sent each in single
file mode.
type afn ... Type files. XYAM prefaces each file with ^R and
suffixes it with ^T.
t[c][mode] [file]The term function with optional capture to file.
The c (close) option causes data in the capture
buffer to be written and closed immeadiately. 0 or
more modes may be enabled. View mode causes the
term function to display control characters by
prefixing ^ to the corresponding letter. A receive
file previously opened by 't file' will not be
closed by 't'. While in the term function, the
keyboarded characters are transmitted except for
1. ^E Exits from the term function back to main
command level. Rapidly typing ^E^E will
instead cause one ^E to be transmitted.
2. ^Q Iff a send file is open and its
transmission has been stopped by a XOFF,
transmission is resumed. Otherwise no special
treatment.
3. ^S Iff a send file is open and it is being
transmitted, transmission is stopped.
Otherwise no special treatment.
4. ^V Replots the last 24 lines, then awaits next
command in replot. ^V^V typed quickly sends
one instead.
The following received characters are recognized in
the term function, when they are fetched from the
circular buffer for the display.
- 3 -
1. XOFF Stops file transmission from yam.
2. XON Resumes file transmission.
3. TAB Tab characters are expanded on the
display.
wrt Write dumps the circular buffer to the receive file,
if open.
; Semicolon is an optional command delimiter which may
be used in place or RETURN in order to place
multiple commands on a line. Since commands such as
"t" have an indefinite number of operands, the
semicolon must be used to string commands together.
Example: "sb *.c;off" batch transmits all *.c files,
then disconnects. Unfortunately, CP/M's CCP
clobbers ; and everyting past it in the command
line, so use backslash instead.
backslash An alternate to ; for CP/M systems.
Modes used with D, E, T or F commands
e Echo characters received from the modem to the
modem. Use this only for keyboard to keyboard
communication, and then only at one end. Reset
after each command. Does not imply "Half Duplex".
f Full duplex.
h Half Duplex. Displays keyboarded characters as they
are sent to the modem.
g Resumes (GO) sending file once in the term function,
equivalent to XON. Disabling GO causes a file queued
for transmission to wait for an XON character.
i Image transparent data capture, all 8 bits of all
characters received, including NULLS. This overrides
the t and/or z modes.
l List unit (Printer) on. Since the printer is
separately buffered, it needn't be as fast as the
incoming data as long as the difference doesn't
exceed the buffer size. The rewind command may be
used to get extra copies of the received data.
n Send NEWLINE (lf) only when transmitting file (no
CR).
p Send CR only at end of line, and then pause until
echoes from remote have stopped. Useful for sending
files to bulletin boards where the remote needs time
to prepare for the next text line.
r Send CR only at the end of each transmitted line.
- 4 -
s Squelch captured data with ^T and unsquelch with ^R.
These characters are not copied to the file. This
mode must be set/reset as desired BEFORE opening the
receive file.
t If Waitnum is more than 1, wait for echoes to stop
after sending each Waitnum characters for period
Pause. If Waitnum==1, send at 1/Throttle, measured
in loops of the term() function. The default values
of Waitnum and Throttle provide transmission at
about 50 words per minute regardless of baud rate.
Many 'BYE' programs cannot accept input at full
speed.
v View control characters as ^C. Useful in shutting up
the bloody bell. View mode is distinct from view
option.
w Wait to receive a newline afrer sending a CR at the
end of a line.
x Exit from the term function when EOF is encountered
on transmitted file.
z Terminate data capture and close file when ^Z is
received. Otherwise ^Z is ignored. It should be
noted that The Source coughs up an occasional ^Z
just as UPI is about to output something
interesting.
Options used with S or R commands
All options are reset after each command.
b Batch mode. Pathnames are provided by the sender.
Disk names are excluded from the transmitted
pathname(s), and may not be specified for batch mode
reception (use the change directory command).
q Quiet mode inhibits some of the status information.
Quiet mode is not necessary for proprer operation at
higher baudrates.
t Execute the term function after file transfer(s).
v View the data being transmitted. Correct data is
displayed once. Viewing ascii files does not
interfere with correct transmission at extreme baud
rates, although throughput will be affected. For
each sector, data is viewed once before
sending/after receiving.
y Yes it is OK to clobber a file already on disk. If
absent, the operator is promped for a y or n
decision.
- 5 -
Parameters used with P command
wn Set Waitnum to n. See "w" mode for details.
Default is 1.
tm Set Throttle to m. The default value corresponds to
about 80 words per minute sending speed.
m Set Pause to m. When the free characters in the
circular buffer reach 400, an XOFF is sent. Pause
controls the time which must then pass without
characters received before believing that the other
end really has obeyed the XOFF character, as opposed
to the sometimes lengthy Compuserve hitches in the
getalong. If Pause is too short, it is possible
that a lurch in output will be interpreted as
acknowledgement of the XOFF, only to have more
characters arrive whilst yam is occupied dumping the
buffer to disk. When this happens, unfortunate
characters are routed to the proverbial bit bucket,
and you can retry the download as the timesharing
service increments the connect charge. The default
value seems suitable for Source over Tymnet and BBS
systems. Pause is also the echo wait period used
with the "p" mode. Some bulletin board programs
require a longer pause when accepting files with the
"p" mode.
Replot Commands
Commands within replot consist of a single character. Replot maps
uppercase, lowercase, and control characters together in decoding
commands.
v backspace
Previous page (some overlap provided)
space Next page
p Backup one line and redisplay
n LF
Advance one line
OTHERWISE Return to previous funccion
Sample YAM Session
A sample session might be:
A0>yam b19200 cd b (set 19kb, change to b disk)
dirr yam?.? yamhlp.mss (list files and calculate xmsn time)
- 6 -
sb yam?.? yamhlp.mss (send them to a local system)
call hydepark (Can't remember the phone number!)
t (go to the term function, log in, run minicbbs, begin entering a
message)
.......
^E
ftp letter (enable prompt and throttle modes, open letter and send to
bbs)
^E
off
Notes
- The transmission of pathnames in batch mode differs from that
used in MODEM7. Yam sends the pathname as a null terminated
string in a standard Wayne Christensen type packet with sector a
number of 0. Disk specifiers (B:) are not sent. The sender
waits for an initial NAK before sending the pathname. An
explicit NAK is sent by the receiver at intervals when is ready
to receive a pathname. Upon receiving and acknowledging the
pathname packet, the receiver opens the file and then sends the
initial NAK for the data in the file. A null pathname
terminates batch transmission.
- File transmission is compatible with MODEM7 in single file
mode. File transmission may be aborted by sending a sequence of
CAN (^X) characters. Each character keyboarded will cause
readline() to return a TIMEOUT error, thus regaining keyboard
control relatively easily.
- I routinely send files at 19200 baud between a Z89 (2 mHz) and a
Cromenco 4mHz system. Reception in the term function seems to
works well at 9600 baud on a Z89 provided the printer is off.
If you use bios calls for terminal i/o (e.g., TRS-80 version),
the maximum speed may be less in the term function. Quiet mode
is not necessary for proper operation at 19kb, although it does
increase thruput slightly. View option (S and R commands) does
not decrease maximum baud rate, although throughput is obviously
affected according to the ratio of terminal speed to
communications rate.
- Printer operation with bios calls or view mode substantially
reduces the highest baudrate possible with the term function
without losing characters (independent of actual printer
speed). The term function will send XOFF to prevent buffer
overflow if the printer is on, or if a receive file is created.
Term function on a Cromenco with a 300 baud printer works fine
at 2400 baud.
- Baudrate selection routines are provided for the Cromenco TUART
and Z89 serial board (8250's).
- 7 -
- In the term function, use of the circular buffer provides some
advantages.
1. Incoming data may come in at a rate higher than the
display and/or printer. Tab expansion for the display
does not compromise this ability.
2. The user may decide to save a timesharing session on the
disk AFTER it has started (or possibly even finished) as
long as the buffer pointers have not wrapped around.
3. The same ability also applies to the printer. The printer
need not be as fast as the modem as long as the Tortoise
is allowed to catch up.
4. Received data may be redisplayed (rep command). A future
version might allow scrolling and/or string searching.
At high speeds, the display will fall behind the incoming data,
as storing of raw modem data into the buffer takes precedence
over all else. As a result, a defective or incorrectly
programmed modem port which sources data at high speed can
lockout the keyboard. If yam "goes away" when entering the term
function, this may be the cause.
- If insufficient stack space is provided above the end of the
circular buffer, yam may sulk when attempting to exit from the
term function.
- The enable t and z modes affecting data capture are executed
when the circular buffer is written to the receive file, not as
the characters are first received from the data port.
Installing Yam
Yam consists of yam.h, yamsys.h, and yam[12357].c. Yam currently
supports the Z89 (with aux board) and Cromenco TUART. Yamz89.h is
used for Z89 computers (check the port definitions to be sure they
agree with your usage.) Yamtuart.h is setup for a TUART board at 60H
running under CDOS. Yamz89xm.h describes the XMODEM configuration.
One of these (Or one you write for your system) should be copied to
yamsys.h before compiling the files. Compilation should be with -e
5800 for all files and -o for yam[235] if operation at extreme baud
rates is desired.
I have found yam to be handy for transferring files between adjacent
machines; hence all the attention to high speed operation.
If your machine uses a different type of UART chip, or a built-in
modem card, then the yamsys.h and yam5.c files will need work.
Two bugs in the BDS C compiler v1.42 have surfaced. The
"preprocessor" sometimes misses #endif lines, depending on the phase
of the moon and the number of characters here there an somwehere else
in the source file. Usually, adding some comments before the #endif
fixes things.
A subtle bug in code generation (or perhaps my source program?) may
- 8 -
cause unpredictable results when e1xpand is called. Its appearance
is also a function of the phase of the moon and will probabaly go
away if you put in printf's to try to track it down. This problem
affects the type, dir, dirr, and sb commands but not s ufn command.
Hopefully, later versions of the compiler aviod these problems.
A bug in some versions of ccc.asm causes wild cards such as *.c to
expand as *.* instead. If you have this problem, use ????????.c or
get a version of ccc.asm and matching deff2.crl with the changes as
indicated in fixccc.asm.
Some early versions of deff.crl with a defective getc() may need to
look like this: /* changed NSECTS to nsecs CAF */ iobuf -> _nleft =
(nsecs * SECSIZ - 1); That change is much easier to get right; just
recompile stdlib1.c and use clib. Later versions have this change.
Interesting #define's
TERMRESET A string enclosed in quotes which sets the terminal
to the mode desireable for the term function.
TERMRESET as defined for the Z19 turns on
wraparound.
STATLINE Define this if your terminal has an extra (viz.,
25th) line usable for status information which does
not scroll up nor interfere with scrolling.
lpstat() writes to the entire status line, clearing
out any previous contents. pstat() writes statrting
at the 48th position, not disturbing any information
written by lpstat().
MODEMSTUFF If you provide routines setbaud(), readbaud(),
bye(), and onhook(), define MODEMSTUFF to exclude
the default dummy routines.
AUTODIAL If your modem supports autodial, write your own
version of dial() and define AUTODIAL to suppress
the default routine.
Z19 Generates output for Z19 functions, especially
status (25th) line.
XYAM Differences
XYAM is produced by defining XMODEM in the file 'yamsys.h'. Consult
'yamz89xm.h' and 'yamx.sub' for an example. Ceratin #defines are
especially applicable to XYAM:
LOGFILE All files sent (includes type or list commands) or
received (r or t file) are stored with the current
baudrate in LOGFILE.
RESTRICTED Certain commands and options are disabled. Files
with '.BAD' extensions and files with TAG2 will not
be opened. A file with extension of '.COM' will be
uploaded with a '.OBJ' extension. Exisiting filles
- 9 -
cannot be overwritten.
CDO Define a test for carrier drop out so that XYAM can
exit when the connection is broken.
- 10 -
ced by defining XMODE