THE PARALLEL PORT ........................................................................................................Spanish press here

     On the DB-25 connector can found 25 pins, 8 of them are to data out ,this your only can modified by software, they are pin 2 (data 0) to pin 9 (data 1).
     Another 5 pins are input data, only can modified by external hardware, they are pin 11,10,12,13 and 15 (the pin 15 are inverted). Remember, when you use the state bits your get a 8 bits the 3 more little are system reserves. And the ping 15 are inverted the correct values is inverted too. 4 pins are a control pins 1,14,16,17, they have two directions, your can modified they by hardware or software. The pins 17,14 and 1 are inverted, have a negative logical and his real value is inverted too.
And the 18 to 25 pins are ground, we always use 25 pins, but you can use some of them.

     The memory parallel port direction can by found in $40: $008, the result is, the Data bus direction, are 3 result typical.
 
3bc (Hex.)
If your have a monochrome MDA video card. 
378 (Hex.)
Usually.
278 (Hex.)
A second parallel port.

     When your get the Data bus direction, plus +1 to get the State bus and +2 to get the Control bus.
 

 
 
 
SORGO I.D.
I/O PORT
I/O PORT
I/O PORT
DATA
3BC 
378
278
STATE
3BD
379
279
CONTROL
3BE
37A
27A

       The output Voltage is 5V c.c and 0,5 mA. This characteristiques is the better to use the TTl technologic to made external hardware controller by this port.
 

    -Schemes to DATA bus 

Data  Outputs

     - SALIDAS.PAS program
Program Salidas ; 
    Uses crt ; 
     Var 
       Salida,DatoSalida: Integer; 
    Begin 
      Salida:=MenW [$040:$008] ;{get the parallel port position} 
           For DatoSalida:= 0 to 255 do Begin
                Port [Salida]:= DatoSalida; {send data to port} 
                Delay (1000); 
          End; 
      Port [Salida]:=0; {release data } 
      Repeat Until Keypresset; 
End. 

 
 
 

     -Schemes to STATE bus 

State Inputs

       - ENTRADAS.PAS program
Program Entradas ; 
  Uses crt ; 
  Var 
     Salida,Entrada,DatoEntrada: Integer; 
   Begin 
      Salida:=MenW [$040:$008] ;
      Entrada:=Salida +1 ;{get de STATE bus position } 
         Repeat 
             DatoEntrada:= Port [Entrada]; {get data } 
             Write (DatoEntrada); 
        Until Keypresset; 
End. 
 

      -Schemes to CONTROL bus

Contorl Outputs

       - ControlS.pas program
Program ControlS ; 
  Uses crt ; 
  Var 
      Salida,Control,DatoSalidaControl: Integer; 
  Begin 
     Salida:=MenW [$040:$008] ; 
     Control:=Salida +2;{get the Control bus direction } 
          For DatoSalidaControl:= 0 to 255 do Begin 
            Port [Control]:= DatoSalidaControl; {send data} 
            Delay (1000);
          End; 
    Port [Control]:=0;   Repeat Until Keypresset; 
End. 
 

       - ControlE.pas program

Control Inputs
  Program ControlE ; 
   Uses crt ; 
   Var 
      Salida,Control,DatoEntradaControl: Integer; 
  Begin 
       Salida:=MenW [$040:$008] ; 
       Control:=Salida +2 ;
           Repeat 
              DatoEntradaControl:= Port [Control]; {get data} 
              Write (DatoEntradaControl);{Remenber inverted bits} 
          Until Keypresset; 
End. 
 

by Necro_

www.sorgonet.com