home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1996 June / 64er_Magazin_96-06_1996_Markt__Technik_de_Side_B.d64 / mini-term (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1996-01-01  |  6.3 KB  |  232 lines

  1. 10 poke56,peek(46)+5
  2. 20 e=e+1:ife=1thenload"ass.80z52990",8,1
  3. 30 ife=2thenload"ass.term",8,1
  4. 31 ife=3thenload"ass.upl",8,1
  5. 32 clr:ee=peek(56)
  6. 35 print"[147]date = ";
  7. 36 inputda$
  8. 40 poke52955,224:poke52956,196:poke206*256,0
  9. 50 dimf$(10),fs(10),fl(10),fb(10):fa=0
  10. 60 mm=197*256:l$="                                        "
  11. 70 fort=0to255:pokemm+t,2:next
  12. 80 fort=4to7:pokemm+t,0:next
  13. 90 fort=eeto191:pokemm+t,0:next
  14. 100 poke56335,0:poke56334,0:sys52990:sys49858:poke218,0:dl%=0
  15. 105 poke780,13:sys49776:fort=1to100:next:poke250,peek(247):cn=0
  16. 106 gosub5000
  17. 110 sys50412:u=peek(782)
  18. 120 print"[147] experimental terminal";:ifcnthengosub3600:print"   ("m;s")";
  19. 130 poke220,0:print"          free memory:";
  20. 140 printu*256;" - used:"int((196-ee-u)/(196-ee)*100+.5)"%
  21. 150 [153]
  22. 160 [139]fa[178]0[167][153]"    no files":[137]200
  23. 170 [129]t[178]1[164]fa:[153][200]("   "[170][196](t)[170]":"[170]f$(t)[170]"  ("[170][196](fb(t))[170]" )"[170]l$,40);
  24. 180 [130]:[139][168](1[175]fa)[167][153]
  25. 200 [153]:[153]"    d: download   ";
  26. 205 [139]dl%[177]0[167][153]"** active **";
  27. 210 [153]
  28. 220 [153]"    u: upload     ";
  29. 226 [153]
  30. 230 [153]:[153]"    t: terminal mode                    ";
  31. 235 [153]"    l: load  file"
  32. 240 [153]"    r: disc-drive com/err               ";
  33. 245 [153]"    v: view  file"
  34. 250 [153]"    h: hang up                          ";
  35. 255 [153]"    s: save  file"
  36. 260 [153]"    b: send a break                     ";
  37. 265 [153]"    e: erase file"
  38. 266 [153]" sh+i: initialize modem                 ";
  39. 267 [153]"    m: mail a file"
  40. 270 [153]:[153]" sh+c: connect                          ";
  41. 280 [153]" sh+x: exit"
  42. 300 [161]q$:[139]q$[178]""[137]300
  43. 310 [139]q$[178]"t"[167][153]"load terminal-mode..":[158]50039:[153]"leaving terminal-mode":[137]110
  44. 320 [139]q$[178]"u"[137]1000
  45. 330 [139]q$[178]"d"[137]2000
  46. 340 [139]q$[178]"e"[137]3000
  47. 341 [139]q$[178]"l"[137]3200
  48. 342 [139]q$[178]"s"[137]4300
  49. 343 [139]q$[178]"r"[137]4500
  50. 344 [139]q$[178]"b"[137]3500
  51. 345 [139]q$[178]"m"[137]3800
  52. 346 [139]q$[178]"right$"[137]5200
  53. 350 [139]q$[178]"v"[137]3100
  54. 360 [139]q$[178]"(NULL)"[167][151]1024,0:[158]1024
  55. 370 [139]q$[178]"h"[137]3300
  56. 380 [139]q$[178]"len"[137]3400
  57. 400 [137]300
  58. 1000 [143] upload
  59. 1010 [153]:[153]"file to upload #";:[141]1100:[139]i[178]0[137]120
  60. 1045 [151]219,0:[151]220,fs(i):[151]221,fl(i)
  61. 1050 [158]820:[153]:[153]"<end of file>":[129]t[178]1[164]1000:[130]:[137]110
  62. 1100 [139]fa[178]0[167][153]" *sorry there is no file*":[129]t[178]1[164]2000:[130]:[151]198,0:i[178]0:[142]
  63. 1105 [161]q$:[139]q$[178]""[137]1100
  64. 1110 i[178][197](q$):[139]i[177]fa[176]i[179]1[167]i[178]0:[153]"-skip-"
  65. 1120 [153]q$"  "[199](34)f$(i)[199](34):[142]
  66. 2000 [143] download
  67. 2010 [139]dl%[179][177]0[137]2100
  68. 2020 [158]50412:t[178][194](780)
  69. 2045 [139]t[178]0[167][153]"out of memory":[137]300
  70. 2050 [151]217,0:[151]218,t:fs[178]t:dl%[178]1:[137]120
  71. 2100 [139][194](218)[178]0[167][151]53280,0
  72. 2105 [153]:[133]"store as ";n$
  73. 2110 fa[178]fa[170]1:f$(fa)[178]n$:fs(fa)[178]fs:fl(fa)[178][194](217):dl%[178]0
  74. 2120 [139][194](218)[178]0[137]2140
  75. 2130 [151]mm[170][194](218),2:[151]218,0
  76. 2140 t[178]fs(fa):x[178][171]1
  77. 2150 i[178][194](mm[170]t):x[178]x[170]1:[139]i[179][177]2[167]t[178]i:[137]2150
  78. 2160 fb(fa)[178]x[172]256[170]fl(fa):[137]110
  79. 3000 [143] erase
  80. 3010 [153]:[153]"file to erase #";
  81. 3020 [141]1100
  82. 3040 [139]i[178]0[137]120
  83. 3045 t[178]fs(i):[153]"erasing "f$(i)
  84. 3046 [129]x[178]i[170]1[164]fa:f$(x[171]1)[178]f$(x):fs(x[171]1)[178]fs(x):fl(x[171]1)[178]fl(x):fb(x[171]1)[178]fb(x):[130]
  85. 3047 fa[178]fa[171]1
  86. 3050 i[178][194](mm[170]t):[151]mm[170]t,0:[139]i[178]2[137]110
  87. 3060 t[178]i:[137]3050
  88. 3100 [143] view
  89. 3110 [153]:[153]"file to view #";
  90. 3120 [141]1100
  91. 3140 [139]i[178]0[137]120
  92. 3145 [151]219,0:[151]220,fs(i):[151]221,fl(i)
  93. 3150 [158]50326:[153]"<eof>":[137]3195
  94. 3160 [153][199]([194](780));:[137]3150
  95. 3195 [146]198,1:[151]198,0:[137]120
  96. 3200 [143] disk-load
  97. 3205 n$[178]"":[153]:[133]"load-filename,type ";n$,b$:[139]n$[178]""[137]120
  98. 3210 [141]3280:[159]1,8,5,n$[170]","[170]b$:[159]15,8,15
  99. 3215 [132]15,er,er$:[141]3290
  100. 3216 [139]er[177]1[167][153]"disc>"er;er$:[141]3280:[160]1:[160]15:[141]3290:[137]110
  101. 3220 [158]50412:t[178][194](780)
  102. 3245 [139]t[178]0[167][153]"out of memory":[137]110
  103. 3250 [151]217,0:[151]218,t:fs[178]t
  104. 3260 [141]3280:[158]50272:[160]15:[141]3290
  105. 3265 fl[178][194](217):f[178][194](218):[139][194](783)[175]1[167][153]"sys > i/o error #"[194](780)
  106. 3270 [153]"local:":[137]2100
  107. 3280 [151]56333,127:[151]56334,192:[142]
  108. 3290 [151]56327,60:[151]56335,1:[151]56334,193:[151]56333,138:[142]
  109. 3300 [143] hang-up
  110. 3305 b$[178]ti$:[153]:[153]"hang up..."
  111. 3320 [141]3550:a$[178]"ath"[170][199](13):[141]3420:[141]5066:[139]a$[178]"no carrier"[137]3325
  112. 3321 [139][168]a[167][153]"not okay ?":[137]110
  113. 3325 [139]cn[178]0[137]110
  114. 3330 cn[178]0:[141]3600:[153]"you've been connected for "m"m"s"s";
  115. 3335 x[178][181](m[173]2[170]1)[172].23:[153]" ("x"- dm )
  116. 3336 fort=1to500:next
  117. 3340 gosub3280:open1,8,2,".modlog,s,a"
  118. 3350 print#1,right$(" "+str$(m),2)+"m"+right$(" "+str$(s),2)+"s,date="+da$
  119. 3360 close1:gosub3290:goto110
  120. 3400 rem connect (insert the tel-number to be called)
  121. 3410 a$="atdt...."+chr$(13):gosub3420:goto3450
  122. 3420 fort=1tolen(a$)
  123. 3430 poke780,asc(mid$(a$,t)):sys49776:ifpeek(783)and1goto3430
  124. 3440 next:return
  125. 3450 print:print"dialing..."
  126. 3455 a$="":ti$="000000"
  127. 3460 gosub4000:ifagoto3480
  128. 3465 ifti$<"000130"goto3460
  129. 3470 print"time out - hang up":a$="+++ath":gosub3420
  130. 3472 ti$="000000":poke198,0:a$=""
  131. 3474 getq$:ifq$<>""goto120
  132. 3475 gosub4000:ifathenprint"modem> "a$:a$=""
  133. 3476 ifti$<"000100"goto3474
  134. 3478 goto3410
  135. 3480 print"modem> "a$:ifleft$(a$,2)="no"goto3472
  136. 3481 ifa$="busy"goto3472
  137. 3485 ifleft$(a$,7)<>"connect"thena$="":ti$="000000":goto3460
  138. 3490 m=0:s=15:gosub3700
  139. 3495 q$="t":cn=-1:fort=1to100:next:a$=chr$(13):gosub3420:fort=1to100:next
  140. 3496 print"send login..."                                 
  141. 3497 a$="--your username--"+chr$(13):gosub3750:fort=1to200:next
  142. 3498 a$="--your passwd--"+chr$(13):gosub3750:goto310
  143. 3500 rem send break
  144. 3505 print:print"send break..."
  145. 3515 gosub3550:a$="at\b"+chr$(13):gosub3420
  146. 3520 gosub5066:ifa$="no carrier"goto110
  147. 3521 ifnotagoto110
  148. 3525 a$="ato"+chr$(13):gosub3420
  149. 3530 a$=""
  150. 3535 gosub4000:ifnotagoto3535
  151. 3540 print"modem> "a$:goto110
  152. 3550 fort=1to1500:next:a$="+++":gosub3420:fort=1to2000:next:return
  153. 3600 rem gettime m,s
  154. 3610 a=peek(56331):a=peek(56330)
  155. 3620 m=int(a/16)*10+(aand15)
  156. 3630 a=peek(56329):s=int(a/16)*10+(aand15):a=peek(56328):return
  157. 3700 rem puttime m,s
  158. 3710 poke56334,193:poke56331,0:poke56330,6*int(m/10)+m:poke56329,6*int(s/10)+s:poke56328,0
  159. 3720 return
  160. 3750 fort=1tolen(a$):x=asc(mid$(a$,t)):ifx>64andx<91thenx=x+32:goto3770
  161. 3760 ifx>191andx<219thenx=x-128
  162. 3770 poke780,x:sys49776:if1andpeek(783)goto3770
  163. 3780 next:return
  164. 3800 rem mail
  165. 3810 print:print"file to mail #";:gosub1100:ifi=0goto120
  166. 3820 poke219,0:poke220,fs(i):poke221,fl(i)
  167. 3830 print"how's the receiver:
  168. 3840 [153]"1:name1  2:name2  3:name3  4:name4  5:name5  6:name6  7:name7
  169. 3850 print"dest=";
  170. 3860 poke198,0:wait198,1:getq$:x=val(q$):ifx<1orx>7thenpoke220,0:goto120
  171. 3870 printq$:onxgosub3891,3892,3893,3894,3895,3896,3897
  172. 3875 a$="mail "+a$+chr$(13):gosub3750
  173. 3877 fort=1to3000:next
  174. 3880 a$="---"+chr$(13):gosub3420:fort=1to1500:next
  175. 3885 goto1050
  176. 3891 a$="---mailadr1---":return
  177. 3892 a$="---mailadr2---":return
  178. 3893 a$="---mailadr3---":return
  179. 3894 a$="---mailadr4---":return
  180. 3895 a$="---mailadr5---":return
  181. 3896 a$="---mailadr6---":return
  182. 3897 a$="---mailadr7---":return
  183. 4000 rem getstring
  184. 4010 x=peek(250)
  185. 4020 ifx=peek(247)thena=0:poke250,x:return
  186. 4030 i=peek(49408+x):x=255and(x+1)
  187. 4040 ifi=13anda$<>""thena=-1:poke250,x:return
  188. 4050 ifi<32goto4020
  189. 4060 a$=a$+chr$(i):goto4020
  190. 4300 rem disk-save
  191. 4310 print:print"file to save #";:gosub1100:ifi=0then120
  192. 4350 n$="":print:input"save-filename,type ";n$,b$:ifn$=""goto120
  193. 4360 gosub3280:open1,8,1,n$+","+b$:open15,8,15
  194. 4370 input#15,er,er$:gosub3290
  195. 4380 ifer>1thenprinter;er$:gosub3280:close1:close15:gosub3290:goto110
  196. 4390 poke220,fs(i):poke221,fl(i):poke219,0
  197. 4400 gosub3280:sys50308:gosub3290
  198. 4410 if1andpeek(783)thenprint"sys > i/o error #"peek(780)
  199. 4420 gosub3280:input#15,er,er$:gosub3290:print"disc>"er;er$
  200. 4430 gosub3280:close15:gosub3290:goto110
  201. 4500 rem disc-com/err
  202. 4510 print:print"disc-command ";:gosub4550
  203. 4520 gosub3280:open1,8,15,a$:input#1,er,er$,t,i:close1:gosub3290
  204. 4530 print"disc>"er","er$","t","i
  205. 4540 poke198,0:wait198,1:poke198,0:goto120
  206. 4550 a$="":print"? ";
  207. 4560 getq$:ifq$=""goto4560
  208. 4570 ifq$=chr$(13)thenprint:return
  209. 4580 ifasc(q$)<32goto4560
  210. 4585 printq$;:a$=a$+q$:goto4560
  211. 5000 rem startup
  212. 5010 print"[147] terminal startup"
  213. 5020 print:print:print
  214. 5030 print"initialize terminal ? (y/n) ";
  215. 5040 poke198,0:wait198,1:getq$
  216. 5050 ifq$<>"y"andq$<>"n"goto5040
  217. 5060 printq$:ifq$="n"thenreturn
  218. 5061 a$="at&f0w2s7=30"+chr$(13):gosub3420
  219. 5062 rem  ---replace it with your init-string!
  220. 5063 gosub5066:ifathenreturn
  221. 5065 goto5000
  222. 5066 rem wait for 'ok'
  223. 5070 a$="":ti$="000000"
  224. 5080 gosub4000:ifagoto5110
  225. 5090 ifti$<"000010"goto5080
  226. 5100 a=0:return
  227. 5110 print"modem> "a$:ifa$="no carrier"thena=0:return
  228. 5115 ifa$<>"ok"thena$="":goto5090
  229. 5120 return
  230. 5200 print:print"initializing..."
  231. 5210 gosub3550:gosub5061:goto110
  232.