[net.micro.cpm] KERMIT and TAC

cc.fdc@COLUMBIA-20.ARPA (11/23/83)

From:  Frank da Cruz <cc.fdc@COLUMBIA-20.ARPA>

I've been told by someone who knows about these things (Mark Crispin at
Stanford) that there's no good way to make KERMIT-20 put the TAC in binary
mode, at least not in a way that doesn't depend on a bug in TOPS-20 that may be
present at some sites but fixed at others (the bug being that FF (a byte with
all 1's) is supposed to be quoted by doubling in the monitor, but isn't, so
some application programs do it instead).  Therefore, the way to use KERMIT
over a TAC would seem to be:

1. Set the TAC escape character to be any control character other than ^A or
CR, LF, etc.  ^A is KERMIT's packet synchronization character, and CR or LF
might be used as line terminators at the end of packets (KERMIT never puts any
control characters inside the packets).  Also, choose the character to be
something you're unlikely to type during your timesharing session.  For
instance, as Keith Petersen suggests, use ^E.  Do this by typing "@I 5" (for
^E) to the TAC.  This allows "@" to be transmitted.

2. To send binary files, type "@B O S" and "@B I S" to the TAC (if you already
did step 1, then I suppose you would type "^EB O S" and "^EB I S").

I'm not a TAC user myself, so I can't vouch for any of this.  - Frank
-------

MRC@SU-SCORE.ARPA (11/24/83)

From:  Mark Crispin <MRC@SU-SCORE.ARPA>

     I believe that @ B I S will suffice to disable the TAC escape character,
so the step of setting it with @I should be unnecessary.
-------

ABN.ISCAMS%usc-isid@sri-unix.UUCP (11/24/83)

Talking about disabling (or changing) the TAC escape character..

I just had a (polite but sincere) talking to by my TAC owners...
Seems they don't really like so very much when users start messing about with
their ports!  (I never changed the excape character because I suspected it
would cause people problems.)  I DID leave F O S set a couple of times
(makes XON/XOFF happen at the TAC level for immediate halting of a listing
while my software writes to file) -- usually when the system choked up and
I got thrown off!  Turns out any of those convenient settings we users make
to ports STAY THAT WAY when we leave/sign off unless we specifically reset
them to the way things were -- and that sure can mess up the next guy.

I'd suggest anyone playing with their TAC maybe check with the operators
first to kind of work out an agreement.  If they know what and why you're
doing, they tend to be much more understanding!

David Kirschbaum
Toad Hall

w8sdz%brl@sri-unix.UUCP (11/26/83)

From:      Keith Petersen <w8sdz@brl>

If you do @B I S to the TAC you don't have ANY intercept character
at all and it's then impossible to @C (close) the connection
between the TAC and your host after you're done.  I'm not certain
but I think this may leave a "hanging job" on your host.  The
@I 5 command to set the TAC for control-E intercept works fine
with KERMIT for text files and when you are done the TAC reverts
to the normal "@" intecept for the next caller so no one will be
unhappy with you changing the intercept character for the duration
of your connection.
--Keith

MRC@SU-SCORE.ARPA (11/26/83)

From:  Mark Crispin <MRC@SU-SCORE.ARPA>

In my humble opinion, any host which fails to hang up the connection
when the user logs out should be disconnected from the ARPANET until
they fix their software!  @ B I S is the means of getting into binary
mode on the TAC, and no host should make that mode useless.  Disabling
the TAC intercept character is necessary if you want true binary I/O.
Hosts ought to work well enough so this functionality is usable.
-------

w8sdz%brl@sri-unix.UUCP (11/27/83)

From:      Keith Petersen <w8sdz@brl>

If the host software is properly written it should be possible for the
operating system to send instructions to the TAC, telling it to enter
and exit BINARY mode.  UMODEM (for UNIX), MODEM (for TOPS-20) and MMODEM
(for ITS at MIT) all do this sucessfully, making it unnecessary for the
user to "lose control" of his TAC.  I frequently connect to several
hosts during one TAC session and "losing control" is unacceptable to me.
-Keith

ABN.ISCAMS%usc-isid@sri-unix.UUCP (11/27/83)

Mark (also also Keith at W8SDZ):

Fully agree with the host properly hanging up/reconfiguring.

The KERMIT patch, though is SO very simple.  Atchd is my patch I recently
sent to a local user who's emulating an IBM PC (kind of) with a Wang PC.
Same problem; same fix outta work.

David Kirschbaum
Toad Hall

To: ABN.20E-SP@USC-ISID
Subject: Re: TAC X/ON X/OFF
In-Reply-To: <[USC-ISID]26-Nov-83 13:42:41.ABN.20E-SP>
------------------------------------------------------------------------
Sir,

I don't have the source code of PCKERMIT available now, so I can't move an
actual patch over to you.

However -- if you can grab the chunk of assembler that actually sends
characters out the port when sending packets (in my version its the
section with OUTCHR, OUTCH0, OUTCH1, etc...) and move/message it to me,
I can put in the patches.

What you do is get the character from a register or memory (wherever
KERMIT put it)(the character you want to send as part of a packet,
that is, and compare it to 40H (the @ sign).  If it isn't an @ sign,
just go ahead and send it.  If it IS -- send it twice!.

In my code (8080), it looks like this...

outchr:	mov a,e		; get the char into A
		call setpar	; This is the routine that sets parity on
				; the char to your desires.  I moved it
				; up here to keep it out of the TAC loop.
		mov e,a		; Put the character back into E while we
				; use A to check port status.
		cpi 40h		; compare immediate A with the @ sign.
		cz outch1	; Yep - got an @.  Call the OUT routine to
				; send it the first time, and fall through to
				; send it the second time (elegant, no?)

outch1:	in mnprts	; Get the output ready flat from the Tx
				; status port.
		ani output	; Is the ready bit set?
		jz outch1	; Not ready, loop...
		mov a,e		; Char back into A register
outch2:	out mnport	; Put it out the modem port (finally).
		ret		; Return the first time to the OUTCHR
				; call, the second time (if there IS a second
				; time) to whatever called this.


That's all there is to it!  Now your code and registers are going to be
a bit different, but basically the simple idea works.

Have fun...

SGM K

ABN.ISCAMS%usc-isid@sri-unix.UUCP (11/27/83)

PCKERMIT users:
Here's a patch to PCKERMIT to hopefully solve the TAC intercept character
problem with no hassles about resetting TACs.  Now, please check this out for
me -- I'm an 8080/Z80 hacker and donno nuttin about 8086/8088 code except
what I reasoned out of the PCKERMIT source.

Regards,

David Kirschbaum
Toad Hall

;************************System Dependent****************************
;       Put a char in AH to the port.
PORT	PROC  NEAR 
IF ibmpc
outchr:	sub cx,cx		; [14 start]
	mov al,ah		; Parity routine works on AL. [16]
	call dopar		; Set parity appropriately.     [10]
	mov ah,al		; Don't overwrite character with status. [16]
	mov dx,03FDH

; Toad Hall note:  hokay - now we got the char in ah.  Need to test and see
;if it's the infamous TAC intercept character (@ in this case).  Sending it
;twice will tell the TAC that it's a true ASCII character for the host: the
;TAC will then send a single @ on to the host, and echo one more back to you.
;If it is, we'll call OUTCH1 to put it out once, and then fall through to
:put it out the second time.  If it isn't, we'll just send one character.
; PS:  Somebody with a manual on this assembler language check this out
; for me - I'm only guessing at the mnemonics since I'm a Z80/8080 hacker.

	cmp ah,40h		; Is it the @?
	cz outch1		; Yep, send it the first time..
				; ...and fall through for the second.
				; Else just send it once.  [Toad Hall]	
;End of Toad Hall TACpatch
outch1:	in al,dx
	test al,20H		; Transmitter ready?
 	jnz outch2		; Yes
	loop outch1
	 jmp r			; Timeout
outch2:	mov al,ah		; Now send it out
	mov dx,03F8H
	out dx,al
	jmp rskp		; [14 end]
ENDIF
IF Z100
outchr:	mov al,ah		; Yes, get the character into al
	mov cx,0
	call dopar		; Set parity appropriately.   [10]

; Toad Hall Note:  somebody check this for me -- I assume here that
; ah has not been trashed by the DOPAR call above, and the char is
; still in ah.  I also assume the BIOS-AUXOUT call don't do nuttin
; to ah or al or wherever the char is being accessed so we can in
; fact call and put it out twice in a row.  [Toad Hall]

	cpi ah,40h		; Is the char an @ (TAC intercept char)?
	cz bios-auxout		; Yep - send it once...
				; ...and fall through to send the 2nd...
; End of Toad Hall TACpatch.

outch1:	call bios_auxout	; Send the character
	jmp rskp
ENDIF