From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e9b2ad3cac4d4266 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Low level (GNAT) Ada? Date: 1998/01/20 Message-ID: <34C4E621.40AB@gsfc.nasa.gov>#1/1 X-Deja-AN: 317737316 Content-Transfer-Encoding: 7bit References: <34C48A74.26CA@mail.connect.usq.edu.au> Content-Type: text/plain; charset=us-ascii Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Mime-Version: 1.0 Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1998-01-20T00:00:00+00:00 List-Id: Matthew Kennedy wrote: > > Hello all, > > I'm using GNAT for Windows (actually NT 4 in my case). > > I'd like to be able to control some purpose-built devices on the > parallel and serial ports of my PC as well as bus cards. I have searched > hard through the documentation for a library that provides > parallel/serial interfaces but they just don't exist. I haven't even > found basic C-like outb/inb functions. > > Everybody keeps saying that Ada is also great for system and low level > programming but it doesn't look like it from the Windows GNAT point of > view. The "library" you are looking for is the Win32 API, provided by Microsoft as the operating system. The OS owns the ports; you cannot write to them directly. You need to get the Microsoft System Development Kit (comes with the Aonix compiler; also comes with Microsoft compilers), and read the Help file. You need an Ada binding for the Win32 API; Win32Ada is free; Aonix sells another (more structured?) one; RR sells a thick binding (see www.adahome.com for sources). To access the serial ports, you just open a file named COM1, COM2, etc. I have not looked into writing to the parallel port; since it is named LPT1 in DOS, you can probably get to it that way. > > BTW, does anyone know if it is possible to interface to the Windows DDE > via a GNAT package and vice-versa? Again, the Win32 API provides functions for doing DDE; you need the Ada binding to those functions. I'm not sure if they are included in Win32Ada. > > -- > Matthew Kennedy > Student of Electrical and Electronics Engineering > University of Southern Queensland, Australia -- - Stephe