Program Serielle_Schnittstelle; Uses Dos,PortCrt; var Vout,Vin,Ref,D,B:Real; i,a,x,xx: Byte; adresse,zeichen: String; BA : word; Begin BA:=MEMW[$0040:$0000]; clrscr; Repeat B:=2048; Vout:=0; Ref:=5.0; adresse:='111101110001'; For i:=1 to 12 do Begin x:=Port[BA+4]; xx:=($FE and x); Port[BA+4]:=xx; zeichen:=copy(adresse,13-i,1); IF zeichen='0' then Begin Port[BA+4]:=($FD and Port[BA+4]); end else Begin Port[BA+4]:=($2 or Port[BA+4]); End; Port[BA+4]:=($1 or Port[BA+4]); IF (Port[BA+6] and 16 ) = 16 then Begin D:=0; End Else Begin D:=1; End; Vout:=Vout+(D*B); B:=B/2; End; Port[BA+4]:=($FD and Port[BA+4]); Port[BA+4]:=($2 or Port[BA+4]); Delay(20); Vin:=(Vout/4091)*Ref; Writeln(Vin:6:6,' Volt'); Delay(800); until keypressed; End.