comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: Low level (GNAT) Ada?
Date: 1998/01/20
Date: 1998-01-20T00:00:00+00:00	[thread overview]
Message-ID: <34C4E621.40AB@gsfc.nasa.gov> (raw)
In-Reply-To: 34C48A74.26CA@mail.connect.usq.edu.au


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




  reply	other threads:[~1998-01-20  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-20  0:00 Low level (GNAT) Ada? Matthew Kennedy
1998-01-20  0:00 ` Stephen Leake [this message]
1998-01-22  0:00 ` Jerry van Dijk
1998-01-22  0:00   ` Matthew Kennedy
1998-01-24  0:00     ` Jerry van Dijk
1998-01-22  0:00   ` Robert Dewar
replies disabled

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