0


Hello.

I am trying to write a very simple Delphi4 32-bit console app which toggles the RTS pin of the COM1 RS232 serial port.

What is the simplest way to do this?

I tried writing asm code (see below) but not surprisingly I got a run-time exception:

Exception EPrivilege in module z.exe at 00008254.
Privileged instruction.


Does Delphi4 have built-in support for toggling RTS? I could not find it.

Thank you.

procedure SetRTS;
asm  
mov dx, 03fch;   {get COM1 MCR}
in al,dx;
or al, 2;        {set RTS}
out dx, al; 
end;  

procedure ClearRTS;
asm  
mov dx, 03fch;
in al,dx;
and al, 0fdh;
out dx, al; 
end;
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Pirsig
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.