base:simple_basic_x-modem_receive
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
base:simple_basic_x-modem_receive [2015-04-17 04:33] – external edit 127.0.0.1 | base:simple_basic_x-modem_receive [2015-08-30 11:31] (current) – white_flame | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Type-in BASIC program for X-Modem file download ===== | ||
+ | Transfer software is great, but how do you initially get it on your 64? I wrote this to solve the bootstrapping problem. | ||
+ | < | ||
+ | 0 rem simple xmodem receive by white flame 2003-11-29 | ||
+ | 10 input" | ||
+ | 20 input" | ||
+ | 21 input" | ||
+ | 22 reada, | ||
+ | 25 open5, | ||
+ | 30 open2, | ||
+ | 31 dimp(128) | ||
+ | 35 input" | ||
+ | 40 print# | ||
+ | 50 e=1: | ||
+ | 998 print" | ||
+ | 999 close5: | ||
+ | 1100 rem --- get char --- | ||
+ | 1105 tm=ti | ||
+ | 1110 geta$: | ||
+ | 1115 ifti-tm> | ||
+ | 1120 get# | ||
+ | 1125 i=asc(i$+chr$(0)) | ||
+ | 1130 return | ||
+ | 2000 rem --- received eot --- | ||
+ | 2010 print" | ||
+ | 2020 print# | ||
+ | 2030 gosub1100 | ||
+ | 2040 ifi<> | ||
+ | 2050 print# | ||
+ | 2060 print" | ||
+ | 3000 rem --- receive loop --- | ||
+ | 3010 gosub 1100 | ||
+ | 3020 ifi=4then2000: | ||
+ | 3025 ifi=24thenprint" | ||
+ | 3030 ifi<> | ||
+ | 3040 gosub1100: | ||
+ | 3050 ifi+i2<> | ||
+ | 3060 ifi2<> | ||
+ | 3080 c=0:n=0:t=0 | ||
+ | 3081 gosub1100: | ||
+ | 3082 p(t)=i: | ||
+ | 3090 gosub1100: | ||
+ | 3095 fort=0to127: | ||
+ | 3096 e=(e+1)and255: | ||
+ | 3100 goto3000 | ||
+ | 3110 rem --- redo packet --- | ||
+ | 3115 print" | ||
+ | 3120 print# | ||
+ | 3130 goto 3010 | ||
+ | 9000 rem --- baud rate codes --- | ||
+ | 9005 data 50,1, 75,2, 110,3, 134.5,4, 150,5 | ||
+ | 9010 data 300,6 | ||
+ | 9020 data 1200,8 | ||
+ | 9030 data 2400, |