Delphi7.0 parallel port control, their online to find a error (error detected cl

function ReadPort(Port:WORD):BYTE;
var
B:BYTE;
begin
ASM
MOV DX, Port;
IN AL, DX;
MOV B, AL;
END;
Result:=B;
end;
procedure WritePort(Port:WORD;ConByte:BYTE);
begin
ASM
MOV DX, Port;
MOV AL, ConByte;
OUT DX, AL;
END;
end;

Where is the problem? What is a good way to control the parallel port, please master pointing.

Started by Tamara at February 09, 2016 - 5:19 AM

You have to control what?

Posted by Lucien at February 15, 2016 - 5:54 AM

Computer parallel port 1-9 voltage

Posted by Tamara at March 01, 2016 - 6:21 AM

1, The data port of 378H D2 potential is set to low, namely 0:

B:=ReadPort($378);

B:=B and $FB;

WritePort($378,B);



  2, The data port of 378H D2 potential is set to high, namely 1:

B:=ReadPort($378);

B:=B or $04;

WritePort($378,B);



  3, Judging the data port of 378H D2 potential height:

B:=ReadPort($378);

if ((B and $04)=$04) then

//The potential for high code

else

//Potential for low code

Or:

B:=ReadPort($378);

if ((B or $FB)=$FF) then

//The potential for high code

else

//Potential for low code

Posted by Tamara at March 02, 2016 - 7:21 AM

Points not enough, not enough for me.

Posted by Tamara at March 14, 2016 - 7:40 AM

You can write directly to end his Windows? Seem to use third party drivers. Such as WINIO porttalk.

Posted by Nina at March 26, 2016 - 8:02 AM

Some people have a bit more detailed explanation, to learn about the best code

Posted by Tamara at January 11, 2017 - 4:55 AM