HP48 KERMIT REVEALED Mark Power (251) The HP48 owners manual provides very little information about the implementation of kermit and, in particular, use of the PKT command. The Frank de Cruz book "Kermit A File Transfer Protocol" describes everything there is to know about kermit. The GENERIC commands hinted at in the HP manuals are fully described. The simple functions presented below implement all of the 'hidden' Kermit commands which can be understood by the PC Kermit supplied in the HP Serial Kit. Twelve commands are presented which are understood by the PC Kermit. For example the GENERIC HELP (KHELP) command asks a remote Kermit to send back details of all of the Kermit commands that it understands. Using this, I found out what commands PC Kermit understands. However this command is not understood by the HP48, so it cannot tell you what other commands it understands! Critical to the use of these extra commands is the encoding of the data packet. For simple commands, like GENERIC USAGE (KUSE), the data packet is simply a letter "U". Encoding of this string is handled by PKT. More complex operations require additional parameters. For example GENERIC MESSAGE (KMSG), sends a textual message to the remote end. The message is encoded in the data packet by prefixing it with the GENERIC command type and a parameter length indicator. The latter is an ASCII character whose value is 32 + length of parameter. This encoding is done by the function KENCR below. All of the functions presented return a string to level 1 of the stack. Sometimes this is useful (for example disk usage of the PC, a file, ...), sometimes it always comes back as an empty string. Errors are trapped by PKT rather than returned on the stack. KCMDS: Checksum BCEBh Bytes 506 %%HP: T(3)A(R)F(.); DIR @ KFIN finishes remote Kermit server and sends goodbye @ message to the HP48. Leaves remote machine in Kermit. KFIN \<< "F" "G" PKT \>> @ KOUT does as KFIN and exits Kermit program as well. KOUT \<< "L" "G" PKT \>> @ KREC receives a file from the remote end without @ interpreting it as an HP48 object. Filename is passed @ as a string in level 1. File is returned as a string in @ level 1. KREC \<< "R" PKT \>> @ KWHO returns a string describing who is on the remote @ server. If remote end is a PC this is a fixed string. KWHO \<< "W" "G" PKT \>> @ KUSE returns string describing disk usage on remote end. KUSE \<< "U" "G" PKT \>> @ KTYPE sends a file back to the HP as if it was typed to @ the PC screen. The filename must be passed to KTYPE as @ a string in level 1. e.g. "\MARK\KERMIT.ASC" KTYPE \<< KENCR "T" SWAP + "G" PKT \>> @ KMSG sends a message to the remote end. The message is @ passed to KMSG as a sting in level 1. e.g. "HELLO PC" KMSG \<< KENCR "M" SWAP + "G" PKT \>> @ KHOST is the equivalent of REMOTE HOST. A string passed @ in level 1 is passed to the remote end and executed. @ e.g. "MKDIR MARK2" KHOST \<< "C" PKT \>> @ KHELP returns a string to level 1 listing all of the @ Kermit commands understood by the remote end. KHELP \<< "H" "G" PKT \>> @ KENCR encodes a parameter for the other kermit commands. KENCR \<< DUP SIZE 32 + CHR SWAP + \>> @ KDIR performs a directory command on the remote end. @ This version takes a file specification as a string @ from level 1 of the stack. KDIR \<< KENCR "D" SWAP + "G" PKT \>> @ KDEL takes a filename as a string from level 1 and @ deletes the appropriate file at the remote end. KDEL \<< KENCR "E" SWAP + "G" PKT \>> @ KCWD changes the working directory on the remote end. @ The directory specification is passed as a string in @ level 1 of the stack. e.g. ".." or "\MARK" .... KCWD \<< KENCR "C" SWAP + "G" PKT \>> END There may be more commands that I haven't found yet. It seems likely that it should be possible to string together more of the lower level Kermit commands to provide even more functionality. I managed to put both ends into strange states trying! Have fun.