Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Version 1.0 Netnews CMS/BITNET 5/19/85; site PSUVM.BITNET Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rochester!cmu-cs-pt!cadre!psuvax1!psuvm.bitnet!gmw From: GMW@psuvm.BITNET Newsgroups: net.micro.cbm Subject: C64BOOT.CLU Message-ID: <1809GMW@psuvm> Date: Wed, 5-Jun-85 03:18:38 EDT Article-I.D.: psuvm.1809GMW Posted: Wed Jun 5 03:18:38 1985 Date-Received: Thu, 6-Jun-85 08:55:12 EDT Lines: 33 %% Program to download files to my Commodore 64 %% Sends lines, one at a time. Each line is followed by a %% checksum. Commodore validates checksum, and either sends %% "OK" or "NG". If no good, retransmit. Last line's checksum %% is sent with a leading minus sign to show end-of-file. start_up = proc () po:stream := stream$primary_output() pi:stream := stream$primary_input() file:stream := stream$open(file_name$parse(get_jcl()),"read") except when not_possible(why:string): stream$putl(po,"Could not open file: " || why) return end received:string := "" while received ~= "OK" do received := stream$getl(pi) end % don't start until initial OK while ~stream$empty(file) | received = "NG" do line:string if received = "OK" then line := stream$getl(file) end checksum:int := 0 for c:char in string$chars(line) do stream$putc_image(po,c) checksum := checksum + char$c2i(c) end stream$putc_image(po,'\r') if stream$empty(file) then stream$putc(po,'-') end stream$puts_image(po, int$unparse(checksum) || "\r") received := stream$getl(pi) end