🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #1854

Re: ��ô��Delphi��д�˿ڣ�Ҳ����Pascal�����⣩��Empty

#1854
From: James
Date: Fri, 27 Mar 1998 00:00
42 lines
1451 bytes
Hi,
    in delphi1 u can use port[] or portw[] to access them, but it is not
supported by d2 and d3, u need to write asm to do that as bellow

procedure OutPort( PortNo : Word ; Value : Byte );
begin
    asm
        mov dx , PortNo
        mov al ,  Value
        out dx , al
    end;
end;

procedure OutPortW( PortNo : Word ; Value : Word )
begin
    asm
        mov dx , PortNo
        mov ax , Value
        out   dx , ax
    end;
end;

function ReadPort( PortNo : Word ) : Byte ;
var
       RetByte : Byte ;
begin
      asm
        mov dx , PortNo
        in   al , dx
        mov RetByte , al
      end;
      ReadPort := RetByte ;
end;

I used these in my own program, wish it will be helpful.
Mr.J wrote:

> as title
>
> --
> �� ��Դ:���������� BBS bbs.nease.net��[FROM: ab-2-221.bta.ne]
Technical Details
Message-ID: <351B01C8.AF70C1A@online.sh.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3Ndel3$TPA@bbs.nease.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fc86e,bfa29839fd0c80da
X-Google-Attributes: gidfc86e,public
From: James <jchonc@online.sh.cn>
Subject: Re: ��ô��Delphi��д�˿ڣ�Ҳ����Pascal�����⣩��Empty
Date: 1998/03/27
Message-ID: <351B01C8.AF70C1A@online.sh.cn>
X-Deja-AN: 338095912
Content-Transfer-Encoding: 8bit
References: <3Ndel3$TPA@bbs.nease.net>
Mime-Version: 1.0
To: "Mr.J" <MrJ.bbs@bbs.nease.net>
Content-Type: text/plain; charset=iso-8859-1
Organization: Net Ease
Newsgroups: cn.bbs.comp.program