home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
ccdos.tar.gz
/
ccdos.tar
/
ccsker.dat
< prev
next >
Wrap
Text File
|
1991-09-08
|
18KB
|
412 lines
; 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] <condition> <command> '
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] <condition> <command> '
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 <the Enter key>.'
db ' Example: SET SPEED 2400<Enter>',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<Enter> or even SET SPE<Esc> 24<Esc>'
db '<Enter>',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<Enter>',cr,lf
db 'o ┤≤▓┐╖╓╡Ñ┤╩(├ⁿ┴ε/▓╬╩²)┐╔╥╘╩╣╙├╦⌡╨┤╨╬╩╜▓ó┐╔═¿╣²░┤ Esc ╝ⁿ╧╘╩╛═Ω╒√'
db '╡─╨╬╩╜.',cr,lf
db ' └²╚τ: SET SPE 24<Enter> ╗≥ ╔⌡╓┴ SET SPE<Esc> 24<Esc>'
db '<Enter>',cr,lf
db 'o Help (╧Ω╧╕ / ╕÷▒≡): ╘┌─│╕÷┤╩║≤├µ░┤ "?" ┐╔╡├╡╜╕├┤╩╡─░∩╓·╨┼╧ó'
db cr,lf
db 'o ▒α╝¡├ⁿ┴ε╨╨╩▒┐╔╙├╗╪═╦╝ⁿ<BackSpace> ╔╛│²╫╓╖√, ╙├ 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