0 'SAVE "SET-I3.BAS",A '11/10/84 11 ' This Program is coded in MicroSoft Basic 5.x (MBASIC). It may 12 ' be used to set the Interfacer 3 Board while in BASIC. 13 ' I used it to set the Interfacer 3 ports and I used the System 14 ' Support 1 Board for my terminal. It worked ok. Then I gave 15 ' the program to Jeff Albrecht and it did not work properly. I 16 ' discovered that he was using the Interfacer 3 for his terminal 17 ' and his printer. Basic would change the user number between 18 ' the time I sent a user number out and the time I sent the baud 19 ' rate request. This always changed the terminal baud rate instead 20 ' of the desired port. I cured the problem by calling an assembly 21 ' language routine to do the actual port initialization. 22 ' 23 ' Rod Aldrich of the Software Store, Marquette, MI added the 24 ' ability to change user numbers on the fly. I had Hard Coded 25 ' the program for my use. 26 ' 27 ' Questions may be addressed to: 28 ' 29 ' Keith W. Antcliff 30 ' P.O. Box 906 31 ' Mead, WA 99021 32 ' 33 ' Messages may be left on the following boards: 34 ' 35 ' Northwest CompuPro RBBS (509) 624-6799 36 ' S.M.U.G. (509) 255-6324 37 ' S.M.U.G. after 11/16/84 (509) 924-0808 38 ' 99 ' 100 WIDTH 255 'Turn Off Width Control 110 GBI3%=16 'Interfacer 3 Base Address (decimal) 120 GBI3U%=GBI3%+7 'Select User Port 130 GBI3M%=GBI3%+2 'Uart Modem Port 140 GBI3C%=GBI3%+3 'Uart Command Port 150 GBUM%=GBI3M% 'Uart Modem Port 160 GBUC%=GBI3C% 'Uart Command Port 170 MODE.REG.1%=238 '11101110b - Async,16x,8 bits,no parity,even,2 stops 180 CMD.REG%=39 '00100111b - Trans. on,dtr low,rec. on,no break 190 HIBITS%=112 '01110000b - Always Use This Pattern 200 LOBITS%=7 '00000111b - 1200 Baud Default Value 210 WI%=79 'Normal Terminal Width 220 DIM BAUD$(17) 'Dimension Variable 230 USER%=6 'Default User [7 = CONSOLE, 4 = LIST, 5 = UL1] 240 ' 250 A$="## = \ \ ## = \ \ " 260 CLR$=CHR$(26) 270 DEF FNER$=STRING$(LEN(QE$),8)+STRING$(LEN(QE$),32)+STRING$(LEN(QE$),8) 280 ' 290 ' BAUD RATE LOBITS% 300 ' 50 0 310 ' 75 1 320 ' 110 2 330 ' 134.5 3 340 ' 150 4 350 ' 300 5 360 ' 600 6 370 ' 1200 7 380 ' 1800 8 390 ' 2000 9 400 ' 2400 10 410 ' 3600 11 420 ' 4800 12 430 ' 7200 13 440 ' 9600 14 450 ' 19,200 15 460 ' 999 ' 1000 GOSUB 2510 'Read the Data Statements 1010 GOSUB 2250 'Print The Choices 1020 GOSUB 2160 'Enter Your Choice 1030 GOSUB 2120 'Set The Port As Specified 1040 GOSUB 2050 'Want To Do It Again? 1999 ' 2000 IF NO.QUIT% THEN 1010 2010 PRINT: PRINT 2020 PRINT "End of SET PORT";: WIDTH WI% 2030 END 2040 ' 2050 PRINT: PRINT 2060 PRINT "Want to initialize another port? [ = no, Y = YES ] : "; 2070 B$=INPUT$(1): B$=CHR$(ASC(B$) AND 95) 2080 IF B$=CHR$(13) THEN NO.QUIT%=0: RETURN 2090 IF B$="Y" THEN NO.QUIT%=-1: RETURN 2100 GOTO 2050 2110 ' 2120 GOSUB 2360 'Load The Assembly Routine 2130 D=USR(0) 'Set The Port 2140 RETURN 2150 ' 2160 PRINT 2170 PRINT "Select Desired Baud Rate [ =";LOBITS%; 2180 PRINT "(";BAUD$(LOBITS%);" BAUD) ] : "; 2190 LINE INPUT;QE$ 2200 IF QE$="" THEN RETURN 2210 IF VAL(QE$)<0 OR VAL(QE$)>15 THEN PRINT FNER$;: GOTO 2190 2220 LOBITS%=VAL(QE$) 2230 PRINT CHR$(13);STRING$(WI%,32);CHR$(13);: GOTO 2170 2240 ' 2250 PRINT CLR$;TAB(30);">> SET PORT <<":PRINT:PRINT 2260 PRINT "FUNCTION: To Initialize serial ports on the Godbout Interfacer III board." 2270 PRINT 2280 PRINT "Relative number of the port to initialize (0-7) [ =";USER%;"] : "; 2290 B$=INPUT$(1):IF B$=CHR$(13) THEN 2320 2300 IF ASC(B$)>=48 AND ASC(B$)<56 THEN USER%=VAL(B$) ELSE 2290 2310 PRINT B$;:PRINT CHR$(13);SPACE$(70);CHR$(13);:GOTO 2280 2320 PRINT:PRINT:PRINT "Baud rate table:":FOR I%=0 TO 7 2330 PRINT TAB(20);: PRINT USING A$;I%,BAUD$(I%),I%+8,BAUD$(I%+8) 2340 NEXT 2350 RETURN 2360 ' 2361 ' mvi A,user% ;Get User Number 2362 ' out gbi3u% ;Out it 2363 ' mvi A,mode.reg.1% ;Get Some Initialization 2364 ' out gbi3m% ;Out Modem Port 2365 ' mvi A,hibit%+lobit% ;Get Baud Value 2366 ' out gbi3m% ;Out Modem Port 2367 ' mvi A,cmd.reg% ;Get More Initialization 2368 ' out gbi3c% ;Out Command Port 2369 ' ret ;Return To Basic 2370 ' 2400 AA$=CHR$(&H3E)+CHR$(USER%)+CHR$(&HD3)+CHR$(GBI3U%) 2410 AA$=AA$+CHR$(&H3E)+CHR$(MODE.REG.1%)+CHR$(&HD3)+CHR$(GBI3M%) 2420 AA$=AA$+CHR$(&H3E)+CHR$(HIBITS%+LOBITS%)+CHR$(&HD3)+CHR$(GBI3M%) 2430 AA$=AA$+CHR$(&H3E)+CHR$(CMD.REG%)+CHR$(&HD3)+CHR$(GBI3C%) 2440 AA$=AA$+CHR$(&HC9)+"" 2450 V=VARPTR(AA$): V1=PEEK(V+1): V2=PEEK(V+2) 2460 V = (256*V2) + V1 2470 IF V>32767 THEN V=V-65536! 2480 DEF USR=V 2490 RETURN 2500 ' 2510 I%=0 2520 READ BAUD$(I%) 2530 IF BAUD$(I%)="EOD" THEN I%=I%-1: RETURN 2540 I%=I%+1: GOTO 2520 2550 '
2560 DATA 50,75,110,134.5,150,300,600,1200,1800 2570 DATA 2000,2400,3600,4800,7200,9600,19200 2580 DATA EOD Baud Rates>