comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Port IO with Gnat
Date: Sun, 31 Aug 2008 21:06:23 GMT
Date: 2008-08-31T21:06:23+00:00	[thread overview]
Message-ID: <jJDuk.192246$102.40455@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 6e0427b4-4871-4e51-a1b1-696136aa45a6@i20g2000prf.googlegroups.com

-- There is a workable example in the gnat doc that comes with GNAT.
-- But these you routine should give you and idea.  

--
--  If your using x86 processors
--
procedure Out_Byte ( Port : unsigned_16 ;
                       Data : unsigned_8 ) is

  begin -- Out_Byte
    Asm ( Template => "outb %%al, %%dx"  & ASCII.LF,
          Inputs => ( Unsigned_8'Asm_Input ( "a", Data ),
                      Unsigned_16'Asm_Input ( "d", Port ) 
                      ),
          Volatile => True ) ;
  end Out_Byte ;


function In_Byte ( Port : unsigned_16 ) return unsigned_8 is

    Data : unsigned_8 ;

  begin -- In_Byte
    Asm ( Template => "inb  %%dx, %%al"  & ASCII.LF,
          Inputs   =>  Unsigned_16'Asm_Input ( "d", Port ),
          Outputs => Unsigned_8'Asm_Output ( "=a", Data ),
          Volatile => True ) ;
    return Data ;
  end In_Byte ;


In <6e0427b4-4871-4e51-a1b1-696136aa45a6@i20g2000prf.googlegroups.com>, levy.david.c@gmail.com writes:
>Could anyone point me at how to do simple port IO under Windows XP
>with GNAT 2005?
>
>Thanks
>
>Dave




  reply	other threads:[~2008-08-31 21:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-31 13:15 Port IO with Gnat levy.david.c
2008-08-31 21:06 ` anon [this message]
2008-09-26  0:34   ` levy.david.c
2008-09-26  1:32     ` Steve
2008-09-26  3:32       ` anon
2008-09-01 12:41 ` Stephen Leake
2008-09-01 14:50   ` Gary Scott
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox