home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
c
/
trsker.jar
< prev
next >
Wrap
Text File
|
2020-01-01
|
191KB
|
4,961 lines
This file is a text archive of the files for Tandy TRS-80 Model I and III
Kermit. Each file begins with a line <<< name >>>, where "name" is the name
of the file. The files begin on the next line.
<<< trscmd.src >>>
; JUMPING TO THIS LOCATION IS LIKE RETSKP. IT ASSUMES THE INSTRUCTION
; AFTER THE CALL IS A JMP ADDR.
RSKP: POP HL ; GET THE RETURN ADDRESS.
INC HL ; INCREMENT BY THREE.
INC HL
INC HL
JP (HL)
; THIS ROUTINE PRINTS THE NUMBER IN HL ON THE SCREEN IN DECIMAL.
; SAVES ALL ACS.
NOUT: PUSH AF ; SAVE OUR ACS.
PUSH BC
PUSH DE
PUSH HL
LD BC,-10 ; GET SOME USEFUL CONSTANTS.
LD DE,-1
NOUT2: ADD HL,BC ; SUBTRACT AS MANY 10S AS POSSIBLE.
INC DE ; COUNT THEM.
JP C,NOUT2 ; IF SOME LEFT KEEP GOING.
LD BC,10 ; RESTORE THE LAST 10 WE TOOK AWAY.
ADD HL,BC
EX DE,HL ; SWAP THE REMAINDER AND THE QUOTIENT.
LD A,H ; GET THE NUMBER OF 10S FOUND.
OR L ;* I THINK THIS CHECKS IF H EQUALS ZERO. IF
CALL NZ,NOUT ; IF NON ZERO, RECURSE.
LD A,E ; GET THE REMAINDER.
ADD A,30H ; MAKE THE NUMBER PRINTABLE.
CALL CONOUT
POP HL ; RESTORE THE ACS.
POP DE
POP BC
POP AF
RET
; THIS SET OF ROUTINES PROVIDES A USER ORIENTED WAY OF PARSING
; COMMANDS. IT IS SIMILAR TO THAT OF THE COMND JSYS IN TOPS-20.
; THIS ROUTINE PRINTS THE PROMPT IN DE AND SPECIFIES THE REPARSE
; ADDRESS.
PROMPT: POP HL ; GET THE RETURN ADDRESS.
PUSH HL ; PUT IT ON THE STACK AGAIN.
LD (CMRPRS),HL ; SAVE IT AS THE ADDRESS TO GO TO ON REPARSE.
LD (CMOSTP),SP ; SAVE FOR LATER RESTORAL.
LD (CMPRMP),DE ;save the prompt location
LD HL,CMDBUF
LD (CMCPTR),HL ; INITIALIZE THE COMMAND POINTER.
LD (CMDPTR),HL
XOR A
LD (CMAFLG),A ; ZERO THE FLAGS.
LD (CMCCNT),A
LD A,0FFH ; TRY IT THIS WAY (DAPHNE.)
LD (CMSFLG),A
LD DE,CMCRLF
CALL PRTSTR
LD DE,(CMPRMP) ; PRINT THE PROMPT.
CALL PRTSTR
RET
; THIS ADDRESS IS JUMPED TO ON REPARSE.
REPARS: LD SP,(CMOSTP) ; GET THE OLD STACK POINTER.
LD HL,CMDBUF
LD (CMDPTR),HL
LD A,0FFH ; TRY IT THIS WAY (DAPHNE.)
LD (CMSFLG),A
LD HL,(CMRPRS) ; GET THE REPARSE ADDRESS.
JP (HL) ; GO THERE.
; THIS ADDRESS CAN BE JUMPED TO ON A PARSING ERROR.
PRSERR: LD SP,(CMOSTP) ; GET THE OLD STACK POINTER.
LD HL,CMDBUF
LD (CMCPTR),HL ; INITIALIZE THE COMMAND POINTER.
LD (CMDPTR),HL
XOR A
LD (CMAFLG),A ; ZERO THE FLAGS.
LD (CMCCNT),A
LD A,0FFH ; TRY IT THIS WAY (DAPHNE.)
LD (CMSFLG),A
LD DE,CMCRLF
CALL PRTSTR
LD DE,(CMPRMP) ; GET THE PROMPT.
CALL PRTSTR
;* INSTEAD RETURN TO BEFORE THE PROMPT CALL.
LD HL,(CMRPRS)
JP (HL)
; THIS ROUTINE PARSES THE SPECIFIED FUNCTION IN A. ANY ADDITIONAL
; INFORMATION IS IN DE AND HL.
; RETURNS +1 ON SUCCESS
; +4 ON FAILURE (ASSUMES A JMP FOLLOWS THE CALL)
COMND: LD (CMSTAT),A ; SAVE WHAT WE ARE PRESENTLY PARSING.
CALL CMINBF ; GET CHARS UNTIL AN ACTION OR A ERASE CHAR.
CP CMCFM ; PARSE A CONFIRM?
JP Z,CMCFRM ; GO GET ONE.
CP CMKEY ; PARSE A KEYWORD?
JP Z,CMKEYW ; TRY AND GET ONE.
CP CMIFI ; PARSE AN INPUT FILE SPEC?
JP Z,CMIFIL ; GO GET ONE.
CP CMIFIN ; INPUT FILE-SPEC SILENT?
JP Z,CMIFIL ; DO AS HE WISHES
CP CMOFI ; OUTPUT FILE SPEC?
JP Z,CMOFIL ; GO GET ONE.
CP CMTXT ; PARSE ARBITRARY TEXT?
JP Z,CMTEXT ; GO DO IT.
LD DE,CMER00 ; "?UNRECOGNIZED COMND CALL"
CALL PRTSTR
RET
; THIS ROUTINE PARSES ARBITRARY TEXT UP TO A CR.
; ACCEPTS DE: ADDRESS TO PUT TEXT
; RETURNS IN A: NUMBER OF CHARS IN TEXT (MAY BE 0)
; DE: UPDATED POINTER
CMTEXT: EX DE,HL ; PUT THE POINTER TO THE DEST IN HL.
LD (CMPTAB),HL ; SAVE THE POINTER.
LD B,0 ; INIT THE CHAR COUNT
CMTXT1: CALL CMGTCH ; GET A CHAR.
OR A ; TERMINATOR?
JP P,CMTXT5 ; NO, PUT IN USER SPACE.
AND 7FH ; TURN OFF MINUS BIT.
CP ESC ; AN ESCAPE?
JR NZ,CMTXT2 ; NO.
LD A,BELL ; GET A BELL.
CALL CONOUT
XOR A
LD (CMAFLG),A ; TURN OFF THE ACTION FLAG.
LD HL,(CMCPTR) ; MOVE THE POINTER TO BEFORE THE ESCAPE.
DEC HL
LD (CMCPTR),HL
LD (CMDPTR),HL
LD HL,CMCCNT ; GET THE CHAR COUNT.
DEC (HL) ; DECREMENT IT BY ONE.
JP CMTXT1 ; TRY AGAIN.
CMTXT2: CP '?' ; IS IT A QUESTION MARK?
JR Z,CMTXT3 ; IF SO PUT IT IN THE TEXT.
CP ' ' ;blank?
JR Z,CMTXT3 ;if so put in the text
CP FF ; IS IT A FORMFEED?
CALL Z,CMBLNK ; IF SO BLANK THE SCREEN.
LD A,B ; RETURN THE COUNT.
LD HL,(CMPTAB) ; RETURN UPDATED POINTER IN HL.
EX DE,HL
JP RSKP ; RETURN SUCCESS.
CMTXT3: LD HL,CMAFLG ; POINT TO THE ACTION FLAG.
LD (HL),0 ; SET IT TO ZERO.
CMTXT5: INC B ; INCREMENT THE COUNT.
CP 'a'
JR C,CMTXT6 ;lower than 'a'
CP 'z'
JR NC,CMTXT6 ;greater than 'z'
AND 5FH ;capitalize it
CMTXT6 LD HL,(CMPTAB) ; GET THE POINTER.
LD (HL),A ; PUT THE CHAR IN THE ARRAY.
INC HL
LD (CMPTAB),HL ; SAVE THE UPDATED POINTER.
JP CMTXT1 ; GET ANOTHER CHAR.
; THIS ROUTINE GETS A CONFIRM.
CMCFRM: LD DE,CMIN00 ; PRINT SOMETHING USEFUL.
CALL PRTSTR
LD DE,CMCRLF ; PRINT A CRLF.
CALL PRTSTR
LD DE,(CMPRMP) ; REPRINT THE PROMPT.
CALL PRTSTR
LD HL,(CMDPTR) ; GET THE POINTER INTO THE BUFFER.
LD A,'$' ; PUT A $ THERE FOR PRINTING.
LD (HL),A
LD HL,(CMCPTR)
DEC HL ; DECREMENT AND SAVE THE BUFFER POINTER.
LD (CMCPTR),HL
LD DE,CMDBUF
CALL PRTSTR
XOR A ; TURN OFF THE ACTION FLAG.
LD (CMAFLG),A
CALL @KEY ;get a key from the keyboard
CP CR
JR Z,CMCFR3
CP FF
JR Z,CMCFR3
CP 4
RET M
LD HL,(CMCPTR)
INC HL
LD (HL),A
INC HL
LD (CMCPTR),HL
CALL CONOUT
JP REPARS ; REPARSE EVERYTHING.
CMCFR3: CP FF ; IS IT A FORM FEED?
CALL Z,CMBLNK ; IF SO BLANK THE SCREEN.
JP RSKP
; THIS ROUTINE PARSES A KEYWORD FROM THE TABLE POINTED
; TO IN DE. THE FORMAT OF THE TABLE IS AS FOLLOWS:
;
; ADDR: DB N ; WHERE N IS THE # OF ENTRIES IN THE TABLE.
; DB M ; M IS THE SIZE OF THE KEYWORD.
; DB 'STRING$' ; WHERE STRING IS THE KEYWORD.
; DB A,B ; WHERE A & B ARE PIECES OF DATA
; ; TO BE RETURNED. (MUST BE TWO OF THEM.)
;
; THE KEYWORDS MUST BE IN ALPHABETICAL ORDER.
;**** NOTE: THE DATA VALUE A IS RETURNED IN REGISTERS A AND E. THE
;**** DATA VALUE B IS RETURNED IN REGISTER D. THIS ALLOWS THE TWO DATA
; BYTES TO BE STORED AS:
; DW XXX
; AND RESULT IN A CORRECTLY FORMATTED 16-BIT VALUE IN REGISTER PAIR
; DE.
CMKEYW: LD (CMHLP),HL ; SAVE THE HELP.
LD (CMPTAB),DE ; SAVE THE BEGINNING OF KEYWORD TAB FOR '?'.
LD A,(DE) ; GET THE NUMBER OF ENTRIES IN THE TABLE.
LD B,A ;save in B
INC DE
LD (CMKPTR),DE
LD HL,(CMDPTR) ; SAVE THE COMMAND POINTER.
LD (CMSPTR),HL
CMKEY2: LD A,B
OR A ; ANY LEFT?
RET Z ; IF NOT WE FAILED.
LD HL,(CMKPTR)
LD E,(HL) ; GET THE LENGTH OF THE KEYWORD.
INC HL
CMKEY3: DEC E ; DECREMENT THE NUMBER OF CHARS LEFT.
LD A,E
CP 0FFH ; HAVE WE PASSED THE END?
JP M,CMKEY5 ; IF SO GO TO THE NEXT.
CALL CMGTCH ; GET A CHAR.
OR A ; IS IT A TERMINATER?
JP P,CMKEY4 ; IF POSITIVE, IT IS NOT.
AND 7FH ; TURN OFF THE MINUS BIT.
CP '?'
JP NZ,CMKY31
XOR A
LD (CMAFLG),A ; TURN OFF THE ACTION FLAG.
LD HL,CMCCNT ; DECREMENT THE CHAR COUNT.
DEC (HL)
;* MUST GO THROUGH THE KEYWORD TABLE AND PRINT THEM.
LD DE,(CMHLP) ; FOR NOW PRINT THE HELP TEXT.
CALL PRTSTR
LD DE,CMCRLF ; PRINT A CRLF.
CALL PRTSTR
LD DE,(CMPRMP) ; REPRINT THE PROMPT.
CALL PRTSTR
LD HL,(CMDPTR) ; GET THE POINTER INTO THE BUFFER.
LD A,'$' ; PUT A $ THERE FOR PRINTING.
LD (HL),A
LD HL,(CMCPTR)
DEC HL ; DECREMENT AND SAVE THE BUFFER POINTER.
LD (CMCPTR),HL
LD DE,CMDBUF
CALL PRTSTR
JP REPARS ; REPARSE EVERYTHING.
CMKY31: CP ESC ; IS IT AN ESCAPE?
JP NZ,CMKY35
XOR A
LD (CMAFLG),A ; TURN OFF THE ACTION FLAG.
PUSH DE
PUSH BC
PUSH HL
CALL CMAMBG
JP CMKY32
LD A,BELL
CALL CONOUT
LD HL,(CMCPTR) ; MOVE THE POINTER TO BEFORE THE ESCAPE.
DEC HL
LD (CMCPTR),HL
LD (CMDPTR),HL
LD HL,CMCCNT ; GET THE CHAR COUNT.
DEC (HL) ; DECREMENT IT BY ONE.
POP HL
POP BC
POP DE
INC E ; INCREMENT THE LEFT TO PARSE CHAR COUNT.
JP CMKEY3
CMKY32: LD HL,(CMCPTR) ; POINTER INTO BUFFER.
DEC HL ; BACKUP TO THE ESCAPE.
EX DE,HL
POP HL
PUSH HL
CMKY33: LD A,(HL) ; GET THE NEXT CHAR.
CP '$' ; FINISHED?
JP Z,CMKY34
INC HL
EX DE,HL
LD (HL),A ; MOVE IT INTO THE BUFFER.
INC HL
EX DE,HL
LD A,(CMCCNT) ; INCREMENT THE CHAR COUNT.
INC A
LD (CMCCNT),A
JP CMKY33
CMKY34: LD A,(CMCCNT) ; GET THE CHARACTER COUNT.
INC A ; INCREMENT AND SAVE IT.
LD (CMCCNT),A
EX DE,HL ; PUT THE COMMAND BUFFER POINTER IN HL.
LD A,' ' ; GET A BLANK.
LD (HL),A ; PUT IT IN THE COMMAND BUFFER.
INC HL ; INCREMENT THE POINTER
LD (CMCPTR),HL ; SAVE THE UPDATED POINTER.
LD (CMDPTR),HL
POP HL
PUSH HL
EX DE,HL
CALL PRTSTR ; PRINT THE REST OF THE KEYWORD.
LD A,' '
CALL CONOUT
POP HL
POP BC
POP DE
JP CMKY37
CMKY35: PUSH HL
PUSH DE
CALL CMAMBG
JP CMKY36
LD DE,CMER01
CALL PRTSTR ; SAY ITS AMBIGUOUS.
JP PRSERR ; GIVE UP.
CMKY36: POP DE
POP HL
CMKY37: INC E ; ADD ONE INCASE IT IS NEGATIVE.
LD D,0
ADD HL,DE ; INCREMENT PAST THE KEYWORD.
INC HL ; PAST THE $.
LD E,(HL) ; GET THE DATA.
INC HL
LD D,(HL)
LD A,E
JP RSKP
CMKEY4: CP 'a' ; IS IT LESS THAN A?
JR C,CMKY41 ; IF SO DON'T CAPITALIZE IT.
CP 'z' ; IS IT MORE THAN Z?
JR NC,CMKY41 ; IF SO DON'T CAPITALIZE IT.
AND 137O ; CAPITALIZE IT.
CMKY41: LD D,(HL) ; GET THE NEXT CHAR OF THE KEYWORD.
INC HL
CP D ; MATCH?
JP Z,CMKEY3 ; IF SO GET THE NEXT LETTER.
CMKEY5: LD D,0
LD A,E ; GET THE NUMBER OF CHARS LEFT.
OR A ; IS IT NEGATIVE?
JP P,CMKY51
LD D,0FFH ; IF SO, SIGN EXTEND.
CMKY51: ADD HL,DE ; INCREMENT PAST THE KEYWORD.
LD DE,0003H ; PLUS THE $ AND DATA.
ADD HL,DE
LD (CMKPTR),HL
DEC B ; DECREMENT THE NUMBER OF ENTRIES LEFT.
LD HL,(CMSPTR) ; GET THE OLD CMDPTR.
LD (CMDPTR),HL ; RESTORE IT.
;* CHECK SO WE DON'T PASS IT.
JP CMKEY2 ; GO CHECK THE NEXT KEYWORD.
CMAMBG: DEC B ; DECREMENT THE NUMBER OF ENTRIES LEFT.
RET M ; IF NONE LEFT THEN IT IS NOT AMBIGUOUS.
INC E ; THIS IS OFF BY ONE; ADJUST.
LD C,E ; SAVE THE CHAR COUNT.
LD A,E
OR A ; ANY CHARS LEFT?
RET Z ; NO, IT CAN'T BE AMBIGUOUS.
LD D,0
ADD HL,DE ; INCREMENT PAST THE KEYWORD.
LD E,3 ; PLUS THE $ AND DATA.
ADD HL,DE
LD B,(HL) ; GET THE LENGTH OF THE KEYWORD.
INC HL
EX DE,HL
LD HL,(CMKPTR) ; GET POINTER TO KEYWORD ENTRY.
LD A,(HL) ; GET THE LENGTH OF THE KEYWORD.
SUB C ; SUBTRACT HOW MANY LEFT.
LD C,A ; SAVE THE COUNT.
CP B
JP Z,CMAMB0
RET P ; IF LARGER THAN THE NEW WORD THEN NOT AMB.
CMAMB0: LD HL,(CMSPTR) ; GET THE POINTER TO WHAT PARSED.
CMAMB1: DEC C ; DECREMENT THE COUNT.
JP M,RSKP ; IF WE ARE DONE THEN IT IS AMBIGUOUS.
EX DE,HL ; EXCHANGE THE POINTERS.
LD B,(HL) ; GET THE NEXT CHAR OF THE KEYWORD
INC HL
EX DE,HL ; EXCHANGE THE POINTERS.
LD A,(HL) ; GET THE NEXT PARSED CHAR.
INC HL
CP 'a' ; IS IT LESS THAN A?
JR C,CMAMB2 ; IF SO DON'T CAPITALIZE IT.
CP 'z' ; IS IT MORE THAN Z?
JR NC,CMAMB2 ; IF SO DON'T CAPITALIZE IT.
AND 137O
CMAMB2: CP B ; ARE THEY EQUAL?
RET NZ ; IF NOT THEN ITS NOT AMBIGUOUS.
JP CMAMB1 ; CHECK THE NEXT CHAR.
CMIFIL EX DE,HL
LD (CMFCB),HL
EX DE,HL
LD HL,(CMFCB)
LD B,50 ;number to blank
CMIFI0: LD (HL),' ' ; BLANK THE FCB.
INC HL
DJNZ CMIFI0
CMIFI1: LD HL,(CMDPTR) ;GET COMMAND FCB
CALL @FSPEC
JR Z,CMIFI2
LD DE,CMER02
CALL PRTSTR
JP PRSERR
CMIFI2: LD (CMDPTR),HL
JP RSKP
CMOFIL: JP CMIFIL
CMINBF: PUSH AF
PUSH DE
PUSH HL
LD A,(CMAFLG) ; IS THE ACTION CHAR FLAG SET?
OR A
JP NZ,CMINB9 ; IF SO GET NO MORE CHARS.
LD HL,(CMCPTR)
LD DE,CMFCB ;END OF BUFFER
XOR A
SBC HL,DE
LD B,L ;size of cmdbuf
LD HL,(CMCPTR)
CALL @KEYIN ;rom lineinput routine
JP C,PRSERR ;action if <BREAK> typed
LD A,B
LD (CMCCNT),A
OR A
JP Z,PRSERR ; IF NOT, JUST START OVER.
LD HL,(CMCPTR)
LD E,B
LD D,0
ADD HL,DE
LD (CMCPTR),HL ;update pointer
CMINB6: LD A,0FFH ; SET THE ACTION FLAG.
LD (CMAFLG),A
CMINB9: POP HL
POP DE
POP AF
RET
CMGTCH: PUSH HL
PUSH BC
CMGTC1: LD A,(CMAFLG)
OR A ; IS IT SET.
CALL Z,CMINBF ; IF THE ACTION CHAR FLAG IS NOT SET GET MORE.
LD HL,(CMDPTR) ; GET A POINTER INTO THE BUFFER.
LD A,(HL) ; GET THE NEXT CHAR.
INC HL
LD (CMDPTR),HL
CP ' ' ; IS IT A SPACE?
JP Z,CMGTC2
CP TAB ; OR A TAB?
JP NZ,CMGTC3
CMGTC2: LD A,(CMSFLG) ; GET THE SPACE FLAG.
OR A ; WAS THE LAST CHAR A SPACE?
JP NZ,CMGTC1 ; YES, GET ANOTHER CHAR.
LD A,0FFH ; SET THE SPACE FLAG.
LD (CMSFLG),A
LD A,' '
POP BC
POP HL
JP CMGTC5
CMGTC3: PUSH AF
XOR A
LD (CMSFLG),A ; ZERO THE SPACE FLAG.
POP AF
POP BC
POP HL
CP ESC
JP Z,CMGTC5
CP '?' ; IS THE USER CURIOUS?
JP Z,CMGTC4
CP CR
JP Z,CMGTC4
CP LF
JP Z,CMGTC4
CP FF
RET NZ ; NOT AN ACTION CHAR, JUST RETURN.
CMGTC4: PUSH HL
LD HL,(CMDPTR)
DEC HL
LD (CMDPTR),HL
POP HL
CMGTC5: OR 80H ; MAKE THE CHAR NEGATIVE TO INDICATE IT IS
RET ; A TERMINATOR.
<<< trsdnld.bas >>>
10 CLEAR1000:ONERRORGOTO500
20 DEFINTA-Z
30 CLS
40 H$="0123456789ABCDEF"
50 PRINT"This is KERMAKE/BAS for the TRS-80 Model I/III":PRINT
53 PRINT"It will create a program called KERMIT/CMD"
55 PRINT"on a drive you specify!"
60 INPUT"Which drive to use (0-3)";DR:IFDR>3ORDR<0THEN60
90 LINEINPUT"PRESS <ENTER> WHEN YOU ARE READY TO BEGIN --> ";A$
120 FS$="KERMIT/CMD:"+RIGHT$(STR$(DR),1)
130 OPEN"O",1,FS$
150 READB$
160 IFB$="*"THEN270
170 X=X+1
180 PRINTUSING"PART ### OF 332 PARTS";X;:PRINTCHR$(29);
190 FORA=1TOLEN(B$)STEP2
200 A1=INSTR(H$,MID$(B$,A,1))-1
210 A2=INSTR(H$,MID$(B$,A+1,1))-1
220 A3=A1*16+A2
230 CK#=CK#+A3
240 PRINT#1,CHR$(A3);
250 NEXTA
260 GOTO150
270 CLS
280 A#=1003039
290 PRINT"CHECKSUM ="CK#" IT SHOULD ="A#:PRINT
300 IF CK#=A# GOTO 330
310 PRINT"CHECKSUM ERROR. IT IS SUGGESTED THAT YOU DOWNLOAD THIS"
320 PRINT"PROGRAM AGAIN.":END
330 PRINT"CHECKSUM CORRECT! YOUR COPY OF KERMIT HAS BEEN VERIFIED."
340 CLOSE
350 END
500 ONERRORGOTO0
1000 DATA 05064B45524D495401020070ED73D19531D396CD1A70AF32CB98118591CD
1001 DATA 3B70CD4B70C330713AF496D3E8D3E93E6CD3EAC9D5114092CD3B70D1C9D5
1002 DATA E5C5F5CD3300F1C1E1D1C91AFE24C8CD2F701318F6D5CD2B00D1C911CB98
1003 DATA 1ACB7FC42844112889CD7471115A9221308C3E01CDE171C39A702170704F
1004 DATA 060009E9C30177C32871C34271C3C376C30F7BC3637FC37978C3F079C3F8
1005 DATA 79C30976C35B76C3B276C3C174C35A75113889CD3B70C34B70116389CD3B
1006 DATA 70C34B70E5C521E0964E060021B97009E9C3CB70C3D570C3C870C3DA70C3
1007 DATA E470C3E670E67FEAE670F680C3E670F680C3E670E67FE2E670F680C3E670
1008 DATA E67FC1E1C9D5DBEAE64028FA7BCDAC70D3EBD1C9DBEAE6802019CD450102
1009 DATA 007170B728F4FE0D2001C9FE1A2804FE1820E7C620320497C9DBEB473AE0
1010 DATA 96FE0678CA4B71E67FC34B713E04CDE171C3A37011CB983ACB98CB7FC428
1011 DATA 44ED7BD195C32D4011308CCD3B70C34B70E1232323E9F5C5D5E501F6FF11
1012 DATA FFFF0913DA5A71010A0009EB7CB5C450717BC630CD2F70E1D1C1F1C9E1E5
1013 DATA 223F95ED733D95ED53419521479522C99522CB95AF323A95323B953EFF32
1014 DATA 3C9511BC94CD3B70ED5B4195CD3B70C9ED7B3D9521479522CB953EFF323C
1015 DATA 952A3F95E9ED7B3D9521479522C99522CB95AF323A95323B953EFF323C95
1016 DATA 11BC94CD3B70ED5B4195CD3B702A3F95E9323995CD3074FE04CA6972FE01
1017 DATA CAB872FE02CA0774FE10CA0774FE03CA2D7401020072FE05CA0C72114694
1018 DATA CD3B70C9EB2243950600CD6874B7F25372E67FFE1B201A3E07CD2F70AF32
1019 DATA 3A952AC9952B22C99522CB95213B9535C31272FE3F2811FE20280DFE0CCC
1020 DATA 2670782A4395EBC34B71213A95360004FE613806FE7A3002E65F2A439577
1021 DATA 23224395C31272119194CD3B7011BC94CD3B70ED5B4195CD3B702ACB953E
1022 DATA 24772AC9952B22C995114795CD3B70AF323A95CD4900FE0D2816FE0C2812
1023 DATA FE04F82AC99523772322C995CD2F70C3A471FE0CCC2670C34B71224595ED
1024 DATA 5343951A4713ED53CD952ACB9522CF9578B7C82ACD955E231D7BFEFFFAB5
1025 DATA 73CD6874B7F2A573E67FFE3FC21B73AF323A95213B9535ED5B4595CD3B70
1026 DATA 11BC94CD3B70ED5B010200734195CD3B702ACB953E24772AC9952B22C995
1027 DATA 114795CD3B70C3A471FE1BC28673AF323A95D5C5E5CDD073C347733E07CD
1028 DATA 2F702AC9952B22C99522CB95213B9535E1C1D11CC3D4722AC9952BEBE1E5
1029 DATA 7EFE24CA637323EB7723EB3A3B953C323B95C34E733A3B953C323B95EB3E
1030 DATA 20772322C99522CB95E1E5EBCD3B703E20CD2F70E1C1D1C39973E5D5CDD0
1031 DATA 73C39773116B94CD3B70C3B771D1E11C160019235E23567BC34B71FE6138
1032 DATA 06FE7A3002E65F5623BACAD47216007BB7F2BE7316FF191103001922CD95
1033 DATA 052ACF9522CB95C3CC7205F81C4B7BB7C81600191E03194623EB2ACD957E
1034 DATA 914FB8CAEB73F02ACF950DFA4B71EB4623EB7E23FE613806FE7A30020102
1035 DATA 0074E65FB8C0C3EE73EB22C795EB2AC795063236202310FB2ACB95CD1C44
1036 DATA 2809117794CD3B70C3B77122CB95C34B71C30774F5D5E53A3A95B7C26474
1037 DATA 2AC99511C795AFED52452AC995CD4000DAB77178323B95B7CAB7712AC995
1038 DATA 5816001922C9953EFF323A95E1D1F1C9E5C53A3A95B7CC30742ACB957E23
1039 DATA 22CB95FE20CA8374FE09C296743A3C95B7C26A743EFF323C953E20C1E1C3
1040 DATA BE74F5AF323C95F1C1E1FE1BCABE74FE3FCAB574FE0DCAB574FE0ACAB574
1041 DATA FE0CC0E52ACB952B22CB95E1F680C92A2D4022619B3A2F4032639B2A3040
1042 DATA 22649B3A324032669B2A094422679B3A0B4432699BED736A9B2ACB957EFE
1043 DATA 0D2813FE20280CFE30FA5175FE3AF251751801020075052318E83E3132BE
1044 DATA 8B3EC3322D40323040320944212675222E40223140220A4421B88BC30544
1045 DATA 2A619B222D403A639B322F402A649B2230403A669B3232402A679B220944
1046 DATA 3A699B320B442A6A9BF9C34B7011CE8BCD3B70C34B703E02112F99CDE171
1047 DATA C34B703E04CDE171C3A370112F99CD2444CA7F75112F8ACD3B70C34B7011
1048 DATA 2F99CD2C44200911C08BCD3B70C34B70CDED75C34B703AE196FE20F2A975
1049 DATA 116A8BCD3B703AE196F640CD2F703E20CD2F70C9CDE6753E41320E97C3C3
1050 DATA 75113689CD3B703A629B4F0600211397093E2477111397CD3B70C9D5CDE6
1051 DATA 7511B091CD3B70D1CD3B70C911F591CD3B70C9B7C8F680F640CD0944C9D5
1052 DATA 11E291CD3B70D1CD010200763B7011FD91CD3B70C93E04CDE171C3A370AF
1053 DATA 320C973E313202973A0C97FE05FA2B7611708ACD3B70C34B703C320C97AF
1054 DATA 32619B3E0132629B21139736463E47CD1086C31A76CD1687C31A76FE59CA
1055 DATA 4B70FE45C21A76CDBD75C34B703E04CDE171C3A370CD6C76C34B70C34B70
1056 DATA AF320C973E313202973A0C97FE05FA847611A38ACD3B70C93C320C97AF32
1057 DATA 619B3E0132629B211397364C3E47CD1086C37D76CD1687C37576FE59CA4B
1058 DATA 71FE45C27576CDBD75C93E04CDE171C3A370CD6C76C34B70C330713E0311
1059 DATA FD98CDE171C3A3703E04CDE171C3A37021D79636FF21619A22E79611FD98
1060 DATA CD2444200C11FD98CD2C4411FD982AE796CD2044C24B70CDED75C34B0102
1061 DATA 0077703E04CDE171C3A37011018BCD3B70CD967511238BCD3B70CD2477CD
1062 DATA 6777C34B70C31877DBEAE680C8DBEBE67FFE0A28F35F3ADA96B728153AD9
1063 DATA 96B7C215787BFE7FC8FE1B200632D996C32477FE0CCA26703AD796B7C430
1064 DATA 783ADF96B7C463787BCD2F70C32477CD4570E67FB7CA4B715F3AE196BBCA
1065 DATA 92777BCDAC705FD5CD7278D13AD896B7CA4B717BE67FCD2F70C34B71CD96
1066 DATA 75CD4570B728FA47CD2F7078FE032807E65FFE43C2C77711468BCD3B703A
1067 DATA D796B7C8AF32D79611E98ACD3B7011FD98CD2844C9FE532006CDFE79C34B
1068 DATA 7178FE3F200911708FCD3B70C3957778E67FFE42200911978BCD3B70C34B
1069 DATA 7178FE3020083E00CDE970C34B715F3AE19601020078BB280A7BCDAC70CD
1070 DATA 7278C34B713E07CD2F70C34B71AF32D9967BFE41F8FE4CF0D64107072130
1071 DATA 925F160019EBCD3B70C97B2AED96772322ED96E5C121629BB7ED42C0D53E
1072 DATA 13CDE97011FD98CD3C44280611E789CD3B7021619A22ED963E11CDE970D1
1073 DATA C93AE837E6F0FE30C07BD5CD3B00D1C9B7C85FCDE970C911E19221708D3E
1074 DATA 01CDE171C39A70218F784F060009E9C31F79C35779C33979C3A370C3DB78
1075 DATA C34E79C39B79C3B379C3B978C34579C37479C30D79C3AA79C3C279118993
1076 DATA 21E68E3E01CDE171C39A70322D983E04CDE171C39A703A2D98320197C34B
1077 DATA 7011719321D48E3E01CDE171C39A7021F1784F060009E9C30279C3F7783E
1078 DATA 04CDE171C3A370C3010200794B703E04CDE171C3A370C34B7011BE94215B
1079 DATA 90CDD17932F496CD1A70C34B703E04CDE171C3A370110E8CCD3B70CD4900
1080 DATA CD2F7032E196C34B70CDCB793A2D9832D896C34B70CDCB7932DA96C34B70
1081 DATA CDCB7932DB96C34B70CDCB7932DC96B728063E03060118043E06060032E0
1082 DATA 967832D896C34B70112994215B8F3E01CDE171C39A70322D987A322E983E
1083 DATA 04CDE171C3A3702A2D987E32E496C34B70110A94213D90CDD17932DD96C3
1084 DATA 4B70CDCB7932DF96C34B7011D39321278FCDD17932E096C34B70CDCB7932
1085 DATA DE96C34B7011FC9321488F3E01CDE171C3E879322D983E04CDE171C3EC79
1086 DATA 3A2D98C9F1C39A70F1C3A3703E04CDFE79C34B70CDFE79C34B7011190102
1087 DATA 007A90CD3B701114903AD896B72803111090CD3B7011D090CD3B70111490
1088 DATA 3ADA96B72803111090CD3B7011E090CD3B703ADD96B7280CFE01112E9028
1089 DATA 081135901803112590CD3B7011EB90CD3B701114903ADC96B72803111090
1090 DATA CD3B7011F590CD3B701114903ADB96B72803111090CD3B70111B91CD3B70
1091 DATA 1114903ADE96B72803111090CD3B70112B91110391CD3B701114903ADF96
1092 DATA B72803111090CD3B70112B91CD3B703AE096115491FE0320051159911819
1093 DATA FE0C2005115E911810FE0920051164911807FE002003116891CD3B701135
1094 DATA 91CD3B703A0197CD2F70114991CD3B70110C91CD3B70CD9675113689CD3B
1095 DATA 70116D91CD3B703AF496D61121BE94017B000102007BEDB12323EBCD3B70
1096 DATA 117A91CD3B70C91113973E05CDE171C3A370B7282932629BEB3624CDCD7B
1097 DATA 11E491CD3B70111397CD3B703E31320297AF32619B3E52CD1086C3A370C3
1098 DATA 497BCDCD7BAF320497210000220897220A97320797320C9711CA91CD3B70
1099 DATA 210000CD50713E52320E9711B391CD3B702A0897CD50713A0E97FE44C287
1100 DATA 7BCD1F7EC36D7BFE46C2927BCD147DC36D7BFE52C29D7BCDE57BC36D7BFE
1101 DATA 43201611C38A3A0497B72807AF32049711AB8BCDF775C34B70FE41200911
1102 DATA CE8ACDF775C34B7011CE8ACDF775C34B70118191CD3B7011F688CD3B703E
1103 DATA 0032E29621619922E796C93A0C97FE10FAF67B117389CDD775C3527C3C32
1104 DATA 0C973E31320297CD0102007C1687C35B7CFE5320403A0C97320D97AF320C
1105 DATA 973A619B3CE63F3207972A0897232208973A629B211397CDB47C211397CD
1106 DATA 7F7C32629B3E59CD1086C3527C3A03973202973E46320E97C9FE45200BCD
1107 DATA B27518003E41320E97C9CD6E7C3A079732619BAF32629B3E4ECD1086C352
1108 DATA 7CC911CA91CD3B702A0A9723220A97CD5071C93AF696C62077233AF896C6
1109 DATA 2077233AFA96C62077233AFC96C640E67F77233AFE96C62077233A009777
1110 DATA 23364E233A039777233E08C93230987EDE2032F5963A3098FE03F823237E
1111 DATA DE2032F9963A3098FE04F8237EC640E67F32FB963A3098FE05F8237EDE20
1112 DATA 32FD963A3098FE06F8237E32FF963A3098FE07F8237E3A3098FE08F80102
1113 DATA 007D237E473A0197B8CA107D3E313A0397C93A0397C93A0C97FE05FA257D
1114 DATA 119089CDD775C3527C3C320C97CD1687C35B7CFE53C26E7D3A0D97FE10FA
1115 DATA 457D117389CDD775C3527C3C320D973A07973D473A619BB8C2587CCD6E7C
1116 DATA AF320C97211397CD7F7C32629B3E59CD1086C3527CC9FE5AC2A77D3A0D97
1117 DATA FE05FA847D11AE89CDD775C3527C3C320D973A07973D473A619BB8C2587C
1118 DATA CD6E7CAF320C9732629B3E59CD1086C3527CC9FE46C2F27D3A0797473A61
1119 DATA 9BB8C2587C3CE63F3207972A089723220897CDED84C3527CCDD97B3A0C97
1120 DATA 320D97AF320C9732629B3E59CD1086C3527C3E44320E97320497FE5AC8AF
1121 DATA 320497C9FE42C2147E3A0797473A619BB8C20102007E587CAF32629B3E59
1122 DATA CD1086C3527C3E43320E97C9FE45C2527CCDB275C3527C3A0C97FE05FA30
1123 DATA 7E11CE89CDD775C3527C3C320C97CD1687C35B7CFE44C2BC7E3A0797473A
1124 DATA 619BB8CA7E7E3A0D97FE05FA5B7E11CE89CDD775C3527C3C320D973A0797
1125 DATA 3D473A619BB8C2587CCD6E7CAF320C9732629B3E59CD1086C3527CC93CE6
1126 DATA 3F3207972A0897232208973A0C97320D973A629BCDC383C3527CAF320C97
1127 DATA 32629B4F320497B7CAB37E4F3E0132629B793213973E59CD1086C3527CC9
1128 DATA FE46C2F57E3A0D97FE05FAD27E119089CDD775C3527C3C320D973A07973D
1129 DATA 473A619BB8C2587CCD6E7CAF320C9732629B3E59CD1086C3527CC9FE5AC2
1130 DATA 587F3A0797473A610102007F9BB8C2587C3CE63F3207972A089723220897
1131 DATA 3A629BFE01C2227F3A1397FE44CA3D7F2AE7963AE2963DB7FA337F361A23
1132 DATA C3287F11CB98CD2844AF3204973A0C97320D97AF320C9732629B3E59CD10
1133 DATA 86C3527C3E46320E97C9FE45C2527CCDB275C3527CC5E5067A2151983620
1134 DATA 2310FBE1C13E05115198CDE171C34B703E04CDE171C34B70215198220597
1135 DATA CD9A843009112F8ACDD775C34B70CDCD7BAF320797320C97210000220897
1136 DATA 220A9711CA91CD3B70210000CD50713E313202973E53320E9711B391CD3B
1137 DATA 702A0897CD50713A0E97FE442006CDCE81C3C17FFE462006CDD280C3C17F
1138 DATA FE5A2006CDA582C3C17FFE532006CD2E80C3C17FFE422006CD4D83C30102
1139 DATA 0080C17FFE43201211C38A3A0497B7280311AB8BCDF775C34B70FE412009
1140 DATA 11CE8ACDF775C34B7011CE8ACDF775C34B703A0C97FE10FA3F8011FA89CD
1141 DATA D775C3527C3C320C973E313202973A0197320397211397CD7F7C32629B3A
1142 DATA 089732619B3E53CD1086C3527CCD1687C32E70FE59C2AB803A0797473A61
1143 DATA 9BB8C03CE63F3207972A0897232208973A629B211397CDB47C3A0C97320D
1144 DATA 97AF320C973A03973202973E46320E97CDD384C3527CC9FE4EC2C780CD6E
1145 DATA 7C3A07973C473A619BB8C0AF320C973E46320E97C9FE45C2527CCDB275C3
1146 DATA 527C3A0C97FE05FAE38011FA89CDD775C3527C3C320C97AF320497211397
1147 DATA 22EB9621319822E99606000E0078FE08C20E01020081813E2E2AEB967723
1148 DATA 22EB9606080C0478FE0CF239812AE9967EE67F2322E996FE21FA39812AEB
1149 DATA 96FE2FCA0181FE3A2809772322EB960CC3FB807932629B2AEB963E247711
1150 DATA E491CD3B70111397CD3B703A079732619B3E46CD1086C3527CCD1687C32E
1151 DATA 70FE59C2AE813A0797473A619BB8C03CE63F3207972A0897232208973A0C
1152 DATA 97320D97AF320C97AF32D5963EFF32D696CD0984C39A81C3A581FEFFC252
1153 DATA 7C3E5A320E97C932F3963E44320E97C9FE4EC2C381CD6E7C3A07973C473A
1154 DATA 619BB8C0C37181FE45C2527CCDB275C3527C3A0C97FE05FADF8111FA89CD
1155 DATA D775C3527C3C320C9721139722EB9621CD9722EF9606012AEF967E2322EF
1156 DATA 962AEB96772322EB0102008296043AF396B8F2F1813AF39632629B3A0797
1157 DATA 32619B3E44CD1086C3527CCD1687C32E70FE59C285823A0797473A619BB8
1158 DATA C03A619B3CE63F3207972A0897232208973A0C97320D97AF320C973A629B
1159 DATA FE01C264823A1397FE5A2003320497FE5820033204973A0497B728063E5A
1160 DATA 320E97C9CD0984C37A8232F396C9FEFFC2527C3E5A320E97C9FE4EC29A82
1161 DATA CD6E7C3A07973C473A619BB8C0C37082FE45C2527CCDB275C3527C3A0C97
1162 DATA FE05FAB68211FA89CDD775C3527C3C320C973A079732619BAF32629B3A04
1163 DATA 97B7280A3E443213973E0132629B3E5ACD1086C3527CCD1687C32E70FE59
1164 DATA 20483A0797473A619BB8C03CE63F3207972A0897232208973A0C97320102
1165 DATA 00830D97AF320C9711CB98CD28443A0497FE5A2815CD9A843810CDD384C3
1166 DATA 527CAF3204973E46320E97C93E42320E97C9FE4E2010CD6E7C3A07973C47
1167 DATA 3A619BB8C0C3EF82FE45C2527CCDB275C3527C3A0C97FE05FA5E8311FA89
1168 DATA CDD775C3527C3C320C973A079732619BAF32629B3E42CD1086C3527CCD16
1169 DATA 87C32E70FE5920263A0797473A619BB8C03CE63F3207972A089723220897
1170 DATA 3A0C97320D97AF320C973E43320E97C9FE4E2010CD6E7C3A07973C473A61
1171 DATA 9BB8C0C38783FE45C2527CCDB275C3527C322D9821139722E5963A009747
1172 DATA 212D9835FA4B712AE5967E2322E596B8C2FD837E2322E596212D983557E6
1173 DATA 805F7AE67FB8CAFC837AC640E67FB311CB9801020084CD1B00C22E70C3D0
1174 DATA 833AFF964F3AD596B7C03AD696B7280206003A0297D631473AF596D60590
1175 DATA 322D9821CD9722EF9606003A2D983DF23C8478C34B71322D9811CB98CD13
1176 DATA 00C2918457E6805F7AE67FFE20FA6D84FE7FCA6D84B9C28484212D98352A
1177 DATA EF96772322EF9604C38484322E98212D98352AEF96712322EF96043A2E98
1178 DATA C640E67F2AEF96B3772322EF9604C331843EFF32D59678C34B71D29E843F
1179 DATA C5D5E5063221CB9836202310FB062021319836202310FB2A0597113198CD
1180 DATA 1C44220597200D21319811CB98CD1C44E1D1C1C93718F93EFF32D696AF32
1181 DATA D596E511CB98216199CD2444E1C2ED75C34B7121139722EB9621CB9822E9
1182 DATA 96AF322D98322E9801020085063236202310FB2AEB967E2322EB96FE2EC2
1183 DATA 21853A2D98322E98AF322D98C35185B7CA7A852AE996772322E9963A2D98
1184 DATA 3C322D98FE08FA0785322E98AF322D982AEB967E2322EB96B7CA7A85FE2E
1185 DATA C239852AE996362F2322E9962AEB967E2322EB96B7CA7A852AE996772322
1186 DATA E9963A2D983C322D98FE03FA5A852AEB96362411E491CD3B70111397CD3B
1187 DATA 702AE99636033ADB96B7CAF98511CB98216199CD2444C2F98511D68ACDD7
1188 DATA 7511CB98CD28442AE9962B7EFE4238FA3522E99611CB98216199CD2444C2
1189 DATA DD8511CB98CD28442AE996B7ED5220D911468ACD3B70C921CB98113198CD
1190 DATA 1C443E3A010E00213198EDB1233624113198CD3B7011CB98216199CD0102
1191 DATA 00862044CA4B71F511E789CDD775F1C3ED7532639B210F973E0177233A02
1192 DATA 97D631473A629BC6238077230100004F3A619BC6207723814F3E0088473A
1193 DATA 639B7723814F3E0088473A629BB7CA5A863D32629B7E23814F3E008847C3
1194 DATA 44863A0297FE32CA8B86D2748679E6C0070781E63FC6207723C3A2863600
1195 DATA E5211097CD8088E14B427A07070707E60FC620772378E60F070747790707
1196 DATA E603B0C620772379E63FC62077233AFD967723AF773ADE96B72804233E24
1197 DATA 77CDBC86C32E70C34B713AF996322D983A2D983DB7FAD786322D983AFB96
1198 DATA 5FCDE970C3C2863ADC96B7CAF1863A0E97FE53CAF186CDF870C3F186FE11
1199 DATA C2E6863ADE96B7280C111C92CD3B7011109701020087CD3B70210F977EB7
1200 DATA CA13875FCDE97023C30687C34B71CD3888C32E70CD7288C31687FE0120F6
1201 DATA CD7288C32E70FE0128F63210974F3A0297D6314779D6239032629B0600CD
1202 DATA 7288C32E70FE0128D932619B321197814F3E0088473A619BD62032619BCD
1203 DATA 7288C32E70FE01CA2687322D98321297814F3E0088473A629B322E982113
1204 DATA 9722EB963A2E98D601FAAA87322E98CD7288C32E70FE01CA26872AEB9677
1205 DATA 2322EB96814F3E00884718DACD7288C32E70FE01CA2687D620322F983A02
1206 DATA 97FE32CA0488D2D98779E6C0070781E63F473A2F98B8CA2D88CD6E7CC92A
1207 DATA EB963600211097CD80884B427A07070707E60F573A2F98BA20E1CD7288C3
1208 DATA 2E70FE01CA2687D60102008820322F9878E60F070747790707E603B0473A
1209 DATA 2F98B8C2D587CD7288C32E70FE01CA2687D6204779E63FB8C2D5872AEB96
1210 DATA 36003A2D98C34B71216D9722F196CDF870C32E702AF196772322F196473A
1211 DATA FE96B820EB3ADE96B728103E247723110B92CD3B70116E97CD3B70216D97
1212 DATA 22F196C34B712AF1967E2322F196FE0DC24B71C9E5C51100007EB7CAB388
1213 DATA E5AB5FE60F4F060021D6880909E57B0F0F0FE61E4F21B688097EAA2356E1
1214 DATA AE5F237EAA57E123C38588C1E1C900008110022183310442855206638773
1215 DATA 088489940AA58BB50CC68DD60EE78FF70000891112239B322446AD573665
1216 DATA BF74488CC19D5AAFD3BE6CCAE5DB7EE9F7F80D4E756D626572206F660102
1217 DATA 0089207061636B6574733A0D4E756D626572206F6620726574726965733A
1218 DATA 0D46696C65206E616D653A244B65726D69742D54525338303E240D240D3F
1219 DATA 556E7265636F676E697A656420636F6D6D616E64240D3F496C6C6567616C
1220 DATA 20636861726163746572240D3F4E6F7420636F6E6669726D6564243F556E
1221 DATA 61626C6520746F207265636569766520696E6974696174650D243F556E61
1222 DATA 626C6520746F20726563656976652066696C65206E616D650D243F556E61
1223 DATA 626C6520746F207265636569766520656E64206F662066696C650D243F55
1224 DATA 6E61626C6520746F207265636569766520646174610D243F53797374656D
1225 DATA 20444F53206572726F720D243F556E61626C0102008A6520746F20726563
1226 DATA 6569766520616E2061636B6E6F776C656467656D656E742066726F6D2074
1227 DATA 686520686F73740D240D3F556E61626C6520746F2066696E642066696C65
1228 DATA 0D243F556E61626C6520746F2072656E616D652066696C65240D3F537973
1229 DATA 74656D20444F53206572726F72240D3F556E61626C6520746F2074656C6C
1230 DATA 20686F73742074686174207468652073657373696F6E2069732066696E69
1231 DATA 73686564240D3F556E61626C6520746F2074656C6C20686F737420746F20
1232 DATA 6C6F676F75742407436F6D706C6574656424074661696C6564242552656E
1233 DATA 616D696E672066696C6520746F20240D3C436C6F73696E6720746865206C
1234 DATA 6F672066696C653E0102008B240D3C436F6E6E656374656420746F207265
1235 DATA 6D6F746520686F73742C207479706520244320746F2072657475726E3E0D
1236 DATA 3C434C4541523E20697320436F6E74726F6C2D5F0D240D3C436F6E6E6563
1237 DATA 74696F6E20636C6F7365642C206261636B206174206D6963726F3E242043
1238 DATA 6F6E74726F6C2D24202854797065204C656674204172726F7720746F2073
1239 DATA 656E64204354524C2D53290D2420284E6F7420696D706C656D656E746564
1240 DATA 290D2407496E7465727275707465642444495220203A300D0D46696C6520
1241 DATA 4B494C4C4544240D0D2B2B20426164206472697665206E616D65240D2043
1242 DATA 6F6E6669726D2077697468203C454E5445523E2C2063616E63656C200102
1243 DATA 008C77697468203C425245414B3E20240D5479706520746865206E657720
1244 DATA 657363617065206368617261637465723A2020240D42594520746F20686F
1245 DATA 737420284C4F474F55542920616E64206578697420746F20444F530D434F
1246 DATA 4E4E45435420746F20686F7374206F6E2073656C656374656420706F7274
1247 DATA 0D444952206F66206C6F63616C206469736B0D4558495420746F20444F53
1248 DATA 0D46494E4953482072756E6E696E67204B65726D6974206F6E2074686520
1249 DATA 686F73740D48454C5020627920676976696E672074686973206D65737361
1250 DATA 67650D4B494C4C20612066696C650D4C4F4720746865207465726D696E61
1251 DATA 6C2073657373696F6E20746F20612066696C0102008D650D4C4F474F5554
1252 DATA 2074686520686F73740D524543454956452066696C652066726F6D20686F
1253 DATA 73740D53454E442066696C6520746F20686F73740D534554206120706172
1254 DATA 616D657465720D53484F572074686520706172616D65746572730D535441
1255 DATA 545553206F66204B65726D6974240D42417564202872617465290D424C6F
1256 DATA 636B2D636865636B2D747970652028666F72206572726F72206465746563
1257 DATA 74696F6E0D444542756767696E67206D6F64652028746F20646973706C61
1258 DATA 79207061636B657473290D45736361706520286368617261637465722064
1259 DATA 7572696E6720434F4E4E454354290D46696C652D6D6F64652028666F7220
1260 DATA 6F7574676F696E670102008E2066696C6573290D49626D20287061726974
1261 DATA 7920616E64207475726E2061726F756E642068616E646C696E67290D4C6F
1262 DATA 63616C2D6563686F202868616C662F6475706C6578290D50417269747920
1263 DATA 28666F7220636F6D6D756E69636174696F6E206C696E65290D504F727420
1264 DATA 28746F20636F6D6D756E6963617465206F6E290D5052696E746572202874
1265 DATA 6F207072696E74207465726D696E616C2073657373696F6E290D56743532
1266 DATA 2D656D756C6174696F6E0D5761726E696E672028666F722066696C656E61
1267 DATA 6D6520636F6E666C6963747329240D5041442D434841520D50414444494E
1268 DATA 47240D312D4348415241435445522D434845434B53554D0D322D43480102
1269 DATA 008F415241435445522D434845434B53554D0D332D434841524143544552
1270 DATA 2D4352432D4343495454240D4556454E2020204D41524B20204E4F4E4520
1271 DATA 20204F44442020205350414345240D4F464620204F4E240D4E4F20202059
1272 DATA 4553240D5354414E4441524420525332333220706F7274240D3F20205468
1273 DATA 6973206D6573736167650D432020436C6F73652074686520636F6E6E6563
1274 DATA 74696F6E0D302020287A65726F29205472616E736D69742061204E554C4C
1275 DATA 0D532020537461747573206F662074686520636F6E6E656374696F6E0D54
1276 DATA 79706520746865206573636170652063686172616374657220616761696E
1277 DATA 20746F2073656E6420697420746F207468650102009020686F73740D0D43
1278 DATA 6F6D6D616E643E24206F6E24206F6666240D4C6F63616C206563686F2420
1279 DATA 64656661756C7424204153434949242062696E617279240D415343494920
1280 DATA 2020202042494E415259202020202044454641554C54240D202020202035
1281 DATA 302020202020373520202020203131302020203133342E35202020203135
1282 DATA 3020202033303020202036303020202020313230300D2020203138303020
1283 DATA 202032303030202020203234303020202020333630302020203438303020
1284 DATA 20373230302020393630302020203139323030240D5654353220656D756C
1285 DATA 6174696F6E240D46696C65204D6F6465240D49424D20666C6167240D4669
1286 DATA 6C65207761726E69010200916E67240D5072696E746572240D4573636170
1287 DATA 6520636861723A20240D446562756767696E67206D6F6465240D50617269
1288 DATA 74793A20240D426C6F636B20636865636B20747970653A20242D63686172
1289 DATA 6163746572246E6F6E65246D61726B247370616365246F6464246576656E
1290 DATA 244C696E652053706565643A202420426175640D241C1F0D244B65726D69
1291 DATA 742D3830205620332E3520285452532D3830204D6F64656C20312F33290D
1292 DATA 24082008242008241D1E241C1A1A19191919191919191919191919191919
1293 DATA 191919241C1A1A1A19191919191919191919191919191919191919241C24
1294 DATA 1C1A1A1A1A1919191919191919191919241C1A1A1A1A1A1A241C1A1A0102
1295 DATA 00921A1A1A1A1A1A1A1A1A1A241C1A1A1A1A1A1A1A1F525061636B3A2024
1296 DATA 1C1A1A1A1A1A1A1A1A1A1A1F535061636B3A20241B2400001A2400001924
1297 DATA 0000182400001C1F240024000024240000241C2400001B2400001F240000
1298 DATA 1E24100342594524212107434F4E4E454354240000034449522424240345
1299 DATA 524124272704455849542403030646494E495348241B1B03474554240C0C
1300 DATA 0448454C50240606044B494C4C242727034C4F47240909064C4F474F5554
1301 DATA 241E1E0752454345495645240C0C0453454E44240F0F0353455424121204
1302 DATA 53484F57241515065354415455532418180C044241554424212110424C4F
1303 DATA 434B2D434845434B2D545950452418180944010200934542554747494E47
1304 DATA 242727064553434150452400000946494C452D4D4F44452412120349424D
1305 DATA 2403030A4C4F43414C2D4543484F2406060650415249545924151504504F
1306 DATA 5254241E1E075052494E5445522424240E565435322D454D554C4154494F
1307 DATA 4E241B1B075741524E494E47240F0F02085041442D434841522400000750
1308 DATA 414444494E472403030314312D4348415241435445522D434845434B5355
1309 DATA 4D24313114322D4348415241435445522D434845434B53554D2432321533
1310 DATA 2D4348415241435445522D4352432D434349545424333305044556454E24
1311 DATA 0000044D41524B240303044E4F4E45240606034F44442409090553504143
1312 DATA 45240C0C02024F4E01020094240101034F46462400000305415343494924
1313 DATA 01010642494E4152592402020744454641554C5424000001085354414E44
1314 DATA 41524424EB00EB0002024E4F240000035945532401010D3F50726F677261
1315 DATA 6D206572726F723A2020496E76616C696420434F4D4E442063616C6C240D
1316 DATA 3F416D626967756F7573240D3F496C6C6567616C20696E7075742066696C
1317 DATA 6520737065632420436F6E6669726D2077697468203C454E5445523E2C20
1318 DATA 43616E63656C2077697468203C425245414B3E240D241002353024000002
1319 DATA 373524111103313130242222053133342E35243333033135302444440333
1320 DATA 30302455550336303024666604313230302477770431383030248888013B
1321 DATA 00950432303030249999043234303024AAAA043336303024BBBB04343830
1322 DATA 3024CCCC043732303024DDDD043936303024EEEE05313932303024FFFF01
1323 DATA 0DD796000000010100000000061F0104ED96619A0112F49655205E080500
1324 DATA 0000000D0D2323313131010405975198020200706967756F7573240D3F49
1325 DATA 6C6C6567616C20696E7075742066696C6520737065632420436F6E666972
1326 DATA 6D2077697468203C454E5445523E2C2043616E63656C2077697468203C42
1327 DATA 5245414B3E240D2410023530240000023735241111033131302422220531
1328 DATA 33342E352433330331353024444403333030245555033630302466660431
1329 DATA 3230302477770431383030248888013B0095043230303024999904323430
1330 DATA 3024AAAA043336303024BBBB043438303024CCCC043732303024DDDD0439
1331 DATA 36303024EEEE05313932303024FFFF010DD796000000010100000000061F
1332 DATA 0104ED96619A0112F49655205E0805000000000D0D232331
10570 DATA "*"
<<< trsget.src >>>
; RECEIVE COMMAND
READ: LD DE,DATA ; WHERE TO PUT THE TEXT (IF ANY.)
LD A,CMTXT
CALL COMND ; GET EITHER SOME TEXT OR A CONFIRM.
JP KERMT3 ; DIDN'T GET ANYTHING.
OR A ; GET ANY CHARS?
JR Z,READ1 ; NOPE, JUST A REGULAR SEND.
LD (ARGBLK+1),A ; STORE THE NUMBER OF CHARS.
EX DE,HL ; GET POINTER INTO HL.
LD (HL),'$' ; PUT IN A DOLLAR SIGN FOR PRINTING.
CALL INIT ; CLEAR THE LINE AND INITIALIZE THE BUFFERS.
LD DE,SCRFLN ; POSITION CURSOR
CALL PRTSTR
LD DE,DATA ; PRINT THE FILE NAME
CALL PRTSTR
LD A,'1' ; START WITH SINGLE CHARACTER CHECKSUM
LD (CURCHK),A ; SAVE THE TYPE
XOR A ; START A PACKET ZERO.
LD (ARGBLK),A
LD A,'R' ; RECEIVE INIT PACKET.
CALL SPACK ; SEND THE PACKET.
JP KERMT3 ; DIE!
JP READ12
READ1: CALL INIT ; CLEAR THE LINE AND INITIALIZE THE BUFFERS.
READ12: XOR A
LD (CZSEEN),A
LD HL,0
LD (NUMPKT),HL ; SET THE NUMBER OF PACKETS TO ZERO.
LD (NUMRTR),HL ; SET THE NUMBER OF RETRIES TO ZERO.
LD (PKTNUM),A ; SET THE PACKET NUMBER TO ZERO.
LD (NUMTRY),A ; SET THE NUMBER OF TRIES TO ZERO.
LD DE,SCRNRT ; POSITION CURSOR
CALL PRTSTR
LD HL,0
CALL NOUT ; WRITE THE NUMBER OF RETRIES.
LD A,'R'
LD (STATE),A ; SET THE STATE TO RECEIVE INITIATE.
; RECEIVE STATE TABLE SWITCHER.
READ2: LD DE,SCRNP ; POSITION CURSOR
CALL PRTSTR
LD HL,(NUMPKT)
CALL NOUT ; WRITE THE CURRENT PACKET NUMBER.
LD A,(STATE) ; GET THE STATE.
CP 'D' ; ARE WE IN THE DATA RECEIVE STATE?
JP NZ,READ3
CALL RDATA
JP READ2
READ3: CP 'F' ; ARE WE IN THE FILE RECEIVE STATE?
JP NZ,READ4
CALL RFILE ; CALL RECEIVE FILE.
JP READ2
READ4: CP 'R' ; ARE WE IN THE RECEIVE-INITIATE STATE?
JP NZ,READ5
CALL RINIT
JP READ2
READ5: CP 'C' ; ARE WE IN THE RECEIVE-COMPLETE STATE?
JR NZ,READ6
LD DE,INFMS3 ; PUT IN "COMPLETE" MESSAGE.
LD A,(CZSEEN)
OR A ; . . .
JR Z,READ5A ; NO.
XOR A ; YES, CLEAR FLAG.
LD (CZSEEN),A
LD DE,INMS13 ; ISSUE "INTERRUPTED" MESSAGE.
READ5A: CALL FINMES ; PRINT COMPLETION MESSAGE IN RIGHT PLACE.
JP KERMIT
READ6: CP 'A' ; ARE WE IN THE RECEIVE-"ABORT" STATE?
JR NZ,READ7
LD DE,INFMS4 ; PRINT MESSAGE.
CALL FINMES
JP KERMIT
READ7: LD DE,INFMS4 ; ANYTHING ELSE IS EQUIVALENT TO "ABORT".
CALL FINMES
JP KERMIT
; INITIALIZE BUFFERS AND CLEAR LINE.
INIT: LD DE,OUTLIN ; PUT BANNER ON SCREEN
CALL PRTSTR
LD DE,OUTLN2 ; PUT STATISTICS HEADERS ON THE SCREEN
CALL PRTSTR ; ONLY FOR SCREEN-FORMATTING VERSIONS.
INIT1: LD A,BUFSIZ ; BUFFER SIZE.
LD (CHRCNT),A ; NUMBER OF CHARS LEFT.
LD HL,BUFF ; ADDR FOR BEGINNING.
LD (BUFPNT),HL ; STORE ADDR FOR BEGINNING.
RET
; RECEIVE ROUTINES
; RECEIVE INIT
RINIT: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP IMXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,RINIT2
LD DE,ERMES4
CALL ERROR3 ; MOVE CURSOR AND PRINT AN ERROR MESSAGE.
JP ABORT ; CHANGE THE STATE TO ABORT.
RINIT2: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,'1' ; RESET BLOCK CHECK TYPE TO SINGLE CHARACTER
LD (CURCHK),A ; STORE AS CURRENT TYPE FOR INITIALIZATION
CALL RPACK ; GET A PACKET.
JP NAK ; TRASHED PACKET: NAK, RETRY.
CP 'S' ; IS IT A SEND INITIATE PACKET?
JR NZ,RINIT3 ; IF NOT SEE IF ITS AN ERROR.
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD A,(ARGBLK) ; RETURNED PACKET NUMBER. (SYNCHRONIZE THEM.)
INC A ; INCREMENT IT.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(ARGBLK+1) ; GET THE NUMBER OF ARGUMENTS RECEIVED.
LD HL,DATA ; GET A POINTER TO THE DATA.
CALL SPAR ; GET THE DATA INTO THE PROPER VARIABLES.
LD HL,DATA ; GET A POINTER TO OUR DATA BLOCK.
CALL RPAR ; SET UP THE RECEIVE PARAMETERS.
LD (ARGBLK+1),A ; STORE THE RETURNED NUMBER OF ARGUMENTS.
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
LD A,(INICHK)
LD (CURCHK),A ; FOR ALL FUTURE PACKETS
LD A,'F' ; SET THE STATE TO FILE SEND.
LD (STATE),A
RET
RINIT3: CP 'E' ; IS IT AN ERROR PACKET.
JR NZ,NAK0 ; IF NOT NAK WHATEVER IT IS.
CALL ERROR
JR ABORT
; THESE ARE SOME UTILITY ROUTINES.
; ABORT
ABORT: LD A,'A' ; OTHERWISE ABORT.
LD (STATE),A
RET
; NAK
NAK0: CALL UPDRTR ; UPDATE NUMBER OF RETRIES.
NAK: LD A,(PKTNUM) ; GET THE PACKET NUMBER WE'RE WAITING FOR.
LD (ARGBLK),A
XOR A ; NO DATA.
LD (ARGBLK+1),A
LD A,'N' ; NAK THAT PACKET.
CALL SPACK
JP ABORT ; GIVE UP.
RET ; GO AROUND AGAIN.
UPDRTR: LD DE,SCRNRT ; POSITION CURSOR
CALL PRTSTR
LD HL,(NUMRTR)
INC HL ; INCREMENT THE NUMBER OF RETRIES
LD (NUMRTR),HL
CALL NOUT ; WRITE THE NUMBER OF RETRIES.
RET
; THIS ROUTINE SETS UP THE DATA FOR INIT PACKET (EITHER THE
; SEND_INIT OR ACK PACKET).
RPAR: LD A,(RPSIZ) ; GET THE RECEIVE PACKET SIZE.
ADD A,' ' ; ADD A SPACE TO MAKE IT PRINTABLE.
LD (HL),A ; PUT IT IN THE PACKET.
INC HL ; POINT TO THE NEXT CHAR.
LD A,(RTIME) ; GET THE RECEIVE PACKET TIME OUT.
ADD A,' ' ; ADD A SPACE.
LD (HL),A ; PUT IT IN THE PACKET.
INC HL
LD A,(RPAD) ; GET THE NUMBER OF PADDING CHARS.
ADD A,' '
LD (HL),A
INC HL
LD A,(RPADCH) ; GET THE PADDING CHAR.
ADD A,100O ; UNCONTROL IT.
AND 7FH
LD (HL),A
INC HL
LD A,(REOL) ; GET THE EOL CHAR.
ADD A,' '
LD (HL),A
INC HL
LD A,(RQUOTE) ; GET THE QUOTE CHAR.
LD (HL),A
INC HL
LD (HL),'N' ; WE DO NOT DO 8-BIT QUOTING YET
INC HL ; ADVANCE TO NEXT
LD A,(INICHK)
LD (HL),A ; STORE IT
INC HL ; ADVANCE POINTER
LD A,08H ; SIX PIECES OF DATA.
RET
; THIS ROUTINE READS IN ALL THE SEND_INIT PACKET INFORMATION.
SPAR: LD (TEMP4),A ; SAVE THE NUMBER OF ARGUMENTS.
LD A,(HL) ; GET THE MAX PACKET SIZE.
SUB 20H ; SUBTRACT A SPACE.
LD (SPSIZ),A ; SAVE IT.
LD A,(TEMP4)
CP 3 ; FEWER THAN THREE PIECES?
RET M ; IF SO WE ARE DONE.
INC HL
INC HL ; INCREMENT PAST THE TIME OUT INFO.
LD A,(HL) ; GET THE NUMBER OF PADDING CHARS.
SUB 20H
LD (SPAD),A
LD A,(TEMP4)
CP 4 ; FEWER THAN FOUR PIECES?
RET M ; IF SO WE ARE DONE.
INC HL
LD A,(HL) ; GET THE PADDING CHAR.
ADD A,100O ; RE-CONTROLIFY IT.
AND 7FH
LD (SPADCH),A
LD A,(TEMP4)
CP 5 ; FEWER THAN FIVE PIECES?
RET M ; IF SO WE ARE DONE.
INC HL
LD A,(HL) ; GET THE EOL CHAR.
SUB 20H
LD (SEOL),A
LD A,(TEMP4)
CP 6 ; FEWER THAN SIX PIECES?
RET M ; IF SO WE ARE DONE.
INC HL
LD A,(HL) ; GET THE QUOTE CHAR.
LD (SQUOTE),A
LD A,(TEMP4) ; GET THE AMOUNT OF DATA SUPPLIED
CP 7 ; HAVE AN 8-BIT QUOTE?
RET M ; IF NOT THERE, ALL DONE
INC HL ; YES, GET THE CHARACTER
LD A,(HL) ; GET THE SUPPLIED CHARACTER
; PERHAPS WE SHOULD VALIDATE THAT THE 8-BIT QUOTE CHARACTER IS ONLY
; 'Y' OR 'N', HOWEVER, IF THE OTHER END REALLY DESIRES 8-BIT QUOTING,
; IT SHOULD GIVE AN ERROR DUE TO OUR STATING THAT WE DO NOT DO 8-BIT
; QUOTING AT ALL.
LD A,(TEMP4) ; DETERMINE IF BLOCK CHECK TYPE GIVEN
CP 8 ; IS THE FIELD THERE?
RET M ; IF NOT, ALL DONE
INC HL ; POINT TO THE CHARACTER
LD A,(HL) ; GET THE VALUE
LD B,A ; COPY VALUE
LD A,(CHKTYP) ; GET OUR TYPE
CP B ; IS IT OUR DESIRED TYPE?
JR Z,SPAR01 ; IF SO, USE IT
LD A,'1' ; NO, USE SINGLE CHARACTER
SPAR01: LD (INICHK),A
RET ; AND RETURN
; RECEIVE FILE
RFILE: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,RFILE1
LD DE,ERMES5
CALL ERROR3 ; MOVE CURSOR AND PRINT AN ERROR MESSAGE.
JP ABORT ; CHANGE THE STATE TO ABORT.
RFILE1: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
CALL RPACK ; GET A PACKET.
JP NAK ; TRASHED PACKET: NAK, RETRY.
CP 'S' ; IS IT A SEND INITIATE PACKET?
JP NZ,RFILE2 ; NO, TRY NEXT TYPE.
LD A,(OLDTRY) ; GET THE NUMBER OF TRIES.
CP IMXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,RFIL12 ; IF NOT PROCEED.
LD DE,ERMES4
CALL ERROR3 ; MOVE CURSOR AND PRINT AN ERROR MESSAGE.
JP ABORT ; CHANGE THE STATE TO ABORT.
RFIL12: INC A ; INCREMENT IT.
LD (OLDTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
DEC A ; DECREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER
CP B ; IS THE PACKET'S NUMBER ONE LESS THAN NOW?
JP NZ,NAK0 ; NO, NAK AND TRY AGAIN.
CALL UPDRTR ; UPDATE THE RETRY COUNT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD HL,DATA ; GET A POINTER TO OUR DATA BLOCK.
CALL RPAR ; SET UP THE PARAMETER INFORMATION.
LD (ARGBLK+1),A ; SAVE THE NUMBER OF ARGUMENTS.
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
RET
RFILE2: CP 'Z' ; IS IT AN EOF PACKET?
JP NZ,RFILE3 ; NO, TRY NEXT TYPE.
LD A,(OLDTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,RFIL21 ; IF NOT PROCEED.
LD DE,ERMES6
CALL ERROR3 ; MOVE CURSOR AND PRINT AN ERROR MESSAGE.
JP ABORT ; CHANGE THE STATE TO ABORT.
RFIL21: INC A ; INCREMENT IT.
LD (OLDTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
DEC A ; DECREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER
CP B ; IS THE PACKET'S NUMBER ONE LESS THAN NOW?
JP NZ,NAK0 ; NO, NAK IT AND TRY AGAIN.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
XOR A
LD (NUMTRY),A ; RESET NUMBER OF TRIES.
LD (ARGBLK+1),A ; NO DATA. (THE PACKET NUMBER IS IN ARGBLK.)
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
RET
RFILE3: CP 'F' ; START OF FILE?
JP NZ,RFILE4
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD B,A
LD A,(ARGBLK)
CP B ; IS IT THE RIGHT PACKET NUMBER?
JP NZ,NAK0 ; NO, NAK IT AND TRY AGAIN.
INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
CALL GOFIL ; GET A FILE TO WRITE TO.
JP ABORT
CALL INIT1 ; INITIALIZE ALL THE BUFFERS.
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD (ARGBLK+1),A ; NO DATA. (THE PACKET NUMBER IS IN ARGBLK.)
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT
LD A,'D' ; SET THE STATE TO DATA RECEIVE.
LD (STATE),A
LD (CZSEEN),A
CP 'Z' ; AND DIDN'T WANT ANY MORE
RET Z ; IF THAT WAS THE REQUEST, KEEP TELLING OTHER END
XOR A ; OTHERWISE, CLEAR FLAG (CONTROL-X IS ONLY FOR ONE FILE)
LD (CZSEEN),A
RET
RFILE4: CP 'B' ; END OF TRANSMISSION.
JP NZ,RFILE5
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD B,A
LD A,(ARGBLK)
CP B ; IS IT THE RIGHT PACKET NUMBER?
JP NZ,NAK0 ; NO, NAK IT AND TRY AGAIN.
XOR A ; NO DATA. (PACKET NUMBER ALREADY IN ARGBLK).
LD (ARGBLK+1),A
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT
LD A,'C' ; SET THE STATE TO COMPLETE.
LD (STATE),A
RET
RFILE5: CP 'E' ; IS IT AN ERROR PACKET.
JP NZ,ABORT
CALL ERROR
JP ABORT
; RECEIVE DATA
RDATA: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,RDATA1
LD DE,ERMS10
CALL ERROR3 ; DISPLAY ERROR MESSAGE.
JP ABORT ; CHANGE THE STATE TO ABORT.
RDATA1: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
CALL RPACK ; GET A PACKET.
JP NAK ; TRASHED PACKET: NAK, RETRY.
CP 'D' ; IS IT A DATA PACKET?
JP NZ,RDATA2 ; NO, TRY NEXT TYPE.
RDAT11: LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER.
CP B ; IS THE PACKET'S NUMBER CORRECT?
JP Z,RDAT14
LD A,(OLDTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,RDAT12 ; IF NOT PROCEED.
LD DE,ERMS10
CALL ERROR3 ; DISPLAY ERR MSG.
JP ABORT ; CHANGE THE STATE TO ABORT.
RDAT12: INC A ; INCREMENT IT.
LD (OLDTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
DEC A ; DECREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER
CP B ; IS THE PACKET'S NUMBER ONE LESS THAN NOW?
JP NZ,NAK0 ; NO, NAK IT AND TRY AGAIN.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
XOR A
LD (NUMTRY),A ; RESET NUMBER OF TRIES.
LD (ARGBLK+1),A ; NO DATA. (THE PACKET NUMBER IS IN ARGBLK.)
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
RET
RDAT14: INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
LD A,(ARGBLK+1) ; GET THE LENGTH OF THE DATA.
CALL PTCHR
JP ABORT ; UNABLE TO WRITE OUT CHARS; ABORT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD (ARGBLK+1),A ; NO DATA. (PACKET NUMBER STILL IN ARGBLK.)
LD C,A ; ASSUME NO DATA
LD (CZSEEN),A
OR A ; . . .
JP Z,RDAT15 ; ZERO IF NOT TYPED
LD C,A ; GET THE TYPE OF CHARACTER TYPED
LD A,1 ; ONE DATA CHARACTER
LD (ARGBLK+1),A ; SAVE THE COUNT
LD A,C ; GET THE POSSIBLE DATA CHARACTER
LD (DATA),A ; STORE IN DATA AREA
RDAT15: LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT
RET
RDATA2: CP 'F' ; START OF FILE?
JP NZ,RDATA3 ; NO, TRY NEXT TYPE.
LD A,(OLDTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,RDAT21 ; IF NOT PROCEED.
LD DE,ERMES5
CALL ERROR3 ; DISPLAY ERR MSG.
JP ABORT ; CHANGE THE STATE TO ABORT.
RDAT21: INC A ; INCREMENT IT.
LD (OLDTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
DEC A ; DECREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER
CP B ; IS THE PACKET'S NUMBER ONE LESS THAN NOW?
JP NZ,NAK0 ; NO, NAK IT AND TRY AGAIN.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
XOR A
LD (NUMTRY),A ; RESET NUMBER OF TRIES.
LD (ARGBLK+1),A ; NO DATA. (THE PACKET NUMBER IS IN ARGBLK.)
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
RET
RDATA3: CP 'Z' ; IS IT A EOF PACKET?
JP NZ,RDATA4 ; TRY AND SEE IF ITS AN ERROR.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER
CP B ; IS THE PACKET'S NUMBER CORRECT?
JP NZ,NAK0 ; NO, NAK IT AND TRY AGAIN.
INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(ARGBLK+1) ; GET THE DATA LENGTH
CP 1 ; HAVE ONE ITEM?
JP NZ,RDAT33 ; IF NOT, IGNORE DATA
LD A,(DATA) ; YES, GET THE CHARACTER
CP 'D' ; IS IT A 'D' FOR DISCARD?
JP Z,RDAT36 ; IF SO, PUNT FILE
RDAT33: LD HL,(BUFPNT) ; GET THE DMA POINTER.
LD A,(CHRCNT) ; GET THE NUMBER OF CHARS LEFT IN THE DMA.
RDAT34: DEC A ; LOWER THE COUNT.
OR A
JP M,RDAT35 ; IF FULL THEN STOP.
LD (HL),'Z'-100O ; PUT IN A ^Z FOR EOF.
INC HL ; POINT TO THE NEXT SPACE.
JP RDAT34
RDAT35: LD DE,FCB
CALL @CLOSE ;CLOSE THE FILE
XOR A ; SINCE WE KEPT THE FILE,
LD (CZSEEN),A
RDAT36: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD (ARGBLK+1),A ; NO DATA. (THE PACKET NUMBER IS IN ARGBLK.)
LD A,'Y' ; ACKNOWLEDGE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT
LD A,'F'
LD (STATE),A
RET
RDATA4: CP 'E' ; IS IT AN ERROR PACKET.
JP NZ,ABORT
CALL ERROR
JP ABORT
<<< trskd.src >>>
;get a directory for a drive
DIR LD HL,(402DH) ;intercept the @exit
LD (ARGBLK),HL ;vector
LD A,(402FH)
LD (ARGBLK+2),A
LD HL,(4030H) ;intercept the @abort
LD (ARGBLK+3),HL ;vector
LD A,(4032H)
LD (ARGBLK+5),A
LD HL,(4409H) ;intercept the @error
LD (ARGBLK+6),HL ;vector
LD A,(440BH)
LD (ARGBLK+8),A
LD (ARGBLK+9),SP
LD HL,(CMDPTR)
DIR1A LD A,(HL)
CP CR
JR Z,DIR1B
CP ' '
JR Z,DIR1AA
CP '0'
JP M,DIRERR ;legal drive number?
CP '9'+1
JP P,DIRERR
JR DIR1C
DIR1AA INC HL
JR DIR1A
DIR1B LD A,'1' ;default to drive 1
DIR1C LD (DIRSPEC),A
LD A,0C3H ;replace dos vectors
LD (402DH),A
LD (4030H),A
LD (4409H),A
LD HL,DIR1D ;route back to kermit
LD (402EH),HL
LD (4031H),HL
LD (440AH),HL
LD HL,DNAM14 ;execute the command
JP 4405H ;DIR :X
DIR1D LD HL,(ARGBLK) ;return here after
LD (402DH),HL ;execution and fix
LD A,(ARGBLK+2) ;dos
LD (402FH),A
LD HL,(ARGBLK+3)
LD (4030H),HL
LD A,(ARGBLK+5)
LD (4032H),A
LD HL,(ARGBLK+6)
LD (4409H),HL
LD A,(ARGBLK+8)
LD (440BH),A
LD HL,(ARGBLK+9)
LD SP,HL ;all done
JP KERMIT
DIRERR LD DE,BADDRV ;bad drive name
CALL PRTSTR
JP KERMIT
;kill a trs-80 file
ERA: LD A,CMIFI ; PARSE A FILE-SPEC
LD DE,KFCB ; INTO FCB
CALL COMND
JP KERMIT
LD A,CMCFM
CALL COMND
JP KERMT3
LD DE,KFCB
CALL @OPEN
JP Z,ERA1 ; FOUND it
LD DE,ERMS15;"UNABLE TO FIND FILE"
CALL PRTSTR
JP KERMIT
ERA1: LD DE,KFCB
CALL @KILL
JR NZ,ERA2
LD DE,INMS18;" FILE KILLED"
CALL PRTSTR
JP KERMIT
ERA2: CALL ERRORD
JP KERMIT
ESCPR: LD A,(ESCCHR) ; GET THE ESCAPE CHAR.
CP ' ' ; IS IT A CONTROL CHAR?
JP P,ESCPR2
LD DE,INMS10 ; OUTPUT CONTROL-.
CALL PRTSTR
LD A,(ESCCHR)
OR 100O ; DE-CONTROLIFY.
ESCPR2: CALL CONOUT
LD A,20H
CALL CONOUT
RET
<<< trsmake.bas >>>
10 CLEAR10000
20 DEFINTA-Z
30 CLS
40 H$="0123456789ABCDEF"
50 PRINT"THIS IS KERMAKE/BAS":PRINT
60 PRINT"IT WILL CREATE A MACHINE LANGUAGE"
70 PRINT"PROGRAM CALLED KERMIT/CMD":PRINT
100 INPUT"WHICH DRIVE WILL YOU BE USING";D
110 IFD<0ORD>3THEN100
120 LINEINPUT"PRESS <ENTER> WHEN YOU ARE READY TO BEGIN --> ";A$
130 A$="KERMIT/CMD:"+MID$(STR$(D),2,1)
140 PRINT"NOW CREATING FILE: ";A$:FORP=1TO300:NEXT
150 OPEN"O",1,A$
160 READB$
170 IFB$="*"THEN280
180 X=X+1
190 PRINTCHR$(29);:PRINTUSING"PART ### OF 325 PARTS";X;
200 FORA=1TOLEN(B$)STEP2
210 A1=INSTR(H$,MID$(B$,A,1))-1
220 A2=INSTR(H$,MID$(B$,A+1,1))-1
230 A3=A1*16+A2
240 CK!=CK!+A3
250 PRINT#1,CHR$(A3);
260 NEXTA
270 GOTO160
280 CLOSE
290 CLS
300 A!=976454
310 PRINT"CHECKSUM ="CK!" IT SHOULD ="A!:PRINT
320 IF CK!=A! GOTO 360
330 PRINT"CHECKSUM ERROR. IT IS SUGGESTED THAT YOU DOWNLOAD THIS"
340 PRINT"PROGRAM AGAIN AND KILL THE COPY OF KERMIT/CMD PRESENTLY"
350 PRINT"SAVED ON DISK":END
360 PRINT"CHECKSUM CORRECT! YOUR COPY OF KERMIT/CMD HAS BEEN VERIFIED."
370 END
1000 DATA 05064B45524D495401020070ED730E96311097CD1A70AF32099911C291CD
1001 DATA 3B70CD4B70C330713A3297D3E8D3E93E6CD3EAC9D5117D92CD3B70D1C9D5
1002 DATA E5C5F5CD3300F1C1E1D1C91AFE24C8CD2F701318F6D5CD2B00D1C9110999
1003 DATA 1ACB7FC42844116589CD7471119792216D8C3E01CDE171C39A702170704F
1004 DATA 060009E9C30177C32871C34271C3C376C30F7BC35E7FC37978C3F079C3F8
1005 DATA 79C30976C35B76C3B276C3C174C35A75117589CD3B70C34B7011A089CD3B
1006 DATA 70C34B70E5C5211E974E060021B97009E9C3CB70C3D570C3C870C3DA70C3
1007 DATA E470C3E670E67FEAE670F680C3E670F680C3E670E67FE2E670F680C3E670
1008 DATA E67FC1E1C9D5DBEAE64028FA7BCDAC70D3EBD1C9DBEAE6802019CD450102
1009 DATA 007170B728F4FE0D2001C9FE1A2804FE1820E7C620324297C9DBEB473A1E
1010 DATA 97FE0678CA4B71E67FC34B713E04CDE171C3A3701109993A0999CB7FC428
1011 DATA 44ED7B0E96C32D40116D8CCD3B70C34B70E1232323E9F5C5D5E501F6FF11
1012 DATA FFFF0913DA5A71010A0009EB7CB5C450717BC630CD2F70E1D1C1F1C9E1E5
1013 DATA 227C95ED737A95ED537E95218495220696220896AF3277953278953EFF32
1014 DATA 799511F994CD3B70ED5B7E95CD3B70C9ED7B7A952184952208963EFF3279
1015 DATA 952A7C95E9ED7B7A95218495220696220896AF3277953278953EFF327995
1016 DATA 11F994CD3B70ED5B7E95CD3B702A7C95E9327695CD3074FE04CA6972FE01
1017 DATA CAB872FE02CA0774FE10CA0774FE03CA2D7401020072FE05CA0C72118394
1018 DATA CD3B70C9EB2280950600CD6874B7F25372E67FFE1B201A3E07CD2F70AF32
1019 DATA 77952A06962B22069622089621789535C31272FE3F2811FE20280DFE0CCC
1020 DATA 2670782A8095EBC34B71217795360004FE613806FE7A3002E65F2A809577
1021 DATA 23228095C3127211CE94CD3B7011F994CD3B70ED5B7E95CD3B702A08963E
1022 DATA 24772A06962B220696118495CD3B70AF327795CD4900FE0D2816FE0C2812
1023 DATA FE04F82A0696237723220696CD2F70C3A471FE0CCC2670C34B71228295ED
1024 DATA 5380951A4713ED530A962A0896220C9678B7C82A0A965E231D7BFEFFFAB5
1025 DATA 73CD6874B7F2A573E67FFE3FC21B73AF32779521789535ED5B8295CD3B70
1026 DATA 11F994CD3B70ED5B010200737E95CD3B702A08963E24772A06962B220696
1027 DATA 118495CD3B70C3A471FE1BC28673AF327795D5C5E5CDD073C347733E07CD
1028 DATA 2F702A06962B22069622089621789535E1C1D11CC3D4722A06962BEBE1E5
1029 DATA 7EFE24CA637323EB7723EB3A78953C327895C34E733A78953C327895EB3E
1030 DATA 207723220696220896E1E5EBCD3B703E20CD2F70E1C1D1C39973E5D5CDD0
1031 DATA 73C3977311A894CD3B70C3B771D1E11C160019235E23567BC34B71FE6138
1032 DATA 06FE7A3002E65F5623BACAD47216007BB7F2BE7316FF1911030019220A96
1033 DATA 052A0C96220896C3CC7205F81C4B7BB7C81600191E03194623EB2A0A967E
1034 DATA 914FB8CAEB73F02A0C960DFA4B71EB4623EB7E23FE613806FE7A30020102
1035 DATA 0074E65FB8C0C3EE73EB220496EB2A0496063236202310FB2A0896CD1C44
1036 DATA 280911B494CD3B70C3B771220896C34B71C30774F5D5E53A7795B7C26474
1037 DATA 2A0696110496AFED52452A0696CD4000DAB77178327895B7CAB7712A0696
1038 DATA 581600192206963EFF327795E1D1F1C9E5C53A7795B7CC30742A08967E23
1039 DATA 220896FE20CA8374FE09C296743A7995B7C26A743EFF3279953E20C1E1C3
1040 DATA BE74F5AF327995F1C1E1FE1BCABE74FE3FCAB574FE0DCAB574FE0ACAB574
1041 DATA FE0CC0E52A08962B220896E1F680C92A2D40229F9B3A2F4032A19B2A3040
1042 DATA 22A29B3A324032A49B2A094422A59B3A0B4432A79BED73A89B2A08967EFE
1043 DATA 0D2813FE20280CFE30FA5175FE3AF251751801020075052318E83E3132FB
1044 DATA 8B3EC3322D40323040320944212675222E40223140220A4421F58BC30544
1045 DATA 2A9F9B222D403AA19B322F402AA29B2230403AA49B3232402AA59B220944
1046 DATA 3AA79B320B442AA89BF9C34B70110B8CCD3B70C34B703E02116D99CDE171
1047 DATA C34B703E04CDE171C3A370116D99CD2444CA7F75116C8ACD3B70C34B7011
1048 DATA 6D99CD2C44200911FD8BCD3B70C34B70CDED75C34B703A1F97FE20F2A975
1049 DATA 11A78BCD3B703A1F97F640CD2F703E20CD2F70C9CDE6753E41324C97C3C3
1050 DATA 75117389CD3B703AA09B4F0600215197093E2477115197CD3B70C9D5CDE6
1051 DATA 7511ED91CD3B70D1CD3B70C9113292CD3B70C9B7C8F680F640CD0944C9D5
1052 DATA 111F92CD3B70D1CD010200763B70113A92CD3B70C93E04CDE171C3A370AF
1053 DATA 324A973E313240973A4A97FE05FA2B7611AD8ACD3B70C34B703C324A97AF
1054 DATA 329F9B3E0132A09B21519736463E47CD4D86C31A76CD5387C31A76FE59CA
1055 DATA 4B70FE45C21A76CDBD75C34B703E04CDE171C3A370CD6C76C34B70C34B70
1056 DATA AF324A973E313240973A4A97FE05FA847611E08ACD3B70C93C324A97AF32
1057 DATA 9F9B3E0132A09B215197364C3E47CD4D86C37D76CD5387C37576FE59CA4B
1058 DATA 71FE45C27576CDBD75C93E04CDE171C3A370CD6C76C34B70C330713E0311
1059 DATA 3B99CDE171C3A3703E04CDE171C3A37021159736FF219F9A222597113B99
1060 DATA CD2444200C113B99CD2C44113B992A2597CD2044C24B70CDED75C34B0102
1061 DATA 0077703E04CDE171C3A370113E8BCD3B70CD967511608BCD3B70CD2477CD
1062 DATA 6777C34B70C31877DBEAE680C8DBEBE67FFE0A28F35F3A1897B728153A17
1063 DATA 97B7C215787BFE7FC8FE1B2006321797C32477FE0CCA26703A1597B7C430
1064 DATA 783A1D97B7C463787BCD2F70C32477CD4570E67FB7CA4B715F3A1F97BBCA
1065 DATA 92777BCDAC705FD5CD7278D13A1697B7CA4B717BE67FCD2F70C34B71CD96
1066 DATA 75CD4570B728FA47CD2F7078FE032807E65FFE43C2C77711838BCD3B703A
1067 DATA 1597B7C8AF32159711268BCD3B70113B99CD2844C9FE532006CDFE79C34B
1068 DATA 7178FE3F200911AD8FCD3B70C3957778E67FFE42200911D48BCD3B70C34B
1069 DATA 7178FE3020083E00CDE970C34B715F3A1F9701020078BB280A7BCDAC70CD
1070 DATA 7278C34B713E07CD2F70C34B71AF3217977BFE41F8FE4CF0D6410707216D
1071 DATA 925F160019EBCD3B70C97B2A2B977723222B97E5C121A09BB7ED42C0D53E
1072 DATA 13CDE970113B99CD3C44280611248ACD3B70219F9A222B973E11CDE970D1
1073 DATA C93AE837E6F0FE30C07BD5CD3B00D1C9B7C85FCDE970C9111E9321AD8D3E
1074 DATA 01CDE171C39A70218F784F060009E9C31F79C35779C33979C3A370C3DB78
1075 DATA C34E79C39B79C3B379C3B978C34579C37479C30D79C3AA79C3C27911C693
1076 DATA 21238F3E01CDE171C39A70326B983E04CDE171C39A703A6B98323F97C34B
1077 DATA 7011AE9321118F3E01CDE171C39A7021F1784F060009E9C30279C3F7783E
1078 DATA 04CDE171C3A370C3010200794B703E04CDE171C3A370C34B7011FB942198
1079 DATA 90CDD179323297CD1A70C34B703E04CDE171C3A370114B8CCD3B70CD4900
1080 DATA CD2F70321F97C34B70CDCB793A6B98321697C34B70CDCB79321897C34B70
1081 DATA CDCB79321997C34B70CDCB79321A97B728063E03060118043E060600321E
1082 DATA 9778321697C34B7011669421988F3E01CDE171C39A70326B987A326C983E
1083 DATA 04CDE171C3A3702A6B987E322297C34B70114794217A90CDD179321B97C3
1084 DATA 4B70CDCB79321D97C34B7011109421648FCDD179321E97C34B70CDCB7932
1085 DATA 1C97C34B7011399421858F3E01CDE171C3E879326B983E04CDE171C3EC79
1086 DATA 3A6B98C9F1C39A70F1C3A3703E04CDFE79C34B70CDFE79C34B7011560102
1087 DATA 007A90CD3B701151903A1697B72803114D90CD3B70110D91CD3B70115190
1088 DATA 3A1897B72803114D90CD3B70111D91CD3B703A1B97B7280CFE01116B9028
1089 DATA 081172901803116290CD3B70112891CD3B701151903A1A97B72803114D90
1090 DATA CD3B70113291CD3B701151903A1997B72803114D90CD3B70115891CD3B70
1091 DATA 1151903A1C97B72803114D90CD3B70116891114091CD3B701151903A1D97
1092 DATA B72803114D90CD3B70116891CD3B703A1E97119191FE0320051196911819
1093 DATA FE0C2005119B911810FE09200511A1911807FE00200311A591CD3B701172
1094 DATA 91CD3B703A3F97CD2F70118691CD3B70114991CD3B70CD9675117389CD3B
1095 DATA 7011AA91CD3B703A3297D61121FB94017B000102007BEDB12323EBCD3B70
1096 DATA 11B791CD3B70C91151973E05CDE171C3A370B7282932A09BEB3624CDCD7B
1097 DATA 112192CD3B70115197CD3B703E31324097AF329F9B3E52CD4D86C3A370C3
1098 DATA 497BCDCD7BAF324297210000224697224897324597324A97110792CD3B70
1099 DATA 210000CD50713E52324C9711F091CD3B702A4697CD50713A4C97FE44C287
1100 DATA 7BCD1A7EC36D7BFE46C2927BCD0F7DC36D7BFE52C29D7BCDE57BC36D7BFE
1101 DATA 43201611008B3A4297B72807AF32429711E88BCDF775C34B70FE41200911
1102 DATA 0B8BCDF775C34B70110B8BCDF775C34B7011BE91CD3B70113389CD3B703E
1103 DATA 00322097219F99222597C93A4A97FE10FAF67B11B089CDD775C3527C3C32
1104 DATA 4A973E31324097CD0102007C5387C35B7CFE5320403A4A97324B97AF324A
1105 DATA 973A9F9B3CE63F3245972A4697232246973AA09B215197CDB47C215197CD
1106 DATA 7F7C32A09B3E59CD4D86C3527C3A41973240973E46324C97C9FE45200BCD
1107 DATA B27518003E41324C97C9CD6E7C3A4597329F9BAF32A09B3E4ECD4D86C352
1108 DATA 7CC9110792CD3B702A489723224897CD5071C93A3497C62077233A3697C6
1109 DATA 2077233A3897C62077233A3A97C640E67F77233A3C97C62077233A3E9777
1110 DATA 23364E233A419777233E08C9326E987ED6203233973A6E98FE03F823237E
1111 DATA D6203237973A6E98FE04F8237EC640E67F3239973A6E98FE05F8237ED620
1112 DATA 323B973A6E98FE06F8237E323D973A6E98FE07F8237E3A6E98FE08F80102
1113 DATA 007D237E473A3F97B828023E31324197C93A4A97FE05FA207D11CD89CDD7
1114 DATA 75C3527C3C324A97CD5387C35B7CFE53C2697D3A4B97FE10FA407D11B089
1115 DATA CDD775C3527C3C324B973A45973D473A9F9BB8C2587CCD6E7CAF324A9721
1116 DATA 5197CD7F7C32A09B3E59CD4D86C3527CC9FE5AC2A27D3A4B97FE05FA7F7D
1117 DATA 11EB89CDD775C3527C3C324B973A45973D473A9F9BB8C2587CCD6E7CAF32
1118 DATA 4A9732A09B3E59CD4D86C3527CC9FE46C2ED7D3A4597473A9F9BB8C2587C
1119 DATA 3CE63F3245972A469723224697CD2685C3527CCDD97B3A4A97324B97AF32
1120 DATA 4A9732A09B3E59CD4D86C3527C3E44324C97324297FE5AC8AF324297C9FE
1121 DATA 42C20F7E3A4597473A9F9BB8C2587CAF32A00102007E9B3E59CD4D86C352
1122 DATA 7C3E43324C97C9FE45C2527CCDB275C3527C3A4A97FE05FA2B7E110B8ACD
1123 DATA D775C3527C3C324A97CD5387C35B7CFE44C2B77E3A4597473A9F9BB8CA79
1124 DATA 7E3A4B97FE05FA567E110B8ACDD775C3527C3C324B973A45973D473A9F9B
1125 DATA B8C2587CCD6E7CAF324A9732A09B3E59CD4D86C3527CC93CE63F3245972A
1126 DATA 4697232246973A4A97324B973AA09BCDBE83C3527CAF324A9732A09B4F32
1127 DATA 4297B7CAAE7E4F3E0132A09B793251973E59CD4D86C3527CC9FE46C2F07E
1128 DATA 3A4B97FE05FACD7E11CD89CDD775C3527C3C324B973A45973D473A9F9BB8
1129 DATA C2587CCD6E7CAF324A9732A09B3E59CD4D86C3527CC9FE5AC2537F3A4597
1130 DATA 473A9F9BB8C2587C0102007F3CE63F3245972A4697232246973AA09BFE01
1131 DATA C21D7F3A5197FE44CA387F2A25973A20973DB7FA2E7F361A23C3237F1109
1132 DATA 99CD2844AF3242973A4A97324B97AF324A9732A09B3E59CD4D86C3527C3E
1133 DATA 46324C97C9FE45C2527CCDB275C3527CC5E5067A218F9836202310FBE1C1
1134 DATA 3E05118F98CDE171C34B703E04CDE171C34B70218F98224397CDD0843009
1135 DATA 116C8ACDD775C34B70CDCD7BAF324597324A972100002246972248971107
1136 DATA 92CD3B70210000CD50713E313240973E53324C9711F091CD3B702A4697CD
1137 DATA 50713A4C97FE442006CDC981C3BC7FFE462006CDCD80C3BC7FFE5A2006CD
1138 DATA A082C3BC7FFE532006CD2980C3BC7FFE422006CD4883C3BC7FFE43200102
1139 DATA 00801211008B3A4297B7280311E88BCDF775C34B70FE412009110B8BCDF7
1140 DATA 75C34B70110B8BCDF775C34B703A4A97FE10FA3A8011378ACDD775C3527C
1141 DATA 3C324A973E313240973A3F97324197215197CD7F7C32A09B3A4697329F9B
1142 DATA 3E53CD4D86C3527CCD5387C32E70FE59C2A6803A4597473A9F9BB8C03CE6
1143 DATA 3F3245972A4697232246973AA09B215197CDB47C3A4A97324B97AF324A97
1144 DATA 3A41973240973E46324C97CD0985C3527CC9FE4EC2C280CD6E7C3A45973C
1145 DATA 473A9F9BB8C0AF324A973E46324C97C9FE45C2527CCDB275C3527C3A4A97
1146 DATA FE05FADE8011378ACDD775C3527C3C324A97AF324297215197222997216F
1147 DATA 9822279706000E0078FE08C209813E2E2A29010200819777232229970608
1148 DATA 0C0478FE0CF234812A27977EE67F23222797FE21FA34812A2997FE2FCAFC
1149 DATA 80FE3A280977232229970CC3F6807932A09B2A29973E2477112192CD3B70
1150 DATA 115197CD3B703A4597329F9B3E46CD4D86C3527CCD5387C32E70FE59C2A9
1151 DATA 813A4597473A9F9BB8C03CE63F3245972A4697232246973A4A97324B97AF
1152 DATA 324A97AF3212973EFF321397CD1F84C39581C3A081FEFFC2527C3E5A324C
1153 DATA 97C93231973E44324C97C9FE4EC2BE81CD6E7C3A45973C473A9F9BB8C0C3
1154 DATA 6C81FE45C2527CCDB275C3527C3A4A97FE05FADA8111378ACDD775C3527C
1155 DATA 3C324A97215197222997210B98222D9706012A2D977E23222D972A299777
1156 DATA 23222997043A319701020082B8F2EC813A319732A09B3A4597329F9B3E44
1157 DATA CD4D86C3527CCD5387C32E70FE59C280823A4597473A9F9BB8C03A9F9B3C
1158 DATA E63F3245972A4697232246973A4A97324B97AF324A973AA09BFE01C25F82
1159 DATA 3A5197FE5A2003324297FE5820033242973A4297B728063E5A324C97C9CD
1160 DATA 1F84C37582323197C9FEFFC2527C3E5A324C97C9FE4EC29582CD6E7C3A45
1161 DATA 973C473A9F9BB8C0C36B82FE45C2527CCDB275C3527C3A4A97FE05FAB182
1162 DATA 11378ACDD775C3527C3C324A973A4597329F9BAF32A09B3A4297B7280A3E
1163 DATA 443251973E0132A09B3E5ACD4D86C3527CCD5387C32E70FE5920483A4597
1164 DATA 473A9F9BB8C03CE63F3245972A4697232246973A4A97324B97AF324A0102
1165 DATA 008397110999CD28443A4297FE5A2815CDD0843810CD0985C3527CAF3242
1166 DATA 973E46324C97C93E42324C97C9FE4E2010CD6E7C3A45973C473A9F9BB8C0
1167 DATA C3EA82FE45C2527CCDB275C3527C3A4A97FE05FA598311378ACDD775C352
1168 DATA 7C3C324A973A4597329F9BAF32A09B3E42CD4D86C3527CCD5387C32E70FE
1169 DATA 5920263A4597473A9F9BB8C03CE63F3245972A4697232246973A4A97324B
1170 DATA 97AF324A973E43324C97C9FE4E2010CD6E7C3A45973C473A9F9BB8C0C382
1171 DATA 83FE45C2527CCDB275C3527C326B982151972223973A3E9747216B9835FA
1172 DATA 4B712A23977E23222397B8C213847E23222397216B983557E6805F7AE67F
1173 DATA B8CAF7837AC640E67FB35F3A1B97FE01200F010200847BFE0A200A3A1497
1174 DATA FE0DCACB831E0D7B321497110999CD1B00C22E70C3CB833A3D974F3A1297
1175 DATA B7C03A1397B7280206003A4097D631473A3397D60590326B98210B98222D
1176 DATA 9706003A6B983DF2528478C34B71326B983A1B97FE01200B3A1497FE0D20
1177 DATA 043E0A1809110999CD1300C2C784573A1B97FE0120047AE67F57E6805F7A
1178 DATA E67F321497FE20FAA384FE7FCAA384B9C2BA84216B98352A2D977723222D
1179 DATA 9704C3BA84326C98216B98352A2D977123222D97043A6C98C640E67F2A2D
1180 DATA 97B37723222D9704C347843EFF32129778C34B71D2D4843FC5D5E5063221
1181 DATA 099936202310FB0620216F9836202310FB2A4397116F98CD1C4422439720
1182 DATA 0D216F98110999CD010200851C44E1D1C1C93718F93EFF321397AF321297
1183 DATA 321497E5110999219F99CD2444E1C2ED75C34B7121519722299721099922
1184 DATA 2797AF326B98326C98063236202310FB2A29977E23222997FE2EC25A853A
1185 DATA 6B98326C98AF326B98C38A85B7CAB3852A279777232227973A6B983C326B
1186 DATA 98FE08FA4085326C98AF326B982A29977E23222997B7CAB385FE2EC27285
1187 DATA 2A2797362F232227972A29977E23222997B7CAB3852A279777232227973A
1188 DATA 6B983C326B98FE03FA93852A29973624112192CD3B70115197CD3B702A27
1189 DATA 9736033A1997B7CA3286110999219F99CD2444C2328611138BCDD7751109
1190 DATA 99CD28442A27972B7EFE4238FA35222797110999219F99CD2444C2160102
1191 DATA 008686110999CD28442A2797B7ED5220D911838ACD3B70C9210999116F98
1192 DATA CD1C443E3A010E00216F98EDB1233624116F98CD3B70AF32149711099921
1193 DATA 9F99CD2044CA4B71F511248ACDD775F1C3ED7532A19B214D973E0177233A
1194 DATA 4097D631473AA09BC6238077230100004F3A9F9BC6207723814F3E008847
1195 DATA 3AA19B7723814F3E0088473AA09BB7CA97863D32A09B7E23814F3E008847
1196 DATA C381863A4097FE32CAC886D2B18679E6C0070781E63FC6207723C3DF8636
1197 DATA 00E5214E97CDBD88E14B427A07070707E60FC620772378E60F0707477907
1198 DATA 07E603B0C620772379E63FC62077233A3B977723AF773A1C97B72804233E
1199 DATA 2477CDF986C32E70C34B713A3797326B983A010200876B983DB7FA148732
1200 DATA 6B983A39975FCDE970C3FF863A1A97B7CA2E873A4C97FE53CA2E87CDF870
1201 DATA C32E87FE11C223873A1C97B7280C115992CD3B70114E97CD3B70214D977E
1202 DATA B7CA50875FCDE97023C34387C34B71CD7588C32E70CDAF88C35387FE0120
1203 DATA F6CDAF88C32E70FE0128F6324E974F3A4097D6314779D6239032A09B0600
1204 DATA CDAF88C32E70FE0128D9329F9B324F97814F3E0088473A9F9BD620329F9B
1205 DATA CDAF88C32E70FE01CA6387326B98325097814F3E0088473AA09B326C9821
1206 DATA 51972229973A6C98D601FAE787326C98CDAF88C32E70FE01CA63872A2997
1207 DATA 7723222997814F3E00884718DACDAF88C32E70FE01CA6387D620326D983A
1208 DATA 4097FE32CA4188D201020088168879E6C0070781E63F473A6D98B8CA6A88
1209 DATA CD6E7CC92A29973600214E97CDBD884B427A07070707E60F573A6D98BA20
1210 DATA E1CDAF88C32E70FE01CA6387D620326D9878E60F070747790707E603B047
1211 DATA 3A6D98B8C21288CDAF88C32E70FE01CA6387D6204779E63FB8C212882A29
1212 DATA 9736003A6B98C34B7121AB97222F97CDF870C32E702A2F977723222F9747
1213 DATA 3A3C97B820EB3A1C97B728103E247723114892CD3B7011AC97CD3B7021AB
1214 DATA 97222F97C34B712A2F977E23222F97FE0DC24B71C9E5C51100007EB7CAF0
1215 DATA 88E5AB5FE60F4F06002113890909E57B0F0F0FE61E4F21F388097EAA2356
1216 DATA E1AE5F237EAA57E123C3C288C1E1C9000081100221833104428552060102
1217 DATA 0089638773088489940AA58BB50CC68DD60EE78FF70000891112239B3224
1218 DATA 46AD573665BF74488CC19D5AAFD3BE6CCAE5DB7EE9F7F80D4E756D626572
1219 DATA 206F66207061636B6574733A0D4E756D626572206F662072657472696573
1220 DATA 3A0D46696C65206E616D653A244B65726D69742D54525338303E240D240D
1221 DATA 3F556E7265636F676E697A656420636F6D6D616E64240D3F496C6C656761
1222 DATA 6C20636861726163746572240D3F4E6F7420636F6E6669726D6564243F55
1223 DATA 6E61626C6520746F207265636569766520696E6974696174650D243F556E
1224 DATA 61626C6520746F20726563656976652066696C65206E616D650D243F556E
1225 DATA 61626C6520746F207265636569766520656E0102008A64206F662066696C
1226 DATA 650D243F556E61626C6520746F207265636569766520646174610D243F53
1227 DATA 797374656D20444F53206572726F720D243F556E61626C6520746F207265
1228 DATA 636569766520616E2061636B6E6F776C656467656D656E742066726F6D20
1229 DATA 74686520686F73740D240D3F556E61626C6520746F2066696E642066696C
1230 DATA 650D243F556E61626C6520746F2072656E616D652066696C65240D3F5379
1231 DATA 7374656D20444F53206572726F72240D3F556E61626C6520746F2074656C
1232 DATA 6C20686F73742074686174207468652073657373696F6E2069732066696E
1233 DATA 6973686564240D3F556E61626C6520746F2074656C6C20686F737420746F
1234 DATA 206C6F676F7574240102008B07436F6D706C6574656424074661696C6564
1235 DATA 242552656E616D696E672066696C6520746F20240D3C436C6F73696E6720
1236 DATA 746865206C6F672066696C653E240D3C436F6E6E656374656420746F2072
1237 DATA 656D6F746520686F73742C207479706520244320746F2072657475726E3E
1238 DATA 0D3C434C4541523E20697320436F6E74726F6C2D5F0D240D3C436F6E6E65
1239 DATA 6374696F6E20636C6F7365642C206261636B206174206D6963726F3E2420
1240 DATA 436F6E74726F6C2D24202854797065204C656674204172726F7720746F20
1241 DATA 73656E64204354524C2D53290D2420284E6F7420696D706C656D656E7465
1242 DATA 64290D2407496E7465727275707465642444495220203A300D0D46690102
1243 DATA 008C6C65204B494C4C4544240D0D2B2B20426164206472697665206E616D
1244 DATA 65240D20436F6E6669726D2077697468203C454E5445523E2C2063616E63
1245 DATA 656C2077697468203C425245414B3E20240D5479706520746865206E6577
1246 DATA 20657363617065206368617261637465723A2020240D42594520746F2068
1247 DATA 6F737420284C4F474F55542920616E64206578697420746F20444F530D43
1248 DATA 4F4E4E45435420746F20686F7374206F6E2073656C656374656420706F72
1249 DATA 740D444952206F66206C6F63616C206469736B0D4558495420746F20444F
1250 DATA 530D46494E4953482072756E6E696E67204B65726D6974206F6E20746865
1251 DATA 20686F73740D48454C5020627920676976690102008D6E67207468697320
1252 DATA 6D6573736167650D4B494C4C20612066696C650D4C4F4720746865207465
1253 DATA 726D696E616C2073657373696F6E20746F20612066696C650D4C4F474F55
1254 DATA 542074686520686F73740D524543454956452066696C652066726F6D2068
1255 DATA 6F73740D53454E442066696C6520746F20686F73740D5345542061207061
1256 DATA 72616D657465720D53484F572074686520706172616D65746572730D5354
1257 DATA 41545553206F66204B65726D6974240D42417564202872617465290D424C
1258 DATA 6F636B2D636865636B2D747970652028666F72206572726F722064657465
1259 DATA 6374696F6E0D444542756767696E67206D6F64652028746F20646973706C
1260 DATA 6179207061636B650102008E7473290D4573636170652028636861726163
1261 DATA 74657220647572696E6720434F4E4E454354290D46696C652D6D6F646520
1262 DATA 28666F72206F7574676F696E672066696C6573290D49626D202870617269
1263 DATA 747920616E64207475726E2061726F756E642068616E646C696E67290D4C
1264 DATA 6F63616C2D6563686F202868616C662F6475706C6578290D504172697479
1265 DATA 2028666F7220636F6D6D756E69636174696F6E206C696E65290D504F7274
1266 DATA 2028746F20636F6D6D756E6963617465206F6E290D5052696E7465722028
1267 DATA 746F207072696E74207465726D696E616C2073657373696F6E290D567435
1268 DATA 322D656D756C6174696F6E0D5761726E696E672028666F722066696C0102
1269 DATA 008F656E616D6520636F6E666C6963747329240D5041442D434841520D50
1270 DATA 414444494E47240D312D4348415241435445522D434845434B53554D0D32
1271 DATA 2D4348415241435445522D434845434B53554D0D332D4348415241435445
1272 DATA 522D4352432D4343495454240D4556454E2020204D41524B20204E4F4E45
1273 DATA 2020204F44442020205350414345240D4F464620204F4E240D4E4F202020
1274 DATA 594553240D5354414E4441524420525332333220706F7274240D3F202054
1275 DATA 686973206D6573736167650D432020436C6F73652074686520636F6E6E65
1276 DATA 6374696F6E0D302020287A65726F29205472616E736D69742061204E554C
1277 DATA 4C0D532020537461747573206F66207468650102009020636F6E6E656374
1278 DATA 696F6E0D5479706520746865206573636170652063686172616374657220
1279 DATA 616761696E20746F2073656E6420697420746F2074686520686F73740D0D
1280 DATA 436F6D6D616E643E24206F6E24206F6666240D4C6F63616C206563686F24
1281 DATA 2064656661756C7424204153434949242062696E617279240D4153434949
1282 DATA 202020202042494E415259202020202044454641554C54240D2020202020
1283 DATA 35302020202020373520202020203131302020203133342E352020202031
1284 DATA 353020202033303020202036303020202020313230300D20202031383030
1285 DATA 202020323030302020202032343030202020203336303020202034383030
1286 DATA 202037323030202001020091393630302020203139323030240D56543532
1287 DATA 20656D756C6174696F6E240D46696C65204D6F6465240D49424D20666C61
1288 DATA 67240D46696C65207761726E696E67240D5072696E746572240D45736361
1289 DATA 706520636861723A20240D446562756767696E67206D6F6465240D506172
1290 DATA 6974793A20240D426C6F636B20636865636B20747970653A20242D636861
1291 DATA 726163746572246E6F6E65246D61726B247370616365246F646424657665
1292 DATA 6E244C696E652053706565643A202420426175640D241C1F0D244B65726D
1293 DATA 69742D3830205620332E3520285452532D3830204D6F64656C20312F3329
1294 DATA 0D24082008242008241D1E241C1A1A191919191919191919191919190102
1295 DATA 0092191919191919241C1A1A1A1919191919191919191919191919191919
1296 DATA 1919241C241C1A1A1A1A1919191919191919191919241C1A1A1A1A1A1A24
1297 DATA 1C1A1A1A1A1A1A1A1A1A1A1A1A241C1A1A1A1A1A1A1A1F525061636B3A20
1298 DATA 241C1A1A1A1A1A1A1A1A1A1A1F535061636B3A20241B2400001A24000019
1299 DATA 240000182400001C1F240024000024240000241C2400001B2400001F2400
1300 DATA 001E24100342594524212107434F4E4E4543542400000344495224242403
1301 DATA 45524124272704455849542403030646494E495348241B1B03474554240C
1302 DATA 0C0448454C50240606044B494C4C242727034C4F47240909064C4F474F55
1303 DATA 54241E1E0752454345495645240C0C045345010200934E44240F0F035345
1304 DATA 542412120453484F57241515065354415455532418180C04424155442421
1305 DATA 2110424C4F434B2D434845434B2D5459504524181809444542554747494E
1306 DATA 47242727064553434150452400000946494C452D4D4F4445241212034942
1307 DATA 4D2403030A4C4F43414C2D4543484F240606065041524954592415150450
1308 DATA 4F5254241E1E075052494E5445522424240E565435322D454D554C415449
1309 DATA 4F4E241B1B075741524E494E47240F0F02085041442D4348415224000007
1310 DATA 50414444494E472403030314312D4348415241435445522D434845434B53
1311 DATA 554D24313114322D4348415241435445522D434845434B53554D24323215
1312 DATA 332D434841524143010200945445522D4352432D43434954542433330504
1313 DATA 4556454E240000044D41524B240303044E4F4E45240606034F4444240909
1314 DATA 055350414345240C0C02024F4E240101034F464624000003054153434949
1315 DATA 2401010642494E4152592402020744454641554C5424000001085354414E
1316 DATA 4441524424EB00EB0002024E4F240000035945532401010D3F50726F6772
1317 DATA 616D206572726F723A2020496E76616C696420434F4D4E442063616C6C24
1318 DATA 0D3F416D626967756F7573240D3F496C6C6567616C20696E707574206669
1319 DATA 6C6520737065632420436F6E6669726D2077697468203C454E5445523E2C
1320 DATA 2043616E63656C2077697468203C425245414B3E240D2410023530240178
1321 DATA 0095000002373524111103313130242222053133342E3524333303313530
1322 DATA 244444033330302455550336303024666604313230302477770431383030
1323 DATA 2488880432303030249999043234303024AAAA043336303024BBBB043438
1324 DATA 303024CCCC043732303024DDDD043936303024EEEE05313932303024FFFF
1325 DATA 010E149700000000010100000000061F01042B979F9A0112329755205E08
1326 DATA 05000000000D0D2323313131010443978F9802020070
1327 DATA *
<<< trsmit.bwr >>>
Date: Wed, 21 Aug 85 15:14 CDT
From: Neil Erdwien <VMAA5@KSUVM>
Subject: TRS-80 Version of KERMIT
To: <DFTCU@CUVMA>
I have been having a few problems with the Model I/III TRS-80 KERMIT.
1. (omitted)
2. The recommended method of getting a micro version is to download
'TRSMAKE/BAS', and run it on the TRS-80; it writes 'KERMIT/CMD'.
Along the way, it keeps a checksum to verify the accuracy of the
download. Unfortunately, TRSMAKE consistantly reports an error.
Repeated downloads produce the exact same "wrong" checksum. I
suspect that the "correct" checksum is in fact wrong.
The resulting KERMIT/CMD works OK as far as I have seen.
3. On KERMSRV there is a file called 'TRSDNLD BAS' which seems to be a
version of 'TRSMAKE BAS'. When downloaded and run, it produces no
checksum error. Both resulting versions of kermit claim to be
Version 3.5. I assume one or the other is out-of-date.
Please advise me as to which is current.
4. On KERMSRV there is a file called 'TRSCMD HEX', which seems to serve no
purpose. There is no need for a file of printable hex to download,
because the above BASIC program does the job. (Besides, several other
'fn HEX' files would be needed also.
5. The VT52 emulation doesn't really exist in the TRS-80 version. I tried
to use this KERMIT with an IBM 7171 protocall converter, with all the
escape sequences showing. I suppose this is a really hard problem to
solve, given that the TRS-80 screen is only 64 characters wide.
I hope I don't sound like too much of a grouch. I realize that the TRS-80
is not a state-of-the-art machine any more. Still, the documentation
for existing programs ought to be current.
Thank you for your time. VMAA5@KSUVM.BITNET
------------------------------
Date: Mon, 16 Mar 87 21:03:01 EST
From: Charles L Oei <burdvax!thing2.PRC.Unisys.COM!oei@seismo.CSS.GOV>
Subject: TRS Model 1
Keywords: TRS Kermit
I have several remarks though that you might want to put into a .BWR file
for future users of Kermit for the TRS80 Model 1 running TRSDOS 2.3:
Of the files that are distributed, a person really only needs to see:
TRSMIT.DOC.1 and TRSMAKE.BAS.1
The others are either Z80 assembly language source code (for good latenight
reading), or miscellaneous/extraneous files that are of no real consequence.
[TRSDNLD.BAS.1 when downloaded and ran produces correct checksum, but
the resultant /CMD file doesn't seem to run correctly (at least the couple
of times I tried it -- it could otherwise, but I didn't want to invest any
more time since TRSMAKE did work satisfactorily).]
When TRSMAKE.BAS is downloaded and ran, don't worry about that it says
that the checksum is wrong, it's probably just fine. Here are the checksums
that TRSMAKE says it should be and what I get, respectively: 976487 976454
There are two problems (of any real consequence) with the resulting
KERMIT/CMD file:
1) not so bad is that vt52 emulation doesn't work
2) The other is that I couldn't talk w/ other Kermits unless I set
set the parity to "space". The Kermit on the other end doesn't
have to set its parity to space though. [After this, all
went well].
Also, some annoying things that I had with it were:
in terminal "connect" mode, I have no cursor;
the <break> key in command mode doesn't appear to "abort" a command,
but the <clear> key seems to do the trick anyway;
in "connect" mode, the <control> key designation doesn't work either.
Oh, and probably some other minor things too, but overall, it's great.
At least it works and sends/receives files better than raw transfers
sans error checking.
Thanks to Stan Barber and the original writers of CP/M 80 Kermit.
Charles Oei
------------------------------
<<< trsmit.doc >>>
TRS-80 KERMIT
Program: Stan Barber, Rice University developed from the CP/M-80 version by
Bill Catchings and others.
Language: Z80 Assembler, compatable with M80 and EDAS from Mysosys
Version: 3.5 (adapted from that version of CP/M 80 Kermit)
Date: March 1984
Documentation: Stan Barber, Rice University
Summary of TRSDOS and TRSDOS-bases Operating Systems
TRSDOS (The Radio Shack Disk Operating System) has a large library of built
in commands dealing with files, directory maintenance, device I/O, etc.
Programs are also used for some functions on some TRSDOS-bases DOS's. Only
those of major interest will be discussed here.
TRSDOS file specifications are of the form FILESPEC/EXT.PASSWORD:D, where:
FILESPEC is the filename up to eight characters.
EXT is the file type, up to three characters.
PASSWORD is the password for that file.
D is a numerical drive specification (0-9).
Filenames, file types and passwords may contain letters and numbers, but the
first character in each must be a letter. No special characters or spaces are
allowed. All fields are optional except the filespec. Any field added must be
preceeded by its special delimiter (/ for file type, . for passwords and
: for drive specifications). Upper and lower case characters are equivalent.
Wildcard file-group specifications are supported on some of the TRSDOS-based
DOS's but is not a standard feature. Consult your DOS manual for more specific
information. It should be noted that TRSDOS has no concept of a default drive
when no drive specification is given in the file specification. It will search
for an existing file on all available drives before it will open a new file.
Further, it will not open a file on a disk that is already full, instead it
will generate a disk full error (if all disks in the system are full or write
protected).
TRSDOS commands of interest include:
DIR :D [other options] lists the names of all visible files on the specified
drive. If no drive is specified, some DOS's give the directories of all mounted
drives. Some give the directory of the system drive (drive 0).
FREE gives statistics on disk usage.
KILL file removes the file from the directory and frees the space allocated to
the file for reassignment.
LIST file lists the file on the display.
RENAME oldfile newfile changes the name of oldfile to newfile if newfile is a
unique file name on that disk.
To duplicate files and disks, there are a variety of commands available. Which
one is available will depend on the operating system you are using. A sampling
is given below:
COPY file1 file2 will copy file1 and name the copy file2. If file2 exists, it
will be replaced.
BACKUP :D :E will make a copy of the disk in drive D on the the disk in drive
E. In some DOS's, this is part of the COPY command (e.g. COPY :D :E or
COPY 0 1).
FORMAT :D will format the disk in drive D. It will ready for any normal read or
write operation following successful completion of this operation. This
operation must be performed before use of a blank disk. Reformatting a
previously formatted disk will cause all previously stored information to be
lost. FORMAT is usually a program but on some DOS's, it is a part of the DOS
command library.
KERMIT-TRS80 Description
This implementation of the Kermit protocol is compatable with all DOS's
available for the TRS80 Model I or Model III (and the Model 4 running in Model
III mode). It has been checked out under the following DOS's: TRSDOS 2.3
(Model I), TRSDOS 1.3 (Model III), NEWDOS/80 V 2.0, LDOS 5.1.3, DOS+ 3.5 and
VTOS 3.0 (Model I).
Since Kermit-TRS80 runs on a TRS-80, it is always local. The screen is
contantly updated with the filename and the packet number, whether sending or
receiving. Kermit-TRS80 will also automatically translate file names to
conform with the Kermit standard when sending and the TRSDOS standard when
receiving. (This does not apply to the GET command.)
If despite the timeout capability, the transmission appears to be stuck (and
you can tell that this has happened if the screen fails to change for a while)
you can hit <ENTER> to have the micro do what it would have done on a timeout,
namely NAK the expected packet to cause to foreign host to send it again (or,
if the micro is sending, to retransmit the last packet). Micro/Micro or
Micro/IBM-mainframe transfers could require this kind of manual intervention.
File transfers may be interrupted in several ways.
[A reminder: Control characters are generated by holding down the Left-shift
and the down arrow keys while striking the alpha key corresponding to the
control character that you wish to generate.]
Control-C This will return you to Kermit-TRS80 command level immediately,
so that you can connect back to the remote system, or take
any other desired action.
Control-X When sending a file, this will terminate the sending of the
current file with a signal to the KERMIT on the other side to
discard what it got so far. If there are more files to be
sent, KERMIT-TRS80 will go on to the next one. When
receiving a file, KERMIT-TRS80 will send a signal to the remote
KERMIT to stop sending this file. If the remote KERMIT
understands this signal (not all implementations of KERMIT
do), it will comply, otherwise the file will keep coming. In
any case, the remote KERMIT will go on to the next file in the
group, if any.
Control-Z Like Control-X, except if a file group is being transmitted,
this will stop the transmission of the entire group. If only a
single file is being transmitted, it is exactly like Control-X.
<ENTER>s
If you type <ENTER> repeatedly Kermit-TRS80 will retry the
current packet up to its retry limit (something like 16 times)
and then, if no valid response was received, return to
Kermit-TRS80 command level.
KERMIT-TRS80 COMMANDS
KERMIT-TRS80 uses the DECSYSTEM-20 keyword style command language. Each
keyword may be abbreviated to its minimum unique length. "?" may be typed to
request a menu of the available options for the current field at any point in a
command. This must be followed by an <ENTER>. If sufficient characters have
not been typed to identify the current field uniquely, KERMIT-TRS80 will
reprompt and allow you to continue from that point.
CONNECT Establish a "virtual terminal" connection to any host that may be con-
nected to the serial port, i.e. pass all typein to the serial port and
display all input from the serial port on the screen. Also, emulate a
DEC VT52 to allow cursor control, screen clearing, etc., if
VT52-EMULATION is ON (see below), in which case you should also set
your terminal type on the remote host to VT52. The escape character
defaults to CTRL-underbar (which is generated by <CLEAR> on the
keyboard). When you issue the CONNECT command, the micro will print a
message telling you how to get back. The escape sequence is
generally an uncommonly-used control character, like CTRL-underbar or
CTRL-uparrow, followed by a single letter "command".
C Close Connection, return to Kermit-TRS80> command level.
S Display Status of connection, but maintain remote connection.
? List available single-character commands.
0 (zero) Send a null (0) character.
^_ (or whatever - a second copy of the escape character) Send the es-
cape character itself to the remote host.
SEND filespec
Send file specified by filespec to the remote Kermit. The filespec
may not contain wildcards.
RECEIVE Receive file(s) from the remote Kermit. Store them under the names
provided in the file headers supplied by the remote host. If the names
aren't legal, use as many legal characters from the name as possible
(see the description of SET FILE-WARNING below). If there's a con-
flict, and FILE-WARNING is ON, warn the user and try to build a unique
name for the file.
GET filespec
When Kermit-TRS80 is talking to a Kermit Server on the host, you may
include a file wildcard IF the host supports wildcards. The filespec
must be in a legal form for the HOST system.
LOG filespec
When CONNECTed to a foreign host as a terminal, log the terminal ses-
sion to the specified diskette file. This functionality depends to
some extent on the remote host's ability to do XON/XOFF flow control,
and does not guarantee a complete transcript (after all, that's what
the KERMIT protocol is for). The log file is closed when the
connection is closed by typing the escape character followed by the
single-character command "C".
BYE When talking to a remote Kermit Server, this command shuts down the
server and logs it out, and also exits from Kermit-TRS80 to DOS
command level.
LOGOUT Like BYE, but leaves you at Kermit-TRS80 command level.
FINISH Like LOGOUT, but shuts down the remote server without logging it out.
Leaves you at Kermit-TRS80 command level; subsequent CONNECT commands
will put you back at host system command level.
SET parameter [value]
Set the specified parameter to the specified value. Possible settings:
WARNING ON (or OFF)
Warn user of filename conflicts when receiving files from
remote host, and attempt to generate a unique name by modifying
the given one. ON by default.
VT52-EMULATION ON (or OFF)
When connected as a terminal to a foreign host, controls
whether the TRS80 emulates a VT52 or runs in "native mode".
VT52 emulation is ON by default.
DEBUGGING ON (or OFF)
When transmitting or receiving packets, controls whether the
packets are displayed on the local screen. Debugging is OFF by
default.
LOCAL-ECHO ON (or OFF)
When you CONNECT to a remote host, you must set LOCAL-ECHO ON
if the host is half duplex, OFF if full duplex. OFF by
default.
ESCAPE Change the escape character for virtual terminal connections.
Kermit-TRS80 will prompt you for the new escape character,
which you type in locally.
BAUD Change the baud rate of the communications port. Type SET
BAUD followed by a question mark, and follow the directions.
PARITY Sets parity for outgoing characters to one of the following:
NONE, SPACE, MARK, EVEN, or ODD. On input, if parity is NONE,
then the 8th bit is kept (as data), otherwise it is stripped
and ignored. The parity setting applies to both terminal con-
nection and file transfer.
IBM ON (or OFF)
Allow the transfer of files to and from an IBM mainframe com-
puter. This makes Kermit-TRS80 wait for the IBM turnaround
character (XON), ignore parity on input, add appropriate parity
to output, and use local echoing during CONNECT. If you don't
give this command, IBM mode is OFF.
FILE-TYPE (ASCII/BINARY/DEFAULT)
Tells KERMIT-TRS80 how to deal with the file being
send/received. IT IS IMPORTANT to tell KERMIT if the
is in ASCII when sending to a non-TRS80 KERMIT. DEFAULT
is the same as BINARY in this version.
BLOCK-CHECK-TYPE
The options are:
1-CHARACTER-CHECKSUM
Normal, default, standard 6-bit checksum.
2-CHARACTER-CHECKSUM
A 12-bit checksum encoded as two characters.
3-CHARACTER-CRC-CCITT
A 16-bit CCITT-format Cyclic Redundancy Check, encoded
as 3 characters.
The 2 and 3 character options should only be used under con-
ditions of extreme line noise. Many implementations of KERMIT
only support the single character checksum.
PORT Allows you to switch between different communication ports.
This command is not available at this time.
PRINTER ON or OFF. Turns copying of CONNECT session to printer on and
off. No attempt is made to do buffering or flow control; it is
assumed printer can keep up. Printer is OFF by default.
DIR Provides a directory for the specified drive. If no drive is specified,
the directory display will be as if you had entered the command from
DOS command level. See the discussion of DIR above.
KILL This executes the DOS KILL command on the specified file.
Installation
Kermit-TRS80 is easily installed. Simply download the program KERMAKE/BAS
(KERMAKE.BAS on the mainframe), enter BASIC, load and run the program.
KERMAKE/BAS is in ASCII format and will keep a running checksum while creating
KERMIT/CMD. If there was some error in the downloading process, you will be
notified by the program when it attempts to make KERMIT/CMD. Once this
process is complete, you will have a running version of Kermit-TRS80.
Building Kermit-TRS80 from the Source.
The Source for Kermit-TRS80 is in seven modules. KERMIT/SRC is the main source
module. It will call the other source files into the assembly as needed. If any
system calls needed to be changed, they are defined here and all labels for
system calls start with an @. This would be useful for assembling a version for
the Model 4 or a version for a TRS-80 work alike that has some hardware
differences (MAX-80, etc.). All serial I/O routines are in this section as
well.
GET/SRC and SEND/SRC contain the code for the RECEIVE (GET) and SEND commands.
XFER/SRC contains the common code used by RECIEVE and SEND. MORE/SRC contains
code for the other commands (with two exceptions) described above. KILLDIR/SRC
contains the code for the KILL and DIR commands. This code would have to be
modified for use on the Model 4. KERSTR/SRC contains the strings and storage
area.
It should be noted that KERMIT/CMD loads into RAM at 7000H. This avoids
conflicts with the DOS overlays that may be called by invoking the DIR command.
Assembly at a lower address is possible if other methods are used to call for a
DIR. I chose this method to be compatable with as many DOS's as possible
without writing code specific to each.
Getting a binary copy of KERMIT-TRS80
If you wish to have a binary copy of KERMIT-TRS80, you can call the SOBBS
TEST MODE at (713) 660-9252 to download an binary copy with KERMIT or the
Chistensen (XMODEM) protocol. At the "First Name or User Number?" prompt,
enter KERMIT. At the "Last Name?" prompt, enter KERMIT. At the "Password?"
prompt, enter KERMIT (will not echo). Select G at the "Command>" prompt.
Just follow the instructions given following that.
Stan Barber
May 1984
(thanks to Frank da Cruz for the documentation for Kermit and Stan Hanks
for the encouragement.)
<<< trsmit.hex >>>
05064B45524D495401020070ED73D19531D396CD1A70AF32CB98118591CD
3B70CD4B70C330713AF496D3E8D3E93E6CD3EAC9D5114092CD3B70D1C9D5
E5C5F5CD3300F1C1E1D1C91AFE24C8CD2F701318F6D5CD2B00D1C911CB98
1ACB7FC42844112889CD7471115A9221308C3E01CDE171C39A702170704F
060009E9C30177C32871C34271C3C376C30F7BC3637FC37978C3F079C3F8
79C30976C35B76C3B276C3C174C35A75113889CD3B70C34B70116389CD3B
70C34B70E5C521E0964E060021B97009E9C3CB70C3D570C3C870C3DA70C3
E470C3E670E67FEAE670F680C3E670F680C3E670E67FE2E670F680C3E670
E67FC1E1C9D5DBEAE64028FA7BCDAC70D3EBD1C9DBEAE6802019CD450102
007170B728F4FE0D2001C9FE1A2804FE1820E7C620320497C9DBEB473AE0
96FE0678CA4B71E67FC34B713E04CDE171C3A37011CB983ACB98CB7FC428
44ED7BD195C32D4011308CCD3B70C34B70E1232323E9F5C5D5E501F6FF11
FFFF0913DA5A71010A0009EB7CB5C450717BC630CD2F70E1D1C1F1C9E1E5
223F95ED733D95ED53419521479522C99522CB95AF323A95323B953EFF32
3C9511BC94CD3B70ED5B4195CD3B70C9ED7B3D9521479522CB953EFF323C
952A3F95E9ED7B3D9521479522C99522CB95AF323A95323B953EFF323C95
11BC94CD3B70ED5B4195CD3B702A3F95E9323995CD3074FE04CA6972FE01
CAB872FE02CA0774FE10CA0774FE03CA2D7401020072FE05CA0C72114694
CD3B70C9EB2243950600CD6874B7F25372E67FFE1B201A3E07CD2F70AF32
3A952AC9952B22C99522CB95213B9535C31272FE3F2811FE20280DFE0CCC
2670782A4395EBC34B71213A95360004FE613806FE7A3002E65F2A439577
23224395C31272119194CD3B7011BC94CD3B70ED5B4195CD3B702ACB953E
24772AC9952B22C995114795CD3B70AF323A95CD4900FE0D2816FE0C2812
FE04F82AC99523772322C995CD2F70C3A471FE0CCC2670C34B71224595ED
5343951A4713ED53CD952ACB9522CF9578B7C82ACD955E231D7BFEFFFAB5
73CD6874B7F2A573E67FFE3FC21B73AF323A95213B9535ED5B4595CD3B70
11BC94CD3B70ED5B010200734195CD3B702ACB953E24772AC9952B22C995
114795CD3B70C3A471FE1BC28673AF323A95D5C5E5CDD073C347733E07CD
2F702AC9952B22C99522CB95213B9535E1C1D11CC3D4722AC9952BEBE1E5
7EFE24CA637323EB7723EB3A3B953C323B95C34E733A3B953C323B95EB3E
20772322C99522CB95E1E5EBCD3B703E20CD2F70E1C1D1C39973E5D5CDD0
73C39773116B94CD3B70C3B771D1E11C160019235E23567BC34B71FE6138
06FE7A3002E65F5623BACAD47216007BB7F2BE7316FF191103001922CD95
052ACF9522CB95C3CC7205F81C4B7BB7C81600191E03194623EB2ACD957E
914FB8CAEB73F02ACF950DFA4B71EB4623EB7E23FE613806FE7A30020102
0074E65FB8C0C3EE73EB22C795EB2AC795063236202310FB2ACB95CD1C44
2809117794CD3B70C3B77122CB95C34B71C30774F5D5E53A3A95B7C26474
2AC99511C795AFED52452AC995CD4000DAB77178323B95B7CAB7712AC995
5816001922C9953EFF323A95E1D1F1C9E5C53A3A95B7CC30742ACB957E23
22CB95FE20CA8374FE09C296743A3C95B7C26A743EFF323C953E20C1E1C3
BE74F5AF323C95F1C1E1FE1BCABE74FE3FCAB574FE0DCAB574FE0ACAB574
FE0CC0E52ACB952B22CB95E1F680C92A2D4022619B3A2F4032639B2A3040
22649B3A324032669B2A094422679B3A0B4432699BED736A9B2ACB957EFE
0D2813FE20280CFE30FA5175FE3AF251751801020075052318E83E3132BE
8B3EC3322D40323040320944212675222E40223140220A4421B88BC30544
2A619B222D403A639B322F402A649B2230403A669B3232402A679B220944
3A699B320B442A6A9BF9C34B7011CE8BCD3B70C34B703E02112F99CDE171
C34B703E04CDE171C3A370112F99CD2444CA7F75112F8ACD3B70C34B7011
2F99CD2C44200911C08BCD3B70C34B70CDED75C34B703AE196FE20F2A975
116A8BCD3B703AE196F640CD2F703E20CD2F70C9CDE6753E41320E97C3C3
75113689CD3B703A629B4F0600211397093E2477111397CD3B70C9D5CDE6
7511B091CD3B70D1CD3B70C911F591CD3B70C9B7C8F680F640CD0944C9D5
11E291CD3B70D1CD010200763B7011FD91CD3B70C93E04CDE171C3A370AF
320C973E313202973A0C97FE05FA2B7611708ACD3B70C34B703C320C97AF
32619B3E0132629B21139736463E47CD1086C31A76CD1687C31A76FE59CA
4B70FE45C21A76CDBD75C34B703E04CDE171C3A370CD6C76C34B70C34B70
AF320C973E313202973A0C97FE05FA847611A38ACD3B70C93C320C97AF32
619B3E0132629B211397364C3E47CD1086C37D76CD1687C37576FE59CA4B
71FE45C27576CDBD75C93E04CDE171C3A370CD6C76C34B70C330713E0311
FD98CDE171C3A3703E04CDE171C3A37021D79636FF21619A22E79611FD98
CD2444200C11FD98CD2C4411FD982AE796CD2044C24B70CDED75C34B0102
0077703E04CDE171C3A37011018BCD3B70CD967511238BCD3B70CD2477CD
6777C34B70C31877DBEAE680C8DBEBE67FFE0A28F35F3ADA96B728153AD9
96B7C215787BFE7FC8FE1B200632D996C32477FE0CCA26703AD796B7C430
783ADF96B7C463787BCD2F70C32477CD4570E67FB7CA4B715F3AE196BBCA
92777BCDAC705FD5CD7278D13AD896B7CA4B717BE67FCD2F70C34B71CD96
75CD4570B728FA47CD2F7078FE032807E65FFE43C2C77711468BCD3B703A
D796B7C8AF32D79611E98ACD3B7011FD98CD2844C9FE532006CDFE79C34B
7178FE3F200911708FCD3B70C3957778E67FFE42200911978BCD3B70C34B
7178FE3020083E00CDE970C34B715F3AE19601020078BB280A7BCDAC70CD
7278C34B713E07CD2F70C34B71AF32D9967BFE41F8FE4CF0D64107072130
925F160019EBCD3B70C97B2AED96772322ED96E5C121629BB7ED42C0D53E
13CDE97011FD98CD3C44280611E789CD3B7021619A22ED963E11CDE970D1
C93AE837E6F0FE30C07BD5CD3B00D1C9B7C85FCDE970C911E19221708D3E
01CDE171C39A70218F784F060009E9C31F79C35779C33979C3A370C3DB78
C34E79C39B79C3B379C3B978C34579C37479C30D79C3AA79C3C279118993
21E68E3E01CDE171C39A70322D983E04CDE171C39A703A2D98320197C34B
7011719321D48E3E01CDE171C39A7021F1784F060009E9C30279C3F7783E
04CDE171C3A370C3010200794B703E04CDE171C3A370C34B7011BE94215B
90CDD17932F496CD1A70C34B703E04CDE171C3A370110E8CCD3B70CD4900
CD2F7032E196C34B70CDCB793A2D9832D896C34B70CDCB7932DA96C34B70
CDCB7932DB96C34B70CDCB7932DC96B728063E03060118043E06060032E0
967832D896C34B70112994215B8F3E01CDE171C39A70322D987A322E983E
04CDE171C3A3702A2D987E32E496C34B70110A94213D90CDD17932DD96C3
4B70CDCB7932DF96C34B7011D39321278FCDD17932E096C34B70CDCB7932
DE96C34B7011FC9321488F3E01CDE171C3E879322D983E04CDE171C3EC79
3A2D98C9F1C39A70F1C3A3703E04CDFE79C34B70CDFE79C34B7011190102
007A90CD3B701114903AD896B72803111090CD3B7011D090CD3B70111490
3ADA96B72803111090CD3B7011E090CD3B703ADD96B7280CFE01112E9028
081135901803112590CD3B7011EB90CD3B701114903ADC96B72803111090
CD3B7011F590CD3B701114903ADB96B72803111090CD3B70111B91CD3B70
1114903ADE96B72803111090CD3B70112B91110391CD3B701114903ADF96
B72803111090CD3B70112B91CD3B703AE096115491FE0320051159911819
FE0C2005115E911810FE0920051164911807FE002003116891CD3B701135
91CD3B703A0197CD2F70114991CD3B70110C91CD3B70CD9675113689CD3B
70116D91CD3B703AF496D61121BE94017B000102007BEDB12323EBCD3B70
117A91CD3B70C91113973E05CDE171C3A370B7282932629BEB3624CDCD7B
11E491CD3B70111397CD3B703E31320297AF32619B3E52CD1086C3A370C3
497BCDCD7BAF320497210000220897220A97320797320C9711CA91CD3B70
210000CD50713E52320E9711B391CD3B702A0897CD50713A0E97FE44C287
7BCD1F7EC36D7BFE46C2927BCD147DC36D7BFE52C29D7BCDE57BC36D7BFE
43201611C38A3A0497B72807AF32049711AB8BCDF775C34B70FE41200911
CE8ACDF775C34B7011CE8ACDF775C34B70118191CD3B7011F688CD3B703E
0032E29621619922E796C93A0C97FE10FAF67B117389CDD775C3527C3C32
0C973E31320297CD0102007C1687C35B7CFE5320403A0C97320D97AF320C
973A619B3CE63F3207972A0897232208973A629B211397CDB47C211397CD
7F7C32629B3E59CD1086C3527C3A03973202973E46320E97C9FE45200BCD
B27518003E41320E97C9CD6E7C3A079732619BAF32629B3E4ECD1086C352
7CC911CA91CD3B702A0A9723220A97CD5071C93AF696C62077233AF896C6
2077233AFA96C62077233AFC96C640E67F77233AFE96C62077233A009777
23364E233A039777233E08C93230987EDE2032F5963A3098FE03F823237E
DE2032F9963A3098FE04F8237EC640E67F32FB963A3098FE05F8237EDE20
32FD963A3098FE06F8237E32FF963A3098FE07F8237E3A3098FE08F80102
007D237E473A0197B8CA107D3E313A0397C93A0397C93A0C97FE05FA257D
119089CDD775C3527C3C320C97CD1687C35B7CFE53C26E7D3A0D97FE10FA
457D117389CDD775C3527C3C320D973A07973D473A619BB8C2587CCD6E7C
AF320C97211397CD7F7C32629B3E59CD1086C3527CC9FE5AC2A77D3A0D97
FE05FA847D11AE89CDD775C3527C3C320D973A07973D473A619BB8C2587C
CD6E7CAF320C9732629B3E59CD1086C3527CC9FE46C2F27D3A0797473A61
9BB8C2587C3CE63F3207972A089723220897CDED84C3527CCDD97B3A0C97
320D97AF320C9732629B3E59CD1086C3527C3E44320E97320497FE5AC8AF
320497C9FE42C2147E3A0797473A619BB8C20102007E587CAF32629B3E59
CD1086C3527C3E43320E97C9FE45C2527CCDB275C3527C3A0C97FE05FA30
7E11CE89CDD775C3527C3C320C97CD1687C35B7CFE44C2BC7E3A0797473A
619BB8CA7E7E3A0D97FE05FA5B7E11CE89CDD775C3527C3C320D973A0797
3D473A619BB8C2587CCD6E7CAF320C9732629B3E59CD1086C3527CC93CE6
3F3207972A0897232208973A0C97320D973A629BCDC383C3527CAF320C97
32629B4F320497B7CAB37E4F3E0132629B793213973E59CD1086C3527CC9
FE46C2F57E3A0D97FE05FAD27E119089CDD775C3527C3C320D973A07973D
473A619BB8C2587CCD6E7CAF320C9732629B3E59CD1086C3527CC9FE5AC2
587F3A0797473A610102007F9BB8C2587C3CE63F3207972A089723220897
3A629BFE01C2227F3A1397FE44CA3D7F2AE7963AE2963DB7FA337F361A23
C3287F11CB98CD2844AF3204973A0C97320D97AF320C9732629B3E59CD10
86C3527C3E46320E97C9FE45C2527CCDB275C3527CC5E5067A2151983620
2310FBE1C13E05115198CDE171C34B703E04CDE171C34B70215198220597
CD9A843009112F8ACDD775C34B70CDCD7BAF320797320C97210000220897
220A9711CA91CD3B70210000CD50713E313202973E53320E9711B391CD3B
702A0897CD50713A0E97FE442006CDCE81C3C17FFE462006CDD280C3C17F
FE5A2006CDA582C3C17FFE532006CD2E80C3C17FFE422006CD4D83C30102
0080C17FFE43201211C38A3A0497B7280311AB8BCDF775C34B70FE412009
11CE8ACDF775C34B7011CE8ACDF775C34B703A0C97FE10FA3F8011FA89CD
D775C3527C3C320C973E313202973A0197320397211397CD7F7C32629B3A
089732619B3E53CD1086C3527CCD1687C32E70FE59C2AB803A0797473A61
9BB8C03CE63F3207972A0897232208973A629B211397CDB47C3A0C97320D
97AF320C973A03973202973E46320E97CDD384C3527CC9FE4EC2C780CD6E
7C3A07973C473A619BB8C0AF320C973E46320E97C9FE45C2527CCDB275C3
527C3A0C97FE05FAE38011FA89CDD775C3527C3C320C97AF320497211397
22EB9621319822E99606000E0078FE08C20E01020081813E2E2AEB967723
22EB9606080C0478FE0CF239812AE9967EE67F2322E996FE21FA39812AEB
96FE2FCA0181FE3A2809772322EB960CC3FB807932629B2AEB963E247711
E491CD3B70111397CD3B703A079732619B3E46CD1086C3527CCD1687C32E
70FE59C2AE813A0797473A619BB8C03CE63F3207972A0897232208973A0C
97320D97AF320C97AF32D5963EFF32D696CD0984C39A81C3A581FEFFC252
7C3E5A320E97C932F3963E44320E97C9FE4EC2C381CD6E7C3A07973C473A
619BB8C0C37181FE45C2527CCDB275C3527C3A0C97FE05FADF8111FA89CD
D775C3527C3C320C9721139722EB9621CD9722EF9606012AEF967E2322EF
962AEB96772322EB0102008296043AF396B8F2F1813AF39632629B3A0797
32619B3E44CD1086C3527CCD1687C32E70FE59C285823A0797473A619BB8
C03A619B3CE63F3207972A0897232208973A0C97320D97AF320C973A629B
FE01C264823A1397FE5A2003320497FE5820033204973A0497B728063E5A
320E97C9CD0984C37A8232F396C9FEFFC2527C3E5A320E97C9FE4EC29A82
CD6E7C3A07973C473A619BB8C0C37082FE45C2527CCDB275C3527C3A0C97
FE05FAB68211FA89CDD775C3527C3C320C973A079732619BAF32629B3A04
97B7280A3E443213973E0132629B3E5ACD1086C3527CCD1687C32E70FE59
20483A0797473A619BB8C03CE63F3207972A0897232208973A0C97320102
00830D97AF320C9711CB98CD28443A0497FE5A2815CD9A843810CDD384C3
527CAF3204973E46320E97C93E42320E97C9FE4E2010CD6E7C3A07973C47
3A619BB8C0C3EF82FE45C2527CCDB275C3527C3A0C97FE05FA5E8311FA89
CDD775C3527C3C320C973A079732619BAF32629B3E42CD1086C3527CCD16
87C32E70FE5920263A0797473A619BB8C03CE63F3207972A089723220897
3A0C97320D97AF320C973E43320E97C9FE4E2010CD6E7C3A07973C473A61
9BB8C0C38783FE45C2527CCDB275C3527C322D9821139722E5963A009747
212D9835FA4B712AE5967E2322E596B8C2FD837E2322E596212D983557E6
805F7AE67FB8CAFC837AC640E67FB311CB9801020084CD1B00C22E70C3D0
833AFF964F3AD596B7C03AD696B7280206003A0297D631473AF596D60590
322D9821CD9722EF9606003A2D983DF23C8478C34B71322D9811CB98CD13
00C2918457E6805F7AE67FFE20FA6D84FE7FCA6D84B9C28484212D98352A
EF96772322EF9604C38484322E98212D98352AEF96712322EF96043A2E98
C640E67F2AEF96B3772322EF9604C331843EFF32D59678C34B71D29E843F
C5D5E5063221CB9836202310FB062021319836202310FB2A0597113198CD
1C44220597200D21319811CB98CD1C44E1D1C1C93718F93EFF32D696AF32
D596E511CB98216199CD2444E1C2ED75C34B7121139722EB9621CB9822E9
96AF322D98322E9801020085063236202310FB2AEB967E2322EB96FE2EC2
21853A2D98322E98AF322D98C35185B7CA7A852AE996772322E9963A2D98
3C322D98FE08FA0785322E98AF322D982AEB967E2322EB96B7CA7A85FE2E
C239852AE996362F2322E9962AEB967E2322EB96B7CA7A852AE996772322
E9963A2D983C322D98FE03FA5A852AEB96362411E491CD3B70111397CD3B
702AE99636033ADB96B7CAF98511CB98216199CD2444C2F98511D68ACDD7
7511CB98CD28442AE9962B7EFE4238FA3522E99611CB98216199CD2444C2
DD8511CB98CD28442AE996B7ED5220D911468ACD3B70C921CB98113198CD
1C443E3A010E00213198EDB1233624113198CD3B7011CB98216199CD0102
00862044CA4B71F511E789CDD775F1C3ED7532639B210F973E0177233A02
97D631473A629BC6238077230100004F3A619BC6207723814F3E0088473A
639B7723814F3E0088473A629BB7CA5A863D32629B7E23814F3E008847C3
44863A0297FE32CA8B86D2748679E6C0070781E63FC6207723C3A2863600
E5211097CD8088E14B427A07070707E60FC620772378E60F070747790707
E603B0C620772379E63FC62077233AFD967723AF773ADE96B72804233E24
77CDBC86C32E70C34B713AF996322D983A2D983DB7FAD786322D983AFB96
5FCDE970C3C2863ADC96B7CAF1863A0E97FE53CAF186CDF870C3F186FE11
C2E6863ADE96B7280C111C92CD3B7011109701020087CD3B70210F977EB7
CA13875FCDE97023C30687C34B71CD3888C32E70CD7288C31687FE0120F6
CD7288C32E70FE0128F63210974F3A0297D6314779D6239032629B0600CD
7288C32E70FE0128D932619B321197814F3E0088473A619BD62032619BCD
7288C32E70FE01CA2687322D98321297814F3E0088473A629B322E982113
9722EB963A2E98D601FAAA87322E98CD7288C32E70FE01CA26872AEB9677
2322EB96814F3E00884718DACD7288C32E70FE01CA2687D620322F983A02
97FE32CA0488D2D98779E6C0070781E63F473A2F98B8CA2D88CD6E7CC92A
EB963600211097CD80884B427A07070707E60F573A2F98BA20E1CD7288C3
2E70FE01CA2687D60102008820322F9878E60F070747790707E603B0473A
2F98B8C2D587CD7288C32E70FE01CA2687D6204779E63FB8C2D5872AEB96
36003A2D98C34B71216D9722F196CDF870C32E702AF196772322F196473A
FE96B820EB3ADE96B728103E247723110B92CD3B70116E97CD3B70216D97
22F196C34B712AF1967E2322F196FE0DC24B71C9E5C51100007EB7CAB388
E5AB5FE60F4F060021D6880909E57B0F0F0FE61E4F21B688097EAA2356E1
AE5F237EAA57E123C38588C1E1C900008110022183310442855206638773
088489940AA58BB50CC68DD60EE78FF70000891112239B322446AD573665
BF74488CC19D5AAFD3BE6CCAE5DB7EE9F7F80D4E756D626572206F660102
0089207061636B6574733A0D4E756D626572206F6620726574726965733A
0D46696C65206E616D653A244B65726D69742D54525338303E240D240D3F
556E7265636F676E697A656420636F6D6D616E64240D3F496C6C6567616C
20636861726163746572240D3F4E6F7420636F6E6669726D6564243F556E
61626C6520746F207265636569766520696E6974696174650D243F556E61
626C6520746F20726563656976652066696C65206E616D650D243F556E61
626C6520746F207265636569766520656E64206F662066696C650D243F55
6E61626C6520746F207265636569766520646174610D243F53797374656D
20444F53206572726F720D243F556E61626C0102008A6520746F20726563
6569766520616E2061636B6E6F776C656467656D656E742066726F6D2074
686520686F73740D240D3F556E61626C6520746F2066696E642066696C65
0D243F556E61626C6520746F2072656E616D652066696C65240D3F537973
74656D20444F53206572726F72240D3F556E61626C6520746F2074656C6C
20686F73742074686174207468652073657373696F6E2069732066696E69
73686564240D3F556E61626C6520746F2074656C6C20686F737420746F20
6C6F676F75742407436F6D706C6574656424074661696C6564242552656E
616D696E672066696C6520746F20240D3C436C6F73696E6720746865206C
6F672066696C653E0102008B240D3C436F6E6E656374656420746F207265
6D6F746520686F73742C207479706520244320746F2072657475726E3E0D
3C434C4541523E20697320436F6E74726F6C2D5F0D240D3C436F6E6E6563
74696F6E20636C6F7365642C206261636B206174206D6963726F3E242043
6F6E74726F6C2D24202854797065204C656674204172726F7720746F2073
656E64204354524C2D53290D2420284E6F7420696D706C656D656E746564
290D2407496E7465727275707465642444495220203A300D0D46696C6520
4B494C4C4544240D0D2B2B20426164206472697665206E616D65240D2043
6F6E6669726D2077697468203C454E5445523E2C2063616E63656C200102
008C77697468203C425245414B3E20240D5479706520746865206E657720
657363617065206368617261637465723A2020240D42594520746F20686F
737420284C4F474F55542920616E64206578697420746F20444F530D434F
4E4E45435420746F20686F7374206F6E2073656C656374656420706F7274
0D444952206F66206C6F63616C206469736B0D4558495420746F20444F53
0D46494E4953482072756E6E696E67204B65726D6974206F6E2074686520
686F73740D48454C5020627920676976696E672074686973206D65737361
67650D4B494C4C20612066696C650D4C4F4720746865207465726D696E61
6C2073657373696F6E20746F20612066696C0102008D650D4C4F474F5554
2074686520686F73740D524543454956452066696C652066726F6D20686F
73740D53454E442066696C6520746F20686F73740D534554206120706172
616D657465720D53484F572074686520706172616D65746572730D535441
545553206F66204B65726D6974240D42417564202872617465290D424C6F
636B2D636865636B2D747970652028666F72206572726F72206465746563
74696F6E0D444542756767696E67206D6F64652028746F20646973706C61
79207061636B657473290D45736361706520286368617261637465722064
7572696E6720434F4E4E454354290D46696C652D6D6F64652028666F7220
6F7574676F696E670102008E2066696C6573290D49626D20287061726974
7920616E64207475726E2061726F756E642068616E646C696E67290D4C6F
63616C2D6563686F202868616C662F6475706C6578290D50417269747920
28666F7220636F6D6D756E69636174696F6E206C696E65290D504F727420
28746F20636F6D6D756E6963617465206F6E290D5052696E746572202874
6F207072696E74207465726D696E616C2073657373696F6E290D56743532
2D656D756C6174696F6E0D5761726E696E672028666F722066696C656E61
6D6520636F6E666C6963747329240D5041442D434841520D50414444494E
47240D312D4348415241435445522D434845434B53554D0D322D43480102
008F415241435445522D434845434B53554D0D332D434841524143544552
2D4352432D4343495454240D4556454E2020204D41524B20204E4F4E4520
20204F44442020205350414345240D4F464620204F4E240D4E4F20202059
4553240D5354414E4441524420525332333220706F7274240D3F20205468
6973206D6573736167650D432020436C6F73652074686520636F6E6E6563
74696F6E0D302020287A65726F29205472616E736D69742061204E554C4C
0D532020537461747573206F662074686520636F6E6E656374696F6E0D54
79706520746865206573636170652063686172616374657220616761696E
20746F2073656E6420697420746F207468650102009020686F73740D0D43
6F6D6D616E643E24206F6E24206F6666240D4C6F63616C206563686F2420
64656661756C7424204153434949242062696E617279240D415343494920
2020202042494E415259202020202044454641554C54240D202020202035
302020202020373520202020203131302020203133342E35202020203135
3020202033303020202036303020202020313230300D2020203138303020
202032303030202020203234303020202020333630302020203438303020
20373230302020393630302020203139323030240D5654353220656D756C
6174696F6E240D46696C65204D6F6465240D49424D20666C6167240D4669
6C65207761726E69010200916E67240D5072696E746572240D4573636170
6520636861723A20240D446562756767696E67206D6F6465240D50617269
74793A20240D426C6F636B20636865636B20747970653A20242D63686172
6163746572246E6F6E65246D61726B247370616365246F6464246576656E
244C696E652053706565643A202420426175640D241C1F0D244B65726D69
742D3830205620332E3520285452532D3830204D6F64656C20312F33290D
24082008242008241D1E241C1A1A19191919191919191919191919191919
191919241C1A1A1A19191919191919191919191919191919191919241C24
1C1A1A1A1A1919191919191919191919241C1A1A1A1A1A1A241C1A1A0102
00921A1A1A1A1A1A1A1A1A1A241C1A1A1A1A1A1A1A1F525061636B3A2024
1C1A1A1A1A1A1A1A1A1A1A1F535061636B3A20241B2400001A2400001924
0000182400001C1F240024000024240000241C2400001B2400001F240000
1E24100342594524212107434F4E4E454354240000034449522424240345
524124272704455849542403030646494E495348241B1B03474554240C0C
0448454C50240606044B494C4C242727034C4F47240909064C4F474F5554
241E1E0752454345495645240C0C0453454E44240F0F0353455424121204
53484F57241515065354415455532418180C044241554424212110424C4F
434B2D434845434B2D545950452418180944010200934542554747494E47
242727064553434150452400000946494C452D4D4F44452412120349424D
2403030A4C4F43414C2D4543484F2406060650415249545924151504504F
5254241E1E075052494E5445522424240E565435322D454D554C4154494F
4E241B1B075741524E494E47240F0F02085041442D434841522400000750
414444494E472403030314312D4348415241435445522D434845434B5355
4D24313114322D4348415241435445522D434845434B53554D2432321533
2D4348415241435445522D4352432D434349545424333305044556454E24
0000044D41524B240303044E4F4E45240606034F44442409090553504143
45240C0C02024F4E01020094240101034F46462400000305415343494924
01010642494E4152592402020744454641554C5424000001085354414E44
41524424EB00EB0002024E4F240000035945532401010D3F50726F677261
6D206572726F723A2020496E76616C696420434F4D4E442063616C6C240D
3F416D626967756F7573240D3F496C6C6567616C20696E7075742066696C
6520737065632420436F6E6669726D2077697468203C454E5445523E2C20
43616E63656C2077697468203C425245414B3E240D241002353024000002
373524111103313130242222053133342E35243333033135302444440333
30302455550336303024666604313230302477770431383030248888013B
00950432303030249999043234303024AAAA043336303024BBBB04343830
3024CCCC043732303024DDDD043936303024EEEE05313932303024FFFF01
0DD796000000010100000000061F0104ED96619A0112F49655205E080500
0000000D0D2323313131010405975198020200706967756F7573240D3F49
6C6C6567616C20696E7075742066696C6520737065632420436F6E666972
6D2077697468203C454E5445523E2C2043616E63656C2077697468203C42
5245414B3E240D2410023530240000023735241111033131302422220531
33342E352433330331353024444403333030245555033630302466660431
3230302477770431383030248888013B0095043230303024999904323430
3024AAAA043336303024BBBB043438303024CCCC043732303024DDDD0439
36303024EEEE05313932303024FFFF010DD796000000010100000000061F
0104ED96619A0112F49655205E0805000000000D0D232331
<<< trsmit.hlp >>>
This implementation of the Kermit protocol was done by Stan Barber at Rice
University (sob@RICE). It is compatable with all DOS's available for the TRS80
Model I or Model III (and the Model 4 running in Model III mode). It has been
checked out under the following DOS's: TRSDOS 2.3 (Model I), TRSDOS 1.3 (Model
III), NEWDOS/80 V 2.0, LDOS 5.1.3, DOS+ 3.5 and VTOS 3.0 (Model I).
The files are as follows:
TRS80 Name Distribution Name Description
COMND/SRC TRSCMD.SRC Command parser
GET/SRC TRSGET.SRC RECEIVE & GET command
KERMIT/SRC TRSMIT.SRC Main source module, calls in others
KERSTR/SRC TRSSTR.SRC Strings & storage area
KILLDIR/SRC TRSKD.SRC Source for KILL & DIR commands
MORE/SRC TRSMORE.SRC Source for misc commands
SEND/SRC TRSSEND.SRC Source for SEND command
XFER/SRC TRSXFER.SRC Source common to RECEIVE & SEND
KERMIT/DOC TRSMIT.DOC User Guide manual chapter
KERMAKE/BAS TRSMAKE.BAS Basic program to create binaries
<<< trsmit.src >>>
;kermit-trs80
;started 10/10/83
;updated 04/01/84
;by Stan Barber
;based on CP/M-80 Kermit
ORG 7000H ;GET OUT OF WAY OF DOS OVERLAYS
; Symbolic Definitions for some ASCII characters
;
BELL EQU 07O ;ASCII BEL (Control-G)
CTRLC EQU 03O ;ASCII ETX (Control-C)
TAB EQU 11O ;ASCII Tab (Control-I)
LF EQU 12O ;ASCII Line Feed (CTRL-J)
FF EQU 14O ;ASCII Form Feed (CTRL-L)
CR EQU 15O ;ASCII Carriage Return (CTRL-M)
XON EQU 21O ;The the ASCII character used for XON
XOFF EQU 23O ;The the ASCII character used for XOFF
ESC EQU 33O ;ASCII ESCape
SUBT EQU 32O ;ASCII SUB (CTRL-Z)
DEL EQU 177O ;ASCII DELete (rubout)
RESET EQU 0E8H ;reset uart
BAUDST EQU 0E9H ;set baud rate
MNPORT EQU 0EBH ;RS232 data port
MNPRTS EQU 0EAH ;RS232 STATUS PORT
OUTPUT EQU 40H
INPUT EQU 80H
DEFESC EQU 31 ;<CLEAR> key on key board
DBAUD EQU 55H ;Default baud rate (300)
MAXPKT EQU '~'-' '+2O ; Maximum size of a packet.
MAXTRY EQU 05O ; Default number of retries on a packet.
IMXTRY EQU 20O ; Default number of retries send initiate.
DRPSIZ EQU 5EH ; Default receive packet size.
DSPSIZ EQU 20H ; Default send packet size.
DSTIME EQU 08H ; Default send time out interval.
DRTIME EQU 05H ; Default receive time out interval.
DSPAD EQU 00H ; Default send padding.
DRPAD EQU 00H ; Default receive padding.
DSPADC EQU 00H ; Default send padding char.
DRPADC EQU 00H ; Default receive padding char.
DSEOL EQU CR ; Default send EOL char.
DREOL EQU CR ; Default receive EOL char.
DSQUOT EQU '#' ; Default send quote char.
DRQUOT EQU '#' ; Default receive quote char.
DSCHKT EQU '1' ; Default checksum type
PAREVN EQU 00H ; Even parity.
PARMRK EQU 03H ; Mark parity.
PARNON EQU 06H ; No parity.
PARODD EQU 09H ; Odd parity.
PARSPC EQU 0CH ; Space parity.
DEFPAR EQU PARNON ; Default parity.
IBMPAR EQU PARMRK ; IBM COMTEN's parity.
SOH EQU 01H ; Start of header char.
BUFSIZ EQU 0
DIASW EQU 01H ; Default is diagnostics on.
CMKEY EQU 01H ; Parse a keyword.
CMIFI EQU 02H ; Parse an input file spec (can be wild).
CMOFI EQU 03H ; Parse an output file spec.
CMCFM EQU 04H ; Parse a confirm.
CMTXT EQU 05H ; Parse text.
CMIFIN EQU 10H ; Parse an input file spec (but no
;dos calls (all preceeded by @)
@GET EQU 13H ;get a byte from a file
@PUT EQU 1BH ;put a byte in a file
@KBD EQU 2BH ;scan keyboard and return
@DSP EQU 33H ;put a character on screen
@PRT EQU 3BH ;put a character on the printer
@KEYIN EQU 40H ;get a line from keyboard
@KEY EQU 49H ;wait for key from keyboard
@EXIT EQU 402DH ;normal exit to dos
@ABORT EQU 4030H ;abnormal exit to dos
@CMNDI EQU 4405H ;execute command =>HL
@ERROR EQU 4409H ;print dos error
@FSPEC EQU 441CH ;process filespec
@INIT EQU 4420H ;initialize a file
@OPEN EQU 4424H ;open existing file
@CLOSE EQU 4428H ;close open file
@KILL EQU 442CH ;kill open file
@VER EQU 443CH ;write a sector with verify
START LD (OLDSP),SP
LD SP,STACK
CALL MDMRST
XOR A ;ZERO A
LD (FCB),A ;SET FILE CLOSED FLAG
LD DE,VERSIO
CALL PRTSTR
CALL KERMIT
JP EXIT1
MDMRST LD A,(SPEED)
OUT (RESET),A
OUT (BAUDST),A
LD A,108
OUT (MNPRTS),A
RET
CMBLNK PUSH DE
LD DE,CLRTOP
CALL PRTSTR
POP DE
QUIT: RET
CONOUT PUSH DE
PUSH HL
PUSH BC
PUSH AF
CALL @DSP
POP AF
POP BC
POP HL
POP DE
RET
PRTSTR LD A,(DE)
CP '$'
RET Z
CALL CONOUT
INC DE
JR PRTSTR
CONIN PUSH DE
CALL @KBD
POP DE
RET
KERMIT LD DE,FCB
LD A,(DE)
BIT 7,A ;WAS FILE OPEN?
CALL NZ,@CLOSE ;CLOSE IT IF IT WAS
LD DE,KERM
CALL PROMPT
LD DE,COMTAB
LD HL,TOPHLP
LD A,CMKEY
CALL COMND
JP KERMT2
LD HL,KERMTB
LD C,A
LD B,0
ADD HL,BC
JP (HL)
KERMTB JP TELNET
JP EXIT
JP HELP
JP LOG
JP READ
JP SEND
JP SETCOM
JP SHOW
JP STATUS
JP FINISH
JP LOGOUT
JP BYE
JP DIR
JP ERA
KERMT2 LD DE,ERMES1
CALL PRTSTR
JP KERMIT
KERMT3 LD DE,ERMES3
CALL PRTSTR
JP KERMIT
SETPAR PUSH HL
PUSH BC
LD HL,PARITY
LD C,(HL)
LD B,0
LD HL,PARJMP
ADD HL,BC
JP (HL)
PARJMP JP EVEN
JP MARK
JP NONE
JP ODD
JP SPACE
NONE JP PARRET
EVEN AND 7FH
JP PE,PARRET
OR 80H
JP PARRET
MARK OR 80H
JP PARRET
ODD AND 7FH
JP PO,PARRET
OR 80H
JP PARRET
SPACE AND 7FH
PARRET POP BC
POP HL
RET
OUTCHR PUSH DE
OUTCHR1 IN A,(MNPRTS)
AND OUTPUT
JR Z,OUTCHR1
LD A,E
CALL SETPAR
OUT (MNPORT),A
POP DE
RET
INCHR IN A,(MNPRTS)
AND INPUT
JR NZ,INCHR2
CALL CONIN
OR A
JR Z,INCHR
CP CR
JR NZ,INCHR4
RET
INCHR4 CP 1AH ;CONTROL-Z?
JR Z,INCHR5
CP 18H ;CONTROL-X?
JR NZ,INCHR
INCHR5 ADD A,20H
LD (CZSEEN),A
RET
INCHR2 IN A,(MNPORT)
LD B,A
LD A,(PARITY)
CP PARNON
LD A,B
JP Z,RSKP
AND 7FH
JP RSKP
EXIT LD A,CMCFM
CALL COMND
JP KERMT3
EXIT1 LD DE,FCB
LD A,(FCB)
BIT 7,A
CALL NZ,@CLOSE ;JUST IN CASE
LD SP,(OLDSP)
JP @EXIT
HELP LD DE,TOPHLP
CALL PRTSTR
JP KERMIT
*GET COMND/SRC ;COMMAND PARSER
*GET KILLDIR/SRC ;KILL AND DIR COMMANDS
*GET MORE/SRC ;MOST OF THE NON PROTOCOL RELATED COMMANDS
*GET GET/SRC ;RECEIVE PROTOCOL
*GET SEND/SRC ;SEND PROTOCOL
*GET XFER/SRC ;PROTOCOL COMMON CODE
*GET KERSTR/SRC ;STRINGS
END START
<<< trsmore.src >>>
; THIS IS WHERE WE GO IF WE GET AN ERROR DURING A PROTOCOL COMMUNICATION.
; CALL ERROR PRINTS THE ERROR PACKET ON LINE 6 OR SO.
; CALL ERROR1 PRINT CRLF FOLLOWED BY THE ERROR PACKET.
; CALL ERROR2 JUST PRINTS THE ERROR PACKET.
; CALL ERROR3 POSITIONS CURSOR AND PRINTS ERROR MESSAGE SPECIFIED IN DE.
ERROR: CALL ERROR9 ; POSITION THE CURSOR.
LD A,'A' ; SET THE STATE TO ABORT.
LD (STATE),A
JP ERROR2
ERROR1: LD DE,CRLF ; PRINT A CRLF.
CALL PRTSTR
ERROR2: LD A,(ARGBLK+1) ; GET THE LENGTH OF THE DATA.
LD C,A
LD B,0 ; PUT IT INTO BC
LD HL,DATA ; GET THE ADDRESS OF THE DATA.
ADD HL,BC ; GET TO THE END OF THE STRING.
LD A,'$' ; PUT A DOLLAR SIGN AT THE END.
LD (HL),A
LD DE,DATA ; PRINT ERROR MESSAGE
CALL PRTSTR
RET
ERROR3: PUSH DE ; SAVE THE POINTER TO THE MESSAGE.
CALL ERROR9 ; POSITION THE CURSOR.
LD DE,CLRLIN ; CLEAR THE LINE
CALL PRTSTR
POP DE ; GET THE POINTER BACK.
CALL PRTSTR ; PRINT ERROR MESSAGE
RET
ERROR9: LD DE,SCRERR ; POSITION CURSOR
CALL PRTSTR
RET
ERRORD: OR A ;display disk error
RET Z
OR 80H
OR 40H
CALL @ERROR
RET
FINMES: PUSH DE ; SAVE MESSAGE.
LD DE,SCRST
CALL PRTSTR
POP DE ; PRINT THE TERMINATION MESSAGE
CALL PRTSTR
LD DE,SCREND ; POSITION CURSOR FOR PROMPT
CALL PRTSTR
RET
; THIS IS THE FINISH COMMAND. IT TELLS THE REMOTE KERSRV TO EXIT.
FINISH: LD A,CMCFM
CALL COMND ; GET A CONFIRM.
JP KERMT3
XOR A ; DIDN'T GET A CONFIRM.
LD (NUMTRY),A ; INITITIALIZE COUNT.
LD A,'1' ; RESET BLOCK CHECK TYPE TO SINGLE CHARACTER
LD (CURCHK),A ; . . .
FINSH1: LD A,(NUMTRY) ; HOW MANY TIMES HAVE WE TRIED?
CP MAXTRY ; TOO MANY TIMES?
JP M,FINSH3 ; NO, TRY IT.
FINSH2: LD DE,ERMS18 ; SAY WE COULDN'T DO IT.
CALL PRTSTR
JP KERMIT ; GO HOME.
FINSH3: INC A ; INCREMENT THE NUMBER OF TRIES.
LD (NUMTRY),A
XOR A
LD (ARGBLK),A ; MAKE IT PACKET NUMBER ZERO.
LD A,1
LD (ARGBLK+1),A ; ONE PIECE OF DATA.
LD HL,DATA
LD (HL),'F' ; FINISH RUNNING KERMIT.
LD A,'G' ; GENERIC COMMAND PACKET.
CALL SPACK
JP FINSH1
CALL RPACK ;GET AN ACKNOWLEDGEMENT.
JP FINSH1
CP 'Y' ; ACK?
JP Z,KERMIT ; YES, WE ARE DONE.
CP 'E' ; IS IT AN ERROR PACKET?
JP NZ,FINSH1 ; TRY SENDING THE PACKET AGAIN.
CALL ERROR1 ; PRINT THE ERROR MESSAGE.
JP KERMIT
; THIS IS THE LOGOUT COMMAND. IT TELLS THE REMOTE KERSRV TO LOGOUT.
LOGOUT: LD A,CMCFM
CALL COMND ; GET A CONFIRM.
JP KERMT3
CALL LOGO ; SEND THE LOGOUT PACKET.
JP KERMIT ; GO GET ANOTHER COMMAND
JP KERMIT ; WHETHER WE SUCCEED OR NOT.
LOGO: XOR A
LD (NUMTRY),A ; INITITIALIZE COUNT.
LD A,'1' ; RESET BLOCK CHECK TYPE TO SINGLE CHARACTER
LD (CURCHK),A ; . . .
LOGO1: LD A,(NUMTRY) ; HOW MANY TIMES HAVE WE TRIED?
CP MAXTRY ; TOO MANY TIMES?
JP M,LOGO3 ; NO, TRY IT.
LOGO2: LD DE,ERMS19 ; SAY WE COULDN'T DO IT.
CALL PRTSTR
RET ; FINISHED.
LOGO3: INC A ; INCREMENT THE NUMBER OF TRIES.
LD (NUMTRY),A
XOR A
LD (ARGBLK),A ; MAKE IT PACKET NUMBER ZERO.
LD A,1
LD (ARGBLK+1),A ; ONE PIECE OF DATA.
LD HL,DATA
LD (HL),'L' ; LOGOUT THE REMOTE HOST.
LD A,'G' ; GENERIC COMMAND PACKET.
CALL SPACK
JP LOGO2
CALL RPACK ; GET AN ACKNOWLEDGEMENT
JP LOGO1
CP 'Y' ; ACK?
JP Z,RSKP ; YES, WE ARE DONE.
CP 'E' ; IS IT AN ERROR PACKET?
JP NZ,LOGO1 ; TRY SENDING THE PACKET AGAIN.
CALL ERROR1 ; PRINT THE ERROR MESSAGE.
RET ; ALL DONE.
; THIS IS THE BYE COMMAND. IT TELLS THE REMOTE KERSRV TO LOGOUT AND EXITS.
BYE: LD A,CMCFM
CALL COMND ; GET A CONFIRM.
JP KERMT3
CALL LOGO ; TELL THE MAIN FRAME TO LOGOUT.
JP KERMIT ; IF IT FAILS, DON'T EXIT.
JP EXIT1 ; EXIT KERMIT.
; THIS IS THE LOG COMMAND. IT LOGS A SESSION TO A FILE.
LOG: LD A,CMOFI ; PARSE AN INPUT FILE SPEC.
LD DE,LFCB
CALL COMND
JP KERMT3
LD A,CMCFM ; PARSE A CONFIRM.
CALL COMND
JP KERMT3
LD HL,LOGFLG
LD (HL),0FFH ; SET THE LOG FLAG.
LD HL,LBUFF
LD (BUFPNT),HL
LD DE,LFCB
CALL @OPEN
JR NZ,LOG1A
LD DE,LFCB
CALL @KILL
LD DE,LFCB
LD HL,(BUFPNT)
LOG1A: CALL @INIT
JP NZ,KERMIT ;[UTK3]
CALL ERRORD
JP KERMIT
;this is the connect command
TELNET: LD A,CMCFM
CALL COMND
JP KERMT3
LD DE,INFMS7
CALL PRTSTR
CALL ESCPR
LD DE,INFMS8
CALL PRTSTR
CHRLUP CALL PRTCHR
CALL CONCHR
JP KERMIT
JP CHRLUP
PRTCHR IN A,(MNPRTS)
AND INPUT
RET Z
PRTCH2 IN A,(MNPORT)
AND 7FH
CP LF
JR Z,PRTCHR
LD E,A
LD A,(VTFLG)
OR A
JR Z,PRTCH1
LD A,(ESCFLG)
OR A
JP NZ,VT52
LD A,E
CP DEL
RET Z
CP ESC
JR NZ,PRTCH1
LD (ESCFLG),A
JP PRTCHR
PRTCH1 CP FF
JP Z,CMBLNK
LD A,(LOGFLG)
OR A
CALL NZ,LOGIT
LD A,(PRTFLG)
OR A
CALL NZ,PRTIT
LD A,E
CALL CONOUT
JP PRTCHR
CONCHR CALL CONIN
AND 7FH
OR A
JP Z,RSKP
LD E,A
LD A,(ESCCHR)
CP E
JP Z,INTCHR
LD A,E
CALL SETPAR
LD E,A
PUSH DE
CALL PRTOUT
POP DE
LD A,(ECOFLG)
OR A
JP Z,RSKP
LD A,E
AND 7FH
CALL CONOUT
JP RSKP
INTCHR CALL ESCPR
INTCH0 CALL CONIN
OR A
JR Z,INTCH0
LD B,A
CALL CONOUT
LD A,B
CP CTRLC ;control-c?
JR Z,CONTC ;yes
AND 137O
CP 'C' ;is it close?
JP NZ,INTCHR0 ;no
CONTC LD DE,INFMS9
CALL PRTSTR
LD A,(LOGFLG) ;is log file on?
OR A
RET Z ;no
XOR A
LD (LOGFLG),A ;turn it off
LD DE,INFMS6
CALL PRTSTR
LD DE,LFCB
CALL @CLOSE
RET
INTCHR0 CP 'S' ;status?
JR NZ,INCH01
CALL STAT01 ;print out status
JP RSKP
INCH01 LD A,B
CP '?'
JR NZ,INTCH1
LD DE,INTHLP
CALL PRTSTR
JP INTCH0
INTCH1 LD A,B
AND 7FH
CP 'B'
JR NZ,INTCH2
LD DE,INMS12
CALL PRTSTR
JP RSKP
INTCH2 LD A,B
CP '0'
JR NZ,INTCH3
LD A,0
CALL OUTCHR
JP RSKP
INTCH3 LD E,A
LD A,(ESCCHR)
CP E
JR Z,INTCHZ
LD A,E
CALL SETPAR
CALL PRTOUT
JP RSKP
INTCHZ LD A,BELL
CALL CONOUT
JP RSKP
VT52 XOR A
LD (ESCFLG),A
LD A,E
CP 'A'
RET M
CP 'K'+1
RET P
SUB 'A'
RLCA
RLCA
LD HL,TA
LD E,A
LD D,0
ADD HL,DE
EX DE,HL
CALL PRTSTR
RET
LOGIT LD A,E
LD HL,(LOGPTR)
LD (HL),A
INC HL
LD (LOGPTR),HL
PUSH HL
POP BC
LD HL,LBUFF+257
OR A
SBC HL,BC
RET NZ ;not full yet
PUSH DE
LD A,XOFF ;stop data flow
CALL OUTCHR ;send it out
LD DE,LFCB
CALL @VER ;write out the buffer
JR Z,LOGIT2
LD DE,ERMS11
CALL PRTSTR
LOGIT2 LD HL,LBUFF
LD (LOGPTR),HL
LD A,XON
CALL OUTCHR ;start data flow
POP DE
RET
PRTIT LD A,(37E8H) ;get printer status
AND 0F0H
CP 30H
RET NZ ;skip this one
LD A,E
PUSH DE
CALL @PRT ;dos printer routine
POP DE
RET
PRTOUT OR A
RET Z
LD E,A
CALL OUTCHR
RET
; THIS IS THE SET COMMAND.
SETCOM: LD DE,SETTAB ; PARSE A KEYWORD FROM THE SET TABLE.
LD HL,SETHLP
LD A,CMKEY
CALL COMND
JP KERMT2
LD HL,SETJTB ; GET THE ADDRESS OF THE JUMP TABLE.
LD C,A
LD B,0
ADD HL,BC
JP (HL)
SETJTB: JP ESCAPE ; 00H SET ESC
JP IBMSET ; 03H SET IBM
JP LOCAL ; 06H SET LOCAL
JP KERMT3 ; 09H SET RECEIVE (NOT CURRENTLY USED)
JP SETSND ; 0CH SET SEND (NOT CURRENTLY USED)
JP FILWAR ; 0FH SET WARNING
JP SETCPM ; 12H SET FILE-MODE
JP PARSET ; 15H SET PARITY
JP BLKSET ; 18H SET BLOCK-CHECK-TYPE
JP VT52EM ; 1BH SET VT52
JP PRTSET ; 1EH SET PORT
JP BAUD ; 21H SET BAUD
JP PRINTR ; 24H set printer
JP SETBUG ; 27H SET DEBUG
BLKSET: LD DE,BLKTAB ; GET THE ADDRESS OF THE BLOCK-CHECK TABLE
LD HL,BLKHLP ; AND THE ADDRESS OF THE HELP TEXT
LD A,CMKEY ; PARSE A KEYWORD
CALL COMND ; GO GET IT
JP KERMT2 ; COULDN'T, COMPLAIN
LD (TEMP1),A ; SAVE THE PARSED ITEM
LD A,CMCFM ; WANT TO END THE COMMAND
CALL COMND ; GO DO IT
JP KERMT2 ; GIVE UP
LD A,(TEMP1) ; GET THE VALUE BACK
LD (CHKTYP),A ; SAVE DESIRED CHECKSUM TYPE
JP KERMIT ; GO GET ANOTHER COMMAND
; SET DEFAULT DISK COMMAND
;SETDISK: JP KERMT3 ;not used on trs80
;SETDI1: LD A,(FCB)
; cp 0
; JP NZ,SETDI2 ; HE TYPED A DRIVE-SPEC
; LD A,(CURDSK) ; HE DIDN'T - GIVE HIM DEFAULT
;SETDI2: LD (CURDSK),A
; JP KERMIT ; ALL DONE
; SET SEND COMMAND.
SETSND: LD DE,STSNTB ; PARSE A KEYWORD FROM THE SET SEND TABLE.
LD HL,STSHLP
LD A,CMKEY
CALL COMND
JP KERMT2
LD HL,STSJTB ; GET THE ADDRESS OF THE JUMP TABLE.
LD C,A
LD B,0
ADD HL,BC
JP (HL)
STSJTB: JP STPDCH
JP STPAD
STPAD: LD A,CMCFM
CALL COMND ; GET A CONFIRM.
JP KERMT3 ; DIDN'T GET A CONFIRM.
JP KERMIT
STPDCH: LD A,CMCFM
CALL COMND ; GET A CONFIRM.
JP KERMT3 ; DIDN'T GET A CONFIRM.
JP KERMIT
;THIS IS THE SET SPEED COMMAND
BAUD: LD DE,SPDTAB
LD HL,SPDHLP
CALL ONOFFA
LD (SPEED),A ; SET THE SPEED.
CALL MDMRST ;set the speed
JP KERMIT
; THIS IS THE ESCAPE CHARACTER SET SUBCOMMAND.
ESCAPE: LD A,CMCFM; NOT (BRAIN OR OSBRN1 OR KPII)
CALL COMND ; GET A CONFIRM.
JP KERMT3 ; DIDN'T GET A CONFIRM.
LD DE,ESCMES ; GET THE ADDRESS OF THE ESCAPE MESSAGE.
CALL PRTSTR
CALL @KEY
CALL CONOUT
LD (ESCCHR),A ; STORE THE NEW ESCAPE CHARACTER.
JP KERMIT
; THIS IS THE LOCAL ECHO SET SUBCOMMAND.
LOCAL: CALL ONOFF
LD A,(TEMP1) ; GET THE PARSED VALUE.
LD (ECOFLG),A ; SET THE LOCAL ECHO FLAG.
JP KERMIT
; THIS IS THE VT52 EMULATION SET SUBCOMMAND.
VT52EM: CALL ONOFF
LD (VTFLG),A ; SET THE VT52 EMULATION FLAG.
JP KERMIT
; THIS IS THE FILE-WARNING SET SUBCOMMAND
FILWAR: CALL ONOFF
LD (FLWFLG),A ; SET THE FILE-WARNING FLAG.
JP KERMIT
; THIS IS THE SET IBM COMMAND.
IBMSET: CALL ONOFF
LD (IBMFLG),A ; SET THE IBM FLAG.
OR A ; IS IT TURNED ON?
JR Z,IBMST1 ; IF NOT, SET PARITY TO THE DEFAULT.
LD A,IBMPAR ; GET THE IBM PARITY.
LD B,1 ; SET LOCAL ECHO ON.
JR IBMST2
IBMST1: LD A,DEFPAR
LD B,0 ; SET LOCAL ECHO OFF.
IBMST2: LD (PARITY),A ; SAVE THEM.
LD A,B
LD (ECOFLG),A
JP KERMIT
; THIS IS THE SET PORT COMMAND.
PRTSET: LD DE,PRTTAB ; GET THE TABLE ADDRESS
LD HL,PRTHLP ; AND THE ADDRESS OF THE HELP TEXT
LD A,CMKEY ; WANT A KEYWORD
CALL COMND ; GET THE FIELD OF THE COMMAND
JP KERMT2 ; NOT VALID, GIVE ERROR
LD (TEMP1),A ; SAVE THE PARSED VALUE.
LD A,D ; GET THE FUNCTION TO USE
LD (TEMP2),A ; SAVE FOR LATER
LD A,CMCFM ; MAKE SURE COMMAND IS FINISHED
CALL COMND ; GET A CONFIRM.
JP KERMT3 ; DIDN'T GET A CONFIRM.
LD HL,(TEMP1) ; GET THE TABLE POINTER
LD A,(HL) ; GET THE I/O port
LD (PORT),A ;save as current
JP KERMIT
; TABLE ENTRIES ARE:
; DB port,port
;
; SET FILE-MODE COMMAND.
SETCPM: LD DE,TYPTAB
LD HL,TYPHLP
CALL ONOFFA
LD (CPMFLG),A ;SET THE CPM FLAG
JP KERMIT
; Set Printer command
PRINTR: CALL ONOFF
LD (PRTFLG),A
JP KERMIT
PARSET: LD DE,PARTAB
LD HL,PARHLP
CALL ONOFFA
LD (PARITY),A ; SET THE CPM FLAG.
JP KERMIT
;SET DEBUG
SETBUG: CALL ONOFF
LD (DBFLG),A
JP KERMIT
ONOFF: LD DE,ONTAB
LD HL,ONHLP
ONOFFA: LD A,CMKEY
CALL COMND
JP ONOFF2
LD (TEMP1),A
LD A,CMCFM
CALL COMND
JP ONOFF3
LD A,(TEMP1)
RET
ONOFF2: POP AF
JP KERMT2
ONOFF3: POP AF
JP KERMT3
; THIS IS THE SHOW COMMAND.
SHOW: LD A,CMCFM
;* RECONCILE THIS AND STATUS.
CALL STAT01 ; FOR NOW JUST COP OUT.
JP KERMIT
; THIS IS THE STATUS COMMAND.
STATUS: CALL STAT01
JP KERMIT
STAT01: LD DE,LOCST ; GET THE ADDRESS OF THE LOCAL ECHO STRING.
CALL PRTSTR
LD DE,OFFSTR
LD A,(ECOFLG) ; GET THE LOCAL ECHO FLAG.
OR A ; IS IT ON?
JR Z,STAT03 ; IF NOT SAY SO.
LD DE,ONSTR ; SAY ON.
STAT03: CALL PRTSTR
LD DE,VTEMST ; GET THE ADDRESS OF THE VT52 EMULATION STRING.
CALL PRTSTR
LD DE,OFFSTR
LD A,(VTFLG) ; GET THE VT52 EMULATION FLAG.
OR A ; IS IT ON?
JR Z,STAT11 ; IF NOT SAY SO.
LD DE,ONSTR ; SAY ON.
STAT11: CALL PRTSTR
LD DE,CPMST ; GET THE ADDRESS OF THE CPM CREATED FILE.
CALL PRTSTR
LD A,(CPMFLG)
OR A ; IS IT ON?
JR Z,STAT2 ; IF NOT SAY SO.
CP 1 ; ASCII?
LD DE,ASCSTR;
JR Z,STAT21 ; SAY ASCII
LD DE,BINSTR; SAY BINARY
JR STAT21
STAT2: LD DE,DEFSTR ; SAY DEFAULT.
STAT21: CALL PRTSTR
LD DE,IBMST ; IBM STRING.
CALL PRTSTR
LD DE,OFFSTR
LD A,(IBMFLG) ; IBM FLAG.
OR A ; IS IT ON?
JR Z,STAT3 ; IF NOT SAY SO.
LD DE,ONSTR ; SAY ON.
STAT3: CALL PRTSTR
LD DE,FILST ; FILE WARNING STRING.
CALL PRTSTR
LD DE,OFFSTR
LD A,(FLWFLG) ; FILE WARNING FLAG.
OR A ; IS IT ON?
JR Z,STAT4 ; IF NOT SAY SO.
LD DE,ONSTR ; SAY ON.
STAT4: CALL PRTSTR
LD DE,BUGST ;debug string
CALL PRTSTR
LD DE,OFFSTR
LD A,(DBFLG)
OR A
JR Z,STAT4A
LD DE,ONSTR
STAT4A: CALL PRTSTR
LD DE,PARST ; PARITY STRING.
LD DE,PNTSTR ;printer string
CALL PRTSTR
LD DE,OFFSTR
LD A,(PRTFLG) ;get printer flag
OR A
JR Z,STAT4D
LD DE,ONSTR
STAT4D: CALL PRTSTR
LD DE,PARST
CALL PRTSTR
LD A,(PARITY) ; GET THE PARITY SETTING.
LD DE,PNONST ; NONE BY DEFAULT.
CP PARMRK ; IS IT MARK?
JR NZ,STAT5 ; IF NOT SAY SO.
LD DE,PMRKST ; SAY MARK.
JR STAT55
STAT5: CP PARSPC ; IS IT SPACE?
JR NZ,STAT51 ; IF NOT SAY SO.
LD DE,PSPCST ; SAY SPACE.
JR STAT55
STAT51: CP PARODD ; IS IT ODD?
JR NZ,STAT52 ; IF NOT SAY SO.
LD DE,PODDST ; SAY ODD.
JR STAT55
STAT52: CP PAREVN ; IS IT EVEN?
JR NZ,STAT55 ; IF NOT SAY SO.
LD DE,PEVNST ; SAY EVEN.
STAT55: CALL PRTSTR
; PRINT OUT CURRENT BLOCK-CHECK-TYPE
LD DE,BCKST ; GET THE STRING
CALL PRTSTR ; PRINT "BLOCK CHECK TYPE: "
LD A,(CHKTYP) ; GET THE TYPE (CHARACTER 1, 2, OR 3)
CALL CONOUT
LD DE,BCKST1; GET REST OF TEXT ("-CHARACTER")
CALL PRTSTR ; . . .
; PRINT THE CURRENT ESCAPE CHARACTER
LD DE,ESCST ; ESCAPE STRING.
CALL PRTSTR
CALL ESCPR ; PRINT THE ESCAPE CHAR.
LD DE,CRLF ; GET THE ADDRESS OF A CRLF.
CALL PRTSTR
; print current baud rate
LD DE,SPEDST ;line speed
CALL PRTSTR
LD A,(SPEED)
SUB 11H ;decement baud bit
LD HL,SPDTAB ;baud speed table
LD BC,CMSTAT-SPDTAB
CPIR ;block compare
INC HL
INC HL
EX DE,HL
CALL PRTSTR ;print baud rate
LD DE,BAUST ;' baud'
CALL PRTSTR
RET
<<< trssend.src >>>
; SEND COMMAND
SEND: PUSH BC
PUSH HL
LD B,7AH
LD HL,MFNBUF
SEND0: LD (HL),20H
INC HL
DJNZ SEND0
POP HL
POP BC
LD A,CMTXT ; PARSE AN INPUT FILE SPEC.
LD DE,MFNBUF ; GIVE THE ADDRESS FOR THE FCB.
CALL COMND
JP KERMIT ; GIVE UP ON BAD PARSE.
SEND1: LD A,CMCFM
CALL COMND ; GET A CONFIRM.
JP KERMIT ; DIDN'T GET A CONFIRM.
SEND11: LD HL,MFNBUF
LD (MFNPTR),HL
CALL MFNAME ; HANDLE (MULTI) FILES
JR NC,SEND14 ; GOT A VALID FILE-NAME
LD DE,ERMS15
CALL ERROR3 ; DISPLAY ERROR MSG.
JP KERMIT
SEND14: CALL INIT ; CLEAR THE LINE AND INITIALIZE THE BUFFERS.
XOR A
LD (PKTNUM),A ; SET THE PACKET NUMBER TO ZERO.
LD (NUMTRY),A ; SET THE NUMBER OF TRIES TO ZERO.
LD HL,0
LD (NUMPKT),HL ; SET THE NUMBER OF PACKETS TO ZERO.
LD (NUMRTR),HL ; SET THE NUMBER OF RETRIES TO ZERO.
LD DE,SCRNRT ; POSITION CURSOR
CALL PRTSTR
LD HL,0
CALL NOUT ; WRITE THE NUMBER OF RETRIES.
LD A,'1' ; RESET TO USE SINGLE CHARACTER CHECKSUM
LD (CURCHK),A ; FOR STARTUP
LD A,'S'
LD (STATE),A ; SET THE STATE TO RECEIVE INITIATE.
; SEND STATE TABLE SWITCHER
SEND2: LD DE,SCRNP ; POSITION CURSOR
CALL PRTSTR
LD HL,(NUMPKT)
CALL NOUT ; WRITE THE PACKET NUMBER.
LD A,(STATE) ; GET THE STATE.
CP 'D' ; ARE WE IN THE DATA SEND STATE?
JR NZ,SEND3
CALL SDATA
JP SEND2
SEND3: CP 'F' ; ARE WE IN THE FILE SEND STATE?
JR NZ,SEND4
CALL SFILE ; CALL SEND FILE.
JP SEND2
SEND4: CP 'Z' ; ARE WE IN THE EOF STATE?
JR NZ,SEND5
CALL SEOF
JP SEND2
SEND5: CP 'S' ; ARE WE IN THE SEND INITIATE STATE?
JR NZ,SEND6
CALL SINIT
JP SEND2
SEND6: CP 'B' ; ARE WE IN THE EOT STATE?
JR NZ,SEND7
CALL SEOT
JP SEND2
SEND7: CP 'C' ; ARE WE IN THE SEND COMPLETE STATE?
JR NZ,SEND8 ; NO...
LD DE,INFMS3 ; YES, WRITE "COMPLETE" MESSAGE.
LD A,(CZSEEN)
OR A ; . . .
JR Z,SEND7A ; NO.
LD DE,INMS13 ; YES, THEN SAY "INTERRUPTED" INSTEAD.
SEND7A: CALL FINMES
JP KERMIT
SEND8: CP 'A' ; ARE WE IN THE SEND "ABORT" STATE?
JR NZ,SEND9
LD DE,INFMS4 ; PRINT MESSAGE.
CALL FINMES
JP KERMIT
SEND9: LD DE,INFMS4 ; ANYTHING ELSE IS EQUIVALENT TO "ABORT".
CALL FINMES
JP KERMIT
; SEND ROUTINES
; SEND INITIATE
SINIT: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP IMXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,SINIT2
LD DE,ERMS14
CALL ERROR3 ; DISPLAY ERMSG
JP ABORT ; CHANGE THE STATE TO ABORT.
SINIT2: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,'1' ; RESET TO USE SINGLE CHARACTER CHECKSUM
LD (CURCHK),A ; FOR STARTUP
LD A,(CHKTYP) ; GET OUR DESIRED BLOCK CHECK TYPE
LD (INICHK),A
LD HL,DATA ; GET A POINTER TO OUR DATA BLOCK.
CALL RPAR ; SET UP THE PARAMETER INFORMATION.
LD (ARGBLK+1),A ; SAVE THE NUMBER OF ARGUMENTS.
LD A,(NUMPKT) ; GET THE PACKET NUMBER.
LD (ARGBLK),A
LD A,'S' ; SEND INITIATE PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
CALL RPACK ; GET A PACKET.
JP QUIT ; TRASHED PACKET DON'T CHANGE STATE, RETRY.
CP 'Y' ; ACK?
JP NZ,SINIT3 ; IF NOT TRY NEXT.
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD B,A
LD A,(ARGBLK)
CP B ; IS IT THE RIGHT PACKET NUMBER?
RET NZ ; IF NOT TRY AGAIN.
INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(ARGBLK+1) ; GET THE NUMBER OF PIECES OF DATA.
LD HL,DATA ; POINTER TO THE DATA.
CALL SPAR ; READ IN THE DATA.
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD A,(INICHK) ;GET THE AGREED UPON BLOCK-CHECK-TYPE
LD (CURCHK),A ; STORE AS TYPE TO USE FOR PACKETS NOW
LD A,'F' ; SET THE STATE TO FILE SEND.
LD (STATE),A
CALL GETFIL ; OPEN THE FILE.
JP ABORT ; SOMETHING IS WRONG, DIE.
RET
SINIT3: CP 'N' ; NAK?
JP NZ,SINIT4 ; IF NOT SEE IF ITS AN ERROR.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
INC A ; INCREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER.
CP B ; IS THE PACKET'S NUMBER ONE MORE THAN NOW?
RET NZ ; IF NOT ASSUME ITS FOR THIS PACKET, GO AGAIN.
XOR A
LD (NUMTRY),A ; RESET NUMBER OF TRIES.
LD A,'F' ; SET THE STATE TO FILE SEND.
LD (STATE),A
RET
SINIT4: CP 'E' ; IS IT AN ERROR PACKET.
JP NZ,ABORT
CALL ERROR
JP ABORT
; SEND FILE HEADER
SFILE: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,SFILE1
LD DE,ERMS14
CALL ERROR3
JP ABORT ; CHANGE THE STATE TO ABORT.
SFILE1: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
XOR A ; CLEAR A
LD (CZSEEN),A
LD HL,DATA ; GET A POINTER TO OUR DATA BLOCK.
LD (DATPTR),HL ; SAVE IT.
LD HL,MFREQ ;get filename
LD (FCBPTR),HL ; SAVE POSITION IN FCB.
LD B,0 ; NO CHARS YET.
LD C,0
SFIL11: LD A,B
CP 8H ; IS THIS THE NINTH CHAR?
JP NZ,SFIL12 ; IF NOT PROCEED.
SFL11A: LD A,'.' ; GET A DOT.
LD HL,(DATPTR)
LD (HL),A ; PUT THE CHAR IN THE DATA PACKET.
INC HL
LD (DATPTR),HL ; SAVE POSITION IN DATA PACKET.
LD B,8
INC C
SFIL12: INC B ; INCREMENT THE COUNT.
LD A,B
CP 0CH ;TWELVE?
JP P,SFIL13
LD HL,(FCBPTR)
LD A,(HL)
AND 7FH ; TURN OFF CP/M 2 OR 3'S HIGH BITS.[UTK013]
INC HL
LD (FCBPTR),HL ; SAVE POSITION IN FCB.
CP '!' ; IS IT A GOOD CHARACTER?
JP M,SFIL13
LD HL,(DATPTR)
CP '/'
JP Z,SFL11A
CP ':' ;drive spec?
JR Z,SFIL13
SFL12A LD (HL),A ; PUT THE CHAR IN THE DATA PACKET.
INC HL
LD (DATPTR),HL ; SAVE POSITION IN DATA PACKET.
INC C
JP SFIL11 ; GET ANOTHER.
SFIL13: LD A,C ; NUMBER OF CHAR IN FILE NAME.
LD (ARGBLK+1),A
LD HL,(DATPTR)
LD A,'$'
LD (HL),A ; PUT IN A DOLLAR SIGN FOR PRINTING.
LD DE,SCRFLN ; POSITION CURSOR
CALL PRTSTR
LD DE,DATA ; PRINT THE FILE NAME
CALL PRTSTR
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD (ARGBLK),A
LD A,'F' ; FILE HEADER PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
CALL RPACK ; GET A PACKET.
JP QUIT ; TRASHED PACKET DON'T CHANGE STATE, RETRY.
CP 'Y' ; ACK?
JP NZ,SFILE2 ; IF NOT TRY NEXT.
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD B,A
LD A,(ARGBLK)
CP B ; IS IT THE RIGHT PACKET NUMBER?
RET NZ ; IF NOT HOLD OUT FOR THE RIGHT ONE.
SFIL14: INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
SFIL15: XOR A ; GET A ZERO.
LD (EOFLAG),A ; INDICATE NOT EOF.
LD A,0FFH
LD (FILFLG),A ; INDICATE FILE BUFFER EMPTY.
CALL GTCHR
JP SFIL16 ; ERROR GO SEE IF ITS EOF.
JP SFIL17 ; GOT THE CHARS, PROCEED.
SFIL16: CP 0FFH ; IS IT EOF?
JP NZ,ABORT ; IF NOT GIVE UP.
LD A,'Z' ; SET THE STATE TO EOF.
LD (STATE),A
RET
SFIL17: LD (SIZE),A ; SAVE THE SIZE OF THE DATA GOTTEN.
LD A,'D' ; SET THE STATE TO DATA SEND.
LD (STATE),A
RET
SFILE2: CP 'N' ; NAK?
JP NZ,SFILE3 ; TRY IF ERROR PACKET.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
INC A ; INCREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER.
CP B ; IS THE PACKET'S NUMBER ONE MORE THAN NOW?
RET NZ ; IF NOT GO TRY AGAIN.
JP SFIL14 ; JUST AS GOOD AS A ACK; GO TO THE ACK CODE.
SFILE3: CP 'E' ; IS IT AN ERROR PACKET.
JP NZ,ABORT
CALL ERROR
JP ABORT
; SEND DATA
SDATA: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,SDATA1
LD DE,ERMS14
CALL ERROR3
JP ABORT ; CHANGE THE STATE TO ABORT.
SDATA1: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD HL,DATA ; GET A POINTER TO OUR DATA BLOCK.
LD (DATPTR),HL ; SAVE IT.
LD HL,FILBUF ; POINTER TO CHARS TO BE SENT.
LD (CBFPTR),HL ; SAVE POSITION IN CHAR BUFFER.
LD B,1 ; FIRST CHAR.
SDAT11: LD HL,(CBFPTR)
LD A,(HL)
INC HL
LD (CBFPTR),HL ; SAVE POSITION IN CHAR BUFFER.
LD HL,(DATPTR)
LD (HL),A ; PUT THE CHAR IN THE DATA PACKET.
INC HL
LD (DATPTR),HL ; SAVE POSITION IN DATA PACKET.
INC B ; INCREMENT THE COUNT.
LD A,(SIZE) ; GET THE NUMBER OF CHARS IN CHAR BUFFER.
CP B ; HAVE WE TRANSFERED THAT MANY?
JP P,SDAT11 ; IF NOT GET ANOTHER.
LD A,(SIZE) ; NUMBER OF CHAR IN CHAR BUFFER.
LD (ARGBLK+1),A
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD (ARGBLK),A
LD A,'D' ; DATA PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
CALL RPACK ; GET A PACKET.
JP QUIT ; TRASHED PACKET DON'T CHANGE STATE, RETRY.
CP 'Y' ; ACK?
JP NZ,SDATA2 ; IF NOT TRY NEXT.
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD B,A
LD A,(ARGBLK)
CP B ; IS IT THE RIGHT PACKET NUMBER?
RET NZ ; IF NOT HOLD OUT FOR THE RIGHT ONE.
LD A,(ARGBLK) ; GET THE PACKET NUMBER BACK
INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD A,(ARGBLK+1) ; GET THE DATA LENGTH
CP 1 ; CHECK IF ONLY 1 CHARACTER?
JP NZ,SDAT15 ; IF NOT, JUST CONTINUE
LD A,(DATA) ; GOT ONE CHARACTER, GET IT FROM DATA
CP 'Z' ; WANT TO ABORT ENTIRE STREAM?
JR NZ,SDAT14 ; IF NOT, CHECK FOR JUST THIS FILE
LD (CZSEEN),A
SDAT14: CP 'X' ; DESIRE ABORT OF CURRENT FILE?
JR NZ,SDAT15 ; IF NOT, JUST CONTINUE
LD (CZSEEN),A
SDAT15: LD A,(CZSEEN)
OR A ; CHECK IF EITHER GIVEN
JR Z,SDAT12 ; IF NEITHER GIVEN, CONTINUE
LD A,'Z' ; CHANGE STATE TO EOF
LD (STATE),A ; . . .
RET ; AND RETURN
SDAT12: CALL GTCHR
JP SDAT13 ; ERROR GO SEE IF ITS EOF.
LD (SIZE),A ; SAVE THE SIZE OF THE DATA GOTTEN.
RET
SDAT13: CP 0FFH ; IS IT EOF?
JP NZ,ABORT ; IF NOT GIVE UP.
LD A,'Z' ; SET THE STATE TO EOF.
LD (STATE),A
RET
SDATA2: CP 'N' ; NAK?
JP NZ,SDATA3 ; SEE IF IS AN ERROR PACKET.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
INC A ; INCREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER.
CP B ; IS THE PACKET'S NUMBER ONE MORE THAN NOW?
RET NZ ; IF NOT GO TRY AGAIN.
JP SDAT12 ; JUST AS GOOD AS A ACK; GO TO THE ACK CODE.
SDATA3: CP 'E' ; IS IT AN ERROR PACKET.
JP NZ,ABORT
CALL ERROR
JP ABORT
; SEND EOF
SEOF: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,SEOF1
LD DE,ERMS14
CALL ERROR3
JP ABORT ; CHANGE THE STATE TO ABORT.
SEOF1: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD (ARGBLK),A
XOR A
LD (ARGBLK+1),A ; NO DATA.
LD A,(CZSEEN)
OR A ; . . .
JR Z,SEOF14 ; IF NOT ABORTED, JUST KEEP GOING
LD A,'D' ; TELL OTHER END TO DISCARD PACKET
LD (DATA),A ; STORE IN DATA PORTION
LD A,1 ; ONE CHARACTER
LD (ARGBLK+1),A ; STORE THE LENGTH
SEOF14: LD A,'Z' ; EOF PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
CALL RPACK ; GET A PACKET.
JP QUIT ; TRASHED PACKET DON'T CHANGE STATE, RETRY.
CP 'Y' ; ACK?
JR NZ,SEOF2 ; IF NOT TRY NEXT.
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD B,A
LD A,(ARGBLK)
CP B ; IS IT THE RIGHT PACKET NUMBER?
RET NZ ; IF NOT HOLD OUT FOR THE RIGHT ONE.
SEOF12: INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD DE,FCB
CALL @CLOSE
;* CHECK IF SUCCESSFUL
LD A,(CZSEEN)
CP 'Z' ; DESIRE ABORT OF ENTIRE STREAM?
JR Z,SEOF13 ; IF SO, JUST GIVE UP NOW
CALL MFNAME ; GET THE NEXT FILE.
JR C,SEOF13 ; NO MORE.
CALL GETFIL ; AND OPEN IT
JP ABORT ; SOMETHING IS WRONG, DIE.
XOR A ; CLEAR A
LD (CZSEEN),A
LD A,'F' ; SET THE STATE TO FILE SEND.
LD (STATE),A
RET
SEOF13: LD A,'B' ; SET THE STATE TO EOT.
LD (STATE),A
RET
SEOF2: CP 'N' ; NAK?
JR NZ,SEOF3 ; TRY AND SEE IF ITS AN ERROR PACKET.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
INC A ; INCREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER.
CP B ; IS THE PACKET'S NUMBER ONE MORE THAN NOW?
RET NZ ; IF NOT GO TRY AGAIN.
JP SEOF12 ; JUST AS GOOD AS A ACK; GO TO THE ACK CODE.
SEOF3: CP 'E' ;ERROR PACKET?
JP NZ,ABORT
CALL ERROR
JP ABORT
; SEND EOT
SEOT: LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
CP MAXTRY ; HAVE WE REACHED THE MAXIMUM NUMBER OF TRIES?
JP M,SEOT1
LD DE,ERMS14
CALL ERROR3
JP ABORT ; CHANGE THE STATE TO ABORT.
SEOT1: INC A ; INCREMENT IT.
LD (NUMTRY),A ; SAVE THE UPDATED NUMBER OF TRIES.
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD (ARGBLK),A
XOR A
LD (ARGBLK+1),A ; NO DATA.
LD A,'B' ; EOF PACKET.
CALL SPACK ; SEND THE PACKET.
JP ABORT ; FAILED, ABORT.
CALL RPACK ; GET A PACKET.
JP QUIT ; TRASHED PACKET DON'T CHANGE STATE, RETRY.
CP 'Y' ; ACK?
JR NZ,SEOT2 ; IF NOT TRY NEXT.
LD A,(PKTNUM) ; GET THE PACKET NUMBER.
LD B,A
LD A,(ARGBLK)
CP B ; IS IT THE RIGHT PACKET NUMBER?
RET NZ ; IF NOT HOLD OUT FOR THE RIGHT ONE.
SEOT12: INC A ; INCREMENT THE PACKET NUMBER.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS.
LD (PKTNUM),A ; SAVE MODULO 64 OF THE NUMBER.
LD HL,(NUMPKT)
INC HL ; INCREMENT THE NUMBER OF PACKETS.
LD (NUMPKT),HL
LD A,(NUMTRY) ; GET THE NUMBER OF TRIES.
LD (OLDTRY),A ; SAVE IT.
XOR A
LD (NUMTRY),A ; RESET THE NUMBER OF TRIES.
LD A,'C' ; SET THE STATE TO FILE SEND.
LD (STATE),A
RET
SEOT2: CP 'N' ; NAK?
JR NZ,SEOT3 ; IS IT ERROR.
CALL UPDRTR ; UPDATE THE NUMBER OF RETRIES.
LD A,(PKTNUM) ; GET THE PRESENT PACKET NUMBER.
INC A ; INCREMENT.
LD B,A
LD A,(ARGBLK) ; GET THE PACKET'S NUMBER.
CP B ; IS THE PACKET'S NUMBER ONE MORE THAN NOW?
RET NZ ; IF NOT GO TRY AGAIN.
JP SEOT12 ; JUST AS GOOD AS A ACK; GO TO THE ACK CODE.
SEOT3: CP 'E' ; IS IT AN ERROR PACKET.
JP NZ,ABORT
CALL ERROR
JP ABORT
<<< trsstr.src >>>
; Pure storage.
OUTLN2: DB CR,'Number of packets:'
DB CR,'Number of retries:'
DB CR,'File name:$'
KERM: DB 'Kermit-TRS80'
KERM1: DB '>$'
;DELPR: DB 'Delete it? $'
CRLF: DB CR,'$'
ERMES1: DB CR,'?Unrecognized command$'
ERMES2: DB CR,'?Illegal character$'
ERMES3: DB CR,'?Not confirmed$'
ERMES4: DB '?Unable to receive initiate',CR,'$'
ERMES5: DB '?Unable to receive file name',CR,'$'
ERMES6: DB '?Unable to receive end of file',CR,'$'
ERMS10: DB '?Unable to receive data',CR,'$'
ERMS11: DB '?System DOS error',CR,'$'
ERMS14: DB '?Unable to receive an acknowledgement from the host',CR,'$'
ERMS15: DB CR,'?Unable to find file',CR,'$'
ERMS16: DB '?Unable to rename file$'
ERMS17: DB CR,'?System DOS error$'
ERMS18: DB CR,'?Unable to tell host that the session is finished$'
ERMS19: DB CR,'?Unable to tell host to logout$'
INFMS3: DB BELL,'Completed$'
INFMS4: DB BELL,'Failed$'
INFMS5: DB '%Renaming file to $'
INFMS6: DB CR,'<Closing the log file>$'
INFMS7: DB CR,'<Connected to remote host, type $'
INFMS8: DB 'C to return>',CR
DB '<CLEAR> is Control-',95,CR,'$'
INFMS9: DB CR,'<Connection closed, back at micro>$'
INMS10: DB ' Control-$'
INMS11: DB ' (Type Left Arrow to send CTRL-S)',CR,'$'
INMS12: DB ' (Not implemented)',CR,'$'
INMS13: DB BELL,'Interrupted$'
DNAM14: DB 'DIR :'
DIRSPEC DB '0',CR
;INMS15: DB CR,TAB,TAB,'Drive $'
;INMS16: DB ' has $';filled in by summary code with drive letter
;INMS17: DB 'K bytes free',CR,'$'
INMS18: DB CR,'File KILLED$',CR
BADDRV: DB CR,'++ Bad drive name$',CR
CFRMES: DB ' Confirm with <ENTER>, cancel with <BREAK> $'
;FILHLP: DB ' Input file spec $'
ESCMES: DB CR,'Type the new escape character: $'
TOPHLP: DB CR,'BYE to host (LOGOUT) and exit to DOS'
DB CR,'CONNECT to host on selected port'
DB CR,'DIR of local disk'
DB CR,'EXIT to DOS'
DB CR,'FINISH running Kermit on the host'
DB CR,'HELP by giving this message'
DB CR,'KILL a file'
DB CR,'LOG the terminal session to a file'
DB CR,'LOGOUT the host'
DB CR,'RECEIVE file from host'
DB CR,'SEND file to host'
DB CR,'SET a parameter'
DB CR,'SHOW the parameters'
DB CR,'STATUS of Kermit$'
SETHLP: DB CR,'BAud (rate)'
DB CR,'BLock-check-type (for error detection'
DB CR,'DEBugging mode (to display packets)'
; DB CR,'DEFault-disk (to receive data)'
DB CR,'Escape (character during CONNECT)'
DB CR,'File-mode (for outgoing files)'
DB CR,'Ibm (parity and turn around handling)'
DB CR,'Local-echo (half/duplex)'
DB CR,'PArity (for communication line)'
DB CR,'POrt (to communicate on)'
DB CR,'PRinter (to print terminal session)'
;* DB CR,LF,'RECEIVE (parameter)' ; Not currently i}plemented
;* DB CR,LF,'SEND (parameter)' ; Ditto
DB CR,'Vt52-emulation'
DB CR,'Warning (for filename conflicts)'
DB '$'
STSHLP: DB CR,'PAD-CHAR'
DB CR,'PADDING$'
BLKHLP: DB CR,'1-CHARACTER-CHECKSUM'
DB CR,'2-CHARACTER-CHECKSUM'
DB CR,'3-CHARACTER-CRC-CCITT$'
PARHLP: DB CR,'EVEN MARK NONE ODD SPACE$'
ONHLP: DB CR,'OFF ON$'
YESHLP: DB CR,'NO YES$'
PRTHLP DB CR,'STANDARD RS232 port$'
INTHLP: DB CR,'? This message'
DB CR,'C Close the connection'
DB CR,'0 (zero) Transmit a NULL'
DB CR,'S Status of the connection'
DB CR,'Type the escape character again to send it to the host'
DB CR,CR,'Command>$'
ONSTR: DB ' on$'
OFFSTR: DB ' off$'
LOCST: DB CR,'Local echo$'
DEFSTR: DB ' default$'
ASCSTR: DB ' ASCII$'
BINSTR: DB ' binary$'
TYPHLP: DB CR,'ASCII BINARY DEFAULT$'
SPDHLP DB CR,' 50 75 110 134.5 150 300 600 1200'
DB CR,' 1800 2000 2400 3600 4800 7200 9600 19200$'
VTEMST: DB CR,'VT52 emulation$'
CPMST: DB CR,'File Mode$'
IBMST: DB CR,'IBM flag$'
FILST: DB CR,'File warning$'
PNTSTR: DB CR,'Printer$'
ESCST: DB CR,'Escape char: $'
BUGST: DB CR,'Debugging mode$'
PARST: DB CR,'Parity: $'
BCKST: DB CR,'Block check type: $'
BCKST1: DB '-character$'
PNONST: DB 'none$'
PMRKST: DB 'mark$'
PSPCST: DB 'space$'
PODDST: DB 'odd$'
PEVNST: DB 'even$'
SPEDST DB 'Line Speed: $'
BAUST DB ' Baud',CR,'$'
OUTLIN DB 28,31,CR,'$'
VERSIO DM 'Kermit-80 V 3.5 (TRS-80 Model 1/3)',CR,'$'
DELSTR DB 10O,' ',10O,'$'
CLRSPC DB ' ',8,'$'
CLRLIN DB 29,30,'$'
SCRNP DB 28,26,26,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,'$' ;place for packets
SCRNRT DB 28,26,26,26,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,'$' ;place for retries
SCRST DB 28,'$' ;place for complete
SCRFLN DB 28,26,26,26,26,25,25,25,25,25,25,25,25,25,25,25,'$' ;place for filename
SCRERR DB 28,26,26,26,26,26,26,'$' ;location for errors
SCREND DB 28,26,26,26,26,26,26,26,26,26,26,26,26,'$' ;location of last line
RPPOS: DB 28,26,26,26,26,26,26,26,31,'RPack: $'
SPPOS: DB 28,26,26,26,26,26,26,26,26,26,26,31,'SPack: $'
TA DB 1BH,'$',0,0 ;cursor up
TB DB 1AH,'$',0,0 ;cursor down
TC DB 19H,'$',0,0 ;cursor right
TD DB 18H,'$',0,0 ;cursor left
CLRTOP DB 1CH,1FH,'$',0 ;clear screen
TF DB '$',0,0,'$'
TG DB '$',0,0,'$'
TH DB 1CH,'$',0,0 ;cursor home
TI DB 1BH,'$',0,0 ;reverse line feed
TJ DB 1FH,'$',0,0 ;clear to end of screen
TK DB 1EH,'$' ;clear to end of line
;
; COMND tables
;
; Structure of command table: [UTK008]
;
; 1) Number of entries.
; 2) Each entry is arranged as follows:
; a) length of command in bytes.
; b) 'name of command and $-sign'
; c) offset into command table at KERMTB:
; d) offset into command table at KERMTB:
;
; ---> Note this command table is in alphabetic order.
;
COMTAB: DB 10H ; Number of entries (currently 16.)
DB 03H,'BYE$',21H,21H
DB 07H,'CONNECT$',00H,00H
DB 03H,'DIR$',24H,24H
DB 03H,'ERA$',27H,27H
DB 04H,'EXIT$',03H,03H
DB 06H,'FINISH$',1BH,1BH
DB 03H,'GET$',0CH,0CH ; Same as RECEIVE
DB 04H,'HELP$',06H,06H
DB 04H,'KILL$',27H,27H ;SAME AS ERA
DB 03H,'LOG$',09H,09H
DB 06H,'LOGOUT$',1EH,1EH
DB 07H,'RECEIVE$',0CH,0CH
DB 04H,'SEND$',0FH,0FH
DB 03H,'SET$',12H,12H
DB 04H,'SHOW$',15H,15H
DB 06H,'STATUS$',18H,18H
SETTAB: DB 0CH ; Number of entries (currently 12.)
DB 04H,'BAUD$',21H,21H ; Data keys to SETJTB positions.
DB 10H,'BLOCK-CHECK-TYPE$',18H,18H
DB 09H,'DEBUGGING$',27H,27H
;* DB 0CH,'DEFAULT-DISK$',24H,24H
DB 06H,'ESCAPE$',00H,00H
DB 09H,'FILE-MODE$',12H,12H
DB 03H,'IBM$',03H,03H
DB 0AH,'LOCAL-ECHO$',06H,06H
DB 06H,'PARITY$',15H,15H
DB 04H,'PORT$',1EH,1EH
DB 07H,'PRINTER$',24H,24H
;* DB 07H,'RECEIVE$',09H,09H ; Not implemented yet.
;* DB 04H,'SEND$',0CH,0CH ; Ditto
DB 0EH,'VT52-EMULATION$',1BH,1BH
DB 07H,'WARNING$',0FH,0FH
STSNTB: DB 02H
DB 08H,'PAD-CHAR$',00H,00H
DB 07H,'PADDING$',03H,03H
BLKTAB: DB 03H
DB 14H,'1-CHARACTER-CHECKSUM$','1','1'
DB 14H,'2-CHARACTER-CHECKSUM$','2','2'
DB 15H,'3-CHARACTER-CRC-CCITT$','3','3'
PARTAB: DB 05H ; Five entries.
DB 04H,'EVEN$',PAREVN,PAREVN
DB 04H,'MARK$',PARMRK,PARMRK
DB 04H,'NONE$',PARNON,PARNON
DB 03H,'ODD$',PARODD,PARODD
DB 05H,'SPACE$',PARSPC,PARSPC
ONTAB: DB 02H ; Two entries.
DB 02H,'ON$',01H,01H
DB 03H,'OFF$',00H,00H
TYPTAB: DB 03H ;Three entries
DB 05H,'ASCII$',01H,01H
DB 06H,'BINARY$',02H,02H
DB 07H,'DEFAULT$',00H,00H
PRTTAB: DB 01H ; Only one port known at this point
DB 08H,'STANDARD$'
DW MNPORT,MNPORT
YESTAB: DB 02H ; Two entries.
DB 02H,'NO$',00H,00H
DB 03H,'YES$',01H,01H
CMER00: DB CR,'?Program error: Invalid COMND call$'
CMER01: DB CR,'?Ambiguous$'
CMER02: DB CR,'?Illegal input file spec$'
CMIN00: DB ' Confirm with <ENTER>, Cancel with <BREAK>$'
CMCRLF: DB CR,'$'
SPDTAB: DB 10H ;16 entries
DB 2,'50$',0,0
DB 02H,'75$',11H,11H
DB 03H,'110$',22H,22H
DB 05H,'134.5$',33H,33H
DB 03H,'150$',44H,44H
DB 03H,'300$',55H,55H
DB 03H,'600$',66H,66H
DB 04H,'1200$',77H,77H
DB 04H,'1800$',88H,88H
DB 04H,'2000$',99H,99H
DB 04H,'2400$',0AAH,0AAH
DB 04H,'3600$',0BBH,0BBH
DB 04H,'4800$',0CCH,0CCH
DB 04H,'7200$',0DDH,0DDH
DB 04H,'9600$',0EEH,0EEH
DB 05H,'19200$',0FFH,0FFH
; Impure data
; COMND storage
CMSTAT: DS 1 ; What is presently being parsed.
CMAFLG: DS 1 ; Non-zero when an action char has been found.
CMCCNT: DS 1 ; Non-zero if a significant char is found.
CMSFLG: DS 1 ; Non-zero when the last char was a space.
CMOSTP: DS 2 ; Old stack pointer for reparse.
CMRPRS: DS 2 ; Address to go to on reparse.
CMPRMP: DS 2 ; Address of prompt.
CMPTAB: DS 2 ; Address of present keyword table.
CMHLP: DS 2 ; Address of present help.
CMDBUF: DS 80H ; Buffer for command parsing.
CMFCB: DS 2 ; Pointer to FCB.
;CMFCB2: DS 2 ; Pointer to position in FCB.
CMCPTR: DS 2 ; Pointer for next char input.
CMDPTR: DS 2 ; Pointer into the command buffer.
CMKPTR: DS 2 ; Pointer to keyword.
CMSPTR: DS 2 ; Place to save a pointer.
OLDSP: DS 2 ; Room for old system stack.
DS 100H ; Room for lots of calls
STACK: DS 2
EOFLAG: DS 1 ; EOF flag; non-zero on EOF.
FILFLG: DS 1 ; NON-ZERO WHEN FILE NOT OPEN
LSTCHR: DB 0 ;Last character in disk i/o
;CURDSK: DB 0 ; holds "logged" disk
LOGFLG: DB 0 ; Flag for a log file.
ECOFLG: DB 0 ; Local echo flag (default off).
ESCFLG: DB 0 ; Escape flag (start off).
VTFLG: DB 1 ; VT52 emulation flag (default on).
FLWFLG: DB 1 ;file warning flag (default on)
IBMFLG: DB 0 ; IBM flag (default off).
CPMFLG: DB 0 ; File was created by DOS
DBFLG: DB 0 ;debugging flag (default off)
PRTFLG: DB 0 ;printer flag (default off)
PARITY: DB DEFPAR ; Parity.
ESCCHR: DB DEFESC ; Storage for the escape character.
CHRCNT: DS 1 ; Number of chars in the file buffer.
FILCNT: DS 1 ; Number of chars left to fill.
PORT DS 1 ;port for commuications
OUTPNT: DS 2 ; Position in packet.
BUFPNT: DS 2 ; Position in file buffer.
FCBPTR: DS 2 ; Position in FCB.
;FCBEXT DS 2
DATPTR: DS 2 ; Position in packet data buffer.
LOGPTR: DW LBUFF ;pointer into log file buffer
CBFPTR: DS 2 ; Position in character buffer.
PKTPTR: DS 2 ; Poistion in receive packet.
SIZE: DS 1 ; Size of data from gtchr.
SPEED: DB DBAUD ;baud rate
SPSIZ: DB DSPSIZ ; Send packet size.
RPSIZ: DB DRPSIZ ; Receive packet size.
STIME: DB DSTIME ; Send time out.
RTIME: DB DRTIME ; Receive time out.
SPAD: DB DSPAD ; Send padding.
RPAD: DB DRPAD ; Receive padding.
SPADCH: DB DSPADC ; Send padding char.
RPADCH: DB DRPADC ; Receive padding char.
SEOL: DB DSEOL ; Send EOL char.
REOL: DB DREOL ; Receive EOL char.
SQUOTE: DB DSQUOT ; Send quote char.
RQUOTE: DB DRQUOT ; Receive quote char.
CHKTYP: DB DSCHKT ; Checksum type desired
CURCHK: DB DSCHKT ; Current checksum type
INICHK: DB DSCHKT ; Agreed upon checksum type
CZSEEN: DS 1 ; Flag that control-Z was typed
MFNPTR: DW MFNBUF ;multiple file processing buffer
PKTNUM: DS 1 ; Packet number.
NUMPKT: DS 2 ; Total number of packets sent.
NUMRTR: DS 2 ; Total number of retries.
NUMTRY: DS 1 ; Number of tries on this packet.
OLDTRY: DS 1 ; Number of tries on previous packet.
STATE: DS 1 ; Present state of the automaton.
PACKET: DS 4 ; Packet (data is part of it).
DATA: DS 5AH ; Data and checksum field of packet.
RECPKT: DS 60H ; Receive packet storage (use the following).
FILBUF: DS 60H ; Character buffer.
;** Temp 1 & 2 must be in order
TEMP1: DS 1 ; Temporary storage.
TEMP2: DS 1
TEMP3: DS 1
TEMP4: DS 1
; Data storage for MFNAME (multi-file access)
MFREQ: DS 32 ;Requested name
MFNBUF DS 7AH ;filename buffer
;
FCB DS 50 ;file control block
LFCB DS 50 ;log file fcb
KFCB DS 50 ;kill file fcb
BUFF DS 256 ;file buffer
LBUFF DS 256 ;log file buffer
ARGBLK: DS 20H ; Used for subroutine arguments.
<<< trsxfer.src >>>
; FILE ROUTINES
; OUTPUT THE CHARS IN A PACKET.
PTCHR: LD (TEMP1),A ; SAVE THE SIZE.
LD HL,DATA ; BEGINNING OF RECEIVED PACKET DATA.
LD (OUTPNT),HL ; REMEMBER WHERE WE ARE.
LD A,(RQUOTE)
LD B,A ; KEEP THE QUOTE CHAR IN B.
PTCHR1: LD HL,TEMP1
DEC (HL) ; DECREMENT # OF CHARS IN PACKET.
JP M,RSKP ; RETURN SUCCESSFULLY IF DONE.
PTCHR2: LD HL,(OUTPNT) ; GET POSITION IN OUTPUT BUFFER.
LD A,(HL) ; GRAB A CHAR.
INC HL
LD (OUTPNT),HL ; AND BUMP POINTER.
CP B ; IS IT THE QUOTE CHAR?
JP NZ,PTCHR4 ; IF NOT PROCEED.
LD A,(HL) ; GET THE QUOTED CHARACTER
INC HL
LD (OUTPNT),HL ; AND BUMP POINTER.
LD HL,TEMP1
DEC (HL) ; DECREMENT # OF CHARS IN PACKET.
LD D,A ; SAVE THE CHAR.
AND 80H ; TURN OFF ALL BUT THE PARITY BIT.
LD E,A ; SAVE THE PARITY BIT.
LD A,D ; GET THE CHAR.
AND 7FH ; TURN OFF THE PARITY BIT.
CP B ; IS IT THE QUOTE CHAR?
JP Z,PTCHR3 ; IF SO JUST GO WRITE IT OUT.
LD A,D ; GET THE CHAR.
ADD A,40H ; MAKE THE CHARACTER A CONTROL CHAR AGAIN.
AND 7FH ; MODULO 128.
PTCHR3: OR E ; OR IN THE PARITY BIT.
LD E,A ;SAVE IT
LD A,(CPMFLG) ;FILE TYPE?
CP 1 ;ASCII?
JR NZ,PTCR3B
LD A,E
CP LF ;LINE FEED?
JR NZ,PTCR3B
LD A,(LSTCHR)
CP CR
JP Z,PTCHR1 ;SKIP IT
LD E,CR ;CONVERT IT
PTCR3B: LD A,E
LD (LSTCHR),A
PTCHR4: LD DE,FCB
CALL @PUT ;output character to file
JP NZ,QUIT ;bad write
JP PTCHR1
; GET THE CHARS FROM THE FILE.
GTCHR: LD A,(SQUOTE) ; GET THE QUOTE CHAR.
LD C,A ; KEEP QUOTE CHAR IN C.
LD A,(EOFLAG)
OR A
RET NZ
LD A,(FILFLG) ; GET THE FILE FLAG.
OR A ; IS THERE ANYTHING IN THE DMA?
JR Z,GTCHR0 ; YUP, PROCEED.
LD B,0 ; NO CHARS YET.
GTCHR0: LD A,(CURCHK) ; GET CURRENT BLOCK CHECK TYPE
SUB '1' ; GET THE EXTRA OVERHEAD
LD B,A ; GET A COPY
LD A,(SPSIZ) ; GET THE MAXIMUM PACKET SIZE.
SUB 5 ; SUBTRACT THE OVERHEAD.
SUB B ; DETERMINE MAX PACKET LENGTH
LD (TEMP1),A ; THIS IS THE NUMBER OF CHARS WE ARE TO GET.
LD HL,FILBUF ; WHERE TO PUT THE DATA.
LD (CBFPTR),HL ; REMEMBER WHERE WE ARE.
LD B,0 ; NO CHARS.
GTCHR1: LD A,(TEMP1)
DEC A ; DECREMENT THE NUMBER OF CHARS LEFT.
JP P,GTCHR2 ; GO ON IF THERE IS MORE THAN ONE LEFT.
LD A,B ; RETURN THE COUNT IN A.
JP RSKP
GTCHR2: LD (TEMP1),A
LD A,(CPMFLG) ;GET THE FILE TYPE FLAG
CP 1 ;ASCII
JR NZ,GTCHR4 ;NOPE
LD A,(LSTCHR) ;GET LAST CHARACTER
CP CR ;CARRIAGE RETURN?
JR NZ,GTCHR4 ;NOPE
LD A,LF ;ADD A LINE FEED
JR GTCR4A
GTCHR4: LD DE,FCB
CALL @GET ;get a character
JP NZ,GTCHR9
GTCR4A: LD D,A ; SAVE THE CHAR.
LD A,(CPMFLG)
CP 1
JR NZ,GTCR4B
LD A,D ;make sure it is a
AND 7FH ;legal ASCII character
LD D,A
GTCR4B: AND 80H ; TURN OFF ALL BUT PARITY.
LD E,A ; SAVE THE PARITY BIT.
LD A,D ; RESTORE THE CHAR.
AND 7FH ; TURN OFF THE PARITY.
LD (LSTCHR),A ;SAVE THIS CHARACTER
CP ' ' ; COMPARE TO A SPACE.
JP M,GTCHR7 ; IF LESS THEN ITS A CONTROL CHAR, HANDLE IT.
CP DEL ; IS THE CHAR A DELETE?
JP Z,GTCHR7
CP C ; IS IT THE QUOTE CHAR?
JP NZ,GTCHR8 ; IF NOT PROCEED.
LD HL,TEMP1 ; POINT TO THE CHAR TOTAL REMAINING.
DEC (HL) ; DECREMENT IT.
LD HL,(CBFPTR) ; POSITION IN CHARACTER BUFFER.
LD (HL),A ; PUT THE CHAR IN THE BUFFER.
INC HL
LD (CBFPTR),HL
INC B ; INCREMENT THE CHAR COUNT.
JP GTCHR8
GTCHR7: LD (TEMP2),A ; SAVE THE CHAR.
LD HL,TEMP1 ; POINT TO THE CHAR TOTAL REMAINING.
DEC (HL) ; DECREMENT IT.
LD HL,(CBFPTR) ; POSITION IN CHARACTER BUFFER.
LD (HL),C ; PUT THE QUOTE IN THE BUFFER.
INC HL
LD (CBFPTR),HL
INC B ; INCREMENT THE CHAR COUNT.
LD A,(TEMP2) ; GET THE CONTROL CHAR BACK.
ADD A,40H ; MAKE THE NON-CONTROL.
AND 7FH ; MODULO 200 OCTAL.
GTCHR8: LD HL,(CBFPTR) ; POSITION IN CHARACTER BUFFER.
OR E ; OR IN THE PARITY BIT.
LD (HL),A ; PUT THE CHAR IN THE BUFFER.
INC HL
LD (CBFPTR),HL
INC B ; INCREMENT THE CHAR COUNT.
JP GTCHR1
GTCHR9: LD A,0FFH
LD (EOFLAG),A
LD A,B
JP RSKP
;MULTI-FILE ACCESS SUBROUTINE. ALLOWS PROCESSING OF MULTIPLE FILES
;(I.E., *.ASM) FROM DISK. THIS ROUTINE BUILDS THE PROPER NAME IN THE
;FCB EACH TIME IT IS CALLED. THIS COMMAND WOULD BE USED IN SUCH PRO-
;GRAMS SUCH AS MODEM TRANSFER, TAPE SAVE, ETC. IN WHICH YOU WANT TO
;PROCESS SINGLE OR MULTIPLE FILES.
;
;THE FCB WILL BE SET UP WITH THE NEXT NAME, READY TO DO NORMAL PROCES-
;SING (OPEN, READ, ETC.) WHEN ROUTINE IS CALLED.
;
;CARRY IS SET IF NO MORE NAMES CAN BE FOUND
;
; MFFLG1 IS COUNT/SWITCH [0 FOR FIRST TIME THRU, POS FOR ALL OTHERS]
; MFFLG2 IS COUNTED DOWN FOR EACH SUCCESSIVE GETNEXT FILE CALL
MFNAME: JP NC,MFN00
CCF ;CLEAR CARRY
MFN00: PUSH BC ;SAVE REGISTERS
PUSH DE
PUSH HL
LD B,50
LD HL,FCB
MFN0A: LD (HL),20H
INC HL
DJNZ MFN0A
LD B,32
LD HL,MFREQ
MFN0B: LD (HL),20H
INC HL
DJNZ MFN0B
LD HL,(MFNPTR)
LD DE,MFREQ
CALL @FSPEC
LD (MFNPTR),HL
JR NZ,MFFIX2
MFN01: LD HL,MFREQ ;SFIRST REQ NAME
LD DE,FCB
CALL @FSPEC ;MOVE TO FCB
MFFIX1: POP HL ; RESTORE REGISTERS
POP DE
POP BC
RET ;AND RETURN
MFFIX2: SCF ;SET CARRY
JR MFFIX1 ;RETURN WITH CARRY SET
GETFIL: LD A,0FFH
LD (FILFLG),A ; NOTHING IN THE DMA.
XOR A
LD (EOFLAG),A ; NOT THE END OF FILE.
LD (LSTCHR),A
PUSH HL
LD DE,FCB
LD HL,BUFF
CALL @OPEN
POP HL
JP NZ,ERRORD
JP RSKP
GOFIL: LD HL,DATA ; GET THE ADDRESS OF THE FILE NAME.
LD (DATPTR),HL ; STORE THE ADDRESS.
LD HL,FCB ; ADDRESS OF THE FCB.
LD (FCBPTR),HL ; SAVE IT.
XOR A
LD (TEMP1),A ; INITIALIZE THE CHAR COUNT.
LD (TEMP2),A
LD B,50
GOFIL1: LD (HL),20H ; BLANK THE FCB.
INC HL
DJNZ GOFIL1
GOFIL2: LD HL,(DATPTR) ; GET THE NAME FIELD.
LD A,(HL)
INC HL
LD (DATPTR),HL
CP '.' ; SEPERATOR?
JP NZ,GOFIL3
LD A,(TEMP1)
LD (TEMP2),A
XOR A
LD (TEMP1),A
JP GOFIL5
GOFIL3: OR A ; TRAILING NULL?
JP Z,GOFIL7 ; THEN WE'RE DONE.
LD HL,(FCBPTR)
LD (HL),A
INC HL
LD (FCBPTR),HL
LD A,(TEMP1) ; GET THE CHAR COUNT.
INC A
LD (TEMP1),A
CP 8H ; ARE WE FINISHED WITH THIS FIELD?
JP M,GOFIL2
GOFIL4: LD (TEMP2),A
XOR A
LD (TEMP1),A
LD HL,(DATPTR)
LD A,(HL)
INC HL
LD (DATPTR),HL
OR A
JP Z,GOFIL7
CP '.' ; IS THIS THE TERMINATOR?
JP NZ,GOFIL4 ; GO UNTIL WE FIND IT.
GOFIL5 LD HL,(FCBPTR)
LD (HL),'/' ;PUT IN A SLASH
INC HL
LD (FCBPTR),HL
GOFIL6: LD HL,(DATPTR) ; GET THE TYPE FIELD.
LD A,(HL)
INC HL
LD (DATPTR),HL
OR A ; TRAILING NULL?
JP Z,GOFIL7 ; THEN WE'RE DONE.
LD HL,(FCBPTR)
LD (HL),A
INC HL
LD (FCBPTR),HL
LD A,(TEMP1) ; GET THE CHAR COUNT.
INC A
LD (TEMP1),A
CP 03H ; ARE WE FINISHED WITH THIS FIELD?
JP M,GOFIL6
GOFIL7: LD HL,(DATPTR)
LD (HL),'$' ; PUT IN A DOLLAR SIGN FOR PRINTING.
LD DE,SCRFLN ; POSITION CURSOR
CALL PRTSTR
LD DE,DATA ; PRINT THE FILE NAME
CALL PRTSTR
LD HL,(FCBPTR)
LD (HL),3 ;PUT TERMINATOR IN FCB
LD A,(FLWFLG) ;IS FILE WARNING ON?
OR A
JP Z,GOFIL9 ; IF NOT, JUST PROCEED.
LD DE,FCB
LD HL,BUFF
CALL @OPEN
JP NZ,GOFIL9 ; IF NOT CREATE IT.
LD DE,INFMS5
CALL ERROR3
LD DE,FCB
CALL @CLOSE ;close opened file
GOFIL8: LD HL,(FCBPTR) ;make a new filename
GOFL8A DEC HL
GOFL8B LD A,(HL)
CP 'B'
JR C,GOFL8A ;TOO SMALL
DEC (HL) ;DECREMENT CHARACTER
LD (FCBPTR),HL
LD DE,FCB ;new file name ok?
LD HL,BUFF
CALL @OPEN
JP NZ,GOFL89 ; yes!
LD DE,FCB
CALL @CLOSE
LD HL,(FCBPTR)
OR A
SBC HL,DE
JR NZ,GOFIL8 ;TRY AGAIN
GOFL88: LD DE,ERMS16 ; TELL USER THAT WE CAN'T RENAME IT.
CALL PRTSTR
RET
GOFL89: LD HL,FCB ;move it for usage by other routines
LD DE,MFREQ
CALL @FSPEC
LD A,':'
LD BC,14
LD HL,MFREQ
CPIR
INC HL
LD (HL),'$'
LD DE,MFREQ
CALL PRTSTR
GOFIL9: XOR A
LD (LSTCHR),A
LD DE,FCB
LD HL,BUFF
CALL @INIT
JP Z,RSKP
PUSH AF
LD DE,ERMS11
CALL ERROR3
POP AF
JP ERRORD
; PACKET ROUTINES
; SEND_PACKET
; THIS ROUTINE ASSEMBLES A PACKET FROM THE ARGUMENTS GIVEN AND SENDS IT
; TO THE HOST.
;
; EXPECTS THE FOLLOWING:
; A - TYPE OF PACKET (D,Y,N,S,R,E,F,Z,T)
; ARGBLK - PACKET SEQUENCE NUMBER
; ARGBLK+1 - NUMBER OF DATA CHARACTERS
; RETURNS: +1 ON FAILURE
; +2 ON SUCCESS
SPACK: LD (ARGBLK+2),A
LD HL,PACKET ; GET ADDRESS OF THE SEND PACKET.
LD A,SOH ; GET THE START OF HEADER CHAR.
LD (HL),A ; PUT IN THE PACKET.
INC HL ; POINT TO NEXT CHAR.
LD A,(CURCHK) ; GET CURRENT CHECKSUM TYPE
SUB '1' ; DETERMINE EXTRA LENGTH OF CHECKSUM
LD B,A ; COPY LENGTH
LD A,(ARGBLK+1) ; GET THE NUMBER OF DATA CHARS.
ADD A,' '+3 ; REAL PACKET CHARACTER COUNT MADE PRINTABLE.
ADD A,B ; DETERMINE OVERALL LENGTH
LD (HL),A ; PUT IN THE PACKET.
INC HL ; POINT TO NEXT CHAR.
LD BC,0 ; ZERO THE CHECKSUM AC.
LD C,A ; START THE CHECKSUM.
LD A,(ARGBLK) ; GET THE PACKET NUMBER.
ADD A,' ' ; ADD A SPACE SO THE NUMBER IS PRINTABLE.
LD (HL),A ; PUT IN THE PACKET.
INC HL ; POINT TO NEXT CHAR.
ADD A,C
LD C,A ; ADD THE PACKET NUMBER TO THE CHECKSUM.
LD A,0 ; CLEAR A (CANNOT BE XRA A, SINCE WE CAN'T TOUCH CARRY FLAG)
ADC A,B ; GET HIGH ORDER PORTION OF CHECKSUM
LD B,A ; COPY BACK TO B
LD A,(ARGBLK+2) ; GET THE PACKET TYPE.
LD (HL),A ; PUT IN THE PACKET.
INC HL ; POINT TO NEXT CHAR.
ADD A,C
LD C,A ; ADD THE PACKET NUMBER TO THE CHECKSUM.
LD A,0 ; CLEAR A
ADC A,B ; GET HIGH ORDER PORTION OF CHECKSUM
LD B,A ; COPY BACK TO B
SPACK2: LD A,(ARGBLK+1) ; GET THE PACKET SIZE.
OR A ; ARE THERE ANY CHARS OF DATA?
JP Z,SPACK3 ; NO, FINISH UP.
DEC A ; DECREMENT THE CHAR COUNT.
LD (ARGBLK+1),A ; PUT IT BACK.
LD A,(HL) ; GET THE NEXT CHAR.
INC HL ; POINT TO NEXT CHAR.
ADD A,C
LD C,A ; ADD THE PACKET NUMBER TO THE CHECKSUM.
LD A,0 ; CLEAR A
ADC A,B ; GET HIGH ORDER PORTION OF CHECKSUM
LD B,A ; COPY BACK TO B
JP SPACK2 ; GO TRY AGAIN.
SPACK3: LD A,(CURCHK) ; GET THE CURRENT CHECKSUM TYPE
CP '2' ; TWO CHARACTER?
JP Z,SPACK4 ; YES, GO HANDLE IT
JP NC,SPACK5 ; NO, GO HANDLE CRC IF '3'
LD A,C ; GET THE CHARACTER TOTAL.
AND 0C0H ; TURN OFF ALL BUT THE TWO HIGH ORDER BITS.
; RRC
; RRC
; RRC
; RRC
; RRC
; RRC ; SHIFT THEM INTO THE LOW ORDER POSITION.
RLCA ; TWO LEFT ROTATES SAME AS 6 RIGHTS
RLCA ; . . .
ADD A,C ; ADD IT TO THE OLD BITS.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS. (MOD 64)
ADD A,' ' ; ADD A SPACE SO THE NUMBER IS PRINTABLE.
LD (HL),A ; PUT IN THE PACKET.
INC HL ; POINT TO NEXT CHAR.
JP SPACK7 ; GO STORE EOL CHARACTER
; HERE FOR 3 CHARACTER CRC-CCITT
SPACK5: LD (HL),0 ; STORE A NULL FOR CURRENT END
PUSH HL ; SAVE H
LD HL,PACKET+1 ; POINT TO FIRST CHECKSUMED CHARACTER
CALL CRCCLC ; CALCULATE THE CRC
POP HL ; RESTORE THE POINTER
LD C,E ; GET LOW ORDER HALF FOR LATER
LD B,D ; COPY THE HIGH ORDER
LD A,D ; GET THE HIGH ORDER PORTION
RLCA ; SHIFT OFF LOW 4 BITS
RLCA ; . . .
RLCA ; . . .
RLCA ; . . .
AND 0FH ; KEEP ONLY LOW 4 BITS
ADD A,' ' ; PUT INTO PRINTING RANGE
LD (HL),A ; STORE THE CHARACTER
INC HL ; POINT TO NEXT POSITION
; HERE FOR TWO CHARACTER CHECKSUM
SPACK4: LD A,B ; GET HIGH ORDER PORTION
AND 0FH ; ONLY KEEP LAST FOUR BITS
RLCA ; SHIFT UP TWO BITS
RLCA ; . . .
LD B,A ; COPY BACK INTO SAFE PLACE
LD A,C ; GET LOW ORDER HALF
RLCA ; SHIFT HIGH TWO BITS
RLCA ; TO LOW TWO BITS
AND 03H ; KEEP ONLY TWO LOW BITS
OR B ; GET HIGH ORDER PORTION IN
ADD A,' ' ; CONVERT TO PRINTING CHARACTER RANGE
LD (HL),A ; STORE THE CHARACTER
INC HL ; POINT TO NEXT CHARACTER
LD A,C ; GET LOW ORDER PORTION
AND 3FH ; KEEP ONLY SIX BITS
ADD A,' ' ; CONVERT TO PRINTING RANGE
LD (HL),A ; STORE IT
INC HL ; BUMP THE POINTER
SPACK7: LD A,(SEOL) ; GET THE EOL THE OTHER HOST WANTS.
LD (HL),A ; PUT IN THE PACKET.
INC HL ; POINT TO NEXT CHAR.
XOR A ; GET A NULL.
LD (HL),A ; PUT IN THE PACKET.
LD A,(DBFLG)
OR A
JR Z,SPACK8 ;debug is off
INC HL ; POINT TO NEXT CHAR.
LD A,'$' ; GET A DOLLAR SIGN.
LD (HL),A ; PUT IN THE PACKET.
SPACK8: CALL OUTPKT ; CALL THE SYSTEM DEPENDENT ROUTINE.
JP QUIT
JP RSKP
; WRITE OUT A PACKET.
OUTPKT LD A,(SPAD) ; GET THE NUMBER OF PADDING CHARS.
LD (TEMP1),A
OUTPK2: LD A,(TEMP1) ; GET THE COUNT.
DEC A
OR A
JP M,OUTPK6 ; IF NONE LEFT PROCEED.
LD (TEMP1),A
LD A,(SPADCH) ; GET THE PADDING CHAR.
LD E,A ; PUT THE CHAR IN RIGHT AC.
CALL OUTCHR ; OUTPUT IT.
JP OUTPK2
OUTPK6: LD A,(IBMFLG) ; IS THIS THE (DUMB) IBM.
OR A
JP Z,OUTPK8 ; IF NOT THEN PROCEED.
LD A,(STATE) ; CHECK IF THIS IS THE SEND-INIT PACKET.
CP 'S'
;* THIS WILL ALSO HAVE TO BE TAKEN CARE FOR 'R' (RECEIVE), 'G' (GENERIC)
;* AND 'C' (COMMAND) PACKETS IF THE IBM BECOMES A SERVER.
JP Z,OUTPK8 ; IF SO DON'T WAIT FOR THE XON.
OUTPK7: CALL INCHR ; WAIT FOR THE TURN AROUND CHAR.
JP OUTPK8
CP XON ; IS IT THE IBM TURN AROUND CHARACTER?
JP NZ,OUTPK7 ; IF NOT, GO UNTIL IT IS.
OUTPK8: LD A,(DBFLG)
OR A
JR Z,OUTPK9
LD DE,SPPOS ; PRINT THE PACKET
CALL PRTSTR
LD DE,PACKET+1
CALL PRTSTR
OUTPK9: LD HL,PACKET ; POINT TO THE PACKET.
OUTLUP: LD A,(HL) ; GET THE NEXT CHARACTER.
OR A ; IS IT A NULL?
JP Z,OUTLUD ; IF SO RETURN SUCCESS.
LD E,A ; PUT THE CHAR IN RIGHT AC.
CALL OUTCHR ; OUTPUT THE CHARACTER.
INC HL ; INCREMENT THE CHAR POINTER.
JP OUTLUP
OUTLUD: JP RSKP ; JUST RETURN
; THIS ROUTINE WAITS FOR A PACKET TO ARRIVE FROM THE HOST. IT READS
; CHARACTERS UNTIL IT FINDS A SOH. IT THEN READS THE PACKET INTO PACKET.
;
; RETURNS: +1 FAILURE (IF THE CHECKSUM IS WRONG OR THE PACKET TRASHED)
; +2 SUCCESS WITH A - MESSAGE TYPE
; ARGBLK - MESSAGE NUMBER
; ARGBLK+1 - LENGTH OF DATA
RPACK: CALL INPKT ; READ UP TO A CARRIAGE RETURN.
JP QUIT ; RETURN BAD.
RPACK0: CALL GETCHR ; GET A CHARACTER.
JP RPACK ; HIT A CR; NULL LINE; JUST START OVER.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JR NZ,RPACK0 ; NO, GO UNTIL IT IS.
RPACK1: CALL GETCHR ; GET A CHARACTER.
JP QUIT ; HIT THE CARRIAGE RETURN, RETURN BAD.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JR Z,RPACK1 ; YES, THEN GO START OVER.
LD (PACKET+1),A ; STORE IN PACKET ALSO
LD C,A ; START THE CHECKSUM.
LD A,(CURCHK) ; GET BLOCK CHECK TYPE
SUB '1' ; DETERMINE EXTRA LENGTH OF BLOCK CHECK
LD B,A ; GET A COPY
LD A,C ; GET BACK LENGTH CHARACTER
SUB ' '+3 ; GET THE REAL DATA COUNT.
SUB B ; GET TOTAL LENGTH
LD (ARGBLK+1),A
LD B,0 ; CLEAR HIGH ORDER HALF OF CHECKSUM
CALL GETCHR ; GET A CHARACTER.
JP QUIT ; HIT THE CARRIAGE RETURN, RETURN BAD.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JR Z,RPACK1 ; YES, THEN GO START OVER.
LD (ARGBLK),A
LD (PACKET+2),A ; SAVE ALSO IN PACKET
ADD A,C
LD C,A ; ADD THE CHARACTER TO THE CHECKSUM.
LD A,0 ; CLEAR A
ADC A,B ; GET HIGH ORDER PORTION OF CHECKSUM
LD B,A ; COPY BACK TO B
LD A,(ARGBLK)
SUB ' ' ; GET THE REAL PACKET NUMBER.
LD (ARGBLK),A
CALL GETCHR ; GET A CHARACTER.
JP QUIT ; HIT THE CARRIAGE RETURN, RETURN BAD.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JP Z,RPACK1 ; YES, THEN GO START OVER.
LD (TEMP1),A ; SAVE THE MESSAGE TYPE.
LD (PACKET+3),A ; SAVE IN PACKET
ADD A,C
LD C,A ; ADD THE CHARACTER TO THE CHECKSUM.
LD A,0 ; CLEAR A
ADC A,B ; GET HIGH ORDER PORTION OF CHECKSUM
LD B,A ; COPY BACK TO B
LD A,(ARGBLK+1) ; GET THE NUMBER OF DATA CHARACTERS.
LD (TEMP2),A
LD HL,DATA ; POINT TO THE DATA BUFFER.
LD (DATPTR),HL
RPACK2: LD A,(TEMP2)
SUB 1 ; ANY DATA CHARACTERS?
JP M,RPACK3 ; IF NOT GO GET THE CHECKSUM.
LD (TEMP2),A
CALL GETCHR ; GET A CHARACTER.
JP QUIT ; HIT THE CARRIAGE RETURN, RETURN BAD.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JP Z,RPACK1 ; YES, THEN GO START OVER.
LD HL,(DATPTR)
LD (HL),A ; PUT THE CHAR INTO THE PACKET.
INC HL ; POINT TO THE NEXT CHARACTER.
LD (DATPTR),HL
ADD A,C
LD C,A ; ADD THE CHARACTER TO THE CHECKSUM.
LD A,0 ; CLEAR A
ADC A,B ; GET HIGH ORDER PORTION OF CHECKSUM
LD B,A ; COPY BACK TO B
JR RPACK2 ; GO GET ANOTHER.
RPACK3: CALL GETCHR ; GET A CHARACTER.
JP QUIT ; HIT THE CARRIAGE RETURN, RETURN BAD.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JP Z,RPACK1 ; YES, THEN GO START OVER.
SUB ' ' ; TURN THE CHAR BACK INTO A NUMBER.
LD (TEMP3),A
; DETERMINE TYPE OF CHECKSUM
LD A,(CURCHK) ; GET THE CURRENT CHECKSUM TYPE
CP '2' ; 1, 2 OR 3 CHARACTER?
JP Z,RPACK4 ; IF ZERO, 2 CHARACTER
JP NC,RPACK5 ; GO HANDLE 3 CHARACTER
LD A,C ; GET THE CHARACTER TOTAL.
AND 0C0H ; TURN OFF ALL BUT THE TWO HIGH ORDER BITS.
; RRC
; RRC
; RRC
; RRC
; RRC
; RRC ; SHIFT THEM INTO THE LOW ORDER POSITION.
RLCA ; TWO LEFT ROTATES SAME AS SIX RIGHTS
RLCA ; . . .
ADD A,C ; ADD IT TO THE OLD BITS.
AND 3FH ; TURN OFF THE TWO HIGH ORDER BITS. (MOD 64)
LD B,A
LD A,(TEMP3) ; GET THE REAL RECEIVED CHECKSUM.
CP B ; ARE THEY EQUAL?
JP Z,RPACK7 ; IF SO, PROCEED.
RPACK9: CALL UPDRTR ; IF NOT, UPDATE THE NUMBER OF RETRIES.
RET ; RETURN ERROR.
; HERE FOR THREE CHARACTER CRC-CCITT
RPACK5: LD HL,(DATPTR) ; GET THE ADDRESS OF THE DATA
LD (HL),0 ; STORE A ZERO IN THE BUFFER TO TERMINATE PACKET
LD HL,PACKET+1 ; POINT AT START OF CHECKSUMMED REGION
CALL CRCCLC ; CALCULATE THE CRC
LD C,E ; SAVE LOW ORDER HALF FOR LATER
LD B,D ; ALSO COPY HIGH ORDER
LD A,D ; GET HIGH BYTE
RLCA ; WANT HIGH FOUR BITS
RLCA ; . . .
RLCA ; AND SHIFT TWO MORE
RLCA ; . . .
AND 0FH ; KEEP ONLY 4 BITS
LD D,A ; BACK INTO D
LD A,(TEMP3) ; GET FIRST VALUE BACK
CP D ; CORRECT?
JR NZ,RPACK9 ; NO, PUNT
CALL GETCHR ; GET A CHARACTER.
JP QUIT ; HIT THE CARRIAGE RETURN, RETURN BAD.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JP Z,RPACK1 ; YES, THEN GO START OVER.
SUB ' ' ; REMOVE SPACE OFFSET
LD (TEMP3),A ; STORE FOR LATER CHECK
; HERE FOR A TWO CHARACTER CHECKSUM AND LAST TWO CHARACTERS OF CRC
RPACK4: LD A,B ; GET HIGH ORDER PORTION
AND 0FH ; ONLY FOUR BITS
RLCA ; SHIFT UP TWO BITS
RLCA ; . . .
LD B,A ; SAVE BACK IN B
LD A,C ; GET LOW ORDER
RLCA ; MOVE TWO HIGH BITS TO LOW BITS
RLCA ; . . .
AND 03H ; SAVE ONLY LOW TWO BITS
OR B ; GET OTHER 4 BITS
LD B,A ; SAVE BACK IN B
LD A,(TEMP3) ; GET THIS PORTION OF CHECKSUM
CP B ; CHECK FIRST HALF
JP NZ,RPACK9 ; IF BAD, GO GIVE UP
CALL GETCHR ; GET A CHARACTER.
JP QUIT ; HIT THE CARRIAGE RETURN, RETURN BAD.
CP SOH ; IS THE CHAR THE START OF HEADER CHAR?
JP Z,RPACK1 ; YES, THEN GO START OVER.
SUB ' ' ; REMOVE SPACE OFFSET
LD B,A ; SAVE IN SAFE PLACE
LD A,C ; GET LOW 8 BITS OF CHECKSUM
AND 3FH ; KEEP ONLY 6 BITS
CP B ; CORRECT VALUE
JP NZ,RPACK9 ; BAD, GIVE UP
RPACK7: LD HL,(DATPTR)
LD (HL),0 ; PUT A NULL AT THE END OF THE DATA.
LD A,(TEMP1) ; GET THE TYPE.
JP RSKP
INPKT: LD HL,RECPKT ; POINT TO THE BEGINNING OF THE PACKET.
LD (PKTPTR),HL
INPKT2: CALL INCHR ; GET A CHARACTER.
JP QUIT ; RETURN FAILURE.
LD HL,(PKTPTR)
LD (HL),A ; PUT THE CHAR IN THE PACKET.
INC HL
LD (PKTPTR),HL
LD B,A
LD A,(REOL) ; GET THE EOL CHAR.
CP B
JR NZ,INPKT2
LD A,(DBFLG)
OR A
JR Z,INPKT3 ;DEBUG MODE IS OFF
LD A,'$' ; GET A DOLLAR SIGN.
LD (HL),A ; PUT IN THE PACKET.
INC HL ; POINT TO NEXT CHAR.
LD DE,RPPOS ; PRINT THE PACKET
CALL PRTSTR
LD DE,RECPKT+1
CALL PRTSTR
INPKT3: LD HL,RECPKT
LD (PKTPTR),HL ; SAVE THE PACKET POINTER.
JP RSKP ; IF SO WE ARE DONE.
GETCHR: LD HL,(PKTPTR) ; GET THE PACKET POINTER.
LD A,(HL) ; GET THE CHAR.
INC HL
LD (PKTPTR),HL
CP CR ; IS IT THE CARRIAGE RETURN?
JP NZ,RSKP ; IF NOT RETURN RETSKP.
RET ; IF SO RETURN FAILURE.
;
; THIS ROUTINE WILL CALCULATE A CRC USING THE CCITT POLYNOMIAL FOR
;A STRING.
;
; USAGE:
; HL/ ADDRESS OF STRING
; A/ LENGTH OF STRING
; CALL CRCCLC
;
; 16-BIT CRC VALUE IS RETURNED IN DE.
;
; REGISTERS BC AND HL ARE PRESERVED.
;
CRCCLC: PUSH HL ; SAVE HL
PUSH BC ; AND BC
LD DE,0 ; INITIAL CRC VALUE IS 0
CRCCL0: LD A,(HL) ; GET A CHARACTER
OR A ; CHECK IF ZERO
JP Z,CRCCL1 ; IF SO, ALL DONE
PUSH HL ; SAVE THE POINTER
XOR E ; ADD IN WITH PREVIOUS VALUE
LD E,A ; GET A COPY
AND 0FH ; GET LAST 4 BITS OF COMBINED VALUE
LD C,A ; GET INTO C
LD B,0 ; AND MAKE HIGH ORDER ZERO
LD HL,CRCTB2; POINT AT LOW ORDER TABLE
ADD HL,BC ; POINT TO CORRECT ENTRY
ADD HL,BC ; . . .
PUSH HL ; SAVE THE ADDRESS
LD A,E ; GET COMBINED VALUE BACK AGAIN
RRCA ; SHIFT OVER TO MAKE INDEX
RRCA ; . . .
RRCA ; . . .
AND 1EH ; KEEP ONLY 4 BITS
LD C,A ; SET UP TO OFFSET TABLE
LD HL,CRCTAB; POINT AT HIGH ORDER TABLE
ADD HL,BC ; CORRECT ENTRY
LD A,(HL) ; GET LOW ORDER PORTION OF ENTRY
XOR D ;XOR US HIGH ORDER HALF
INC HL ; POINT TO HIGH ORDER BYTE
LD D,(HL) ; GET INTO D
POP HL ; GET BACK POINTER TO OTHER TABLE ENTRY
XOR (HL) ; INCLUDE WITH NEW HIGH ORDER HALF
LD E,A ; COPY NEW LOW ORDER PORTION
INC HL ; POINT TO OTHER PORTION
LD A,(HL) ; GET THE OTHER PORTION OF THE TABLE ENTRY
XOR D ; INCLUDE WITH OTHER HIGH ORDER PORTION
LD D,A ; MOVE BACK INTO D
POP HL ; AND H
INC HL ; POINT TO NEXT CHARACTER
JP CRCCL0 ; GO GET NEXT CHARACTER
CRCCL1: POP BC ; RESTORE B
POP HL ; AND HL
RET ; AND RETURN, DE=CRC-CCITT
CRCTAB: DW 00000H
DW 01081H
DW 02102H
DW 03183H
DW 04204H
DW 05285H
DW 06306H
DW 07387H
DW 08408H
DW 09489H
DW 0A50AH
DW 0B58BH
DW 0C60CH
DW 0D68DH
DW 0E70EH
DW 0F78FH
CRCTB2: DW 00000H
DW 01189H
DW 02312H
DW 0329BH
DW 04624H
DW 057ADH
DW 06536H
DW 074BFH
DW 08C48H
DW 09DC1H
DW 0AF5AH
DW 0BED3H
DW 0CA6CH
DW 0DBE5H
DW 0E97EH
DW 0F8F7H