10 REM ********************************************************20 REM Setting transmission parameters21 REM from the Olivetti I/O with externa peripherals manual22 REM copied by Davide Bucci23 REM August, 22, 200524 REM *******************************************************40 DIM PN$(3)50 DATA "com:", "com1:", "com2:"60 FOR I=1 TO 3: READ PN$(I):NEXT70 DIM R$(8)80 DATA "50","110","300","600","1200","2400","4800","9600"90 FOR I=1 TO 8: READ R$(I): NEXT100 DIM P$(3)110 DATA "none", "odd", "even"120 FOR I=1 TO 3:READ P$(I):NEXT130 PRINT:INPUT "'rs' already executed? (yes-no) ",A$140 IF A$<>"no"THEN 160150 EXEC "rs"160 PRINT :INPUT "'ci' already executed? (yes-no) ",A$170 IF A$<>"no" THEN 190180 EXEC "pl ci"190 PRINT :INPUT "Enter port number (0-1-2) ", PN%200 IF PN%<0 OR PN%>2 THEN PRINT "Invalid selection": GOTO 190210 PRINT :INPUT "Enter baud rate (50-110-300-600-1200-2400-4800-9600) ", BR$220 FOR I=1 TO 8:IF R$(I)=BR$ THEN 250230 NEXT240 PRINT "Invalid selection": GOTO 210250 PRINT:INPUT "Enter parity (none-odd-even) ", PA$260 FOR I=1 TO 3: IF P$(I)=PA$ THEN 290270 NEXT I280 PRINT "Invalid selection": GOTO 250290 PRINT :INPUT "Enter no. of stop bits (0=1bit 1=1.5bits 2=2 bits) ", SB$300 IF SB$<"0" OR SB$>"2" THEN PRINT "Invalid selection": GOTO 290310 PRINT : INPUT "Enter no. of data bits (5-6-7-8) ", DB$320 IF DB$<"5" OR DB$>"8" THEN PRINT "Invalid selection": GOTO 310330 PRINT : INPUT "Enter duplex type (full-half) ", DU$340 IF DU$<>"full" AND DU$<>"half" THEN PRINT "Invalid selection": GOTO 330350 PRINT : INPUT "Enter handshake (on-off) ", HA$360 IF HA$<>"on" AND HA$<>"off" THEN PRINT "Invalid selection":GOTO 350370 PRINT :INPUT "Enter buffer size (>0) ", BS$380 IF BS$<"0" THEN PRINT "Invalid selection": GOTO 370390 ES$="sc "+PN$(PN%+1)+","+BR$+","+PA$+","+SB$+","+DB$+","+DU$+","+HA$+","+BS$400 EXEC ES$410 E%=0420 CALL "ci" (PN%, "o", @E%)430 IF E%=0 THEN GOTO 460440 PRINT "Port error when opening: "; E%450 STOP460 PRINT : INPUT "Default transmission parameters ok? (yes-no) ", A$470 IF A$<>"no" THEN 650480 HS%=0490 A$="transmit enable":GOSUB 700500 HS%=HS%+I%510 A$="data terminal ready": GOSUB 700520 HS%=HS%+2*I%530 A$="receive enable": GOSUB 700540 HS%=HS%+4*I%550 A$="send break character":GOSUB 700560 HS%=HS%+8*I%570 A$="error reset":GOSUB 700580 HS%=HS%+16*I%590 A$="request to send":GOSUB 700600 HS%=HS%+32*I%610 CALL "ci" (PN%, "sw", @E%,,@HS%)620 IF E%=0 THEN GOTO 650630 PRINT "Status write error: "; E640 STOP650 PRINT : PRINT "End of setup program"660 END 700 PRINT A$;" (1=yes 0=no)";720 INPUT I%730 IF I%<>1 AND I%<>0 THEN PRINT "Invalid selection": GOTO 700740 RETURN