打印机接口用于A/D转换
10 DIM C(7),N(7):FOR I=0 TO 7:M(I)=0:N(I)=255:NEXT:X=0:
Y=50:CLS
20 ADDW=&H378:ADDR=&H379:SCREEN 2:D=7
30 ADDW=&H3BC:ADDR=&H3BD:SCREEN 2:D=7
40 FOR I=0 TO D:WA=&H18+I:WRC=I:RA=&H20+I:RB=&H60+I
50 OUT ADDW,WA:OUT ADDW,WRC
60 OUT ADDW, RA:A=INP(ADDR)\16:OUT ADDW,RB:B=INP(ADDR)\16:OUT ADDW,WRC
70 C(I)=A*16+B
80 IF M(I)<C(I) THEN M(I)=C(I)
90 IF N(I)>C(I) THEN N(I)=C(I)
100 NEXT:LOCATE 1,1 110 PRINT" A/D#";:FOR I=0 TO 7:PRINT USING"#####";I;:NEXT:PRINT:PRINT
120 PRINT"A/D=";FOR I=0 TO 7:PRINT USING "#####";C (I);:NEXT:PRINT:PRINT
130 PRINT"MAD=";:FOR I=0 TO 7:RPINT USIG "#####";N(I);:NEXT :PRINT:PRINT
140 PRTINT"MIN=";:FOR I=0 TO 7:RPINT USING "#####"N(I);:NEXT:PRINT:PRINT
150 PRINT" M-N=";:FOR I=0 TO 7:RPINT USING "#####";M(I)-N(I);:NEXT :PRINT
160 YY=Y+C(0):PSET(X,YY):X=X+1:IF X>599 THEN X=0
170 A$=INKEY$ :IF A$=""THEN 40 ELSE :PRINT:LIST
(武汉 刘晓兵)