GMW@psuvm.BITNET (06/05/85)
Here is the download program for the C64. Note that the RS-232 channel open statement in line 10 may need to be modified for the particular host. Also, be aware that this program performs the proper ASCII to PETASCII conversions. The hex loader on CU20B assumes that no conversions are done, therefore expecting lowercase letters, instead of uppercase. I patched my copy of the hex loader; however, removing the GOSUB 150 in line 198 will omit the conversion to PETASCII, thereby allowing the regular hex loader to function properly. The mainframe host should have a DONWLOAD program to accompany this one which runs on the C64. DOWNLOAD is currently written in CLU, and is available in executable form for TOPS-20 and 4.2 UNIX systems. To download a file, load and run this program on the Commodore 64. Use the dumb terminal mode to log in to the remote host. Set the remote host for half duplex communication (this prevents the remote host from echoing the acknowledgements it receives back to the C64). Then run the download program on the remote host, including the name of the file you wish to download to the C64 on the command line. For example, to download the file foo, you would type DOWNLOAD FOO ============================================================================= 1 REM FILE CAPTURE PROGRAM; ROBERT LENOIL, AUTHOR. 2 REM WRITTEN DECEMBER 1984. CLEANED UP FOR GENERAL PUBLIC FEBRUARY 1985. 5 PRINT "[CLEAR]NOW IN DUMB TERMINAL MODE. PRESS F1 KEY"; 6 PRINT "TO BEGIN RECEIVING FILE. (MAKE SURE THAT"; 7 PRINT"HOST IS SET FOR HALF-DUPLEX.)" 8 PRINT "----------------------------------------"; 10 OPEN 1,2,0,CHR$(38)+CHR$(161) : OPEN 15,8,15 15 GET A$ : IF A$ = CHR$(133) THEN 20 18 PRINTA$; : PRINT#1,A$; : GET#1,A$ : GOSUB 150 : PRINTA$; : GOTO 15 20 F$="" : INPUT "LOCAL FILENAME";F$ 23 IF F$="" THEN CLOSE 15 : CLOSE 1 : PRINT "QUITTING" : END 25 OPEN 8,8,8,"0:"+F$+",S,W" 30 GOSUB 60 : IF EN$ > "00" THEN CLOSE 8 : GOTO 20 35 GET#1,A$ : IF A$ > "" GOTO 35 40 GOSUB 45 : GOTO 190 45 PRINT#1,"ok" : RETURN :REM "OK" ON REMOTE HOST 47 PRINT#1,"ng" : RETURN :REM "NG" ON REMOTE HOST 60 INPUT#15,EN$,EM$,ET$,ES$ : IF EN$ > "00" THEN PRINT "[RVS ON]"EN$EM$ET$ES$ 61 RETURN 150 REM CONVERT ASCII TO PETASCII 155 A = ASC(A$+CHR$(0)) : IF A > 64 AND A < 91 THEN A = A + 128 160 IF A > 96 AND A < 123 THEN A = A - 32 165 IF A=127 THEN A=20 170 A$=CHR$(A) :RETURN 190 L$="" : CK=0 195 GET#1,A$ : IF A$="" THEN 195 197 IF A$=CHR$(13) THEN 200 198 CK = CK + ASC(A$) : GOSUB 150 : L$ = L$ +A$ : PRINT A$; : GOTO 195 200 PRINT : CK$="" 202 GET#1,A$ : IF A$="" THEN 202 203 IF A$ <> CHR$(13) THEN CK$ = CK$ + A$ : GOTO 202 205 IF CK = ABS(VAL(CK$)) THEN 210 207 PRINT "[RVS ON]CHECKSUM ERROR - SENDING NACK" : GOSUB 47 : GOTO 190 210 PRINT#8,L$ : GOSUB 60 : IF EN$ > "00" THEN STOP :REM (FATAL?) DISK ERROR 215 GOSUB 45 : IF LEFT$(CK$,1) <> "-" THEN 190 220 CLOSE 8 : GOTO 20