Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > Oracle Database, SQL, Application, Programming


How to access ports


Reply
Views: 1432  
Thread Tools Rate Thread
  #1  
Old 08-20-2010, 10:51 AM
bholas bholas is offline
Award Winner
 
Join Date: Apr 2010
Posts: 4,977
Default How to access ports

In the old days of DOS and 16bit Windows, writing to ports (serial, printer, game, video and other ports) in your computer was easy; all you had to do was use the "port[]" command.
Delphi no longer supports the "port[]" command, so you may have to use assembly functions as follows:
function ReadPortB
( wPort : Word ) : Byte;
begin
asm
mov dx, wPort
in al, dx
mov result, al
end;
end;

procedure WritePortB
( wPort : Word; bValue : Byte );
begin
asm
mov dx, wPort
mov al, bValue
out dx, al
end;
end;

Reply With Quote
Reply

Tags
programming tips

New topics in Oracle Database, SQL, Application, Programming





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)