; Edit History: ; 1990: ; CC-Kermit 2.32/A is a Chinese version of MS-Kermit 2.32/A. ; This program keeps all functions of MS-Kermit 2.32/A in MS-DOS. ; In CC-DOS, all display messages are translated in Chinese. ; Jul.10,1991 [zqf] public dosnum, curdsk, fpush, isfile, sbrk, crun, errlev public takrd, takadr, taklev, filtst, drives, maxtry, imxtry public lclsusp, lclrest, lclexit, cwdir, kstatus include ccsdef.h env equ 2CH ; environment address in psp cline equ 80H ; offset in psp of command line CSTACK SEGMENT PARA STACK 'STACK' ; Renamed from STACK dw 200 dup(0) ; Initialize stack to all zeros CSTACK ENDS datas segment public 'datas' extrn buff:byte, comand:byte, flags:byte, pack:byte, trans:byte extrn prmptr:word, inichk:byte, ttyact:byte extrn machnam:byte, msfinal:byte, diskio:byte, decbuf:byte extrn isccdos:byte ; Jun.1990 [zqf] versio label byte verdef db cr,lf db 'Copyright (C) Trustees of Columbia University 1990.' db cr,lf,'$' cversio label byte cverdef db cr,lf db '浙江大学计算机系 1990 年汉化 哥伦比亚大学 1990 年受托版权 ' db cr,lf,'$' hlpmsg db 'Type ? or HELP for help',cr,lf,'$' chlpmsg db '键入 ? 或 HELP 请求帮助',cr,lf,'$' crlf db cr,lf,'$' ermes1 db cr,lf,'?More parameters are needed$' cermes1 db cr,lf,'?需要更多的参数 $' ermes2 db cr,lf,'?Unable to initialize memory$' cermes2 db cr,lf,'?内存无法初始化 $' ermes3 db cr,lf,'?Command canceled$' cermes3 db cr,lf,'?命令被取消 $' ermes4 db cr,lf,'?Unable to change directory$' cermes4 db cr,lf,'?无法改变当前目录 $' erms30 db cr,lf,'?Passed maximum nesting level for TAKE command$' cerms30 db cr,lf,'?超出 TAKE 命令所允许的嵌套层数$' erms31 db cr,lf,'?Cannot find Take-file: $' cerms31 db cr,lf,'?找不到 TAKE文件 : $' erms34 db cr,lf,'This program requires DOS 2.0 or above$' cerms34 db cr,lf,'本程序要求 DOS 2.0 以上操作系统$' erms37 db cr,lf,'?Unable to execute program$' cerms37 db cr,lf,'?程序无法运行$' badnam db cr,lf,'?Protected or no such file(s)$' cbadnam db cr,lf,'?此文件被保护或没有这个文件 $' filmsg db ' Filename$' cfilmsg db ' 文件名 $' pthmsg db ' Name of new working directory and/or disk$' cpthmsg db ' 新的工作目录名或/与磁盘设备号 $' runmsg db ' program name and command line$' crunmsg db ' 程序名和命令行 $' tophlp db cr,lf db ' Ask (get console input to variable)' db ' Mail (file to host Mailer)' db cr,lf db ' Bye (logout remote server) ' db ' Output text (for scripts)' db cr,lf db ' C or Connect (become a terminal) ' db ' Pause [seconds] (for scripts)' db cr,lf db ' Clear (clear serial port buffer)' db ' Pop (exit current Take file or macro)' db cr,lf db ' Close (logging file) ' db ' Push (go to DOS, keep Kermit)' db cr,lf db ' Comment (text is ignored) ' db ' Quit (leave Kermit)' db cr,lf db ' CWD or CD (change dir &/or disk) ' db ' R or Receive (opt local filename)' db cr,lf db ' Define/Assign (a command macro) ' db ' Reinput (script Input, reread buffer)' db cr,lf db ' Delete (a file) ' db ' Remote (prefix for commands)' db cr,lf db ' Directory ' db ' Run (a program)' db cr,lf db ' Disable (selected server commands)' db ' S or Send (local file new name)' db cr,lf db ' Do (a macro) ' db ' Server [timeout] (become a server)' db cr,lf db ' Echo text (show line on screen) ' db ' Set (most things)' db cr,lf db ' Enable (selected server commands)' db ' Show (most things)' db cr,lf db ' EXIT (leave Kermit) ' db ' Space (free on current disk)' db cr,lf db ' Finish (to remote server) ' db ' Status (show main conditions)' db cr,lf db ' Get (remote file opt new name)' db ' Stay (in Kermit after startup)' db cr,lf db ' Goto (label,Take file or Macro)' db ' Stop (exit all Take files & macros)' db cr,lf db ' Hangup (drop DTR, hang up phone) ' db ' Take (do a command file)' db cr,lf db ' If [not] ' db ' Transmit filespec [prompt] (raw upload)' db cr,lf db ' I or Input [timeout] text (scripts)' db ' Type (a file)' db cr,lf db ' Log (Packet, Session, Transaction) ' db ' Wait [timeout] on modem \cd \cts \dsr' db cr,lf db ' Logout (remote server) ' db ' Version (show Kermit''s id)' db cr,lf db ' Type HELP for an Introduction, use "?" within commands for' db ' specific help.$' ctophlp db cr,lf db ' Ask (请求从控制台输入变量值) ' db ' Mail (发送文件到主机邮箱)' db cr,lf db ' Bye (退出远程服务器) ' db ' Output <正文> (Script)' db cr,lf db ' C 或 Connect (联机成为一个终端) ' db ' Pause [秒数] (暂停 Script)' db cr,lf db ' Clear (清除串行口缓冲器) ' db ' Pop (退出当前 Take 文件或宏命令)' db cr,lf db ' Close (关闭 log 文件) ' db ' Push (进入 DOS 状态 ,保护 Kermit)' db cr,lf db ' Comment (注释正文) ' db ' Quit (退出Kermit)' db cr,lf db ' CWD 或 CD (改变目录 或 磁盘 ) ' db ' R 或 Receive (接收文件) ' db cr,lf db ' Define/Assign (定义一个宏命令) ' db ' Reinput (Script输入,重读缓冲区)' db cr,lf db ' Delete (删除文件) ' db ' Remote (远程命令)' db cr,lf db ' Directory (显示文件目录) ' db ' Run (运行程序 ) ' db cr,lf db ' Disable (使被择的服务器命令无效) ' db ' S 或 Send (本地文件名 新文件名 ) ' db cr,lf db ' Do (运行一个宏命令) ' db ' Server [timeout] (进入服务器状态) ' db cr,lf db ' Echo text (在屏幕上显示一行正文) ' db ' Set (设置参数) ' db cr,lf db ' Enable (使被择的服务器命令有效) ' db ' Show (显示参数) ' db cr,lf db ' EXIT (退出Kermit) ' db ' Space (显示当前磁盘自由空间) ' db cr,lf db ' Finish (结束远程服务) ' db ' Stasus (显示当前状态) ' db cr,lf db ' Get (取得远程文件) ' db ' Stay (启动后保持 Kermit 状态)' db cr,lf db ' Goto (转到<标号>处) ' db ' Stop ( 退出 Take 文件或宏命令)' db cr,lf db ' Hangup ( 挂断电话 ) ' db ' Take (运行命令文件) ' db cr,lf db ' If [not] ' db ' Transmit 文件名 [提示符] (原始装入) ' db cr,lf db ' I 或 Input [timeout] 正文(Script) ' db ' Type (显示文件) ' db cr,lf db ' Log (记录数据包,对话,事务处理) ' db ' Wait [timeout] on modem\cd\cts\dsr' db cr,lf db ' Logout (退出远程服务器状态) ' db ' Version (显示 Kermit 的版本) ' db cr,lf db '键入 HELP 请求有关 Kermit 的简介,或在命令行中使用"?" ' db '请求特定命令的 Help.$' qckhlp db cr,lf db ' Introduction to Kermit',cr,lf db 'o A Kermit-CC command is a line of words separated by spaces and' db ' ending with',cr,lf,' a carriage return .' db ' Example: SET SPEED 2400',cr,lf db 'o Most words can be abbreviated and can be completed by pressing' db ' the Esc key.',cr,lf db ' Example: SET SPE 24 or even SET SPE 24' db '',cr,lf db 'o Help (detailed, specific): press the "?" key where a word would' db ' appear.',cr,lf db 'o Edit lines using the BackSpace key to delete characters,' db ' Control-W to delete',cr,lf db ' words, and Control-U to delete the line. Control-C cancels the' db ' command.',cr,lf db 'o Frequently used Kermit-CC commands:',cr,lf db ' EXIT Leave the Kermit program. QUIT does the same' db ' thing.',cr,lf db ' SET PORT, PARITY, SPEED, TERMINAL and many other' db ' parameters.',cr,lf db ' SHOW or STATUS Display groups of important parameters.' db ' SHOW ? for categories.',cr,lf,lf db ' CONNECT Establish a terminal connection to a remote' db ' system or a modem.',cr,lf db ' Control-$' qckhlp1 db ' C (Control $' qckhlp2 db ' followed by "C") Exit CONNECT mode.',cr,lf,lf db ' SEND filename Send the file(s) to the remote system (to its' db ' Kermit).',cr,lf db ' GET filename Ask the remote Kermit server to send the file(s)' db ' to us.',cr,lf db ' RECEIVE Like GET but remote end chooses files to be sent' db ' here.',cr,lf db ' FINISH Shut down remote Kermit but stay logged into' db ' remote system.',cr,lf db ' BYE FINISH and logout of remote system and exit' db ' local Kermit.',cr,lf db 'o Common startup sequence: SET SPEED 9600, CONNECT, login, start' db ' remote Kermit,',cr,lf db ' put it into Server mode, escape back with Control-$' qckhlp3 db ' C, transfer' db ' files with',cr,lf db ' SEND x.txt, GET b.txt, BYE. Read more about it in the Kermit-CC' db ' Users Manual.' db cr,lf db 'Press the "?" key for a summary of Kermit commands: $' cqckhlp db cr,lf db ' ******* Kermit 命令简介 *******',cr,lf,lf db 'o Kermit-CC 命令行由以空格为分格符的一系列单词组成, 命令行用回' db '车键 <即 Enter 键> 结束.',cr,lf db ' 例如: SET SPEED 2400',cr,lf db 'o 大部分单词(命令/参数)可以使用缩写形式并可通过按 Esc 键显示完整' db '的形式.',cr,lf db ' 例如: SET SPE 24 或 甚至 SET SPE 24' db '',cr,lf db 'o Help (详细 / 个别): 在某个词后面按 "?" 可得到该词的帮助信息' db cr,lf db 'o 编辑命令行时可用回退键 删除字符, 用 Ctrl-W 删除一个' db '单词, 用 Ctrl-U',cr,lf db '删除一行, 用 Ctrl-C 取消当前命令.',cr,lf db 'o 常用的 Kermit-CC 命令:',cr,lf db ' EXIT 退出 Kermit-CC 程序. QUIT 功能相同',cr,lf db ' SET 设置 通信端口, 速度, 终端 等许多参数',cr,lf db ' SHOW 或 STATUS 显示一组重要参数的状态. SHOW ? 显示参数表' db cr,lf db ' CONNECT 建立一个到远程系统或 MODEM 的终端连接.',cr,lf db ' Ctrl-$' cqckhlp1 db ' C (Ctrl $' cqckhlp2 db ' 随后紧接着按一个 "C") 退出 CONNECT 方式.',cr,lf db ' SEND <文件名> 发送一个或一组文件到远程系统(的 Kermit).',cr,lf db ' GET <文件名> 请求远程 Kermit服务器 发送一个或一组文件给我们' db cr,lf db ' RECEIVE 接收一个或一组从远程系统(的 Kermit)发来的文件.' db cr,lf db ' FINISH 关闭远程 Kermit, 但未退出登录的远程系统.',cr,lf db ' BYE 关闭远程 Kermit, 退出远程系统的登录和本地 Kermit' db cr,lf db 'o 常用的使用过程: SET SPEED 9600, CONNECT, login, 启动远程 Kermit' db ', 使它进入服',cr,lf db '务器方式, 通过 Ctrl-$' cqckhlp3 db ' C 回到本地, 用 SEND x.txt, GET b.txt 等传送文件, BYE.',cr,lf db ' 请通过阅读 Kermit-CC 的用户手册得到更详细的信息' db cr,lf db '按 "?" 键可得到 Kermit 的命令简表: $' comtab db 55 ; COMND tables mkeyw 'Ask',ask mkeyw 'Assign',assign mkeyw 'Bye',bye mkeyw 'C',telnet mkeyw 'CD',cwdir mkeyw 'Clear',scclr mkeyw 'Close',clscpt mkeyw 'Comment',comnt mkeyw 'Connect',telnet mkeyw 'CWD',cwdir mkeyw 'Define',dodef mkeyw 'Delete',delete mkeyw 'Directory',direct mkeyw 'Disable',srvdsa mkeyw 'Do',docom mkeyw 'Echo',scecho mkeyw 'Enable',srvena mkeyw 'Exit',exit mkeyw 'Finish',finish mkeyw 'Get',get mkeyw 'goto',goto mkeyw 'H',help mkeyw 'Hangup',dtrlow mkeyw 'Help',help mkeyw 'If',ifcmd mkeyw 'I',scinp mkeyw 'Input',scinp mkeyw 'Log',setcpt mkeyw 'Logout',logout mkeyw 'Mail',mail mkeyw 'Output',scout mkeyw 'Pause',scpau mkeyw 'Pop',takclos mkeyw 'Push',dopush mkeyw 'Quit',exit mkeyw 'R',read mkeyw 'Receive',read mkeyw 'Reinput',screinp mkeyw 'Remote',remote mkeyw 'Run',run mkeyw 'S',send mkeyw 'Send',send mkeyw 'Server',server mkeyw 'Set',setcom mkeyw 'Show',showcmd mkeyw 'Space',chkdsk mkeyw 'Status',status mkeyw 'Stay',rskp ; this command does nothing mkeyw 'Stop',takeqit mkeyw 'Take',take mkeyw 'Transmit',scxmit mkeyw 'Type',typec mkeyw 'Version',prvers mkeyw 'Wait',scwait mkeyw ':',comnt shotab db 12 ; SHOW keyword mkeyw 'Communications',shcom mkeyw 'File',shfile mkeyw 'Key',shokey mkeyw 'Logging',shlog mkeyw 'Macros',shomac mkeyw 'Modem',shomodem mkeyw 'Protocol',shpro mkeyw 'Scripts',shscpt mkeyw 'Server',shserv mkeyw 'Statistics',shosta mkeyw 'Terminal',shterm mkeyw 'Translation',shorx lclsusp dw 0 ; address of routine to call when going to DOS lclrest dw 0 ; address of routine to call when returning lclexit dw 0 ; address of routine to call when exiting ssave dw ? ; Original SS when doing Command.com in3ad dw 0,0 ; Original break interrupt addresses ceadr dd 0 ; DOS Critical Error interrupt address curdsk db 0 ; Current disk. origd db 0 ; Original disk orgdir db 64 dup (?) ; original dir on original disk drives db ? ; number of disk drives on system taklev db 0 ; Take levels takadr dw takstr-(size takinfo) ; Pointer into structure takstr db (size takinfo) * maxtak dup(?) psp dw ? ; segment of Program Segment Prefix imxtry db defmxtry ; Retry limit for I packet send/rcv maxtry db defmxtry ; Retry limit for data packet send/rcv ininm2 db 'CCKERMIT.INI',0 ; init file name for 2.0 filtst filest <> ; file structure for procedure isfile exearg dw ? ; segment addr of environment (filled in below) dd 0 ; ptr to cmd line (filled in below) dw 5ch,0,6ch,0 ; our def fcb's; segment filled in later delcmd db ' del ',0 ; delete command dircmd db ' dir ',0 ; directory command typcmd db ' type ',0 ; type command dosnum db ? ; dos version number pthnam db 'PATH=' ; Path environment variable pthlen equ $-pthnam ; length of that string pthadr dw 0 ; offset of PATH= string slashc db ' /c ' ; slashc Must directly preceed tmpbuf tmpbuf db 80h dup (?) ; temp space for file names and comments cmspnam db 'COMSPEC=' ; Environment variable cmsplen equ $-cmspnam cmspbuf db '\command.com',30 dup (0) ; default name plus additional space eexit db cr,'exit',cr leexit equ $-eexit mfmsg db '?Not enough memory to run Kermit$' cmfmsg db '?没有足够内存运行 Kermit 程序 $' mf7msg db '?Attempted to allocate a corrupted memory area$' cmf7msg db '?试图分配一个出待的内存区域 $' spcmsg db ' bytes available on disk',cr,lf,0 cspcmsg db ' 磁盘可用字节数',cr,lf,0 spcmsg2 db ' Drive not ready',cr,lf,'$' cspcmsg2 db ' 驱动器没有准备好 ',cr,lf,'$' errlev db 0 ; DOS errorlevel to be returned kstatus dw 0 ; command execution status (0 = success) temp dw 0 datas ends ; End data segment