PROCEDURE Set_IRQ_Off;
BEGIN
PORT[Control_Address] := $04;{Write 4 to disable IRQ}
END; {Set_IRQ_Off}
The function, In_Byte, returns the value of the variable, Input_Byte. It is defined as:
FUNCTION In_Byte : Byte;
BEGIN
In_Byte := Input_Byte;
End; { In_Byte }
Notice that this does not read the value of the parallel port. The function Read_Input_Bit reads the port.
The function, Out_Byte, returns the value of the variable Output_Byte. It is defined as:
FUNCTION Out_Byte : Byte;
BEGIN
Out_Byte := Output_Byte;
End; { Out_Byte }
Notice that this does not read the parallel port. It only returns the value of Output_Byte.
The function, Read_Input_Bit, returns the status of the specified input line. The function is defined as:
FUNCTION Read_Input_Bit (Bit_Number:BYTE) : BYTE;
BEGIN
Input_Byte := (PORT[Status_Address] AND $F0)
OR (PORT[Control_Address] AND $0F) ;
IF ( (Input_Byte AND (1 SHL Bit_Number) ) = 0 ) THEN
Read_Input_Bit := 0
ELSE
Read_Input_Bit := 1;
END; {Read_Input_Bit}
PPIO2899 Manual | 13 |
B&B Electronics Mfg Co Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph