DelphiFAQ Home Search:

Read and write I/O ports

 

comments7 comments. Current rating: 3 stars (3 votes). Leave comments and/ or rate it.

In Borland Pascal and Delphi 1, there is a predefined pseudo variable Port.

In the 32bit versions of Delphi you need 2 lines of assembler code..

function InPort(PortAddr:word): byte;
{$IFDEF WIN32}
assembler; stdcall;
asm
  mov dx,PortAddr
  in al,dx
end;
{$else}
begin
  Result := Port[PortAddr];
end;
{$ENDIF}
You don't like the formatting? Check out SourceCoder then!
Content-type: text/html

Comments:

2006-03-04, 10:54:14
anonymous from Bosnia and Herzegovina  
rating
something I was looking for
2006-08-27, 09:29:56
anonymous from Iran  
what must I do next? I mean in the place of PortAddr what must be replaced?
2006-08-27, 10:02:25
[hidden] from Iran  
rating
I want to read data from female port in windows xp and in delphi what must I do?
2006-11-15, 08:28:53
HUNTER from China  
READING DATA FROM PORT?
2006-12-13, 03:05:11
hunter from China  
you application must runing of the ring0
2007-03-18, 16:13:43
same from Lithuania  
rating
not usefull
2012-01-17, 10:35:20
ricky.spl@gmail.com from South Africa  
HI
I have delphi 4 and i want to to write a simple program to read the microphone and play the sound at the same time to a speaker. I am a beginer in programming please help.

Please reply by email: ricky.spl@gmail.com

Thanks
Ricky

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: