Direct port access in Windows 95/98  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 19/05/01

Tip accessed 424 times

 


Delphi 1, had functions to read and to write ports. In Delphi 2 and in later versions, these functions no longer exist.
Here you have two very simple functions that allow you to make it:


   procedure EscribePuerto(Direccion:word;valor:byte);
    begin
     asm
       mov dx,Direccion
       mov AL,valor
       out DX,AL
     end;
    end;






    function LeePuerto(Direccion:Word):Byte;
    begin
     asm
       mov dx,Direccion
       in al,dx
       mov Result,al
     end;
    end;






 http://jlceada.virtualave.net/Delphi/Componentes/componentes.html




Updated at 19/05/2001