home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1988 April / 64er_Magazin_88-04_1988_Markt__Technik_de_Side_A.d64 / rs232-kommunikat (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  1KB  |  34 lines

  1. 10 rem rs232 kommunikationsprogramm
  2. 20 rem geschrieben von m. mueller   88
  3. 30 rem -------------------------------
  4. 40 rem (c) 1988 by 64'er
  5. 50 :
  6. 60 print chr$(147);"moment..."
  7. 100 open 2,2,0,chr$(6)+chr$(0)
  8. 110 dim s(255):rem array fuer umwandlung c-64 zeichensatz ->ascii
  9. 120 for i=0 to 64: s(i)=i:next:rem steuer-, interpunktionszeichen u. zahlen
  10. 130 for i=65 to 90: s(i)=i+32:next:rem c-64kleinbuchstaben nach ascii
  11. 140 for i=91 to 192:s(i)=i:next:rem sonnstige zeichen
  12. 150 for i=193 to 218:s(i)=i-128:next:rem c64grossbuchstaben nach ascii
  13. 160 for i=219 to 255:s(i)=i:next:rem sonstige zeichen
  14. 170 s(20)=8:rem code fuer del nach ascii code fuer bs
  15. 200 :
  16. 210 dim a(255):rem array fuer umwandlung ascii zeichensatz->c 64
  17. 220 for i=0 to 64:a(i)=i:next
  18. 230 for i=65 to 90:a(i)=i+128:next:rem ascii grossbuchstaben nach c 64
  19. 240 for i=91 to 96:a(i)=i:next:rem wie zeile 140
  20. 250 for i=97 to 122:a(i)=i-32:next:rem ascii kleinbuchstaben ->c 64close
  21. 260 for i=123 to 255:a(i)=i:next
  22. 270 a(8)=20:rem ascii code fuer bs nach c 64 code fuer del
  23. 280 :
  24. 290 print chr$(147);:gosub 900
  25. 300 :
  26. 310 get a$:if a$="" then 400
  27. 320 print#2,chr$(s(asc(a$)));:print a$;:gosub 900
  28. 330 if a$=chr$(13) then print#2,chr$(10);:rem wenn cr, dann noch lf senden
  29. 340 goto 310
  30. 400 get#2,a$:if a$="" then 310
  31. 410 print chr$(a(asc(a$)));:gosub 900:goto 400
  32. 900 poke 212,0:rem anfuehrungszeichenmodus aus
  33. 910 return
  34.